/* Self-hosted, not fetched from a CDN at runtime — same rule main.css's own
 * header comment states for the GUI ("a request client has no business
 * phoning a third party at boot"; a public landing page shouldn't either).
 * Fraunces for the one display moment (the hero headline), Inter Tight for
 * everything else, Geist Mono for material (commands, filenames) — the same
 * three families DESIGN.md and gui/tailwind.config.js define, replacing the
 * IBM Plex pair this site used to load from Google Fonts (#447). */
@font-face {
  font-family: 'Inter Tight';
  src: url('fonts/inter-tight-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('fonts/inter-tight-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('fonts/inter-tight-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Design tokens synced from gui/src/renderer/src/assets/main.css's current
 * dark :root (generated by docs/design/palette.mjs) — the site has no build
 * step, so values are pasted rather than imported. The previous set here
 * predated the #425/#426/#428 accent-role split and still had accent as a
 * blue; accent is white now (the one primary-action fill), and every link/
 * focus/selection role reads through status-info's own literal hue instead
 * (#447). Re-sync this block if the palette is retuned. */
:root {
  --c-canvas: 0 0 0;
  --c-panel: 10 10 12;
  --c-sunken: 6 6 10;
  --c-raised: 16 16 18;
  --c-line: 26 26 28;
  --c-line-strong: 46 46 48;
  --c-ink: 252 253 255;
  --c-ink-bright: 217 218 219;
  --c-ink-muted: 176 177 179;
  --c-ink-dim: 161 164 165;
  --c-ink-faint: 136 142 144;
  --c-accent: 252 253 255;
  --c-accent-ink: 0 0 0;
  --c-status-ok: 17 255 153;
  --c-status-info: 59 158 255;
  --c-status-warn: 255 197 61;
  --c-status-err: 255 32 71;

  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    --motion-fast: 150ms;
    --motion-base: 240ms;
    --motion-slow: 420ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
    --motion-slow: 0ms;
    --ease-out: linear;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: rgb(var(--c-canvas));
  color: rgb(var(--c-ink));
  font-family: 'Inter Tight', system-ui, sans-serif;
  line-height: 1.5;
  /* .feature-block's full-bleed trick (100vw + negative margin) can read a
     sliver wider than the real viewport on some browsers — this is the
     usual safety net, not evidence something is already wrong. */
  overflow-x: hidden;
}

code,
pre,
.mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
}

a {
  color: rgb(var(--c-status-info));
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.topnav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  background: rgb(var(--c-canvas) / 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgb(var(--c-line));
  z-index: 10;
}

.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  color: rgb(var(--c-ink));
}

.topnav-mark {
  display: block;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
}

.topnav-links a {
  text-decoration: none;
  color: rgb(var(--c-ink-dim));
  transition: color var(--motion-fast) var(--ease-out);
}

.topnav-links a:hover {
  color: rgb(var(--c-ink));
}

/* The one link on this bar that should pull the eye — everything else here
   is a quiet nav link, this is the one meant to make someone curious. */
.topnav-links a.topnav-changelog {
  color: rgb(var(--c-status-info));
  font-weight: 500;
}

header.hero {
  padding: 96px 0 72px;
  text-align: center;
  border-bottom: 1px solid rgb(var(--c-line));
}

header.hero.compact {
  padding: 56px 0 40px;
}

.beta-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgb(var(--c-status-info));
  color: rgb(var(--c-status-info));
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.tagline {
  font-size: 1.125rem;
  color: rgb(var(--c-ink-muted));
  max-width: 46ch;
  margin: 0 auto 32px;
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    transform var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* The one primary action per view — filled solid with the accent, same rule
   the app's own workbench follows (DESIGN.md's Brand & Accent). */
.btn.primary {
  background: rgb(var(--c-accent));
  color: rgb(var(--c-accent-ink));
}

.btn.primary:hover {
  background: rgb(var(--c-accent) / 0.9);
}

.btn.secondary {
  border-color: rgb(var(--c-line-strong));
  color: rgb(var(--c-ink));
}

.btn.secondary:hover {
  border-color: rgb(var(--c-status-info));
  color: rgb(var(--c-status-info));
}

section {
  padding: 64px 0;
  border-bottom: 1px solid rgb(var(--c-line));
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.section-note {
  color: rgb(var(--c-ink-dim));
  margin: 0 0 32px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.download-card {
  background: rgb(var(--c-panel));
  border: 1px solid rgb(var(--c-line));
  border-radius: 12px;
  padding: 24px;
  transition:
    border-color var(--motion-base) var(--ease-out),
    transform var(--motion-base) var(--ease-out);
}

.download-card:hover {
  border-color: rgb(var(--c-line-strong));
  transform: translateY(-2px);
}

.download-card h3 {
  margin: 0 0 4px;
}

.download-card p {
  color: rgb(var(--c-ink-dim));
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.mac-signing-hint {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgb(var(--c-line));
}

.mac-signing-hint .hint-label {
  font-size: 0.8rem;
  color: rgb(var(--c-ink-faint));
  margin: 0 0 8px;
}

.code-copy {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.code-copy code {
  flex: 1;
  min-width: 0;
  background: rgb(var(--c-raised));
  border: 1px solid rgb(var(--c-line));
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre;
}

.copy-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgb(var(--c-line-strong));
  color: rgb(var(--c-ink));
  border-radius: 6px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.copy-btn:hover {
  border-color: rgb(var(--c-status-info));
  color: rgb(var(--c-status-info));
}

.copy-btn:disabled {
  color: rgb(var(--c-status-ok));
  border-color: rgb(var(--c-status-ok));
  cursor: default;
}

.linux-note {
  margin-top: 20px;
  color: rgb(var(--c-ink-dim));
  font-size: 0.9rem;
}

.download-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.download-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid rgb(var(--c-line));
}

.download-list li:last-child {
  border-bottom: none;
}

.download-list li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-list-kind {
  font-size: 0.8rem;
  color: rgb(var(--c-ink-faint));
}

/* Four real screens, one per feature (#457, replacing the #447 placeholder).
   Breaks out to the true viewport edge on one side (the classic "centered
   container, full-bleed child" trick: 100vw width, shifted left by half a
   viewport, offset back by 50%) while feature-copy stays inside a column
   that lines up with .wrap's own 960px/24px math on the *other* side —
   only that side gets the inset, so the image is free to reach the edge.
   overflow-x: hidden on body (below) is this trick's usual safety net
   against a stray horizontal scrollbar. */
.feature-block {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  display: flex;
  align-items: center;
  gap: 5vw;
}

.feature-media {
  flex: 1 1 55%;
  min-width: 0;
}

.feature-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px 0 0 12px;
}

.feature-block.bleed-left .feature-media img {
  border-radius: 0 12px 12px 0;
}

.feature-copy {
  flex: 0 0 auto;
  width: min(420px, 40vw);
}

.feature-copy h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.feature-copy p {
  margin: 0;
  color: rgb(var(--c-ink-dim));
}

/* The inset side (where copy sits) reproduces .wrap's own math — same
   960px cap, same 24px gutter — so this text lines up with every other
   section's, even though the block itself isn't inside a .wrap. */
.feature-block.bleed-right .feature-copy {
  margin-left: max(24px, calc((100vw - 960px) / 2 + 24px));
}

.feature-block.bleed-left .feature-copy {
  margin-right: max(24px, calc((100vw - 960px) / 2 + 24px));
}

.feature-media-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}

.feature-media-trigger img {
  transition: opacity var(--motion-fast) var(--ease-out);
}

.feature-media-trigger:hover img {
  opacity: 0.85;
}

/* ---- Lightbox (#457 follow-up) ---- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgb(var(--c-canvas) / 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--motion-base) var(--ease-out);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  border: 1px solid rgb(var(--c-line-strong));
  background: rgb(var(--c-panel));
  color: rgb(var(--c-ink));
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  border-color: rgb(var(--c-status-info));
  color: rgb(var(--c-status-info));
}

/* ---- macOS sign-command modal (#480) ---- */
/* Same overlay mechanics as .lightbox above (backdrop blur, opacity
   transition, hidden attribute) — a second, independent overlay, not that
   one reused, since the content (a dialog vs. an image) doesn't fit its
   image-centered layout. */

.mac-sign-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgb(var(--c-canvas) / 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--motion-base) var(--ease-out);
}

.mac-sign-modal[hidden] {
  display: none;
}

.mac-sign-modal.is-open {
  opacity: 1;
}

.mac-sign-modal-panel {
  position: relative;
  max-width: 440px;
  width: 100%;
  background: rgb(var(--c-panel));
  border: 1px solid rgb(var(--c-line));
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
}

.mac-sign-modal-panel h3 {
  margin: 0 0 8px;
}

.mac-sign-modal-panel p {
  color: rgb(var(--c-ink-dim));
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.mac-sign-modal-panel .code-copy {
  margin-bottom: 20px;
}

.mac-sign-modal-panel .btn {
  width: 100%;
  text-align: center;
}

.mac-sign-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  border: 1px solid rgb(var(--c-line-strong));
  background: rgb(var(--c-panel));
  color: rgb(var(--c-ink));
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.mac-sign-modal-close:hover {
  border-color: rgb(var(--c-status-info));
  color: rgb(var(--c-status-info));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-grid h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.feature-grid p {
  margin: 0;
  color: rgb(var(--c-ink-dim));
  font-size: 0.9rem;
}

.code-block {
  background: rgb(var(--c-raised));
  border: 1px solid rgb(var(--c-line));
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.875rem;
}

footer {
  padding: 40px 0 80px;
  color: rgb(var(--c-ink-faint));
  font-size: 0.85rem;
}

footer a {
  color: rgb(var(--c-ink-dim));
}

footer .links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.changelog {
  max-width: 720px;
}

.changelog .release + .release {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid rgb(var(--c-line));
}

.changelog .release h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.375rem;
}

.changelog .release time {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgb(var(--c-ink-faint));
}

.changelog .release h3 {
  font-size: 1rem;
  margin: 20px 0 8px;
}

.changelog .release ul {
  margin: 0;
  padding-left: 20px;
  color: rgb(var(--c-ink-muted));
}

.changelog .release li + li {
  margin-top: 4px;
}

/* ---- Motion (#447) ---- */

/* The hero's own entrance — plays once, unconditionally, on load. Guarded by
   the reduced-motion media query above collapsing every --motion-* duration
   to 0ms, so the same rule set becomes an instant, no-animation layout for
   anyone who asked for less motion, rather than a second code path. */
.hero-animate {
  animation: fade-up var(--motion-slow) var(--ease-out) both;
}
.hero-animate:nth-child(2) {
  animation-delay: 60ms;
}
.hero-animate:nth-child(3) {
  animation-delay: 120ms;
}
.hero-animate:nth-child(4) {
  animation-delay: 180ms;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Scroll-reveal (assets/reveal.js toggles .is-visible via
   IntersectionObserver). Progressive enhancement: a section is visible by
   default, and only gets held at opacity 0 once JS confirms it can also
   reveal it again — so a visitor with JS disabled, or reveal.js failing to
   load, never ends up with permanently invisible content. */
.reveal {
  transition:
    opacity var(--motion-slow) var(--ease-out),
    transform var(--motion-slow) var(--ease-out);
}
.reveal.reveal-armed {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Responsive (#447 — this site had no breakpoint at all before) ---- */

@media (max-width: 768px) {
  header.hero {
    padding: 72px 0 48px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row .btn {
    text-align: center;
  }

  .download-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 48px 0;
  }

  /* No bleed at this width — nowhere for it to go. Plain full-width stack,
     image above text regardless of source order (`order: -1` normalizes
     bleed-left and bleed-right the same way). */
  .feature-block {
    position: static;
    left: auto;
    width: auto;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 0 24px;
  }

  .feature-media {
    order: -1;
  }

  .feature-media img {
    border-radius: 12px;
  }

  .feature-copy,
  .feature-block.bleed-right .feature-copy,
  .feature-block.bleed-left .feature-copy {
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 16px;
  }

  .feature-block {
    padding: 0 16px;
  }

  .topnav-links {
    gap: 12px;
    font-size: 0.8rem;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.5rem);
  }

  .tagline {
    font-size: 1rem;
  }
}
