/* ==========================================================================
   Revali — revali.dev
   --------------------------------------------------------------------------
   A terminal-dark marketing page. Two accents, both taken from the logo:
   amber (the wing) marks YOUR code, indigo (the letterform) marks GENERATED
   code. That pairing is the page's one idea, so it is a rule, not a palette:
   if something on this page is amber it is hand-written, and if it is indigo
   Revali produced it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Backdrop. Not pure black — a slight blue cast keeps the amber from
     vibrating against it, and gives the glows something to sit on. */
  --bg: #07080c;
  --bg-raised: #0c0e14;
  --bg-panel: #0f1219;
  --bg-inset: #090b10;

  --line: #1c2029;
  --line-soft: #14171e;
  --line-strong: #2a303c;

  --text: #e7e9ee;
  --text-dim: #a2a9b8;
  --text-faint: #6b7385;

  /* Amber — "yours". Straight off the logo's wing gradient. */
  --amber: #fbbf24;
  --amber-bright: #fcd34d;
  --amber-deep: #d97706;
  --amber-glow: rgba(251, 191, 36, 0.5);

  /* Indigo — "generated". The logo's letterform gradient, lifted for
     legibility on near-black. */
  --indigo: #8b9cf5;
  --indigo-bright: #a5b4fc;
  --indigo-deep: #4e5fc6;
  --indigo-glow: rgba(139, 156, 245, 0.45);

  --green: #4ade80;
  --red: #f87171;
  --cyan: #67e8f9;

  --font-sans: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Monaco', 'Consolas',
    'Liberation Mono', monospace;

  /* Fluid type. clamp() rather than breakpoints so the display sizes track
     the viewport continuously — a 900px-wide window is a real size, not a
     tablet pretending to be a phone. */
  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.875rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
  --step-1: clamp(1.1rem, 1.03rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.2rem + 0.75vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.45rem + 1.75vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.4vw, 4.6rem);

  --shell: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(5rem, 11vw, 9.5rem);

  --radius: 14px;
  --radius-lg: 20px;

  /* One easing for everything that moves. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The sticky header would otherwise cover the heading of any section
     reached by an in-page link. */
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
  /* Belt and braces against a wide child escaping its container: the page
     must never scroll sideways, and one overflowing code block on a phone is
     the usual culprit. */
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--amber);
  color: #0a0a0a;
}

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

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

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* A hairline between sections that fades out at both ends, so the page reads
   as one continuous surface rather than a stack of boxes. */
.section--ruled::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--line) 15%,
    var(--line) 85%,
    transparent
  );
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.eyebrow--center {
  justify-content: center;
}

.section-title {
  font-size: var(--step-3);
  margin-bottom: 1.1rem;
}

.section-sub {
  color: var(--text-dim);
  font-size: var(--step-1);
  line-height: 1.6;
}

/* Gradient text. Used on exactly one phrase per section — it is emphasis, and
   emphasis that appears everywhere is wallpaper. */
.grad {
  background: linear-gradient(100deg, var(--amber-bright), var(--amber-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grad-i {
  background: linear-gradient(100deg, var(--indigo-bright), var(--indigo-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   4. Ambient background
   -------------------------------------------------------------------------- */

/* Two fixed, blurred pools of colour behind everything, plus a faint grid.
   `position: fixed` means they do not move on scroll, so the content appears
   to travel across a lit surface instead of dragging its own lighting along
   with it. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient__grid {
  position: absolute;
  inset: -50%;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  /* Fades the grid out toward the edges so it never reaches a hard border. */
  mask-image: radial-gradient(ellipse 60% 50% at 50% 35%, #000 0%, transparent 75%);
  opacity: 0.55;
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
}

.ambient__glow--amber {
  width: 46rem;
  height: 34rem;
  top: -14rem;
  left: 48%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.4), transparent 68%);
}

.ambient__glow--indigo {
  width: 40rem;
  height: 32rem;
  top: 6rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(78, 95, 198, 0.34), transparent 68%);
}

/* Film grain, drawn as an inline SVG turbulence so it costs no request. It
   sits above the glows and breaks up the banding that large, heavily blurred
   gradients show on 8-bit displays. */
.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Everything that is not ambient sits above it. */
.page {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

/* Toggled from motion.js once the page has scrolled. Transparent over the
   hero, frosted once there is content behind it. */
.hdr[data-stuck='true'] {
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--line);
}

.hdr__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.25rem;
}

.hdr__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hdr__brand img {
  width: 1.9rem;
  height: 1.9rem;
}

.hdr__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hdr__link {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.hdr__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 720px) {
  .hdr__link--hide-sm {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--amber-bright), var(--amber-deep));
  color: #1a1206;
  font-weight: 620;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 8px 26px -10px var(--amber-glow);
}

.btn--primary:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 12px 34px -10px var(--amber-glow);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: #3c4454;
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
}

/* --------------------------------------------------------------------------
   7. Code
   -------------------------------------------------------------------------- */

.code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
  /* The one place horizontal scrolling is allowed — inside the block, never
     on the page. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.code::-webkit-scrollbar {
  height: 6px;
}

.code::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

/* Token colours. Deliberately restrained: annotations are the loudest thing
   in a Dart snippet because they are what the page is about. */
.tok-comment {
  color: #5a6273;
  font-style: italic;
}
.tok-ann {
  color: var(--amber);
  font-weight: 550;
}
.tok-kw {
  color: #c4a2f5;
}
.tok-type {
  color: var(--indigo-bright);
}
.tok-str {
  color: #86e0a8;
}
.tok-num {
  color: #f0b478;
}
.tok-lit {
  color: #f0b478;
}
.tok-fn {
  color: #7cc7f5;
}
.tok-ident {
  color: var(--text-dim);
}
.tok-key {
  color: var(--indigo-bright);
}
.tok-instr {
  color: #c4a2f5;
  font-weight: 550;
}
.tok-cmd {
  color: var(--amber);
}
.tok-flag {
  color: #7cc7f5;
}
.tok-dash {
  color: var(--text-faint);
}

/* --- Window chrome ------------------------------------------------------- */

/* The recurring container for code: a titled pane with a traffic-light bar.
   Used for editor panes, terminals and generated output alike, with the
   accent colour saying which of the three it is. */
.win {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

.win__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #12151d, #0d1017);
  flex-shrink: 0;
}

.win__dots {
  display: flex;
  gap: 0.4rem;
}

.win__dots i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #2b3240;
}

/* Only the active/foreground window gets coloured lights — a small cue that
   costs nothing and makes a static screenshot feel live. */
.win--live .win__dots i:nth-child(1) {
  background: #ff5f57;
}
.win--live .win__dots i:nth-child(2) {
  background: #febc2e;
}
.win--live .win__dots i:nth-child(3) {
  background: #28c840;
}

.win__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  min-width: 0;
}

/* Without an explicit size an inline SVG takes its intrinsic 24px and then
   some, which swamped a 0.75rem title bar and squeezed the filename into an
   ellipsis. */
.win__title svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.win__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win__badge {
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  flex-shrink: 0;
}

.win__badge--yours {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.win__badge--gen {
  color: var(--indigo);
  border-color: rgba(139, 156, 245, 0.3);
  background: rgba(139, 156, 245, 0.08);
}

.win__body {
  padding: 1.1rem 1.25rem;
  min-width: 0;
  flex: 1;
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

@media (max-width: 940px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
  }
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.hero__pill:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.06);
}

.hero__pill b {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero__pill svg {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.6;
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 660;
  letter-spacing: -0.038em;
  line-height: 1.02;
  margin-bottom: 1.5rem;
}

.hero__lede {
  max-width: 34rem;
  margin-bottom: 2.25rem;
  color: var(--text-dim);
  font-size: var(--step-1);
  line-height: 1.6;
}

.hero__lede code {
  padding: 0.1em 0.4em;
  border-radius: 5px;
  background: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Once the two buttons have wrapped onto separate lines, ragged widths read as
   a mistake. Below the wrap point they share the row instead. */
@media (max-width: 460px) {
  .hero__cta .btn {
    flex: 1 1 10rem;
  }
}

.hero__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.hero__note i {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-style: normal;
}

.hero__note svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--green);
}

/* --- Hero visual --------------------------------------------------------- */

/* The editor pane and the four generated outputs, stacked in one column so
   the eye reads source -> outputs top to bottom. */
.heroviz {
  position: relative;
  min-width: 0;
}

.heroviz__source {
  position: relative;
  z-index: 2;
}

/* The amber rim-light that marks the source pane as the origin of everything
   below it. */
.heroviz__source .win {
  border-color: rgba(251, 191, 36, 0.22);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.06),
    0 30px 70px -35px rgba(217, 119, 6, 0.55),
    0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

/* The run of dashes between the source pane and the outputs. Its ::after is
   the travelling pulse, animated in the keyframes below. */
.heroviz__wire {
  position: relative;
  height: 2.75rem;
  margin-left: 2.25rem;
  border-left: 1px dashed var(--line-strong);
}

.heroviz__wire::after {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px 2px var(--amber-glow);
  animation: wire-run 2.6s var(--ease) infinite;
}

@keyframes wire-run {
  0% {
    top: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.heroviz__outs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 480px) {
  .heroviz__outs {
    grid-template-columns: 1fr;
  }
}

.heroviz__out {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.heroviz__out:hover {
  border-color: rgba(139, 156, 245, 0.4);
  background: rgba(139, 156, 245, 0.06);
  transform: translateY(-2px);
}

.heroviz__out svg {
  width: 1rem;
  height: 1rem;
  color: var(--indigo);
  flex-shrink: 0;
}

.heroviz__out b {
  color: var(--text);
  font-weight: 550;
}

/* --------------------------------------------------------------------------
   9. Marquee (logos / facts strip)
   -------------------------------------------------------------------------- */

.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  padding-block: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.chip svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   10. Pipeline (one source of truth)
   -------------------------------------------------------------------------- */

.pipe {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

@media (max-width: 900px) {
  .pipe {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pipe__tabs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Each output is a button that swaps the pane on the right. On a narrow
   screen the list sits above the pane, so it becomes a horizontal scroller
   rather than a tall stack of full-width rows. */
@media (max-width: 900px) {
  .pipe__tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
  }
}

.ptab {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  text-align: left;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease);
}

@media (max-width: 900px) {
  .ptab {
    flex-shrink: 0;
    width: 15rem;
    scroll-snap-align: start;
  }
}

.ptab:hover {
  border-color: var(--line-strong);
  background: var(--bg-panel);
}

.ptab[aria-selected='true'] {
  border-color: rgba(139, 156, 245, 0.45);
  background: linear-gradient(
    100deg,
    rgba(139, 156, 245, 0.1),
    rgba(139, 156, 245, 0.02)
  );
}

.ptab__ico {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.ptab__ico svg {
  width: 1.05rem;
  height: 1.05rem;
}

.ptab[aria-selected='true'] .ptab__ico {
  color: var(--indigo-bright);
  border-color: rgba(139, 156, 245, 0.45);
  background: rgba(139, 156, 245, 0.12);
}

.ptab__txt {
  min-width: 0;
}

.ptab__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 560;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
}

.ptab__name code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 400;
}

.ptab__desc {
  margin-top: 0.2rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.5;
}

.pipe__pane {
  position: sticky;
  top: 5.5rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .pipe__pane {
    position: static;
  }
}

/* Panels are swapped by toggling [hidden]; the incoming one plays a short
   rise so the change registers as motion rather than a flicker. */
.pipe__panel[hidden] {
  display: none;
}

.pipe__panel .win__body {
  max-height: 27rem;
  overflow-y: auto;
}

.pipe__panel:not([hidden]) {
  animation: panel-in 0.35s var(--ease) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   11. Lifecycle
   -------------------------------------------------------------------------- */

.life {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 900px) {
  .life {
    grid-template-columns: minmax(0, 1fr);
  }
}

.life__track {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lstep {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}

.lstep__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: all 0.35s var(--ease);
}

.lstep__dot svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* The connector between consecutive steps, drawn upward from each dot so the
   first step has nothing above it without a special case. */
.lstep + .lstep .lstep__dot::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 1.4rem;
  margin-bottom: 1px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.lstep[data-on='true'] .lstep__dot {
  border-color: var(--amber);
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08),
    0 0 22px -4px var(--amber-glow);
}

.lstep__txt strong {
  display: block;
  font-weight: 560;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
  transition: color 0.3s var(--ease);
}

.lstep[data-on='true'] .lstep__txt strong {
  color: var(--amber);
}

.lstep__txt span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.lstep__ret {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-inset);
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .lstep__ret {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   12. Bento
   -------------------------------------------------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

/* A pointer-following highlight. --mx/--my are written by motion.js; with no
   JS the gradient simply sits at its 50%/0% default and never updates, which
   is a perfectly reasonable static card. */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    22rem circle at var(--mx, 50%) var(--my, 0%),
    rgba(251, 191, 36, 0.09),
    transparent 42%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card > * {
  position: relative;
}

.card__ico {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
  color: var(--amber);
}

.card__ico svg {
  width: 1.2rem;
  height: 1.2rem;
}

.card h3 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Scoped to `p` on purpose. A bare `.card code` also matches the <code> that
   every highlighted block is wrapped in, which gave whole code panes the
   inline-pill treatment — a padded, rounded, lighter box per block. Inline
   code only ever appears in a card's paragraph. */
.card p code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text);
}

/* Spans. Named for what they are rather than the column count so the grid can
   be re-proportioned without renaming every card. */
.card--wide {
  grid-column: span 3;
}
.card--half {
  grid-column: span 3;
}
.card--third {
  grid-column: span 2;
}
.card--full {
  grid-column: span 6;
}

@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .card--wide,
  .card--half,
  .card--third,
  .card--full {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .card--wide,
  .card--half,
  .card--third,
  .card--full {
    grid-column: span 1;
  }
}

/* A card whose body is a code sample rather than prose. */
.card--code {
  padding: 0;
  gap: 0;
}

.card--code .card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.35rem 1.5rem 1rem;
}

.card--code .card__head .card__ico {
  width: 2rem;
  height: 2rem;
}

.card--code .card__head h3 {
  font-size: 1rem;
}

.card--code p {
  padding: 0 1.5rem 1.1rem;
}

.card--code .code {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-inset);
}

/* --------------------------------------------------------------------------
   13. Terminal
   -------------------------------------------------------------------------- */

.term {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.85;
}

.term__line {
  display: flex;
  gap: 0.6rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.term__prompt {
  color: var(--green);
  flex-shrink: 0;
}

.term__out {
  color: var(--text-dim);
}

.term__ok {
  color: var(--green);
}

.term__key {
  color: var(--amber);
}

.term__url {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The blinking block cursor at the end of the terminal transcript. */
.term__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   14. Quickstart
   -------------------------------------------------------------------------- */

.qs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}

@media (max-width: 900px) {
  .qs {
    grid-template-columns: 1fr;
  }
}

.qstep {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}

.qstep__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.1rem 1.25rem;
}

.qstep__n {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.qstep__head strong {
  font-weight: 560;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
}

.qstep .code {
  flex: 1;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-inset);
}

/* --- Copy button --------------------------------------------------------- */

.copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.copy:hover {
  color: var(--text);
  border-color: #3c4454;
  background: rgba(255, 255, 255, 0.04);
}

.copy svg {
  width: 0.85rem;
  height: 0.85rem;
}

.copy[data-copied='true'] {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}

/* --------------------------------------------------------------------------
   15. CTA + footer
   -------------------------------------------------------------------------- */

.cta {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(
      ellipse 80% 130% at 50% 0%,
      rgba(217, 119, 6, 0.16),
      transparent 62%
    ),
    var(--bg-raised);
  text-align: center;
  overflow: hidden;
}

.cta h2 {
  font-size: var(--step-3);
  margin-bottom: 1rem;
}

.cta p {
  max-width: 34rem;
  margin: 0 auto 2rem;
  color: var(--text-dim);
  font-size: var(--step-1);
}

.cta__cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
  padding: 0.7rem 0.75rem 0.7rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-inset);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  max-width: 100%;
  overflow-x: auto;
}

.cta__cmd .term__prompt {
  user-select: none;
}

.cta__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.ftr {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
}

.ftr__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.ftr__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.ftr__brand img {
  width: 1.35rem;
  height: 1.35rem;
  opacity: 0.85;
}

.ftr__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.ftr__links a {
  color: var(--text-faint);
  font-size: 0.88rem;
  transition: color 0.2s var(--ease);
}

.ftr__links a:hover {
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   16. Scroll reveal
   -------------------------------------------------------------------------- */

/* Applied by motion.js only — the class is added to <html> as soon as the
   script runs, so with JS disabled these rules never match and everything is
   simply visible. Never hide content in a way that depends on JS to undo. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   17. Reduced motion
   -------------------------------------------------------------------------- */

/* Everything decorative stops. The reveal transition is kept but collapsed to
   a plain fade with no travel, so the page still feels intentional rather
   than abruptly different. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .heroviz__wire::after,
  .term__cursor {
    display: none;
  }
}
