/* ==========================================================================
   GenXSync — marketing site
   Palette: deep petrol ground, copper signal accent, low-saturation teal for
   retrieval traces. Copper is the only loud colour; everything else stays in
   the ground's family so the accent never has to fight for attention.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;

  --copper:      #E08A3C;
  --copper-lift: #F0A661;
  --teal:        #5FB3A8;

  --ground:      #071316;
  --surface:     #0C1D22;
  --surface-2:   #112A31;
  --line:        #1C3B44;
  --line-soft:   #14313880;

  --text:        #E6EDEC;
  --text-dim:    #9FB3B4;
  --text-faint:  #6E8789;

  --shadow: 0 1px 0 #ffffff0d inset, 0 18px 40px -24px #000000cc;

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1160px;
  --gut: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;

  /* type scale — 1.25 minor third, fluid at the top end */
  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1.0625rem;
  --t-lg:   1.1875rem;
  --t-xl:   clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --t-2xl:  clamp(1.8rem, 1.3rem + 2.2vw, 2.75rem);
  --t-3xl:  clamp(2.3rem, 1.4rem + 3.9vw, 4.15rem);
}

@media (prefers-color-scheme: light) {
  :root { color-scheme: light;
    --ground:     #F4F2EE;
    --surface:    #FFFFFF;
    --surface-2:  #EDEAE4;
    --line:       #D6D0C6;
    --line-soft:  #D6D0C680;
    --text:       #15211F;
    --text-dim:   #4E5B59;
    --text-faint: #7B8785;
    --copper:     #B4620F;
    --copper-lift:#8F4C08;
    --teal:       #2C7A6E;
    --shadow: 0 1px 0 #ffffff inset, 0 16px 34px -26px #2b201499;
  }
}

/* The viewer's toggle stamps data-theme and must win over the media query
   in both directions, so both are declared explicitly. */
:root[data-theme="light"] { color-scheme: light;
  --ground:#F4F2EE; --surface:#FFFFFF; --surface-2:#EDEAE4;
  --line:#D6D0C6; --line-soft:#D6D0C680;
  --text:#15211F; --text-dim:#4E5B59; --text-faint:#7B8785;
  --copper:#B4620F; --copper-lift:#8F4C08; --teal:#2C7A6E;
  --shadow: 0 1px 0 #ffffff inset, 0 16px 34px -26px #2b201499;
}
:root[data-theme="dark"] { color-scheme: dark;
  --ground:#071316; --surface:#0C1D22; --surface-2:#112A31;
  --line:#1C3B44; --line-soft:#14313880;
  --text:#E6EDEC; --text-dim:#9FB3B4; --text-faint:#6E8789;
  --copper:#E08A3C; --copper-lift:#F0A661; --teal:#5FB3A8;
  --shadow: 0 1px 0 #ffffff0d inset, 0 18px 40px -24px #000000cc;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0;
}
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
b { font-weight: 600; color: var(--text); }

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--copper); color: #0B0705;
  padding: .7rem 1.1rem; z-index: 99; font-weight: 600;
}
.skip:focus { left: .5rem; top: .5rem; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* ---------- shared type devices ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0;
}
.eyebrow--rule {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.eyebrow--rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.tag {
  font-family: var(--f-mono);
  color: var(--teal);
  font-size: .95em;
}
.tag--sm { font-size: .9em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: .62rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn--lg { padding: .85rem 1.5rem; font-size: var(--t-base); }
.btn--full { width: 100%; }

.btn--solid  { background: var(--copper); color: #120A03; }
.btn--solid:hover  { background: var(--copper-lift); transform: translateY(-1px); }

.btn--outline { border-color: var(--line); color: var(--text); }
.btn--outline:hover { border-color: var(--copper); color: var(--copper); }

.btn--ghost { color: var(--text-dim); }
.btn--ghost:hover { color: var(--text); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 66px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__alt { color: var(--copper); }
.wordmark__mark {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--copper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper) 18%, transparent);
}

.topnav {
  display: flex;
  gap: clamp(.9rem, 2vw, 1.6rem);
  margin-inline-end: auto;
  font-size: var(--t-sm);
}
.topnav a {
  text-decoration: none;
  color: var(--text-dim);
  padding-block: .35rem;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.topnav a:hover { color: var(--text); border-bottom-color: var(--copper); }

.topbar__actions { display: flex; align-items: center; gap: .55rem; }

.themetoggle {
  display: inline-flex; align-items: center; gap: .45rem;
  background: none; border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--f-mono); font-size: var(--t-xs);
  letter-spacing: .08em; text-transform: uppercase;
  padding: .42rem .7rem; border-radius: var(--radius);
  cursor: pointer;
}
.themetoggle:hover { color: var(--text); border-color: var(--copper); }
.themetoggle__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--copper);
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 7rem) clamp(3rem, 7vw, 6rem); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}
.hero__copy { display: flex; flex-direction: column; gap: 1.5rem; }

.hero__title {
  font-size: var(--t-3xl);
  max-width: 15ch;
}
.hero__lede {
  font-size: var(--t-lg);
  color: var(--text-dim);
  max-width: 54ch;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__facts {
  display: grid;
  gap: .9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}
.hero__facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; align-items: baseline; }
.hero__facts dt {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--copper);
}
.hero__facts dd { color: var(--text-dim); font-size: var(--t-sm); }

/* ---------- demo panel ---------- */
.demo {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.demo__chrome {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--t-sm);
}
.demo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.demo__channel { font-family: var(--f-mono); color: var(--text); }
.demo__meta { color: var(--text-faint); font-size: var(--t-xs); margin-inline-start: auto; }

.demo__body { display: grid; gap: 1.1rem; padding: 1.25rem 1.15rem 3.2rem; }

.msg { display: grid; gap: .35rem; }
.msg__who {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .02em;
}
.msg__who--agent { color: var(--teal); }
.msg__text { font-size: var(--t-sm); line-height: 1.6; }

.msg--agent {
  border-inline-start: 2px solid var(--teal);
  padding-inline-start: .85rem;
}

.caret {
  display: inline-block;
  width: 7px; height: 1.05em;
  background: var(--copper);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* steps 2 and 3 are revealed by script; hidden state is the default */
.retrieval, .msg--agent { opacity: 0; transform: translateY(6px); }
.demo.is-step2 .retrieval,
.demo.is-step3 .retrieval,
.demo.is-step3 .msg--agent {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}
.demo.is-step3 .caret { display: none; }

.retrieval__label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: .55rem;
}
.retrieval__chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .65rem;
}
.chip b { color: var(--teal); font-weight: 500; font-variant-numeric: tabular-nums; }
.demo.is-step2 .chip, .demo.is-step3 .chip {
  animation: chipin .42s backwards ease;
  animation-delay: calc(var(--i) * .13s);
}
@keyframes chipin { from { opacity: 0; transform: translateY(4px); } }

.cites { display: grid; gap: .25rem; margin-top: .6rem; }
.cites li {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--text-faint);
}
.cites__n {
  display: grid; place-items: center;
  width: 15px; height: 15px;
  border: 1px solid var(--teal);
  color: var(--teal);
  border-radius: 3px;
  font-size: 10px;
}

.demo__replay {
  position: absolute; right: .9rem; bottom: .85rem;
  background: none; border: 1px solid var(--line);
  color: var(--text-faint);
  font-family: var(--f-mono); font-size: var(--t-xs);
  letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: var(--radius);
  cursor: pointer;
}
.demo__replay:hover { color: var(--copper); border-color: var(--copper); }

/* ---------- bands ---------- */
.band { padding-block: clamp(3.5rem, 7vw, 6.5rem); border-top: 1px solid var(--line-soft); }
.band--alt { background: color-mix(in srgb, var(--surface) 55%, var(--ground)); }

.sechead { display: grid; gap: 1rem; max-width: 62ch; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.sechead h2 { font-size: var(--t-2xl); }
.sechead__lede { color: var(--text-dim); font-size: var(--t-lg); }

/* ---------- the pipeline ---------- */
.chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.chain__step {
  background: var(--surface);
  padding: 1.4rem 1.2rem 1.5rem;
  display: grid;
  gap: .5rem;
  align-content: start;
}
.chain__n {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--copper);
  border: 1px solid var(--copper);
  border-radius: 3px;
  width: 21px; height: 21px;
  display: grid; place-items: center;
}
.chain__step h3 { font-size: var(--t-lg); }
.chain__step p { font-size: var(--t-sm); color: var(--text-dim); }

/* ---------- feature blocks ---------- */
.feats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.feat {
  background: var(--surface);
  padding: 1.6rem 1.4rem;
  display: grid; gap: .55rem; align-content: start;
}
.feat--wide { grid-column: span 3; background: var(--surface-2); }
.feat__kicker {
  font-family: var(--f-mono); font-size: var(--t-xs);
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--teal);
}
.feat h3 { font-size: var(--t-xl); }
.feat p { color: var(--text-dim); font-size: var(--t-sm); max-width: 60ch; }
.feat--wide p { font-size: var(--t-base); }

/* ---------- generic card grids ---------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { background: var(--surface); padding: 1.5rem 1.35rem; display: grid; gap: .5rem; align-content: start; }
.card--tight { padding: 1.3rem 1.2rem; }
.card h3 { font-size: var(--t-lg); }
.card p { color: var(--text-dim); font-size: var(--t-sm); }

.footnote {
  margin-top: 1.25rem;
  color: var(--text-faint);
  font-size: var(--t-sm);
  max-width: 72ch;
}

/* ---------- split (education / business) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
/* Flipped: the lead moves to the second column, so the track sizes swap too —
   otherwise the ledger inherits the narrow column meant for the lead. */
.split--flip { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.split--flip .split__lead { order: 2; }
.split__lead { display: grid; gap: 1.1rem; justify-items: start; position: sticky; top: 96px; }
.split__lead h2 { font-size: var(--t-2xl); }

.ledger { display: grid; }
.ledger li {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.ledger__k { font-weight: 600; font-size: var(--t-base); }
.ledger__v { color: var(--text-dim); font-size: var(--t-sm); }

/* ---------- plans ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: start;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem 1.45rem;
  display: grid;
  gap: 1.25rem;
  align-content: start;
}
.plan--feature {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px var(--copper), var(--shadow);
}
.plan__head { display: grid; gap: .35rem; }
.plan__head h3 { font-size: var(--t-xl); }
.plan__for { color: var(--text-faint); font-size: var(--t-sm); }
.plan__limit {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: .3rem;
}
.plan__limit b { color: var(--copper); font-variant-numeric: tabular-nums; }
.plan__list { display: grid; gap: .6rem; }
.plan__list li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: var(--t-sm);
  color: var(--text-dim);
}
.plan__list li::before {
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 6px; height: 1px;
  background: var(--copper);
}

/* ---------- closer ---------- */
.closer {
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(120% 100% at 12% 0%, color-mix(in srgb, var(--copper) 12%, transparent), transparent 62%),
    var(--ground);
}
/* No max-width here: this element also carries .shell, whose margin-inline:auto
   would centre the narrowed box instead of leaving it against the left edge.
   Constrain the children instead. */
.closer__inner { display: grid; gap: 1.1rem; justify-items: start; }
.closer h2 { font-size: var(--t-2xl); max-width: 19ch; }
.closer p { color: var(--text-dim); font-size: var(--t-lg); max-width: 44ch; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.foot__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
}
.foot__brand { display: grid; gap: .8rem; align-content: start; }
.foot__brand p { color: var(--text-faint); font-size: var(--t-sm); max-width: 38ch; }
.foot__owner { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .02em; }
.foot__nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.foot__nav div { display: grid; gap: .5rem; align-content: start; }
.foot__nav h4 {
  font-family: var(--f-mono); font-size: var(--t-xs);
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--copper); font-weight: 500;
}
.foot__nav a { color: var(--text-dim); text-decoration: none; font-size: var(--t-sm); }
.foot__nav a:hover { color: var(--text); }

.foot__legal {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
}
.foot__legal p { margin: 0; }

/* ---------- hero panel (static structure card) ---------- */
.demo__body--static { padding-bottom: 1.4rem; gap: 0; }
.ledger--tight li {
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: .7rem 0;
  font-size: var(--t-sm);
}
.ledger--tight li:first-child { border-top: 0; padding-top: 0; }
.ledger--tight li:last-child { border-bottom: 0; }
.ledger--tight .ledger__k { font-size: var(--t-sm); }
.ledger--tight .ledger__v { font-size: var(--t-sm); }
.demo__note {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: var(--t-xs);
  line-height: 1.6;
}

/* Two cards rather than three: only one plan is purchasable today. */
.plans--single { grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); }
@media (max-width: 1040px) { .plans--single { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .topnav { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__title { max-width: 20ch; }
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat--wide { grid-column: span 2; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split--flip { grid-template-columns: 1fr; }
  .split--flip .split__lead { order: 0; }
  .split__lead { position: static; }
  .plans { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .grid--3, .grid--4, .feats, .chain { grid-template-columns: 1fr; }
  .feat--wide { grid-column: span 1; }
  .foot__inner { grid-template-columns: 1fr; }
  .foot__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger li { grid-template-columns: 1fr; gap: .3rem; }
  .hero__facts > div { grid-template-columns: 1fr; gap: .15rem; }
  .btn--lg { width: 100%; }
  .hero__cta { width: 100%; }
}

@media (max-width: 460px) {
  /* Keep the header on one line: drop the secondary link and reduce the theme
     toggle to its indicator dot rather than letting the primary CTA wrap. */
  .topbar__actions .btn--ghost { display: none; }
  .themetoggle__label { display: none; }
  .themetoggle { padding: .42rem .5rem; }
  .demo__meta { display: none; }
  .wordmark { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .caret { display: none; }
}
