/*
 * Tenet — the marketing site.
 *
 * The palette is the app's own (app/src/app/globals.css, "Glacier"):
 * layered near-blacks, white ink, and colour only where the app has it —
 * the red playhead and the muted port colours that tell wires apart on the
 * canvas. Everything coloured on this page is either footage or one of
 * those. Type is Inter Tight throughout — the app's own Inter, set tight
 * for titles. Mono is for timecode only, as in the app.
 */

:root {
  --app: #0a0a0b;
  --panel: #151517;
  --raised: #242428;
  --inset: #0d0d0f;
  --hover: #2e2e33;
  --edge: #ffffff12;
  --edge-strong: #ffffff26;

  --ink: #f0f0f2;
  --ink-bright: #ffffff;
  --ink-dim: #b9b9c0;
  --ink-mute: #9c9ca4;
  --ink-faint: #86868e;

  --playhead: #e5484d;
  --port-text: #8c93a8;
  --port-frame: #c8b98a;
  --port-video: #7d9bb5;
  --port-audio: #86ae95;
  --port-image: #a58fb0;
  --clip-audio: #2d7a52;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: var(--sans);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--app);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

/* SVG has no `hidden`; icon swaps rely on this. */
svg [hidden] { display: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink-bright); color: #000; padding: 8px 14px; border-radius: 6px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ── Type ─────────────────────────────────────────────── */

h1, h2, h3 { margin: 0; font-weight: 800; color: var(--ink-bright); }

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.045em;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 6.2vw, 108px); }
h2 { font-size: clamp(40px, 5.6vw, 92px); }
h3 { font-size: 21px; line-height: 1.2; font-weight: 700; }

p { margin: 0; text-wrap: pretty; }

.fine { font-size: 13px; color: var(--ink-faint); }

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--ink-bright);
  color: #000;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: #dcdce2; }
.btn:active { transform: scale(.98); }
.btn-small { padding: 8px 15px; font-size: 14px; }

/* ── Nav ──────────────────────────────────────────────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  height: 64px;
  padding: 0 var(--gutter);
  transition: background-color .25s, border-color .25s;
  border-bottom: 1px solid transparent;
}
.nav[data-scrolled] {
  background: rgba(10, 10, 11, .78);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
          backdrop-filter: saturate(140%) blur(18px);
  border-bottom-color: var(--edge);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 28px; height: auto; }
.brand span { font-weight: 700; font-size: 16px;
  letter-spacing: .32em; margin-right: -.32em; color: var(--ink-bright);
}
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { text-decoration: none; font-size: 15px; color: var(--ink-dim); transition: color .15s; }
.nav nav a:hover { color: var(--ink-bright); }
@media (max-width: 860px) { .nav nav { display: none; } .nav .btn-small { margin-left: auto; } }

/* ── Hero ─────────────────────────────────────────────── */

.hero { position: relative; background: #000; }
.hero-frame {
  position: relative;
  height: max(560px, calc(100svh - 132px));
  overflow: hidden;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.6) 0, rgba(0,0,0,.25) 9%, rgba(0,0,0,0) 22%),
    linear-gradient(0deg, rgba(0,0,0,.82) 0, rgba(0,0,0,.35) 38%, rgba(0,0,0,0) 62%),
    linear-gradient(90deg, rgba(0,0,0,.45) 0, rgba(0,0,0,0) 55%);
}
.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 5vh, 56px);
  max-width: var(--max);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 56px; align-items: end;
}
.hero-copy h1 { grid-row: span 2; }
.lede { font-size: clamp(16px, 1.35vw, 19px); color: #e6e6ea; max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
@media (max-width: 900px) {
  .hero-copy { grid-template-columns: 1fr; }
  .hero-copy h1 { grid-row: auto; }
}

/* The strip under the reel: a lane of the app's timeline, playing it. */
.strip {
  background: var(--panel);
  border-top: 1px solid #000;
  padding: 10px var(--gutter) 14px;
}
.strip-head { display: flex; align-items: center; gap: 12px; height: 26px; margin-bottom: 6px; }
.tc { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.strip-toggle {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 5px; background: transparent; color: var(--ink-dim); cursor: pointer;
}
.strip-toggle:hover { background: #ffffff12; color: var(--ink-bright); }
.strip-toggle svg { width: 13px; height: 13px; fill: currentColor; }

.lane {
  position: relative; display: flex; align-items: stretch; height: 58px;
  background: var(--inset); border-radius: 5px;
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.lane-name {
  flex: none; width: 40px; display: grid; place-items: center;
  font-size: 12px; color: var(--ink-faint); border-right: 1px solid #000;
}
.clips { --clip-h: 50px; position: relative; flex: 1; display: flex; gap: 2px; padding: 4px 0; }
.clip {
  position: relative; overflow: hidden; border-radius: 3px;
  background-color: var(--raised);
  background-image: url("media/reel-strip.webp");
  background-repeat: no-repeat;
  /* The sprite is the reel at 4 frames a second; a clip shows its own
     frames at their natural shape, like the app's filmstrips. */
  background-size: auto 100%;
  background-position: calc(var(--f) * var(--clip-h) * -16 / 9) 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.clip span {
  position: absolute; left: 4px; top: 4px; max-width: calc(100% - 8px);
  padding: 1px 5px; border-radius: 3px;
  background: rgba(10,10,11,.78); color: var(--ink);
  font-size: 11px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clip.on { box-shadow: inset 0 0 0 1.5px var(--ink-bright); }
.playhead {
  position: absolute; top: -7px; bottom: -3px; left: 40px; width: 2px; margin-left: -1px;
  background: var(--playhead); pointer-events: none; will-change: transform;
}
.playhead::before {
  content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 9px;
  background: var(--playhead); clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%);
}
.strip-note { margin-top: 10px; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 640px) {
  .clip span { display: none; }
  .lane { height: 46px; }
  .clips { --clip-h: 38px; }
  .lane-name { width: 28px; }
}

/* Load moment: the lane fills with clips as the reel starts. */
@media (prefers-reduced-motion: no-preference) {
  .js .clip { opacity: 0; transform: translateY(6px); }
  .js .strip.ready .clip { opacity: 1; transform: none; transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i) * 45ms + 150ms); }
  .js .hero-copy > * { opacity: 0; transform: translateY(10px); }
  .js .hero.ready .hero-copy > * { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
  .js .hero.ready .hero-copy > :nth-child(2) { transition-delay: .12s; }
  .js .hero.ready .hero-copy > :nth-child(3) { transition-delay: .22s; }
}

/* ── Sections ─────────────────────────────────────────── */

main > section:not(.hero) { padding: clamp(88px, 12vw, 168px) var(--gutter) 0; }
main > section:not(.hero) > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

.section-head {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px 56px; align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head p { color: var(--ink-dim); font-size: clamp(16px, 1.35vw, 19px); max-width: 44ch; }
@media (max-width: 900px) { .section-head { grid-template-columns: 1fr; } }

/* ── Work gallery ─────────────────────────────────────── */

.gallery { columns: 3 340px; column-gap: 28px; }
.take { break-inside: avoid; margin: 0 0 40px; }
.take-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 7px; background: var(--panel);
}
.take-media video, .take-media img { width: 100%; height: 100%; object-fit: cover; }
.take-meta { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-size: 14px; }
.model { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; }
.model::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--port-video); }
.how { color: var(--ink-faint); }
.prompt {
  position: relative; margin: 0; color: var(--ink-dim); font-size: 15.5px; line-height: 1.55;
  font-style: italic;
}
.prompt q { quotes: "“" "”"; }
.prompt.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more {
  margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 14px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--edge-strong); text-underline-offset: 3px;
}
.more:hover { text-decoration-color: var(--ink); }
.prompt.long { white-space: pre-line; font-style: normal; font-size: 14px; }
.agent-wrote { color: var(--ink-faint); font-size: 13px; margin-top: 6px; }

/* ── Window: tabs + real screenshots ──────────────────── */

.tabs {
  display: flex; gap: 4px; width: max-content; max-width: 100%;
  margin-bottom: 24px !important; margin-left: 0 !important;
  padding: 4px; border-radius: 10px; background: var(--panel);
}
.window .tabs { margin-left: max(0px, calc((100% - var(--max)) / 2)) !important; }
.tabs button {
  padding: 8px 18px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--ink-mute);
  transition: background-color .15s, color .15s;
}
.tabs button:hover { color: var(--ink-bright); }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink-bright); }

.pane { margin: 0; }
.shot {
  border-radius: 12px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--edge-strong), 0 40px 120px -30px rgba(0,0,0,.9), 0 0 140px -40px rgba(125,155,181,.18);
}
.shot img { width: 100%; height: auto; }
.pane figcaption {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 56px;
  margin-top: 28px;
}
.pane figcaption p { color: var(--ink-dim); max-width: 60ch; }
.pane figcaption strong { color: var(--ink-bright); font-weight: 650; }
.src { font-size: 14px; color: var(--ink-faint) !important; }
@media (max-width: 900px) { .pane figcaption { grid-template-columns: 1fr; } }

/* ── Agent ────────────────────────────────────────────── */

.agent-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 56px; align-items: start;
}
@media (max-width: 1000px) { .agent-grid { grid-template-columns: 1fr; } }

.chat {
  list-style: none; margin: 0; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--panel); border-radius: 12px; box-shadow: 0 0 0 1px var(--edge);
  font-size: 15px; line-height: 1.55;
}
.msg .who { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-faint); margin-bottom: 4px; }
.msg.you p { background: var(--raised); border-radius: 9px; padding: 10px 13px; color: var(--ink); }
.msg.it p { color: var(--ink-dim); padding: 0 2px; }
.msg.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.msg.tools span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-mute); padding: 3px 9px; border-radius: 999px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--edge);
}
.msg.tools span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--port-audio); }

.result { margin: 0; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--edge-strong); }
.player video { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; left: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 13px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.92); color: #000; font-weight: 650; font-size: 14px;
  transition: background-color .15s;
}
.play:hover { background: #fff; }
.play svg { width: 13px; height: 13px; fill: currentColor; }

.mini { position: relative; margin-top: 12px; padding: 8px 0 22px; }
.mini-lane { display: flex; gap: 2px; height: 30px; border-radius: 4px; overflow: hidden; }
.mini-lane + .mini-lane { margin-top: 3px; }
.mini-lane.v span {
  display: flex; align-items: center; padding: 0 8px; border-radius: 3px;
  background: #4a3a8c; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden;
}
.mini-lane.a { display: flex; position: relative; background: var(--clip-audio); border-radius: 3px; }
.mini-lane.a svg { position: absolute; inset: 3px 0; width: 100%; height: calc(100% - 6px); }
.mini-lane.a svg path { fill: #9ee2b8; opacity: .55; }
.mini-lane.a em { position: relative; align-self: center; margin-left: 5px; font-style: normal; font-size: 12px; color: #e8fff0; padding: 1px 7px; line-height: 18px; border-radius: 3px; background: rgba(10,10,11,.55); }
.cut { position: absolute; top: 0; bottom: 14px; width: 0; border-left: 1.5px dashed rgba(255,255,255,.75); }
.cut b { position: absolute; bottom: -18px; left: 0; transform: translateX(-50%); font: 500 11.5px var(--mono); color: var(--ink-dim); }
.mini-head { position: absolute; top: 2px; bottom: 14px; left: 0; width: 2px; margin-left: -1px; background: var(--playhead); will-change: transform; }
.result figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-faint); max-width: 62ch; }

.modes {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 56px;
  margin-top: clamp(56px, 6vw, 88px) !important; padding-top: 32px; border-top: 1px solid var(--edge);
}
.modes dt { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; font-size: 36px; line-height: 1; color: var(--ink-bright); margin-bottom: 10px; }
.modes dd { margin: 0; color: var(--ink-dim); max-width: 32ch; }
@media (max-width: 760px) { .modes { grid-template-columns: 1fr; } }

/* ── Director flow ────────────────────────────────────── */

.steps {
  list-style: none; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 28px;
}
.steps li { counter-increment: step; padding-top: 18px; border-top: 1px solid var(--edge-strong); }
.steps li::before {
  content: counter(step); font-family: var(--display); display: block; margin-bottom: 18px; font-weight: 300; font-size: 56px; line-height: .8; color: var(--ink-faint);
}
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-dim); font-size: 15.5px; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .steps { grid-template-columns: 1fr; } }

.board { margin-top: clamp(56px, 6vw, 96px) !important; }
.board figcaption { margin-top: 16px; font-size: 14px; color: var(--ink-faint); }

/* ── Models ───────────────────────────────────────────── */

.model-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; }
.mcol h3 { font-family: var(--display);
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 16px; margin-bottom: 14px; border-top: 2px solid var(--port); font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1;
}
.mcol h3 span { font-size: 15px; font-weight: 600; color: var(--ink-faint); }
.mcol ul { list-style: none; margin: 0; padding: 0; }
.mcol li { padding: 6px 0; border-bottom: 1px solid var(--edge); font-size: 15.5px; color: var(--ink); }
.mnote { margin-top: 18px; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 1000px) { .model-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .model-cols { grid-template-columns: 1fr; } }

/* ── Why ──────────────────────────────────────────────── */

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 56px; }
.why-col h3 { margin-bottom: 16px; }
.why-col ul { list-style: none; margin: 0; padding: 0; }
.why-col li { padding: 16px 0; border-top: 1px solid var(--edge); font-size: clamp(17px, 1.5vw, 21px); line-height: 1.4; }
.before li { color: var(--ink-faint); }
.before h3 { color: var(--ink-mute); }
.after li { color: var(--ink-bright); }
.file { font-family: var(--mono); font-size: .85em; }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

/* ── Credits roll ─────────────────────────────────────── */

.credits h2 { text-align: center; margin-bottom: clamp(48px, 6vw, 80px); }
.roll { margin: 0 auto; max-width: 880px !important; }
.roll div { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; padding: 9px 0; }
.roll dt { text-align: right; font-weight: 500; color: var(--ink-mute); font-size: 16px; }
.roll dd { margin: 0; color: var(--ink-bright); font-size: 17px; max-width: 34ch; }
@media (max-width: 600px) {
  .roll div { grid-template-columns: 1fr; text-align: center; padding: 10px 0; }
  .roll dt { text-align: center; }
  .roll dd { margin: 0 auto; }
}

/* ── Pricing ──────────────────────────────────────────── */

.plans { width: 100%; border-collapse: collapse; }
.plans thead th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-faint); padding: 0 16px 12px 0; }
.plans tbody th, .plans td { text-align: left; vertical-align: baseline; padding: 22px 16px 22px 0; border-top: 1px solid var(--edge); }
.plans tbody th { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--ink-bright); width: 22%; }
.plans .price { font-family: var(--display); font-size: 34px; font-weight: 300; letter-spacing: -.03em; line-height: 1; color: var(--ink-bright); width: 16%; white-space: nowrap; }
.plans td { color: var(--ink-dim); }
.plan-notes { margin-top: 20px; color: var(--ink-faint); font-size: 14px; max-width: 70ch; }
@media (max-width: 760px) {
  .plans thead { display: none; }
  .plans tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 20px 0; border-top: 1px solid var(--edge); }
  .plans tbody th, .plans td { padding: 0; border: 0; width: auto; }
  .plans td:nth-child(3), .plans td:nth-child(4) { grid-column: 1 / -1; }
  .plans td:nth-child(3) { color: var(--ink); }
}

/* ── Close: the palindrome ────────────────────────────── */

.close { padding: clamp(120px, 14vw, 200px) var(--gutter) 28px; overflow: hidden; }
.close-cta { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.pincer {
  font-family: var(--display);
  margin: clamp(72px, 9vw, 128px) calc(-1 * var(--gutter)) 0;
  display: flex; flex-direction: column; align-items: center; font-weight: 700;
  font-size: 22vw; line-height: .74; letter-spacing: -.06em;
  color: var(--ink-bright); user-select: none;
}
.pincer span { display: block; }
.pincer .flip {
  transform: rotate(180deg);
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.22);
  background: linear-gradient(0deg, rgba(255,255,255,.0), rgba(255,255,255,.10));
  -webkit-background-clip: text; background-clip: text;
}
.legal {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  margin-top: 40px; font-size: 13px; color: var(--ink-faint);
}
.legal a { text-decoration: none; }
.legal a:hover { color: var(--ink-bright); }
