/* Epsimo Agents landing page. Tokens follow the app (frontend/src/index.css, branch redesign):
   porcelain ground, white reading surface, graphite ink, cobalt accent, moss for "done".
   Interface type is Schibsted Grotesk; anything the agent "says" is set in Source Serif 4. */
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/SchibstedGrotesk-Variable.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-400.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("fonts/DMMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #F3F5F7;
  --surface: #FFFFFF;
  --tint: #ECEFF3;
  --rule: #E1E4E9;
  --ink: #22272F;
  --ink-2: #3C424C;
  --muted: #5F6672;
  --cobalt: #2F4FD8;
  --cobalt-deep: #2440B8;
  --moss: #4E7A5B;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--cobalt); }
a:focus-visible, .btn:focus-visible, video:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: rgb(255 255 255 / 0.92); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { font-weight: 650; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.top-nav { display: flex; gap: 24px; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.98rem; }
.top-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.top-act { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--ink); }

.btn { display: inline-block; background: var(--cobalt); color: #fff; font-weight: 600; text-decoration: none; padding: 10px 18px; border-radius: 10px; white-space: nowrap; }
.btn:hover { background: var(--cobalt-deep); }
.btn-lg { font-size: 1.1rem; padding: 14px 26px; }

/* Hero: a thread. The question sits in the app's grey bubble; the headline is the agent's answer, in serif. */
.hero { background: var(--surface); padding: clamp(48px, 8vw, 104px) 0 40px; }
.hero-in > * { max-width: 980px; }
.thread { margin-bottom: 28px; }
.ask { display: inline-block; max-width: 34rem; background: var(--tint); color: var(--ink); border-radius: 18px 18px 18px 6px; padding: 12px 18px; font-size: 1.05rem; line-height: 1.45; }
.steps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.step { display: inline-flex; align-items: center; gap: 10px; background: #F6F7F9; border-radius: 10px; padding: 7px 12px; font-size: 0.95rem; color: var(--ink-2); }
.step i { width: 11px; height: 11px; border-radius: 50%; background: var(--moss); }
.answer { font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: clamp(2.5rem, 1.3rem + 4.2vw, 4.6rem); line-height: 1.02; color: var(--ink); }
.answer .line { display: block; }
.lede { margin-top: 26px; max-width: 38rem; font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }
.fine { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }

/* The one orchestrated moment: the thread plays once on load. */
@media (prefers-reduced-motion: no-preference) {
  .thread .ask { animation: rise 0.5s cubic-bezier(.16,1,.3,1) both 0.1s; }
  .thread .step { animation: rise 0.45s cubic-bezier(.16,1,.3,1) both; }
  .thread .step:nth-child(1) { animation-delay: 0.55s; }
  .thread .step:nth-child(2) { animation-delay: 0.85s; }
  .hero .answer .line { animation: write 0.7s steps(28, end) both; clip-path: inset(0 0 0 0); }
  .hero .answer .line:nth-child(1) { animation-delay: 1.2s; }
  .hero .answer .line:nth-child(2) { animation-delay: 1.85s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.demo { padding: 24px 0 88px; background: linear-gradient(var(--surface) 50%, var(--ground) 50%); }
.video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--ground); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 14px 38px rgb(34 39 47 / 0.12); }

/* Sections */
.band { padding: clamp(56px, 7vw, 96px) 0; background: var(--surface); }
.band-alt { background: var(--ground); }
.intro { margin-top: 14px; max-width: 34rem; color: var(--ink-2); }
.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }

/* The three steps are a real sequence, so they are numbered. */
.seq { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: s; }
.seq li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 18px; }
.seq li::before { content: counter(s); display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--cobalt); color: #fff; font-weight: 700; font-size: 0.95rem; align-items: center; justify-content: center; margin-bottom: 14px; }
.seq p { margin-top: 8px; color: var(--ink-2); }

.models { margin: 0; }
.models div { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.models div:first-child { border-top: 1px solid var(--rule); }
.models dt { font-weight: 600; }
.models dd { margin: 0; color: var(--ink-2); }

.tools h3 { margin-top: 26px; }
.tools h3:first-child { margin-top: 0; }
.tools p { margin-top: 6px; color: var(--ink-2); max-width: 36rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 0.95rem; color: var(--muted); padding: 0 0 10px; border-bottom: 2px solid var(--ink); }
td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.access td:first-child { font-weight: 600; width: 38%; }
.access td:last-child { color: var(--ink-2); }
.plans td { font-size: 1.2rem; }
.plans td:first-child { font-weight: 600; }
.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.plans + .fine { margin-bottom: 26px; }

.code { margin: 0; background: #1D2129; border-radius: 14px; overflow: hidden; }
.code figcaption { padding: 12px 20px; background: #252A33; color: #AEB4BE; font-size: 0.9rem; }
.code pre { margin: 0; padding: 20px 0; overflow-x: auto; }
.code code { display: block; font-size: 0.92rem; line-height: 1.75; color: #E6E8EC; padding: 0 20px; white-space: pre; }
.code mark { display: inline-block; min-width: calc(100% + 40px); margin: 0 -20px; padding: 0 20px; background: rgb(78 122 91 / 0.32); color: #DDF1E3; }

.close { padding: clamp(64px, 9vw, 120px) 0; background: var(--surface); border-top: 1px solid var(--rule); }

.ask-close { margin-bottom: 22px; }
.answer-close { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.1; margin-bottom: 34px; max-width: 24ch; }

.foot { border-top: 1px solid var(--rule); background: var(--ground); padding: 28px 0; font-size: 0.95rem; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; gap: 24px; }
.foot a { color: var(--ink-2); }
.foot-in span { margin-right: auto; }

@media (max-width: 860px) {
  .top-nav { display: none; }
  .two { grid-template-columns: 1fr; }
  .seq { grid-template-columns: 1fr; gap: 28px; }
  .models div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 600px) {
  .answer .line { display: inline; }
  .answer .line + .line::before { content: " "; }
}
@media (max-width: 480px) {
  .top-act .link { display: none; }
  .access td:first-child { width: auto; }
}
