/* Portia site. One stylesheet for every page.
 *
 * The identity is the logo's: lime on near-black, the ink itself for text and buttons, square
 * corners because the mark has none. One theme: the editor is dark-first and so is everything
 * around it.
 *
 * Colour is kept for three places, and that is what makes them land: the film and the part
 * pictures, where lime is what the tools found; pass and fail, which keep their own green and
 * red; and code, where colour carries the syntax.
 */

:root {
  --bg: #121212;
  --panel: #191918;
  --raised: #20201f;
  --line: #2b2b29;
  --ink: #fafaf8;
  --dim: #b2b2ac;
  --faint: #6e6e69;
  --deep: #3a3a37;
  --pass: #4cd68f;
  --fail: #ff6b5e;

  /* The logo's lime: what a tool found, and nothing else. */
  --lime: #e4ff1a;

  /* Code. One family of hues, readable on the code panel, distinct from each other. */
  --code-bg: #0c0c0c;
  --code-ink: #e6e6e1;
  --c-comment: #6e6e69;
  --c-keyword: #ff7ab2;
  --c-string: #a8e26a;
  --c-number: #ffb15e;
  --c-func: #7fb4ff;
  --c-type: #5fe0cf;
  --c-key: #c9a6ff;
  --c-table: #ffd76a;
  --c-punct: #9a9a94;

  --sans: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wide: 76rem;
  color-scheme: dark;
}

* { 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(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; letter-spacing: -0.03em; }
code, kbd { font-family: var(--mono); font-size: 0.92em; color: var(--ink); }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: rgba(18, 18, 18, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
/* 34px tall is the kit's 120px minimum width for the horizontal logo. It glows like the film. */
.brand img { height: 34px; width: auto; filter: drop-shadow(0 0 5px rgba(228, 255, 26, 0.45)) drop-shadow(0 0 16px rgba(228, 255, 26, 0.22)); }
.top nav { display: flex; gap: 22px; font-size: 0.9375rem; margin-left: auto; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top .actions { display: flex; align-items: center; gap: 10px; }
.top nav + .actions { margin-left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 0.9375rem/1 var(--sans); letter-spacing: -0.01em; text-decoration: none;
  padding: 0 18px; height: 44px; border: 1px solid var(--ink); cursor: pointer;
  background: var(--ink); color: var(--bg);
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.small { height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim);
}
/* A short rule in the logo's lime. */
.eyebrow::before { content: ""; width: 18px; height: 2px; flex: none; background: var(--lime); }
.lead { color: var(--dim); font-size: 1.125rem; max-width: 36rem; }
.lead strong { color: var(--ink); font-weight: 500; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }
/* The headline and the film side by side, the offer under the headline. */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "pitch film" "offer film";
  gap: 28px clamp(28px, 5vw, 64px); align-items: center;
}
.hero .pitch { grid-area: pitch; align-self: end; }
.hero .offer { grid-area: offer; align-self: start; }
.hero h1 {
  font-size: clamp(2.5rem, 4.8vw, 4.25rem); line-height: 0.98; letter-spacing: -0.045em;
  margin-top: 18px;
}
.hero h1 span { color: var(--faint); }
.hero .model { color: var(--dim); font-size: 1.0625rem; max-width: 34rem; }
.hero .model strong { color: var(--ink); font-weight: 500; }
.hero .download { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero .download span { color: var(--faint); font-size: 0.8125rem; }

/* The film, beside the headline. Visitors who turn motion off get its poster instead. */
.film { grid-area: film; margin: 0; position: relative; }
.film::before {
  /* The lime the film is drawn in, glowing past its edges. */
  content: ""; position: absolute; inset: 8% 6% -4%; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(228, 255, 26, 0.16), transparent 70%);
  filter: blur(40px);
}
.film video, .film .still {
  position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #000; border: 1px solid var(--line);
}
.film .still { display: none; }
.film figcaption { position: relative; z-index: 1; margin-top: 12px; font: 400 0.8125rem/1.5 var(--mono); color: var(--faint); }
@media (prefers-reduced-motion: reduce) {
  .film video { display: none; }
  .film .still { display: block; }
}

/* ---------- Parts ---------- */
.parts { margin-top: 48px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.part { grid-column: span 2; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; }
.part.wide { grid-column: span 3; }
/* The last card lies across the whole row: picture left, words right. */
.part.row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.part.row .txt { padding: 28px 30px; align-content: center; }
.part img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.part .txt { padding: 18px 20px 20px; display: grid; gap: 8px; align-content: start; flex: 1; }
.part .kind { font: 500 0.6875rem/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--lime); }
.part h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.part p { color: var(--dim); font-size: 0.9375rem; }
.part .res {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  font: 400 0.8125rem/1.5 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums;
}
.part .res b { color: var(--ink); font-weight: 500; }
.part .res .sep { color: var(--faint); margin: 0 4px; }
.v {
  display: inline-block; font: 600 0.6875rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 6px; margin-right: 8px; border: 1.5px solid currentColor; vertical-align: 1px;
}
.v.pass { color: var(--pass); }
.v.fail { color: var(--fail); }

/* A clip cut from the film's editor shots, playing beside the words it shows. */
.clip { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.stack { display: grid; gap: 16px; }
@media (prefers-reduced-motion: reduce) { .clip { display: none; } }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bands ---------- */
.band { border-top: 1px solid var(--line); padding-block: clamp(64px, 9vw, 128px); }
.band h2 { font-size: clamp(2rem, 3.8vw, 3.25rem); line-height: 1.04; margin-top: 18px; max-width: 46rem; }
.band .lead { margin-top: 18px; }
.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split > * { min-width: 0; }
.points { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 34rem; }
.points li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; color: var(--dim); }
.points li::before { content: ""; width: 8px; height: 8px; margin-top: 0.55em; border: 1.5px solid var(--faint); }
.points strong { color: var(--ink); font-weight: 500; }
.sub-h { font-size: 1.375rem; letter-spacing: -0.02em; }

/* ---------- Pricing ---------- */
.prices {
  margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line);
}
.tier { padding: 32px 30px 34px; display: grid; gap: 14px; align-content: start; }
.tier + .tier { border-left: 1px solid var(--line); }
.tier.free { background: var(--ink); color: var(--bg); }
.tier.free .what, .tier.free li { color: rgba(18, 18, 18, 0.7); }
.tier .name { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.tier .amt { font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.tier .amt small { font-size: 1rem; font-weight: 400; letter-spacing: 0; margin-left: 8px; opacity: 0.7; }
.tier .what { color: var(--dim); font-size: 1rem; max-width: 26rem; }
.tier ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 0.9375rem; color: var(--dim); }
.tier li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.tier li::before { content: ""; width: 6px; height: 6px; margin-top: 0.6em; background: currentColor; opacity: 0.6; }
.terms {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  margin-top: 28px; color: var(--dim); font-size: 0.9375rem;
}
.terms b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

/* ---------- Code ---------- */
.term, .code {
  margin: 0; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line);
  font: 400 0.8125rem/1.7 var(--mono); font-variant-numeric: tabular-nums;
  overflow-x: auto;
}
.term .bar, .code .bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #222;
  color: #8a8a84; font-size: 0.75rem;
}
.term .bar i, .code .bar i { width: 9px; height: 9px; border: 1.5px solid #3a3a37; }
.term pre, .code pre { margin: 0; padding: 18px 20px 22px; white-space: pre; }
.cm { color: var(--c-comment); font-style: italic; }
.kw { color: var(--c-keyword); }
.st { color: var(--c-string); }
.nu { color: var(--c-number); }
.fn { color: var(--c-func); }
.ty { color: var(--c-type); }
.ky { color: var(--c-key); }
.tb { color: var(--c-table); }
.pu { color: var(--c-punct); }
.mc { color: var(--c-type); }
/* The terminal: who is speaking, what was typed, and what came back. */
.t-you { color: #fafaf8; }
.t-you::before { content: "you  "; color: var(--c-keyword); }
.t-ai { color: #cfcfc9; }
.t-ai::before { content: "agent  "; color: var(--c-type); }
.t-cmd { color: #fafaf8; }
.t-cmd::before { content: "$ "; color: var(--c-number); }
.t-out { color: #9a9a94; }
.ok { color: var(--pass); }
.bad { color: var(--fail); }
.fl { color: var(--c-number); }
/* Diff lines. */
.del { display: block; background: rgba(255, 107, 94, 0.12); margin: 0 -20px; padding: 0 20px; position: relative; }
.add { display: block; background: rgba(76, 214, 143, 0.12); margin: 0 -20px; padding: 0 20px; position: relative; }
.del::before { content: "-"; position: absolute; left: 7px; color: var(--fail); }
.add::before { content: "+"; position: absolute; left: 7px; color: var(--pass); }
.cap { margin-top: 12px; font: 400 0.8125rem/1.5 var(--mono); color: var(--faint); }

.chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-s {
  font: 500 0.8125rem/1 var(--mono); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 12px; background: var(--panel);
}


/* ---------- Open: four promises beside a node of your own ---------- */
.split.open { margin-top: 48px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.quads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.quad { padding: 24px 22px 8px 0; display: grid; gap: 10px; align-content: start; }
.quad:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }
.quad:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 16px; }
.quad h3 { font-size: 1.1875rem; letter-spacing: -0.02em; line-height: 1.25; }
.quad p { color: var(--dim); font-size: 0.9688rem; }

/* ---------- Gym ---------- */
.loop { margin: 40px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ink); counter-reset: step; }
.loop li { padding: 20px 18px 6px 0; display: grid; gap: 8px; align-content: start; counter-increment: step; }
.loop li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.loop li::before { content: counter(step, decimal-leading-zero); font: 500 0.75rem/1 var(--mono); color: var(--faint); letter-spacing: 0.06em; }
.loop h3 { font-size: 1.0625rem; letter-spacing: -0.015em; }
.loop p { color: var(--dim); font-size: 0.9063rem; }
.gym-clip { margin: 48px auto 0; max-width: 60%; }

/* ---------- Closing ---------- */
.closing .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: end; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: 40px 56px; color: var(--faint); font-size: 0.875rem; }
footer .stakes { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 0.8125rem/1.4 var(--mono); color: var(--dim); padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
footer .stakes span:first-child { color: var(--faint); }
footer .row { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: start; }
footer .mark img { width: auto; height: 32px; }
footer .credits { max-width: 46rem; }
footer nav { display: flex; gap: 18px; }
footer a { color: var(--dim); }

/* ---------- Secondary pages ---------- */
.page { padding-block: clamp(48px, 8vw, 104px); }
.page .wrap { max-width: 52rem; }
.page h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.02; letter-spacing: -0.04em; margin-top: 18px; }
.page h2 { font-size: 1.375rem; margin-top: 48px; letter-spacing: -0.02em; }
.page p, .page li { color: var(--dim); }
.page p + p { margin-top: 14px; }
.page ol, .page ul { padding-left: 1.2em; display: grid; gap: 10px; margin: 16px 0 0; }
.page strong { color: var(--ink); font-weight: 500; }
.dl {
  margin-top: 32px; border: 1px solid var(--line); background: var(--panel);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 24px; padding: 24px; align-items: center;
}
.dl dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; font: 400 0.8125rem/1.5 var(--mono); }
.dl dt { color: var(--faint); }
.dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.note-box { margin-top: 24px; border-left: 3px solid var(--faint); padding: 4px 0 4px 18px; }

/* ---------- Narrow ---------- */
@media (max-width: 1080px) {
  .top nav { display: none; }
  .top .actions { margin-left: auto; }
  .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .loop li:nth-child(4) { padding-left: 0; border-left: 0; }
  .loop li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .split.open { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .split, .split.flip, .closing .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pitch" "film" "offer"; }
  .gym-clip { max-width: 100%; }
  .part, .part.wide { grid-column: 1 / -1; }
  .part.row { grid-template-columns: minmax(0, 1fr); }
  footer .row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .prices, .terms, .quads, .loop { grid-template-columns: minmax(0, 1fr); }
  .tier + .tier { border-left: 0; border-top: 1px solid var(--line); }
  .quad, .quad:nth-child(even), .loop li, .loop li + li { padding: 20px 0 14px; border-left: 0; margin-top: 0; }
  .quad + .quad, .loop li + li { border-top: 1px solid var(--line); }
  .top .btn.small { display: none; }
}
