/* Hallmark · macrostructure: Marquee Hero · tone: technical-atmospheric · anchor hue: cyan (cool)
 * genre: atmospheric · theme: custom "night conduit" (dark · Syne + Inter + JetBrains Mono)
 * nav: N5 floating pill · footer: single-line minimal
 * enrichment: brand lockup (app icon + wordmark) + stylized product mocks · contrast: pass
 */

@import url("tokens.css");

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
  /* CJK: break only at punctuation, never mid-word; anywhere is the overflow fallback */
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
  min-width: 0;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-md);
}
.section {
  padding-block: var(--space-4xl);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  white-space: nowrap;
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius-pill);
  border: var(--rule) solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.btn--primary:hover {
  background: var(--color-accent-strong);
  box-shadow: 0 0 32px -6px var(--glow-a);
}
.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-line-2);
}
.btn--ghost:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent-strong);
}
.btn--lg {
  font-size: var(--text-base);
  padding: 1rem 1.7rem;
}

/* ---------- Nav (N5 floating pill) ---------- */
.nav {
  position: fixed;
  top: var(--space-md);
  left: 0;
  right: 0;
  z-index: 40;
  pointer-events: none;
}
.nav__pill {
  pointer-events: auto;
  margin-inline: auto;
  width: fit-content;
  max-width: calc(100vw - 2 * var(--space-md));
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0.55rem 0.65rem 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: var(--rule) solid var(--color-line);
  background: color-mix(in oklch, var(--color-paper-2) 78%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  box-shadow: 0 12px 40px -18px var(--color-code-shadow);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.01em;
}
.brand__mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: block;
  /* the icon glyph is bright on transparent; a whisper of glow seats it on dark paper */
  filter: drop-shadow(0 0 6px oklch(62% 0.13 227 / 0.35));
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
/* Language toggle (shared by the LP and the docs) */
.nav__lang {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  border: var(--rule) solid var(--color-line-2);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}
.nav__lang:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.nav__link {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link:hover {
  color: var(--color-ink);
}
@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
}

/* ---------- Hero (Marquee: centered) ---------- */
.hero {
  position: relative;
  /* the brand lockup adds height; one step less top padding keeps the fold */
  padding-top: calc(var(--space-4xl) + var(--space-md));
  padding-bottom: var(--space-3xl);
  text-align: center;
  isolation: isolate;
}

/* ---------- Brand lockup (icon + wordmark, the hero's anchor) ---------- */
.hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.hero__logo {
  width: 128px;
  height: 128px;
  /* seat the transparent glyph on dark paper with the icon's own segment hues */
  filter: drop-shadow(0 16px 48px oklch(62% 0.13 227 / 0.5))
    drop-shadow(0 -8px 36px oklch(52% 0.2 292 / 0.35));
}
.hero__wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
.hero__brand .eyebrow {
  margin: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% 0;
  z-index: -1;
  background:
    radial-gradient(42rem 26rem at 50% 4%, var(--glow-a), transparent 68%),
    radial-gradient(30rem 22rem at 78% 22%, var(--glow-b), transparent 70%),
    radial-gradient(34rem 24rem at 20% 30%, var(--glow-c), transparent 70%);
  pointer-events: none;
}
.hero__title {
  /* one step under the wordmark — the brand lockup owns the hero */
  font-size: clamp(2.25rem, 6.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-inline: auto;
  max-width: 14ch;
}
.hero__title .accent {
  /* quotes the icon's three ring segments: blue → bolt cyan → violet */
  color: var(--color-accent);
  background: linear-gradient(
    100deg,
    var(--color-accent-3),
    var(--color-accent) 55%,
    var(--color-accent-2)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__lead {
  margin: var(--space-lg) auto 0;
  font-size: var(--text-lg);
  color: var(--color-ink-2);
  max-width: 42ch;
}
.hero__actions {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.hero__meta {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.hero__note {
  margin: var(--space-md) auto 0;
  max-width: 52ch;
  font-size: var(--text-sm);
  color: var(--color-ink-3);
}
.hero__note code {
  font-family: var(--font-mono);
  color: var(--color-accent);
}
.chip {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.8rem;
  background: color-mix(in oklch, var(--color-paper-2) 60%, transparent);
}

/* ---------- Code block (real <pre>, no fake chrome) ---------- */
.code {
  text-align: left;
  margin: var(--space-2xl) auto 0;
  max-width: 620px;
  background: var(--color-code-bg);
  color: var(--color-code-fg);
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.8;
  box-shadow: 0 32px 80px -40px var(--color-code-shadow);
}
.code pre {
  margin: 0;
}
.code .c-dim {
  color: var(--color-code-dim);
}
.code .c-key {
  color: var(--color-code-accent);
}
.code .c-str {
  color: var(--color-code-string);
}

/* ---------- Section head ---------- */
.section-head {
  max-width: 44ch;
  margin-bottom: var(--space-2xl);
}
.section-head h2 {
  font-size: clamp(2rem, 4.5vw, var(--text-3xl));
}
.section-head p {
  margin-top: var(--space-md);
  color: var(--color-ink-2);
  font-size: var(--text-lg);
}

/* ---------- Bento features ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}
.cell {
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  background: linear-gradient(
    160deg,
    var(--color-paper-2),
    color-mix(in oklch, var(--color-paper-2) 55%, var(--color-paper))
  );
  transition: border-color var(--dur-mid) var(--ease-out),
    transform var(--dur-mid) var(--ease-out);
}
.cell:hover {
  border-color: var(--color-line-2);
  transform: translateY(-3px);
}
.cell--wide {
  grid-column: span 2;
}
/* Closing full-width row, so the bento ends on a complete row */
.cell--full {
  grid-column: span 4;
}
.cell h3 {
  font-size: var(--text-xl);
  font-weight: 700;
}
.cell--wide h3 {
  font-size: var(--text-2xl);
}
.cell p {
  margin-top: var(--space-sm);
  color: var(--color-ink-2);
  font-size: var(--text-base);
  max-width: 40ch;
}
.cell .kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-dim);
  margin-bottom: var(--space-md);
}

/* ---------- Flow steps ---------- */
.flow {
  border-block: var(--rule) solid var(--color-line);
  background:
    radial-gradient(36rem 20rem at 18% 110%, var(--glow-b), transparent 70%),
    var(--color-paper);
}
.flow__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}
.flow__step {
  position: relative;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: var(--rule) solid var(--color-line);
  background: color-mix(in oklch, var(--color-paper-2) 70%, transparent);
}
.flow__step h3 {
  font-size: var(--text-xl);
}
.flow__step p {
  margin-top: var(--space-sm);
  color: var(--color-ink-2);
}
.flow__pipe {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
}
/* the three steps carry the app icon's segment colors: blue → cyan → violet */
.flow__step:nth-of-type(1) .flow__pipe {
  color: oklch(72% 0.16 257);
  background: oklch(26% 0.07 257);
}
.flow__step:nth-of-type(3) .flow__pipe {
  color: oklch(74% 0.17 292);
  background: oklch(27% 0.08 292);
}

/* ---------- Split (why rust) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: start;
}
.split .section-head {
  margin-bottom: 0;
}
/* one-line stack credit for the engineers who scan for it */
.split__note {
  margin-top: var(--space-lg);
  font-size: var(--text-xs);
  color: var(--color-ink-3);
}
.split__note a {
  color: var(--color-ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.split__note a:hover {
  color: var(--color-accent);
}
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-lg);
}
.checks li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding-bottom: var(--space-lg);
  border-bottom: var(--rule) solid var(--color-line);
}
.checks li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.checks svg {
  flex: none;
  margin-top: 4px;
  color: var(--color-accent);
}
.checks strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: 0;
}
.checks span {
  color: var(--color-ink-2);
}

/* ---------- CTA band ---------- */
.cta {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-2xl), 7vw, var(--space-4xl)) var(--space-xl);
  text-align: center;
  background: var(--color-paper-2);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(30rem 18rem at 50% 120%, var(--glow-a), transparent 70%),
    radial-gradient(24rem 16rem at 85% -20%, var(--glow-b), transparent 72%);
}
.cta h2 {
  font-size: clamp(2.1rem, 5.5vw, var(--text-4xl));
  font-weight: 800;
  max-width: 16ch;
  margin-inline: auto;
}
.cta p {
  margin: var(--space-md) auto 0;
  max-width: 42ch;
  color: var(--color-ink-2);
}
.cta__actions {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.cta__cmd {
  margin-top: var(--space-xl);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  background: var(--color-code-bg);
  overflow-x: auto;
  max-width: 100%;
}
.cta__cmd .c-key {
  color: var(--color-code-accent);
}

/* ---------- Footer (single-line minimal) ---------- */
.foot {
  padding-block: var(--space-2xl);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  align-items: center;
  justify-content: space-between;
  border-top: var(--rule) solid var(--color-line);
  padding-top: var(--space-xl);
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}
.foot__links a {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  transition: color var(--dur-fast) var(--ease-out);
}
.foot__links a:hover {
  color: var(--color-accent-strong);
}
.foot__note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-3);
}

/* ---------- Product mock (stylized app window, not a screenshot) ----------
 * Drawn in DOM rather than shipped as a PNG: stays sharp at any DPI, restyles
 * with the page tokens, and carries no personal data from a real desktop. */
.mock {
  margin: var(--space-2xl) auto 0;
  max-width: 620px;
  text-align: left;
  background: var(--color-code-bg);
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px -40px var(--color-code-shadow);
  overflow: hidden;
}
/* Sits inside a bento cell rather than centred on the page */
.mock--inset {
  margin: var(--space-md) 0 0;
  max-width: none;
  box-shadow: none;
  background: var(--color-paper);
}
.mock__cap {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--rule) solid var(--color-line);
  font-size: var(--text-xs);
  color: var(--color-ink-3);
}
.mock__cap b {
  font-family: var(--font-mono);
  color: var(--color-accent);
}
.mock__chrome {
  position: relative;
  height: 26px;
  border-bottom: var(--rule) solid var(--color-line);
}
/* the frameless window's drag grip */
.mock__chrome::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-line-2);
}
.mock__search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--rule) solid var(--color-line);
}
.mock__glass {
  color: var(--color-ink-3);
  flex-shrink: 0;
}
.mock__query {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--color-ink);
}
.mock__caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--color-accent);
  animation: mockCaret 1.1s steps(1, end) infinite;
}
@keyframes mockCaret {
  50% {
    opacity: 0;
  }
}
.mock__keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg) 0;
}
.mock__key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: var(--rule) solid var(--color-line);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: var(--text-xs);
  color: var(--color-ink-3);
}
.mock__key b {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-accent);
}
.mock__list {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
}
.mock__row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 7px 10px;
  border-radius: var(--radius-md);
}
.mock__row.is-sel {
  background: var(--color-accent-soft);
}
.mock__ico {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  border-radius: var(--radius-sm);
  background: var(--color-paper-3);
}
.mock__text {
  min-width: 0;
  flex: 1;
}
/* spans by default: force the two lines to stack */
.mock__text,
.mock__title,
.mock__sub {
  display: block;
}
.mock__title {
  color: var(--color-ink);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock__title mark {
  background: none;
  color: var(--color-accent);
  font-weight: 600;
}
.mock__sub {
  margin-top: 1px;
  color: var(--color-ink-3);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock__hint {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  background: var(--color-paper-3);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}
.mock__status {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 7px var(--space-lg);
  border-top: var(--rule) solid var(--color-line);
  font-size: var(--text-xs);
  color: var(--color-ink-3);
}
/* Two-column app grid variant (the launcher's browse view) */
.mock__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px var(--space-sm);
  padding: var(--space-sm);
}
.mock__grid .mock__row {
  padding: 5px 8px;
}
.mock__grid .mock__ico {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .mock__caret {
    animation: none;
  }
}
@media (max-width: 620px) {
  .mock__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mock__sub {
    display: none;
  }
}

/* ---------- Reveal motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cell--wide,
  .cell--full {
    grid-column: span 2;
  }
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .section {
    padding-block: var(--space-3xl);
  }
}
@media (max-width: 620px) {
  .wrap {
    padding-inline: var(--space-md);
  }
  .hero__logo {
    width: 96px;
    height: 96px;
  }
  .bento {
    grid-template-columns: minmax(0, 1fr);
  }
  .cell--wide,
  .cell--full {
    grid-column: auto;
  }
  .hero__actions .btn,
  .cta__actions .btn {
    flex: 1 1 auto;
  }
}
