/* =========================================================================
   Theme tokens — ported verbatim from the app's src/renderer/styles/globals.css
   so the site matches the desktop app (sage/forest palette, 1.4rem radius).
   ========================================================================= */
:root {
  --background: rgb(253, 253, 253);
  --foreground: rgb(0, 0, 0);
  --card: rgb(253, 253, 253);
  --card-foreground: rgb(0, 0, 0);
  --popover: rgb(252, 252, 252);
  --popover-foreground: rgb(0, 0, 0);
  --primary: rgb(102, 159, 108);
  --primary-foreground: rgb(250, 250, 249);
  --secondary: rgb(212, 217, 208);
  --secondary-foreground: rgb(8, 8, 8);
  --muted: rgb(245, 245, 245);
  --muted-foreground: rgb(135, 135, 135);
  --accent: rgb(73, 89, 64);
  --accent-foreground: rgb(255, 255, 255);
  --destructive: rgb(179, 25, 31);
  --destructive-foreground: rgb(255, 255, 255);
  --border: rgb(231, 231, 238);
  --input: rgb(235, 235, 235);
  --ring: rgb(175, 190, 165);
  --sidebar: rgb(245, 248, 251);

  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 1.4rem;

  --shadow-sm: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 1px 2px -1px hsl(0 0% 0% / 0.16);
  --shadow-md: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 2px 4px -1px hsl(0 0% 0% / 0.16);
  --shadow-lg: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 4px 6px -1px hsl(0 0% 0% / 0.16);
  --shadow-xl: 0px 2px 3px 0px hsl(0 0% 0% / 0.16), 0px 8px 10px -1px hsl(0 0% 0% / 0.16);

  --tracking: -0.025em;
}

.dark {
  --background: rgb(7, 5, 3);
  --foreground: rgb(249, 248, 247);
  --card: rgb(16, 13, 8);
  --card-foreground: rgb(249, 248, 247);
  --popover: rgb(11, 9, 5);
  --popover-foreground: rgb(249, 248, 247);
  --primary: rgb(175, 190, 165);
  --primary-foreground: rgb(4, 3, 2);
  --secondary: rgb(38, 33, 26);
  --secondary-foreground: rgb(231, 228, 223);
  --muted: rgb(30, 26, 20);
  --muted-foreground: rgb(146, 143, 138);
  --accent: rgb(73, 89, 64);
  --accent-foreground: rgb(255, 255, 255);
  --destructive: rgb(179, 25, 31);
  --destructive-foreground: rgb(249, 248, 247);
  --border: rgb(47, 40, 27);
  --input: rgb(26, 21, 14);
  --ring: rgb(175, 190, 165);
  --sidebar: rgb(4, 3, 2);

  --shadow-sm: 0px 2px 12px 0px hsl(0 0% 0% / 0.35), 0px 1px 2px -1px hsl(0 0% 0% / 0.35);
  --shadow-md: 0px 2px 12px 0px hsl(0 0% 0% / 0.35), 0px 2px 4px -1px hsl(0 0% 0% / 0.35);
  --shadow-lg: 0px 2px 12px 0px hsl(0 0% 0% / 0.35), 0px 4px 6px -1px hsl(0 0% 0% / 0.35);
  --shadow-xl: 0px 2px 12px 0px hsl(0 0% 0% / 0.35), 0px 8px 10px -1px hsl(0 0% 0% / 0.35);
}

/* =========================================================================
   Base / reset
   ========================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* clears the sticky header for anchor jumps */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  letter-spacing: var(--tracking);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1rem; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--muted);
  padding: 0.1em 0.4em;
  border-radius: 0.45rem;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.muted { color: var(--muted-foreground); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.8rem 1.4rem;
  border-radius: calc(var(--radius) * 0.62);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.1em; height: 1.1em; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); opacity: 0.94; }

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover { box-shadow: var(--shadow-sm); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn-outline:hover { background: var(--muted); }

.btn-lg { padding: 1rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon {
  padding: 0.55rem;
  border-radius: 999px;
  background: transparent;
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn-icon:hover { background: var(--muted); }

/* =========================================================================
   Cards / badges
   ========================================================================= */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm);
  padding: 1.6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.badge-primary { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--accent); }
.dark .badge-primary { color: var(--primary); }
.badge-amber { background: color-mix(in srgb, #b8860b 20%, transparent); color: #8a6400; }
.dark .badge-amber { color: #e8c060; }

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
}
.brand .logo-mark {
  width: 2rem; height: 2rem;
  color: var(--primary);
  flex: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.nav-links a.navlink {
  padding: 0.5rem 0.85rem;
  border-radius: 0.7rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted-foreground);
}
.nav-links a.navlink:hover { color: var(--foreground); background: var(--muted); }
.nav-links a.navlink.active { color: var(--foreground); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.4rem; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    inset: 4.25rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem 1.25rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    transition: transform 0.2s ease;
    margin-left: 0;
  }
  body.nav-open .nav-links { transform: translateY(0); }
  .nav-links a.navlink { padding: 0.75rem 0.85rem; }
  .header-actions { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% 0 auto 0;
  height: 70%;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  max-width: 16ch;
  margin-inline: auto;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted-foreground);
  max-width: 44ch;
  margin: 1rem auto 2rem;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-meta {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-meta svg { width: 1rem; height: 1rem; color: var(--primary); }

/* =========================================================================
   Sections
   ========================================================================= */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head { max-width: 60ch; margin: 0 auto 2.5rem; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-head p { color: var(--muted-foreground); font-size: 1.05rem; }

.band { background: var(--sidebar); border-block: 1px solid var(--border); }

/* audience band */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.audience-grid .card h3 { font-family: var(--font-sans); font-size: 1.05rem; }
.audience-grid .pain { color: var(--destructive); font-weight: 600; font-size: 0.85rem; }

/* feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.feature .icon-wrap {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: calc(var(--radius) * 0.55);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--accent);
  margin-bottom: 1rem;
}
.dark .feature .icon-wrap { color: var(--primary); }
.feature .icon-wrap svg { width: 1.5rem; height: 1.5rem; }
.feature h3 { font-family: var(--font-sans); font-size: 1.15rem; margin-bottom: 0.4rem; }
.feature p { color: var(--muted-foreground); margin: 0; font-size: 0.95rem; }

/* security spotlight */
.security-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.security-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.security-list li { display: flex; gap: 0.75rem; }
.security-list svg { width: 1.4rem; height: 1.4rem; color: var(--primary); flex: none; margin-top: 0.1rem; }
.security-list strong { display: block; }
.security-list span { color: var(--muted-foreground); font-size: 0.92rem; }
.tier-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tier-table th, .tier-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.tier-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); }
@media (max-width: 760px) { .security-grid { grid-template-columns: 1fr; } }

/* final CTA */
.cta-band { text-align: center; }
.cta-band .card { max-width: 640px; margin-inline: auto; padding: 3rem 2rem; }

/* =========================================================================
   Download page
   ========================================================================= */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (max-width: 760px) { .download-grid { grid-template-columns: 1fr; } }

.os-card { position: relative; display: flex; flex-direction: column; gap: 1rem; }
.os-card .os-head { display: flex; align-items: center; gap: 0.85rem; }
.os-card .os-head svg { width: 2.25rem; height: 2.25rem; }
.os-card .os-head h3 { font-family: var(--font-sans); margin: 0; font-size: 1.3rem; }
.os-card[data-featured="true"] {
  box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-md);
}
.featured-flag {
  position: absolute; top: 1.1rem; right: 1.1rem;
  display: none;
}
.os-card[data-featured="true"] .featured-flag { display: inline-flex; }

.installer-row {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding-top: 1rem; border-top: 1px solid var(--border);
}
.installer-row .installer-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.installer-row .installer-meta .fmt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-foreground); }
.installer-row p { font-size: 0.85rem; color: var(--muted-foreground); margin: 0 0 0.5rem; }

.callout {
  display: flex; gap: 0.75rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: calc(var(--radius) * 0.6);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
}
.callout svg { width: 1.3rem; height: 1.3rem; color: var(--accent); flex: none; margin-top: 0.1rem; }
.dark .callout svg { color: var(--primary); }
.callout strong { display: block; margin-bottom: 0.15rem; }

.other-downloads { margin-top: 2.5rem; }

/* =========================================================================
   Guide / docs page
   ========================================================================= */
.docs-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 3rem;
  align-items: start;
}
.docs-toc {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  font-size: 0.9rem;
}
.docs-toc nav { display: flex; flex-direction: column; gap: 0.1rem; }
.docs-toc .toc-title { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); margin-bottom: 0.6rem; }
.docs-toc a {
  padding: 0.4rem 0.7rem;
  border-radius: 0.55rem;
  color: var(--muted-foreground);
  border-left: 2px solid transparent;
}
.docs-toc a:hover { color: var(--foreground); background: var(--muted); }
.docs-toc a.sub { padding-left: 1.4rem; font-size: 0.85rem; }
.docs-toc a.active { color: var(--foreground); border-left-color: var(--primary); }

.docs-content { min-width: 0; max-width: 720px; }
.docs-content h2 {
  font-size: 1.9rem;
  padding-top: 1rem;
  margin-top: 2.5rem;
}
.docs-content h2:first-of-type { margin-top: 0; }
.docs-content h3 { font-family: var(--font-sans); font-size: 1.25rem; margin-top: 2rem; }
.docs-content ol, .docs-content ul { padding-left: 1.3rem; }
.docs-content li { margin-bottom: 0.5rem; }
.docs-content .lede { font-size: 1.1rem; color: var(--muted-foreground); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1.25rem;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

/* screenshot placeholders */
figure.shot { margin: 1.5rem 0; }
figure.shot .placeholder {
  border: 2px dashed var(--border);
  border-radius: calc(var(--radius) * 0.7);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 12px, color-mix(in srgb, var(--muted) 60%, transparent) 12px, color-mix(in srgb, var(--muted) 60%, transparent) 24px);
  min-height: 220px;
  display: grid; place-items: center;
  text-align: center;
  color: var(--muted-foreground);
  padding: 1.5rem;
}
figure.shot .placeholder .ph-inner { display: grid; gap: 0.4rem; justify-items: center; }
figure.shot .placeholder svg { width: 1.6rem; height: 1.6rem; opacity: 0.7; }
figure.shot .placeholder code { background: transparent; font-size: 0.78rem; }
figure.shot figcaption { font-size: 0.85rem; color: var(--muted-foreground); margin-top: 0.6rem; text-align: center; }
/* When a real screenshot is dropped in, it renders normally and the placeholder is hidden via the img:not([hidden]) sibling rule below. */
figure.shot img { border-radius: calc(var(--radius) * 0.7); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-md); }
figure.shot img + .placeholder { display: none; }

.field-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 1rem 0 1.5rem; }
.field-table th, .field-table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.field-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.field-table td code { font-size: 0.8rem; }

.note {
  display: flex; gap: 0.7rem;
  background: var(--muted);
  border-radius: calc(var(--radius) * 0.55);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  margin: 1.25rem 0;
}
.note svg { width: 1.2rem; height: 1.2rem; color: var(--primary); flex: none; margin-top: 0.15rem; }

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs-toc { position: static; top: auto; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
  .docs-toc nav { flex-flow: row wrap; }
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--sidebar);
  padding: 2.5rem 0;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer .foot-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted-foreground); }
.site-footer a:hover { color: var(--foreground); }
.site-footer .powered { color: var(--muted-foreground); }

/* utility */
.stack-sm > * + * { margin-top: 0.5rem; }
[hidden] { display: none !important; }
