/* ============================================================
   Janus Prime — janusprime.co
   Two acts: dark (the present) → amber threshold → light (the built future)
   ============================================================ */

:root {
  /* Core palette */
  --ink: #14161D;          /* back-facing present */
  --ink-2: #1B1E27;        /* raised surface on dark */
  --ink-3: #21242F;        /* higher surface on dark */
  --ink-line: #2C303B;     /* hairlines on dark */
  --limestone: #ECE7DC;    /* forward-facing built future */
  --limestone-2: #F5F2EA;  /* raised surface on light */
  --limestone-line: #D8D2C4;

  /* Signal (amber / bronze) — direction of travel */
  --bronze: #C0803B;
  --bronze-bright: #E2A85E;
  --bronze-ink: #8A5A24;   /* text-weight bronze, AA on light */

  /* Text */
  --on-ink: #E9E4D8;
  --on-ink-muted: #9BA1AD;
  --on-light: #23262E;
  --on-light-muted: #5B6472;

  /* System */
  --wrap: 1160px;
  --pad: clamp(1.25rem, 5vw, 3rem);
  --sp-section: clamp(4rem, 8vw, 7rem);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 4px;
  --radius-lg: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-dark: 0 20px 50px -25px rgba(0,0,0,0.7);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
strong { font-weight: 600; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.02em; }

/* Accessibility */
.skip-link {
  position: absolute; left: 0; top: 0; transform: translateY(-120%);
  background: var(--bronze); color: var(--ink); font-family: var(--font-mono);
  font-size: 0.85rem; padding: 0.6rem 1rem; z-index: 100; transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, .btn):focus-visible { outline: 2px solid var(--bronze-bright); outline-offset: 3px; border-radius: 2px; }

/* Section acts */
[data-act="dark"] { background: var(--ink); color: var(--on-ink); }
[data-act="light"] { background: var(--limestone); color: var(--on-light); }

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }
.reveal-ready [data-reveal] { will-change: opacity, transform; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Eyebrows / shared section type ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--bronze-bright);
  margin: 0 0 1.4rem; padding-left: 1.6rem; position: relative;
}
.eyebrow::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 1rem; height: 2px; background: var(--bronze); }
.eyebrow-dark { color: var(--bronze-ink); }
.eyebrow-dark::before { background: var(--bronze-ink); }

/* Pill variant (hero) */
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.95rem 0.5rem 0.85rem; margin-bottom: 1.8rem;
  border: 1px solid var(--ink-line); border-radius: 100px;
  background: var(--ink-2); color: var(--on-ink-muted);
}
.eyebrow-pill::before { display: none; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bronze-bright); box-shadow: 0 0 10px 1px rgba(226,168,94,0.6); flex: none; }

.section-title { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); max-width: 20ch; }
.section-lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.28rem); color: var(--on-ink-muted); max-width: 54ch; margin-top: 1.4rem; }
.section-lede-dark { color: var(--on-light-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--font-display); font-weight: 700; font-size: 0.98rem;
  letter-spacing: -0.01em; text-decoration: none;
  padding: 0.85em 1.5em; border-radius: var(--radius);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-primary { background: var(--bronze); color: var(--ink); box-shadow: 0 8px 24px -12px rgba(192,128,59,0.8); }
.btn-primary:hover { background: var(--bronze-bright); transform: translateY(-2px); }
.btn-ghost { color: inherit; border: 1px solid currentColor; background: transparent; opacity: 0.82; }
.btn-ghost:hover { opacity: 1; transform: translateY(-2px); }
.btn-lg { font-size: 1.08rem; padding: 1em 1.9em; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--on-ink); }
.brand-mark { color: var(--on-ink); flex: none; }
.brand-word { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; font-size: 1.12rem; }
.header-nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 1.9rem); }
.header-nav > a { font-family: var(--font-display); font-weight: 500; font-size: 0.92rem; text-decoration: none; color: var(--on-ink-muted); transition: color 0.16s var(--ease); }
.header-nav > a:hover { color: var(--on-ink); }
.header-cta { color: var(--bronze-bright) !important; border: 1px solid var(--ink-line); padding: 0.5em 1em; border-radius: var(--radius); }
.header-cta:hover { border-color: var(--bronze); background: var(--ink-2); }
@media (max-width: 820px) { .header-nav > a:not(.header-cta) { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: var(--sp-section); position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero-title {
  font-weight: 900; font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.4rem);
  letter-spacing: -0.035em; max-width: 15ch;
}
.hero-title-accent { color: var(--bronze-bright); }
.hero-lede { font-size: clamp(1.1rem, 1rem + 0.55vw, 1.4rem); color: var(--on-ink-muted); max-width: 44ch; margin-top: 1.5rem; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }
.hero-trust { margin-top: 1.8rem; font-size: 0.8rem; letter-spacing: 0.08em; color: var(--on-ink-muted); text-transform: uppercase; }
.hero-trust span { color: var(--bronze); margin-inline: 0.3rem; }

/* Hero engine (canvas) */
.engine { margin: 0; min-width: 0; }
.engine-frame {
  position: relative; aspect-ratio: 5 / 4; width: 100%;
  border: 1px solid var(--ink-line); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 78% 30%, rgba(192,128,59,0.10), transparent 60%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
  box-shadow: var(--shadow-dark); overflow: hidden;
}
.engine-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.engine-labels { position: absolute; inset: 0; pointer-events: none; }
.engine-label { position: absolute; bottom: 0.9rem; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-ink-muted); }
.engine-label--before { left: 1rem; }
.engine-label--after { right: 1rem; color: var(--bronze-bright); }
.engine-caption { display: flex; align-items: center; gap: 0.7rem; justify-content: flex-end; margin-top: 0.9rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-ink-muted); }
.engine-arrow { color: var(--bronze); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .engine-frame { aspect-ratio: 16 / 10; max-width: 560px; }
  .engine-caption { justify-content: flex-start; }
}

/* ============================================================
   PROBLEM
   ============================================================ */
.problem { padding-block: var(--sp-section); border-top: 1px solid var(--ink-line); }
.pain-list { list-style: none; margin: 2.6rem 0 0; padding: 0; max-width: 64ch; }
.pain-list li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.2rem; align-items: baseline; padding: 1.1rem 0; border-top: 1px solid var(--ink-line); color: var(--on-ink); }
.pain-list li:last-child { border-bottom: 1px solid var(--ink-line); }
.pain-tag { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze-bright); padding-top: 0.15rem; }
@media (max-width: 560px) { .pain-list li { grid-template-columns: 1fr; gap: 0.35rem; } }

/* ============================================================
   THRESHOLD — the crossing (ink → limestone seam)
   ============================================================ */
.threshold { background: linear-gradient(180deg, var(--ink) 0%, var(--ink) 10%, var(--limestone) 34%, var(--limestone) 100%); padding: 0 0 clamp(3.5rem, 8vw, 5.5rem); overflow: hidden; }
.threshold-inner { position: relative; text-align: center; padding-top: clamp(148px, 21vw, 205px); }
/* Descending seam: a bronze line dropping out of the dark into the light, ending in a glowing
   node ABOVE the copy — the "crossing", without running through the text. */
.threshold-line { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 1px; height: clamp(118px, 17vw, 172px); background: linear-gradient(180deg, transparent, var(--bronze) 45%, var(--bronze-bright)); }
.threshold-line::before { content: ""; position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%); width: 8px; height: 8px; background: var(--bronze-bright); border-radius: 50%; box-shadow: 0 0 16px 3px rgba(226,168,94,0.55); }
.threshold-kicker { position: relative; display: inline-block; font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--bronze-ink); margin: 0 0 1.4rem; }
.threshold-copy { position: relative; z-index: 1; font-family: var(--font-serif); font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem); line-height: 1.5; color: var(--on-light); max-width: 30ch; margin-inline: auto; }
.threshold-copy strong { color: var(--bronze-ink); font-weight: 600; }

/* ============================================================
   SERVICES
   ============================================================ */
.work { padding-block: var(--sp-section); }
.services { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 1px; background: var(--limestone-line); border: 1px solid var(--limestone-line); border-radius: var(--radius-lg); overflow: hidden; }
.service { background: var(--limestone); padding: clamp(1.6rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 0.75rem; transition: background 0.2s var(--ease); }
.service:hover { background: var(--limestone-2); }
.service-index { font-size: 0.8rem; color: var(--bronze-ink); letter-spacing: 0.1em; }
.service-title { font-weight: 700; font-size: 1.22rem; color: var(--on-light); }
.service p { color: var(--on-light-muted); font-size: 1rem; line-height: 1.55; }
.service p strong { color: var(--bronze-ink); font-weight: 600; }

/* ============================================================
   PROCESS TIMELINE
   ============================================================ */
.process { padding-block: var(--sp-section); background: var(--limestone-2); }
.phases { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); counter-reset: phase; }
.phase { position: relative; padding-top: 1.6rem; border-top: 2px solid var(--limestone-line); }
.phase::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bronze); box-shadow: 0 0 0 4px var(--limestone-2); }
.phase-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.phase-index { font-size: 1.1rem; font-weight: 500; color: var(--bronze-ink); }
.phase-dur { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-light-muted); border: 1px solid var(--limestone-line); border-radius: 100px; padding: 0.3rem 0.7rem; background: var(--limestone); }
.phase-title { font-size: 1.5rem; font-weight: 800; color: var(--on-light); margin-bottom: 0.6rem; }
.phase p { color: var(--on-light-muted); font-size: 0.98rem; line-height: 1.55; }
@media (max-width: 760px) { .phases { grid-template-columns: 1fr; } }

/* ============================================================
   PROOF + CASES
   ============================================================ */
.proof { padding-block: var(--sp-section); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: clamp(1.4rem, 3vw, 2.4rem); margin-top: 2.8rem; }
.stat { display: flex; flex-direction: column; }
.stat-figure { font-family: var(--font-mono); font-weight: 500; font-size: clamp(2.6rem, 2rem + 2.6vw, 3.8rem); line-height: 1; color: var(--ink); letter-spacing: -0.03em; display: flex; align-items: baseline; }
.stat-plus { color: var(--bronze-ink); }
.stat-num { font-variant-numeric: tabular-nums; }
.stat-label { color: var(--on-light-muted); font-size: 0.95rem; line-height: 1.4; margin-top: 0.75rem; max-width: 22ch; }
.stat-bar { display: block; height: 3px; background: var(--limestone-line); margin-top: 1.2rem; overflow: hidden; }
.stat-bar > i { display: block; height: 100%; width: var(--to); background: var(--bronze); transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.stat-bar.is-filled > i { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .stat-bar > i { transform: scaleX(1); transition: none; } }

.cases-title { font-size: 1.15rem; font-weight: 700; color: var(--on-light); margin-top: clamp(3.5rem, 7vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--limestone-line); letter-spacing: 0.01em; }
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(1rem, 2vw, 1.4rem); margin-top: 1.6rem; }
.case { background: var(--limestone-2); border: 1px solid var(--limestone-line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 2.6vw, 2rem); display: flex; flex-direction: column; transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease); }
.case:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -30px rgba(20,22,29,0.5); }
.case-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.case-tags span { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-light-muted); border: 1px solid var(--limestone-line); border-radius: 100px; padding: 0.28rem 0.7rem; background: var(--limestone); }
.case-name { font-size: 1.28rem; font-weight: 800; color: var(--on-light); margin-bottom: 1.1rem; }
.case-body { margin: 0 0 1.3rem; display: grid; gap: 0.25rem; }
.case-body dt { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze-ink); margin-top: 0.7rem; }
.case-body dt:first-child { margin-top: 0; }
.case-body dd { margin: 0; color: var(--on-light-muted); font-size: 0.98rem; line-height: 1.5; }
.case-result { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--limestone-line); color: var(--on-light); font-size: 0.98rem; }
.case-metric { color: var(--bronze-ink); font-weight: 500; font-size: 1.05rem; }
.cases-note { margin-top: 1.6rem; font-size: 0.74rem; letter-spacing: 0.04em; color: var(--on-light-muted); }

/* ============================================================
   TOOLS MARQUEE
   ============================================================ */
.tools { padding-block: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--limestone-line); overflow: hidden; }
.tools-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-light-muted); margin: 0 0 1.5rem; padding-inline: var(--pad); max-width: var(--wrap); margin-inline: auto; }
.marquee { position: relative; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.marquee-group li { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 1rem + 1.6vw, 2.1rem); color: var(--on-light); opacity: 0.72; white-space: nowrap; padding-inline: clamp(1.2rem, 3vw, 2.6rem); }
.marquee-group li::after { content: "·"; color: var(--bronze); margin-left: clamp(1.2rem, 3vw, 2.6rem); opacity: 0.7; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding-block: var(--sp-section); }
.about-inner { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-lede { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); color: var(--on-light); margin-top: 1.4rem; line-height: 1.55; }
.about-body > p { color: var(--on-light-muted); margin-top: 1.2rem; max-width: 54ch; }
.about-body > p strong { color: var(--on-light); }
.about-signoff { color: var(--bronze-ink) !important; font-size: 0.9rem; margin-top: 1.8rem; letter-spacing: 0.02em; }
.about-facts { background: var(--ink); color: var(--on-ink); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2rem); position: sticky; top: 90px; box-shadow: var(--shadow-dark); }
.about-facts dl { margin: 0; display: flex; flex-direction: column; }
.about-facts div { padding: 0.95rem 0; border-bottom: 1px solid var(--ink-line); }
.about-facts div:first-child { padding-top: 0; }
.about-facts div:last-child { border-bottom: none; padding-bottom: 0; }
.about-facts dt { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bronze-bright); margin-bottom: 0.35rem; }
.about-facts dd { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--on-ink); }
@media (max-width: 780px) { .about-inner { grid-template-columns: 1fr; } .about-facts { position: static; } }

/* ============================================================
   CLOSING CTA
   ============================================================ */
.cta { padding-block: var(--sp-section); border-top: 1px solid var(--ink-line); text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta .eyebrow { padding-left: 0; }
.cta .eyebrow::before { display: none; }
.cta-title { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); max-width: 20ch; }
.cta-lede { color: var(--on-ink-muted); font-size: clamp(1.1rem, 1rem + 0.5vw, 1.28rem); max-width: 48ch; margin: 1.4rem 0 2.4rem; }
.cta-alt { margin-top: 1.3rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--on-ink-muted); }
.cta-alt a { color: var(--bronze-bright); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.16s var(--ease); }
.cta-alt a:hover { border-color: var(--bronze-bright); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { padding-block: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--ink-line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; }
.brand-footer .brand-word { font-size: 1rem; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { font-family: var(--font-mono); font-size: 0.85rem; color: var(--on-ink-muted); text-decoration: none; transition: color 0.16s var(--ease); }
.footer-nav a:hover { color: var(--bronze-bright); }
.footer-meta { width: 100%; font-size: 0.74rem; color: var(--on-ink-muted); letter-spacing: 0.04em; padding-top: 1.2rem; border-top: 1px solid var(--ink-line); }
