/* Tegata. Paper, sumi ink, and one shu seal (docs/marketing/DESIGN.md): borders 1.5px sumi, no shadows, no gradients. */

@font-face { font-family: "Shippori Mincho"; src: url("/assets/fonts/shippori-mincho-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Shippori Mincho"; src: url("/assets/fonts/shippori-mincho-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Asimovian"; src: url("/assets/fonts/asimovian-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Kaku Gothic New"; src: url("/assets/fonts/zen-kaku-gothic-new-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Kaku Gothic New"; src: url("/assets/fonts/zen-kaku-gothic-new-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #e5e3dc;
  --paper-2: #dcd9d0;   /* a fold of the same paper, for code */
  --sumi: #2a2926;
  --sumi-2: #5c5a54;    /* thinned ink */
  --shu: #e14d2a;
  --line: 1.5px solid var(--sumi);
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --gothic: "Zen Kaku Gothic New", -apple-system, system-ui, sans-serif;
  --name: "Asimovian", var(--gothic);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 760px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--sumi); font: 400 17px/1.65 var(--gothic); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
code, pre { font-family: var(--mono); }
.dim { color: var(--sumi-2); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 22px; text-align: center; padding: 72px 20px 56px; position: relative; }
/* The rail stays on the left edge and names the section in view (site.js); without JavaScript it keeps the first name. */
.rail { position: fixed; left: 28px; top: 50%; transform: translateY(-50%); z-index: 2; writing-mode: vertical-rl; font: 500 14px/1 var(--mincho); letter-spacing: .5em; color: var(--sumi-2); transition: opacity .25s ease; }
.rail.swap { opacity: 0; }
@media (min-width: 641px) and (max-width: 1200px) { main, footer { padding-left: 56px; } }
.seal { width: 112px; height: 132px; background: var(--shu); color: var(--paper); border-radius: 10px; display: grid; place-content: center; gap: 2px; font: 700 46px/1 var(--mincho); transform: rotate(-3deg); }
.seal span { display: block; }
/* The name is set in Asimovian, lowercase, as a wordmark; everything else that speaks stays in Mincho. */
h1 { font: 400 clamp(60px, 12vw, 124px)/1 var(--name); font-kerning: normal; letter-spacing: .04em; margin-top: 8px; padding-left: .04em; }
/* The version, read from the latest release (site.js); the HTML carries the one current at deploy time. */
.name { position: relative; }
.ver { position: absolute; left: 100%; top: .55em; margin-left: 12px; font: 500 12px/1 var(--mono); letter-spacing: .02em; color: var(--shu); border: 1.5px solid var(--shu); border-radius: 999px; padding: 5px 9px; text-decoration: none; white-space: nowrap; }
.ver:hover { background: var(--shu); color: var(--paper); }
@media (max-width: 640px) { .ver { position: static; display: inline-block; margin: 10px 0 0; } }
.tagline { font: 500 clamp(20px, 3vw, 28px)/1.3 var(--mincho); letter-spacing: .02em; }
.lead { max-width: 620px; color: var(--sumi); font-size: 18px; }
.meta { font: 400 13px/1.5 var(--mono); letter-spacing: .02em; color: var(--sumi-2); }

/* The stamp: pressed down, then lifted, ink left behind. Only for people who did not ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .seal { animation: stamp .9s cubic-bezier(.2, .9, .25, 1) .15s both; }
  h1, .tagline, .lead, .install, .meta { animation: rise .8s ease-out both; }
  h1 { animation-delay: .55s; } .tagline { animation-delay: .7s; } .lead { animation-delay: .82s; }
  .install { animation-delay: .95s; } .meta { animation-delay: 1.05s; }
  @keyframes stamp {
    0% { opacity: 0; transform: translateY(-36px) scale(1.35) rotate(-9deg); }
    55% { opacity: 1; transform: translateY(0) scale(.94) rotate(-3deg); }
    72% { transform: scale(1.03) rotate(-3deg); }
    100% { opacity: 1; transform: scale(1) rotate(-3deg); }
  }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ── Install box ───────────────────────────────────────────────────────── */
.install { width: min(620px, 100%); border: var(--line); border-radius: 10px; text-align: left; margin-top: 6px; overflow: hidden; }
.tabs { display: flex; border-bottom: var(--line); }
.tabs button { flex: 0 0 auto; font: 500 13px/1 var(--gothic); letter-spacing: .04em; background: none; border: 0; border-right: var(--line); padding: 11px 16px; color: var(--sumi-2); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--sumi); background: var(--paper-2); }
.panel { position: relative; }
.install pre { padding: 16px 18px; font-size: 13.5px; line-height: 1.75; overflow-x: auto; white-space: pre; }
.copy { position: absolute; top: 10px; right: 10px; font: 500 12px/1 var(--gothic); background: var(--paper); color: var(--sumi); border: var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer; text-decoration: none; }
.copy:hover, .tabs button:hover { background: var(--paper-2); }
.copy.done::after { content: " ✓"; }

/* ── Sections ──────────────────────────────────────────────────────────── */
main section { min-width: 0; max-width: 1040px; margin: 0 auto; padding: 96px 24px; border-top: var(--line); }
.heading { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
/* Kanji are the seal's ink: shu, decorative (the English heading beside them says the same). */
.heading .kanji { font: 700 16px/1 var(--mincho); letter-spacing: .3em; color: var(--shu); writing-mode: vertical-rl; border-left: 1.5px solid var(--shu); padding-left: 10px; min-height: 64px; }
h2 { font: 700 clamp(28px, 4vw, 40px)/1.2 var(--mincho); letter-spacing: .01em; }
.intro { max-width: var(--measure); color: var(--sumi); margin-bottom: 36px; font-size: 18px; }
section > p code, li code, .split p code { font-size: .88em; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }

/* ── Terminal: sumi ground, paper ink ───────────────────────────────────── */
.terminal { max-width: 100%; border: var(--line); border-radius: 12px; overflow: hidden; background: var(--sumi); color: var(--paper); }
.terminal .bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1.5px solid #45433e; font: 400 12px/1 var(--mono); color: #a9a69e; }
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #6e6b64; }
.terminal .bar span { margin-left: auto; margin-right: auto; padding-right: 48px; }
.screen { min-height: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 22px 6px 26px 10px; font-size: 13px; line-height: 1.3; overflow-x: auto; }
.screen code { display: block; white-space: pre; }
.screen [data-type]::before { content: "$ "; color: #a9a69e; }
.screen [data-type].typing::after { content: "▍"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.screen .dim { color: #a9a69e; }
.screen b { font-weight: 500; color: #f4f2ec; }
.screen .hot { color: #f07a5c; }
.screen .seal-text { color: #f07a5c; }
.terminal figcaption { border-top: 1.5px solid #45433e; padding: 12px 16px; font-size: 13px; color: #a9a69e; }
.js .out { opacity: 0; }
.js .out.shown { opacity: 1; transition: opacity .25s; }

/* ── Four ways ─────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border: var(--line); border-radius: 12px; overflow: hidden; }
.grid article { padding: 28px 24px 26px; border-right: var(--line); display: flex; flex-direction: column; gap: 12px; }
.grid article:last-child { border-right: 0; }
.grid .kanji { font: 700 30px/1 var(--mincho); color: var(--shu); }
.grid h3 { font: 700 20px/1.2 var(--mincho); }
.grid p { font-size: 15.5px; flex: 1; }
.grid code { white-space: nowrap; overflow-x: auto; font-size: 12.5px; background: var(--paper-2); border: var(--line); border-radius: 6px; padding: 8px 10px; }
@media (max-width: 960px) { .grid article { border-right: 0; border-bottom: var(--line); } .grid article:last-child { border-bottom: 0; } }

/* ── Watch ─────────────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split p { font-size: 18px; }
.split img { width: 100%; height: auto; border-radius: 22px; clip-path: inset(0 round 22px); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* ── Agents ────────────────────────────────────────────────────────────── */
.new { display: inline-block; font: 500 12px/1 var(--mono); color: var(--shu); border: 1.5px solid var(--shu); border-radius: 999px; padding: 4px 8px; margin-left: 6px; vertical-align: 2px; }
.agents .split { align-items: start; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; font-size: 16px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; display: grid; place-content: center; font: 700 14px/1 var(--mincho); color: var(--paper); background: var(--shu); border-radius: 6px; }
.steps li b { display: block; font: 700 18px/1.35 var(--mincho); margin-bottom: 4px; }
.steps code { font-size: .88em; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }
.terminal figcaption a { color: inherit; }

/* ── Vows ──────────────────────────────────────────────────────────────── */
.vows ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0; border-top: var(--line); }
.vows li { padding: 22px 8px 22px 0; border-bottom: var(--line); font-size: 16px; padding-right: 28px; }
.vows li b { display: block; font: 700 19px/1.35 var(--mincho); margin-bottom: 6px; }

/* ── Verify ────────────────────────────────────────────────────────────── */
.verify pre { border: var(--line); border-radius: 10px; padding: 18px 20px; font-size: 13.5px; line-height: 1.8; overflow-x: auto; background: var(--paper-2); margin-bottom: 20px; }

/* ── App and beta ──────────────────────────────────────────────────────── */
.beta { max-width: 560px; }
.beta label { display: block; font: 500 15px/1.4 var(--gothic); margin-bottom: 10px; }
.beta .row { display: flex; gap: 10px; }
.beta input[type="email"] { flex: 1; font: inherit; background: var(--paper); color: var(--sumi); border: var(--line); border-radius: 8px; padding: 11px 13px; }
.beta button { font: 500 15px/1 var(--gothic); background: var(--sumi); color: var(--paper); border: var(--line); border-radius: 8px; padding: 0 18px; cursor: pointer; }
.beta .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.beta .status { margin-top: 10px; min-height: 1.6em; font-size: 15px; }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer { border-top: var(--line); padding: 56px 24px 72px; text-align: center; display: grid; justify-items: center; gap: 10px; font-size: 14px; }
/* The same seal as the top of the page, smaller: the stamp at the end of the paper. */
.mini-seal { writing-mode: vertical-rl; font: 700 18px/1 var(--mincho); background: var(--shu); color: var(--paper); border-radius: 6px; padding: 9px 7px; letter-spacing: .1em; transform: rotate(-3deg); margin-bottom: 6px; }

@media (max-width: 640px) {
  .rail { display: none; }
  main section { padding: 72px 18px; }
  .heading .kanji { display: none; }
  .beta .row { flex-direction: column; } .beta button { padding: 12px; }
}
