/* Same structure and neutral scale as ZenBooks-PHP's own style.css (the site this one was built
   to match as closely as possible) - only --accent/--accent-hover/--accent-soft differ, DomOS's
   own blue instead of ZenBooks' green. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f6f8;
  --border: #e2e4e9;
  --text: #1c2027;
  --text-muted: #676d79;
  --accent: #3763ab;
  --accent-hover: #2d5290;
  --accent-soft: #e5ecf7;
  --shadow: 0 12px 32px rgba(20, 24, 32, 0.08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Explicit choice (theme-toggle in site_nav(), stored in localStorage - see the inline script
   in render_page_start()) always wins over the OS preference below. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14171c;
  --bg-elevated: #1b1f26;
  --bg-subtle: #191d23;
  --border: #2b3038;
  --text: #e7e9ed;
  --text-muted: #9298a3;
  --accent: #6c9ce8;
  --accent-hover: #86b0ee;
  --accent-soft: #1e2a3d;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* :not([data-theme='light']) - an explicit light choice must opt out of this even when the OS
   itself prefers dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #14171c;
    --bg-elevated: #1b1f26;
    --bg-subtle: #191d23;
    --border: #2b3038;
    --text: #e7e9ed;
    --text-muted: #9298a3;
    --accent: #6c9ce8;
    --accent-hover: #86b0ee;
    --accent-soft: #1e2a3d;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { background: none; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-elevated); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.link-strong { color: var(--accent); font-weight: 600; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-brand img { width: 26px; height: 26px; border-radius: 7px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.site-nav a:not(.btn):hover { color: var(--text); }
.site-nav a.active { color: var(--text); }

/* Light/dark switcher (site_nav()) - same two-button sun/moon group as ZenBooks-PHP's own. */
.theme-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button.active { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 90px 0 70px; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 780px;
  margin: 0 auto;
}
.hero-subtitle {
  max-width: 600px;
  margin: 22px auto 0;
  font-size: 18px;
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

/* Smaller hero variant for sub-pages (docs) */
.page-hero { max-width: 760px; margin: 0 auto; padding: 56px 24px 32px; text-align: center; }
.page-hero-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.page-hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; margin: 8px 0 0; }
.page-hero-subtitle { margin: 14px auto 0; max-width: 600px; color: var(--text-muted); font-size: 16px; }

/* ---------------------------------------------------------- product mock */
.mock-window {
  max-width: 920px;
  margin: 64px auto 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-screenshot { display: block; width: 100%; height: auto; }
.mock-screenshot-dark { display: none; }
:root[data-theme='dark'] .mock-screenshot-light { display: none; }
:root[data-theme='dark'] .mock-screenshot-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .mock-screenshot-light { display: none; }
  :root:not([data-theme='light']) .mock-screenshot-dark { display: block; }
}

/* ------------------------------------------------------------- sections */
section { padding: 80px 0; }
.section-header { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-kicker {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.section-header h2 { font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.section-header p { margin-top: 14px; color: var(--text-muted); font-size: 16px; }

/* ------------------------------------------------------------ features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  background: var(--bg-elevated);
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 14px; }
.feature-card code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

/* --------------------------------------------------------- how it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}
.step { position: relative; }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 16px;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; }
.step p code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.step-targets { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.step-target {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* -------------------------------------------------------------- get started */
.get-started-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.get-started-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 24px;
  min-width: 0;
}
.get-started-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.get-started-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.get-started-card p code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
pre.code-block {
  background: #0f1115;
  color: #d6e2e0;
  border-radius: 8px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0;
}
pre.code-block .comment { color: #6b7583; }
pre.code-block .accent { color: #6fd6b5; }

/* -------------------------------------------------------- prose (docs) */
.page-content { max-width: 760px; margin: 0 auto; padding: 8px 24px 80px; flex: 1; }
.page-content h2 { font-size: 22px; margin: 40px 0 14px; letter-spacing: -0.01em; }
.page-content h2:first-child { margin-top: 0; }
.page-content p { color: var(--text); margin: 12px 0; }
.page-content a { color: var(--accent); }
.page-content a:hover { text-decoration: underline; }
.page-content code { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 0.9em; font-family: var(--mono); }
.page-content pre.code-block { margin: 12px 0 20px; }

.callout {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 14px;
}
.callout strong { color: var(--accent); }

/* 404 */
.not-found { max-width: 480px; margin: 0 auto; padding: 100px 24px; text-align: center; flex: 1; }
.not-found h1 { font-size: 56px; margin: 0; color: var(--text-muted); }

/* --------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: auto; padding: 24px 0; }
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .feature-grid, .steps, .get-started-grid { grid-template-columns: 1fr; }

  .site-nav { gap: 16px; }
}
