/* ============================================================================
   rompix apex landing (apps/www) — static, no build step.
   Brand tokens reuse the app's palette; the landing extends, it does not fork.
   The display typeface (Inter Tight) is self-hosted HERE ONLY and never reaches
   the app (apps/app stays on system-ui).
   ========================================================================== */

@font-face {
  font-family: 'Inter Tight';
  src: url('/fonts/inter-tight.var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Body';
  src: url('/fonts/inter.var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #15181f;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --dim: #8b93a5;      /* decorative / large text only */
  --dim-2: #aab2c0;    /* readable body — clears 4.5:1 on --bg at small sizes */
  --keeper: #f5c84b;
  --keeper-ink: #1a1205;

  --display: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter Body', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1100px 620px at 78% 26%, rgba(245, 200, 75, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* --- a11y helpers --------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--keeper); color: var(--keeper-ink); font-weight: 650;
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

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

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 650; letter-spacing: -0.01em; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; border-radius: 10px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn--cta {
  background: var(--keeper); color: var(--keeper-ink);
  font-size: 15px; padding: 11px 18px; min-height: 40px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 24px rgba(245, 200, 75, 0.16);
}
.btn--cta:hover { background: #ffd567; transform: translateY(-1px); }
.btn--cta:active { transform: translateY(0); }
.btn--lg { font-size: 16.5px; padding: 15px 26px; min-height: 48px; border-radius: 11px; }

/* --- header --------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.bar {
  max-width: var(--maxw); margin: 0 auto; padding: 16px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 750; font-size: 20px;
  letter-spacing: -0.025em; text-decoration: none; color: var(--text);
}
.brand__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--keeper); box-shadow: 0 0 14px rgba(245, 200, 75, 0.7);
}
.site-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.nav-link {
  font-family: var(--display); font-weight: 550; font-size: 15px;
  color: var(--dim-2); text-decoration: none;
}
.nav-link:hover { color: var(--text); }

/* --- hero ----------------------------------------------------------------- */
.hero {
  flex: 1;
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) var(--pad) clamp(44px, 7vw, 84px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 56px);
}
.kicker {
  color: var(--keeper); font-family: var(--display);
  font-weight: 600; font-size: 12.5px; letter-spacing: 0.13em;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 780;
}
.hero__title .accent { color: var(--keeper); }
.hero__sub {
  color: var(--dim-2); font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55; margin-top: 22px; max-width: 34ch;
}
.hero__cta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 18px; margin-top: 34px; }
.reassure { color: var(--dim-2); font-size: 14px; }
.reassure b { color: var(--text); font-weight: 600; }

/* --- stage (the animated tree) ------------------------------------------- */
.hero__stage { margin: 0; min-width: 0; }
.stage {
  position: relative; width: 100%;
  aspect-ratio: 660 / 520;
  border: 1px solid var(--border); border-radius: 18px;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0),
    var(--panel-2);
  background-size: auto, 22px 22px, auto;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.stage__bar {
  position: absolute; inset: 0 0 auto 0; height: 34px; z-index: 4;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px; padding: 0 13px;
  background: rgba(15, 17, 21, 0.6);
}
.stage__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2f3a; }
.stage__note {
  position: absolute; left: 16px; bottom: 13px; z-index: 4;
  color: var(--dim-2); font-size: 12.5px; letter-spacing: -0.005em;
  max-width: 60%;
}
.defs { position: absolute; width: 0; height: 0; pointer-events: none; }

.edges { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.edges--tall { display: none; }
.edge { stroke: #39404d; stroke-width: 2; fill: none; }
.edge--gold { stroke: var(--keeper); stroke-width: 2.4; opacity: 0.9; }

.node {
  position: absolute; z-index: 2;
  left: calc(var(--cx) / 660 * 100%);
  top: calc(var(--cy) / 520 * 100%);
  width: calc(var(--w) * 1%);
  transform: translate(-50%, -50%);
}
/* Desktop coordinates in the 660×520 design space. Defined as class rules (not
   inline styles) so the phone media query can override them — inline styles would
   win over any selector. */
.node--root   { --cx: 92;  --cy: 250; --w: 17; }
.node--v1     { --cx: 300; --cy: 110; --w: 19; }
.node--v2     { --cx: 300; --cy: 262; --w: 19; }
.node--v3     { --cx: 300; --cy: 410; --w: 19; }
.node--keeper { --cx: 510; --cy: 262; --w: 22; }
.frame {
  display: block; position: relative; width: 100%;
  aspect-ratio: 160 / 116;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.frame svg { display: block; width: 100%; height: 100%; }
.tag {
  position: absolute; left: 7px; bottom: 7px; z-index: 3;
  font-family: var(--display); font-size: 10.5px; font-weight: 550;
  color: var(--dim-2);
  background: rgba(15, 17, 21, 0.82); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px;
}
.tag--keeper { color: var(--keeper); border-color: rgba(245, 200, 75, 0.4); }

/* keeper ring + chip */
.keeper .frame {
  outline: 2px solid var(--keeper); outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--keeper), 0 0 30px rgba(245, 200, 75, 0.34), 0 8px 22px rgba(0, 0, 0, 0.4);
}
.keeperchip {
  position: absolute; top: -11px; left: 9px; z-index: 5;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--display); font-size: 11px; font-weight: 700;
  color: var(--keeper-ink); background: var(--keeper);
  border-radius: 6px; padding: 3px 8px;
  box-shadow: 0 4px 12px rgba(245, 200, 75, 0.28);
}
.keeperchip--mobile { display: none; }

/* --- pricing strip -------------------------------------------------------- */
.pricing {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}
.price-strip {
  max-width: var(--maxw); margin: 0 auto; list-style: none;
  padding: clamp(22px, 3.5vw, 34px) var(--pad);
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: clamp(14px, 3vw, 30px);
  text-align: center;
}
.price-item { display: flex; flex-direction: column; gap: 4px; }
.price-item__lead {
  font-family: var(--display); font-weight: 650; font-size: 16px;
  color: var(--text); letter-spacing: -0.01em;
}
.price-item__sub { font-size: 13px; color: var(--dim-2); }
.price-item--muted .price-item__lead { color: var(--dim-2); font-weight: 600; }
.price-sep { width: 1px; height: 30px; background: var(--border); }
.badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-family: var(--body); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--dim); background: rgba(139, 147, 165, 0.12);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px;
}

/* --- footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 26px var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.footer-links a {
  color: var(--dim-2); text-decoration: none; font-size: 14px;
}
.footer-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.copyright { color: var(--dim); font-size: 13.5px; }

/* ============================================================================
   BUILD-ON ANIMATION
   Default (this block absent) = final keeper-lit poster, painted on first load
   (no dark flash, works with JS off). `.anim` is added on <html> before paint
   only when JS is on and reduced-motion is NOT requested.
   ========================================================================== */
.anim .node--v1, .anim .node--v2, .anim .node--v3 {
  opacity: 0;
  animation: nodeIn 0.5s ease forwards;
}
.anim .node--v1 { animation-delay: 0.45s; }
.anim .node--v2 { animation-delay: 0.6s; }
.anim .node--v3 { animation-delay: 0.75s; }
.anim .node--keeper {
  opacity: 0;
  animation: keeperPop 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 1.15s forwards;
}
.anim .keeper .frame {
  outline-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  animation: ringLight 0.7s ease 1.35s forwards;
}
.anim .stage__note { opacity: 0; animation: fadeIn 0.6s ease 1.5s forwards; }

.anim .edge {
  stroke-dasharray: 1; stroke-dashoffset: 1;   /* paired with pathLength="1" */
  animation: drawIn 0.7s ease forwards;
}
.anim .edges--wide .edge:nth-of-type(1) { animation-delay: 0.3s; }
.anim .edges--wide .edge:nth-of-type(2) { animation-delay: 0.42s; }
.anim .edges--wide .edge:nth-of-type(3) { animation-delay: 0.54s; }
.anim .edges--wide .edge:nth-of-type(4) { animation-delay: 0.98s; }   /* edge into keeper */
.anim .edges--tall .edge:nth-of-type(1) { animation-delay: 0.3s; }
.anim .edges--tall .edge:nth-of-type(2) { animation-delay: 0.42s; }
.anim .edges--tall .edge:nth-of-type(3) { animation-delay: 0.54s; }

@keyframes nodeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes keeperPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  62%  { opacity: 1; transform: translate(-50%, -50%) scale(1.045); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes drawIn { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes ringLight {
  to {
    outline-color: var(--keeper);
    box-shadow: 0 0 0 1px var(--keeper), 0 0 30px rgba(245, 200, 75, 0.34), 0 8px 22px rgba(0, 0, 0, 0.4);
  }
}

/* Belt-and-suspenders: never animate for reduced-motion, even if `.anim` slipped on. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .node { opacity: 1 !important; }
  .edge { stroke-dashoffset: 0 !important; }
}

/* ============================================================================
   RESPONSIVE — tablet
   ========================================================================== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: clamp(28px, 6vw, 44px);
    padding-top: clamp(28px, 6vw, 48px);
  }
  .hero__copy { max-width: 38rem; }
  .hero__sub { max-width: 46ch; }
  .stage { max-width: 560px; margin-inline: auto; }
}

/* ============================================================================
   RESPONSIVE — phone (<=640): tree collapses to a 2-level vertical
   root -> 3 branches, the middle branch lit as the keeper.
   ========================================================================== */
@media (max-width: 640px) {
  .hero { padding-bottom: clamp(36px, 9vw, 52px); }
  .hero__title { font-size: clamp(34px, 11vw, 46px); }
  .hero__cta { gap: 14px; }
  .btn--cta.btn--lg { width: 100%; min-height: 50px; }   /* full-width 44px+ target */
  .reassure { width: 100%; }

  .stage { aspect-ratio: 360 / 376; max-width: 460px; }
  .edges--wide { display: none; }
  .edges--tall { display: block; }

  .node--root  { --cx: 330; --cy: 120; --w: 30; }
  .node--v1    { --cx: 125; --cy: 360; --w: 27; }
  .node--v2    { --cx: 330; --cy: 360; --w: 27; }
  .node--v3    { --cx: 535; --cy: 360; --w: 27; }
  .node--keeper { display: none; }   /* refined sub-node folds away on mobile */

  /* light v2 as the keeper on phones */
  .node--v2 .frame {
    outline: 2px solid var(--keeper); outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--keeper), 0 0 26px rgba(245, 200, 75, 0.34), 0 8px 22px rgba(0, 0, 0, 0.4);
  }
  .node--v2 .tag { color: var(--keeper); border-color: rgba(245, 200, 75, 0.4); }
  .keeperchip--mobile { display: inline-flex; }

  .stage__note { font-size: 11.5px; max-width: 72%; }

  /* on mobile the kept line is v2 (not the folded refined node) */
  .anim .node--v2 { animation-delay: 0.85s; }
}

@media (max-width: 420px) {
  .footer-inner { justify-content: flex-start; }
}
