/* Aphelion — shared site styles (palette, type, body sections) */

/* Self-hosted fonts (latin subset, ~59KB total) */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/geist.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/geist-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic.woff2') format('woff2');
}

:root {
  /* Dark (default) palette */
  --bg: #07080A;
  --surface: #0E1014;
  --surface-2: #0B0D11;
  --border-mid: #1A1D22;
  --border-hair: rgba(236,237,238,0.08);
  --text: #ECEDEE;
  --text-mid: #B8BBC2;
  --text-muted: #8B8E94;
  --text-faint: #5A5D63;
  --accent: #F4A340;
  --accent-hot: #FFE3B5;

  /* Brand system extras (per logo handoff) */
  --accent-ink: #C17618;
  --paper: #F2EEE7;
  --ink: #0E1014;

  /* Layout */
  --max: 1400px;
  --pad-x: 32px;
  --section-pad: 128px;

  /* Hero palette tokens — read by hero-01.js at mount */
  --hero-body-rgb: 236, 237, 238;
  --hero-orbit-stroke-a: 0.09;
  --hero-axis-stroke-a: 0.06;
  --hero-body-tag-a: 0.55;
  --hero-grain-a: 0.025;
  --hero-solar-a: 0.075;
  --hero-solar-mid-a: 0.018;
  --hero-still-grid-a: 0.022;
  --hero-still-hatch-a: 0.014;
}

/* Light theme — warm paper palette */
body.theme-light {
  --bg: #F4F1EA;
  --surface: #ECE7DC;
  --surface-2: #E8E2D3;
  --border-mid: #D6CFBF;
  --border-hair: rgba(20, 18, 14, 0.10);
  --text: #1A1A1C;
  --text-mid: #3A3833;
  --text-muted: #5E5A52;
  --text-faint: #8A867D;
  --accent: #C77A1A;
  --accent-hot: #8C4F0A;

  --hero-body-rgb: 26, 26, 28;
  --hero-orbit-stroke-a: 0.18;
  --hero-axis-stroke-a: 0.12;
  --hero-body-tag-a: 0.7;
  --hero-grain-a: 0.04;
  --hero-solar-a: 0.18;
  --hero-solar-mid-a: 0.05;
  --hero-still-grid-a: 0.06;
  --hero-still-hatch-a: 0.04;
}
body.theme-light ::selection { background: rgba(199,122,26,0.28); color: var(--text); }
body.theme-light .col-still {
  background:
    linear-gradient(rgba(20,18,14,0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(20,18,14,0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    repeating-linear-gradient(135deg, rgba(20,18,14,0.04) 0 1px, transparent 1px 14px),
    var(--surface-2);
}
body.theme-light .products::before {
  background: radial-gradient(ellipse at 74% -50%, rgba(199,122,26,0.10) 0%, rgba(199,122,26,0.025) 35%, transparent 70%);
}
body.theme-light footer.site-footer .arc svg path { stroke: rgba(20,18,14,0.16); }

/* Theme toggle button (lives inside nav) */
.theme-toggle {
  appearance: none;
  background: rgba(11,13,17,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 18px;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
  pointer-events: auto;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle svg { width: 14px; height: 14px; display: block; }
body.theme-light .theme-toggle { background: rgba(255,253,246,0.55); }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
body.theme-light .theme-toggle .icon-sun { display: none; }
body.theme-light .theme-toggle .icon-moon { display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 320ms ease, color 320ms ease;
}
::selection { background: rgba(244,163,64,0.25); color: var(--text); }
.mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* ---- Focus rings (accessibility) ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- Header ---- */
header.nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 24px 32px;
  z-index: 60;
  pointer-events: none;
  display: flex; justify-content: space-between; align-items: center;
}
header.nav > * { pointer-events: auto; }
.brandmark {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}
.brandmark .dot { color: var(--accent); margin-right: 0.35em; }
nav.links { display: flex; align-items: center; gap: 28px; }
nav.links a {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
nav.links a:hover { color: var(--text); }
nav.links .sep { color: var(--text-faint); }

/* ---- Hero stage (mount point) ---- */
.hero-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-mid);
  background: var(--bg);
}
@media (max-width: 768px) { .hero-stage { height: 100svh; } }

/* ---- Body sections ---- */
.products {
  position: relative;
  padding: var(--section-pad) var(--pad-x);
  border-bottom: 1px solid var(--border-mid);
}
.products::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 200px;
  background: radial-gradient(ellipse at 74% -50%, rgba(244,163,64,0.06) 0%, rgba(244,163,64,0.012) 35%, transparent 70%);
  pointer-events: none;
}
.container { max-width: var(--max); margin: 0 auto; position: relative; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 80px; flex-wrap: wrap; gap: 16px;
}
.section-head .eyebrow {
  font-family: "Geist Mono", monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.section-head h2 {
  font-family: "Geist", sans-serif; font-weight: 300;
  font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.02em; line-height: 1.1;
  margin: 0; max-width: 18ch;
}
.section-head .meta {
  font-family: "Geist Mono", monospace; font-size: 10px; letter-spacing: 0.12em;
  color: var(--text-faint); text-transform: uppercase; text-align: right;
}
.product-row {
  display: grid; grid-template-columns: 1.05fr 1.4fr 1fr;
  gap: 56px; padding: 56px 0; border-top: 1px solid var(--border-mid);
}
.product-row:last-child { border-bottom: 1px solid var(--border-mid); }
.product-row.flip { grid-template-columns: 1fr 1.4fr 1.05fr; }
.product-row.flip .col-marker { order: 3; text-align: right; }
.product-row.flip .col-still { order: 1; }
.product-row.flip .col-body { order: 2; }
.col-marker { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding-top: 6px; }
.marker-top {
  display: flex; align-items: center; gap: 10px;
  font-family: "Geist Mono", monospace;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
}
.marker-top .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(244,163,64,0.12); }
.marker-top .num { color: var(--accent); }
.marker-top .lab { color: var(--text-faint); }
.marker-coords { font-family: "Geist Mono", monospace; font-size: 10px; color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.85; }
.marker-coords .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--border-mid); }
.marker-coords .v { color: var(--text-muted); }
.product-row.flip .marker-coords .row { flex-direction: row-reverse; }
.col-still {
  position: relative; min-height: 280px; border: 1px solid var(--border-mid);
  background:
    linear-gradient(rgba(236,237,238,0.022) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(236,237,238,0.022) 1px, transparent 1px) 0 0 / 32px 32px,
    repeating-linear-gradient(135deg, rgba(236,237,238,0.014) 0 1px, transparent 1px 14px),
    var(--surface-2);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 18px;
  transition: border-color 280ms ease;
}
.col-still::before, .col-still::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  background: var(--text-faint); opacity: 0.45;
}
.col-still::before { width: 1px; height: 18px; transform: translate(-50%, -50%); }
.col-still::after  { width: 18px; height: 1px; transform: translate(-50%, -50%); }
.col-still:hover { border-color: rgba(244,163,64,0.18); }
.col-still .corner { position: absolute; width: 10px; height: 10px; border-color: var(--text-faint); border-style: solid; border-width: 0; }
.col-still .corner.tl { top: 8px; left: 8px; border-top-width: 1px; border-left-width: 1px; }
.col-still .corner.tr { top: 8px; right: 8px; border-top-width: 1px; border-right-width: 1px; }
.col-still .corner.bl { bottom: 8px; left: 8px; border-bottom-width: 1px; border-left-width: 1px; }
.col-still .corner.br { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }
.col-still .still-label, .col-still .still-tag {
  font-family: "Geist Mono", monospace; font-size: 9.5px; letter-spacing: 0.18em; color: var(--text-faint); text-transform: uppercase;
}
.col-still .still-label .ad { color: var(--accent); }
.col-still .still-tag { letter-spacing: 0.12em; text-align: right; }
.col-body { display: flex; flex-direction: column; padding-top: 6px; }
.col-body .tagline { font-family: "Geist Mono", monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 22px; }
.col-body h3 { font-family: "Geist", sans-serif; font-weight: 300; font-size: clamp(28px, 2.8vw, 40px); letter-spacing: -0.022em; line-height: 1.05; margin: 0 0 22px 0; }
.col-body p { font-size: 15px; line-height: 1.6; color: var(--text-mid); margin: 0 0 32px 0; max-width: 44ch; }
.col-body .visit { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; transition: color 220ms ease, gap 220ms ease; margin-top: auto; }
.col-body .visit:hover { color: var(--accent); gap: 14px; }
.col-body .visit .arrow { transition: transform 220ms ease; display: inline-block; }
.col-body .visit:hover .arrow { transform: translate(2px, -2px); }

/* "Coming Soon" non-link badge for unreleased products */
.col-body .visit-soon {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: auto;
  cursor: default;
}
.col-body .visit-soon::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.6;
}

/* About */
.about { padding: var(--section-pad) var(--pad-x); border-bottom: 1px solid var(--border-mid); }
.about .grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 64px; }
.about .side { grid-column: span 3; }
.about .main { grid-column: span 9; }
.about .eyebrow { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 32px; }
.meta-table { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.meta-table .row { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border-mid); gap: 16px; }
.meta-table .row:last-child { border-bottom: 1px solid var(--border-mid); }
.meta-table .k { color: var(--text-faint); }
.meta-table .v { color: var(--text); }
.about h2.headline {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-style: italic; font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px); line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 56px 0; max-width: 22ch; text-wrap: pretty;
  color: var(--text);
}
.about p { font-size: 17px; line-height: 1.65; color: var(--text-mid); margin: 0 0 28px 0; max-width: 62ch; }
.about p.closing { color: var(--text-muted); margin-top: 40px; font-size: 16px; }

/* Footer */
footer.site-footer {
  position: relative; border-top: 1px solid var(--border-mid);
  padding: 64px 32px; margin-top: 128px;
}
footer.site-footer .arc { position: absolute; top: -1px; left: 0; right: 0; height: 64px; pointer-events: none; overflow: hidden; }
footer.site-footer .arc svg { display: block; width: 100%; height: 100%; }
footer.site-footer .grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; align-items: start;
  font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
footer.site-footer .brand-block .mark { color: var(--text); }
footer.site-footer .brand-block .mark .dot { color: var(--accent); margin-right: 0.4em; }
footer.site-footer .brand-block .tag { margin-top: 18px; color: var(--text-faint); line-height: 1.85; letter-spacing: 0.1em; }
footer.site-footer .col-label { color: var(--text-faint); margin-bottom: 14px; }
footer.site-footer .contact .line { color: var(--text); }
footer.site-footer .contact .line.sub { color: var(--text-muted); margin-top: 6px; }
footer.site-footer .system { text-align: right; }
footer.site-footer .system .links { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
footer.site-footer .system a { color: var(--text-muted); text-decoration: none; transition: color 200ms ease; }
footer.site-footer .system a:hover { color: var(--text); }

@media (max-width: 900px) {
  .product-row, .product-row.flip { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
  .product-row.flip .col-marker { order: 1; text-align: left; }
  .product-row.flip .col-still { order: 2; }
  .product-row.flip .col-body { order: 3; }
  .product-row.flip .marker-coords .row { flex-direction: row; }
  .col-marker { flex-direction: row; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .marker-coords { min-width: 220px; }
  .col-still { min-height: 220px; }
  .about .grid { grid-template-columns: 1fr; gap: 40px; }
  .about .side, .about .main { grid-column: span 1; }
  footer.site-footer .grid { grid-template-columns: 1fr; gap: 40px; }
  footer.site-footer .system, footer.site-footer .system .links { text-align: left; align-items: flex-start; }
}
@media (max-width: 768px) {
  :root { --pad-x: 22px; --section-pad: 88px; }
  header.nav { padding: 22px 22px; }
  nav.links { gap: 18px; }
  .section-head { margin-bottom: 56px; }
  .about h2.headline { margin-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Common entrance helper */
.fade-in { opacity: 0; transition: opacity 1.2s ease-out; }
.fade-in.in { opacity: 1; }
