/* ---------------------------------------------------------
   arply — fonts
   Geist / Geist Mono, self-hosted as variable woff2 files.
   Each @font-face below shares the same file on purpose —
   the resource is a variable font, and browsers resolve the
   requested static weight (400/500/600/700) from its "wght"
   axis, so one file covers the whole range.
--------------------------------------------------------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-var.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/geist-mono-var.woff2") format("woff2");
}

/* ---------------------------------------------------------
   arply — tokens
--------------------------------------------------------- */
:root {
  --ground: #f7f8fb;
  --surface: #ffffff;
  --ink: #14151a;
  --ink-soft: #55586b;
  --ink-faint: #8688a0;
  --accent: #4a54e1;
  --accent-ink: #ffffff;
  --accent-soft: #e7e9fc;
  --line: #e4e5ef;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --measure: 62ch;
  --container: 1120px;
}

/* ---------------------------------------------------------
   Reset & base
--------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* Keep anchor targets (#waitlist, #quickstart, #flash) from landing
     underneath the sticky, blurred header. */
  scroll-padding-top: 5.5rem;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@media (min-width: 720px) {
  .wrap { padding-inline: 2.5rem; }
}

.text-balance { text-wrap: balance; }

/* ---------------------------------------------------------
   Type
--------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.hero-title {
  font-size: clamp(2.75rem, 6vw + 1rem, 5.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 0 1.25rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 1.4vw + 0.7rem, 1.3rem);
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 2.25rem;
}

.section-title {
  font-size: clamp(1.75rem, 2.4vw + 1rem, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.section-text {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0;
}

/* ---------------------------------------------------------
   Header
--------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark-logo { height: 20px; width: auto; display: block; }

.wordmark.small .wordmark-logo { height: 16px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px -12px rgb(0 0 0 / 12%);
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child { border-bottom: none; }
}

/* ---------------------------------------------------------
   Buttons & form
--------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black 6%); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  padding: 0.55rem 1.15rem;
}

.btn-ghost:hover { border-color: var(--ink-faint); }

.btn.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 26rem;
}

.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 12rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.waitlist-form input[type="email"]::placeholder { color: var(--ink-faint); }

/* Live feedback as soon as the browser considers the field "user-invalid"
   (after blur or a submit attempt) — no need to wait for a full submit. */
.waitlist-form input[type="email"]:user-invalid,
.waitlist-form input[type="email"][aria-invalid="true"] {
  border-color: #d24545;
}

.waitlist-form input[type="email"]:user-valid {
  border-color: var(--accent);
}

.waitlist-form.is-success input,
.waitlist-form.is-success button { display: none; }

.form-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0.75rem 0 0;
}

.form-note[data-state="success"] { color: var(--accent); }
.form-note[data-state="error"] { color: #d24545; }

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero {
  padding-top: clamp(3.5rem, 7vw, 6.5rem);
  padding-bottom: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .waitlist-form { justify-content: center; }
.hero .hero-sub { margin-inline: auto; }
.hero .eyebrow { text-align: center; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.hero-visual {
  width: 100%;
  max-width: 720px;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

#broadcast {
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 360;
}

/* ---------------------------------------------------------
   Sections
--------------------------------------------------------- */
.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.grid-asym {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .grid-asym {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 4rem;
  }
}

/* ---------------------------------------------------------
   Flow diagram
--------------------------------------------------------- */
.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 700px) {
  .flow-diagram {
    flex-direction: row;
    align-items: stretch;
  }
}

.flow-node {
  flex: 1;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) {
  .flow-node {
    border-top: none;
    padding: 0 1.25rem;
  }
  .flow-node:first-child { padding-left: 0; }
  .flow-node:last-child { padding-right: 0; }
}

.flow-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

.flow-node h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.flow-node p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0;
}

.flow-connector {
  display: none;
}

@media (min-width: 700px) {
  .flow-connector {
    display: block;
    align-self: center;
    width: 2.5rem;
    height: 1px;
    margin-top: -1.6rem;
    background-image: linear-gradient(to right, var(--ink-faint) 50%, transparent 0);
    background-size: 8px 1px;
    background-repeat: repeat-x;
    flex-shrink: 0;
  }
}

/* ---------------------------------------------------------
   Trust row
--------------------------------------------------------- */
.trust-row {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  margin-top: 0.5rem;
}

@media (min-width: 700px) {
  .trust-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.trust-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.trust-item p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
  max-width: 34ch;
}

.trust-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.trust-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------
   Closing CTA
--------------------------------------------------------- */
.closing-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.closing-section .section-text { margin-inline: auto; margin-bottom: 2rem; }
.closing-section .waitlist-form { justify-content: center; }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--ink); }

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--ink-faint);
  max-width: 62ch;
  margin: 0.5rem 0 0;
  line-height: 1.6;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0.75rem 0 0;
}

.footer-copy a {
  color: var(--ink-faint);
  text-decoration: underline;
}

.footer-copy a:hover { color: var(--ink); }

/* ---------------------------------------------------------
   Hardware page — file cards & preorder
--------------------------------------------------------- */
.hardware-hero { text-align: center; }

.file-row {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}

@media (min-width: 700px) {
  .file-row { grid-template-columns: repeat(2, 1fr); }
}

.file-card {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.file-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.file-card p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.preorder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  padding: 2rem;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.preorder-price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.preorder-amount {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.preorder-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.preorder-card .form-note { margin: 0; }

.flasher-card esp-web-install-button {
  display: inline-block;
}

.flasher-card [slot="unsupported"],
.flasher-card [slot="not-allowed"] {
  display: block;
  max-width: 34ch;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------
   Notice banner (used on hardware.html)
--------------------------------------------------------- */
.notice-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
  padding: 1.1rem 1.4rem;
  background: color-mix(in srgb, #d97a06 9%, var(--surface));
  border: 1px solid color-mix(in srgb, #d97a06 32%, var(--line));
  border-radius: 12px;
}

.notice-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

.notice-banner p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.notice-banner strong { color: var(--ink); }

.notice-banner a {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------------------------------------------------------
   Legal pages (impressum, preorder-terms)
--------------------------------------------------------- */
.legal-hero { text-align: center; }

.legal-content { max-width: 72ch; }

.legal-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3rem 0 0.9rem;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.6rem;
}

.legal-content p,
.legal-content li {
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.legal-content dl { margin: 0.5rem 0 0; }

.legal-content dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.legal-content dt:first-child { margin-top: 0; }

.legal-content dd {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.legal-content .lang-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

.legal-content .callout {
  padding: 1.1rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.legal-content .callout a { color: var(--accent); }

.legal-content .statute-block {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 1.25rem;
}

.legal-content .statute-block p:last-child { margin-bottom: 0; }

.legal-content .placeholder {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.05em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ---------------------------------------------------------
   Quickstart steps
--------------------------------------------------------- */
.steps-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step {
  display: flex;
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.step:first-child {
  padding-top: 0;
  border-top: none;
}

.step-number {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.step-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

.step-body p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 52ch;
}

/* ---------------------------------------------------------
   Cross-document view transitions
   Progressive enhancement — unsupported browsers just get an
   instant navigation, same as before.
--------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ---------------------------------------------------------
   Reduced motion
--------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
