/* AuxPipe website. The palette is the app's own (src/theme.rs), so the page
   and the window a buyer opens afterwards look like one product.

   Every size, colour, radius and duration below comes from a token in
   :root. Change a token, not a component, to change the look. */

:root {
  color-scheme: dark;

  /* Colour, named by role. Text tokens reach WCAG AA (4.5:1) on both the
     page and the cards; --color-border-control reaches 3:1 on the page. */
  --color-bg: #0b0c10;
  --color-surface: #14161c;
  --color-surface-hover: #1a1d25;
  --color-inset: #0e1015;
  --color-border: #23262f;
  --color-border-strong: #313642;
  --color-border-control: #5f6676;
  --color-text: #e8eaf0;
  --color-text-muted: #99a0af;
  --color-text-subtle: #80879a;
  --color-accent: #5b8cff;          /* links, icons, focus: 6.2:1 on the page */
  --color-primary: #3566ea;         /* filled buttons: white text at 4.95:1 */
  --color-primary-hover: #2f60e0;
  --color-primary-active: #2a58d4;
  --color-on-primary: #ffffff;
  --color-media: #3fc9f0;
  --color-voice: #b57bff;
  --color-success: #3ddc97;
  --color-warning: #f5b34a;
  --color-error: #ff6b6b;
  --color-focus: var(--color-accent);

  /* Spacing: an 8 px scale, with 4 px and 12 px for fine steps. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Type. */
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-h2: clamp(1.75rem, 3vw, 2.25rem);
  --font-size-h1: clamp(2.25rem, 4.6vw, 3.5rem);

  /* Shape and depth. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-media: 0 24px 64px rgba(0, 0, 0, 0.55);

  /* Layout and motion. */
  --header-height: 64px;
  --target: 44px;                   /* smallest touch target */
  --gutter: 20px;
  --duration: 150ms;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-4)); }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--font-size-md)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Links in running text are underlined, so colour is not the only cue. */
a { color: var(--color-accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--font-size-h1); font-weight: 700; }
h2 { font-size: var(--font-size-h2); font-weight: 650; }
h3 { font-size: var(--font-size-lg); font-weight: 600; }

/* One visible focus treatment for everything that takes focus. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }

section { padding: var(--space-9) 0; }
.band { background: linear-gradient(180deg, rgba(20, 22, 28, 0.6), rgba(20, 22, 28, 0)); border-top: 1px solid var(--color-border); }
.section-lead { color: var(--color-text-muted); max-width: 640px; margin: var(--space-4) 0 0; font-size: var(--font-size-lg); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 20;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text);
}
.skip-link:focus { top: var(--space-3); }

/* ---------------------------------------------------------------- nav -- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 12, 16, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav-row { display: flex; align-items: center; gap: var(--space-5); height: var(--header-height); }
.brand {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--target);
  color: var(--color-text); font-weight: 650; font-size: var(--font-size-lg); text-decoration: none;
}
.nav-wide { flex: 1; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.nav-links a {
  display: flex; align-items: center; min-height: var(--target); padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-size: var(--font-size-sm); text-decoration: none;
}
.nav-links a:hover { color: var(--color-text); background: var(--color-surface-hover); }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.nav-actions .button { white-space: nowrap; }

.menu-button {
  display: none; align-items: center; justify-content: center; flex: none;
  width: var(--target); height: var(--target); padding: 0; cursor: pointer;
  color: var(--color-text); background: transparent;
  border: 1px solid var(--color-border-control); border-radius: var(--radius-pill);
}
.menu-button:hover { background: var(--color-surface-hover); }
.menu-icon { width: 20px; height: 20px; }

/* The panel only exists on narrow screens; see the media query below. */
.nav-panel { display: none; }

/* ------------------------------------------------------------ buttons -- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); padding: 0 var(--space-5); border-radius: var(--radius-pill);
  background: var(--color-primary); color: var(--color-on-primary);
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.button:hover { background: var(--color-primary-hover); }
.button:active { background: var(--color-primary-active); transform: translateY(1px); }
.button.small { padding: 0 var(--space-4); font-size: var(--font-size-sm); }
.button.ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-control); }
.button.ghost:hover { background: var(--color-surface-hover); }
.button.ghost:active { background: var(--color-surface); }

/* --------------------------------------------------------------- hero -- */
.hero { padding: var(--space-8) 0; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.18), transparent 62%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-8); align-items: center; position: relative; }
.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--color-media); font-weight: 600; font-size: var(--font-size-sm);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.lead { color: var(--color-text-muted); font-size: var(--font-size-lg); margin: var(--space-5) 0 0; max-width: 560px; }
.cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
/* A requirement, not a footnote: readable size and contrast. */
.fine { color: var(--color-text-muted); font-size: var(--font-size-sm); margin: var(--space-4) 0 0; max-width: 560px; }
.hero-shot { justify-self: center; }
.hero-shot img {
  width: 360px; border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-media);
}

/* ------------------------------------------------------------ trailer -- */
.trailer { padding-top: var(--space-5); }
.trailer-video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-top: var(--space-6);
  background: #000; border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-media);
}

/* --------------------------------------------------------------- flow -- */
.flow { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-7); }
.flow-sources { display: flex; flex-direction: column; gap: var(--space-3); }
.node {
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); min-width: 150px; display: flex; flex-direction: column; gap: 2px;
}
.node strong { font-size: var(--font-size-md); }
.node span { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.node.media { border-left: 3px solid var(--color-media); }
.node.voice { border-left: 3px solid var(--color-voice); }
.node.accent { border-color: rgba(91, 140, 255, 0.55); background: linear-gradient(180deg, rgba(91, 140, 255, 0.12), var(--color-surface)); }
.arrow { flex: 1; min-width: 18px; height: 2px; background: linear-gradient(90deg, var(--color-border-strong), var(--color-accent)); position: relative; }
.arrow::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border: 5px solid transparent; border-left-color: var(--color-accent); border-right: 0;
}

/* ----------------------------------------------------------- features -- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-top: var(--space-6); }
.card { background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); }
/* Feature cards are not links, so they have no hover state. */
.feature { padding: var(--space-5); }
.feature p { color: var(--color-text-muted); margin: var(--space-2) 0 0; }
.icon {
  width: 40px; height: 40px; padding: var(--space-2); margin-bottom: var(--space-4);
  color: var(--color-accent); background: rgba(91, 140, 255, 0.1); border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------- setup -- */
.setup-grid { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: var(--space-7); align-items: start; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-5); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: var(--space-4); }
.steps li::before {
  content: counter(step); grid-row: span 2;
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--color-inset); border: 1px solid var(--color-border-strong); color: var(--color-accent); font-weight: 700;
}
.steps h3 { padding-top: var(--space-2); }
.steps p { color: var(--color-text-muted); margin: var(--space-1) 0 0; }
.requirements { padding: var(--space-5); }
.requirements dl { margin: var(--space-4) 0 0; display: grid; grid-template-columns: auto 1fr; gap: var(--space-3) var(--space-4); }
.requirements dt { color: var(--color-text-subtle); font-size: var(--font-size-sm); }
.requirements dd { margin: 0; font-size: var(--font-size-sm); }

/* ---------------------------------------------------------------- faq -- */
/* Narrow for reading, but on the same left edge as every other section. */
#faq .wrap > * { max-width: 760px; }
details { border-bottom: 1px solid var(--color-border); }
details:first-of-type { margin-top: var(--space-5); border-top: 1px solid var(--color-border); }
summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  min-height: var(--target); padding: var(--space-4) 0;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--color-text-muted); font-weight: 400; font-size: var(--font-size-xl); line-height: 1; }
details[open] summary::after { content: "\2212"; }
summary:hover { color: var(--color-accent); }
details p { color: var(--color-text-muted); margin: 0 0 var(--space-5); }

/* ------------------------------------------------------------- policy -- */
/* Running text: narrow for reading, on the same left edge as the rest. */
.policy { padding: var(--space-8) 0 var(--space-9); }
.policy .wrap > * { max-width: 760px; }
.policy h2 { font-size: var(--font-size-xl); margin-top: var(--space-7); }
.policy p { color: var(--color-text-muted); margin: var(--space-4) 0 0; }
.policy .section-lead { color: var(--color-text); }

/* ------------------------------------------------------------- footer -- */
footer { border-top: 1px solid var(--color-border); padding: var(--space-5) 0; color: var(--color-text-subtle); font-size: var(--font-size-sm); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-5); flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: var(--space-3); }
.footer-notes { margin: 0; }
.footer-links { display: flex; align-items: center; gap: var(--space-2) var(--space-5); flex-wrap: wrap; }
footer a { color: var(--color-text-muted); }
.footer-link, .footer-brand a { display: inline-flex; align-items: center; min-height: var(--target); }

/* -------------------------------------------------------- narrow widths -- */
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .setup-grid { grid-template-columns: 1fr; }
  .hero-shot img { width: 300px; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-sources { flex-direction: row; }
  .flow-sources .node { flex: 1; }
  .arrow { width: 2px; height: 24px; min-width: 0; flex: none; align-self: center;
           background: linear-gradient(180deg, var(--color-border-strong), var(--color-accent)); }
  .arrow::after { right: -4px; top: auto; bottom: -1px; border: 5px solid transparent;
                  border-top-color: var(--color-accent); border-bottom: 0; }

  /* The section links and the language move into the menu. */
  .nav-wide, .lang-wide { display: none; }
  .menu-button { display: inline-flex; }
  .nav-panel {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) 0 var(--space-4);
  }
  .nav-panel[hidden] { display: none; }
  .nav-panel .nav-links { flex-direction: column; gap: 0; }
  .nav-panel .nav-links a { min-height: 48px; padding: 0 var(--space-3); font-size: var(--font-size-md); }
  .nav-panel .button { margin-top: var(--space-3); width: 100%; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .features { grid-template-columns: 1fr; }
  .flow-sources { flex-direction: column; }
  section { padding: var(--space-8) 0; }
  .hero { padding: var(--space-7) 0; }
  .cta .button { flex: 1 1 auto; }
  .nav-row { gap: var(--space-3); }
}

/* Too narrow for the name next to the button: the icon stays. */
@media (max-width: 399px) {
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .menu-button, .nav-links a, summary {
    transition: background-color var(--duration) ease, color var(--duration) ease, transform var(--duration) ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button:active { transform: none; }
}
