:root {
  --bg: #000; --tile: #161617; --ink: #f5f5f7; --dim: #a1a1a6; --line: #2c2c2e;
  --fill: #f5f5f7; --on-fill: #000; --ghost: #1c1c1e; --r: 28px; --gap: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f5f5f7; --tile: #fff; --ink: #1d1d1f; --dim: #6e6e73; --line: #d2d2d7; --fill: #1d1d1f; --on-fill: #fff; --ghost: #ebebef; }
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }

.nav { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 max(16px, calc(50% - 560px)); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); }
.brand { display: flex; align-items: center; min-height: 44px; }
.mark { font: 6px/1 var(--mono); margin: 0; background: linear-gradient(var(--ink), var(--dim)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ascii { position: absolute; inset: 0; z-index: -1; margin: auto; width: min(92%, 1040px); aspect-ratio: 45 / 20; pointer-events: none; }
.links { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.links > a:not(.pill) { line-height: 44px; color: var(--dim); transition: color .2s; }
.links > a:hover { color: var(--ink); }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 99px; background: var(--fill); color: var(--on-fill) !important; font-weight: 500; transition: transform .2s; }
.pill.big { min-height: 48px; padding: 0 26px; font-size: 17px; }

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: calc(92vh - 56px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 16px; }
.kanji { color: var(--dim); font-size: 19px; letter-spacing: .1em; margin-bottom: 18px; }
h1 { font-size: clamp(48px, 10.5vw, 136px); line-height: 1.02; letter-spacing: -.045em; font-weight: 700; }
h1 span { display: block; }
.sub { max-width: 30em; margin: 26px 0 34px; color: var(--dim); font-size: clamp(19px, 2.2vw, 26px); line-height: 1.3; letter-spacing: -.015em; }

.stage { padding: 0 16px; display: flex; justify-content: center; }
.frame img { width: 100%; }
.frame { width: 100%; max-width: 1400px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); max-width: 1120px; margin: 140px auto 0; padding: 0 16px; }
.tile { position: relative; overflow: hidden; min-height: 300px; padding: 34px; background: var(--tile); border-radius: var(--r); }
.tile h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.03em; font-weight: 650; }
.tile p { margin-top: 10px; color: var(--dim); font-size: 19px; line-height: 1.35; }
.cold { grid-column: span 4; grid-row: span 2; min-height: 620px; }
.cold h2 { font-size: clamp(36px, 5vw, 60px); max-width: 10em; }
.cold img { position: absolute; left: 34px; top: 240px; width: 1100px; max-width: none; border-radius: 14px 0 0 0; border: 1px solid var(--line); }
.phone { grid-column: span 2; grid-row: span 3; }
.iphone { position: absolute; left: 0; right: 0; bottom: 24px; margin: 0 auto; width: min(calc(100% - 36px), 300px); padding: 42px 0 0; overflow: hidden; background: #121212; border: 9px solid #000; border-radius: 48px; box-shadow: 0 0 0 1.5px #48484a; }
.iphone::before { content: ""; position: absolute; top: 11px; left: 50%; width: 31%; height: 23px; margin-left: -15.5%; border-radius: 99px; background: #000; }
.iphone img { width: 100%; height: auto; }
.plan, .loop { grid-column: span 2; }
.approve { position: absolute; left: 34px; bottom: 34px; padding: 12px 26px; border-radius: 99px; background: var(--fill); color: var(--on-fill); font-weight: 600; }
.loop svg { position: absolute; right: 26px; bottom: 26px; width: 130px; transform: rotate(-90deg); }
.loop circle { fill: none; stroke-width: 9; }
.track { stroke: var(--line); }
.ring { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.work, .agents { grid-column: span 3; }
.words { font-size: clamp(36px, 5vw, 60px) !important; }
.words span { display: block; }
.notes { grid-column: span 2; }
.agents, .notes, .open { min-height: 230px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.chips li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; }
.open .pill { align-self: flex-start; margin-top: 18px; min-height: 44px; }
.open { grid-column: span 4; display: flex; flex-direction: column; justify-content: flex-end; }

.flow { min-height: 90vh; display: flex; align-items: center; justify-content: center; padding: 140px 16px; text-align: center; }
.flow p { font-size: clamp(54px, 11vw, 150px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; }
.flow span { display: block; }

.install { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 16px 140px; }
.install h2 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -.04em; line-height: 1.05; font-weight: 700; }
.os { display: flex; gap: 4px; margin: 34px 0 16px; padding: 4px; border-radius: 99px; background: var(--tile); }
.os button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 99px; background: none; color: var(--dim); font-size: 15px; transition: color .2s, background .2s; }
.os [aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
.cmd { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 760px; padding: 12px 12px 12px 22px; background: var(--tile); border-radius: 18px; text-align: left; }
.cmd code { flex: 1; min-width: 0; font: 14px/1.5 var(--mono); overflow-wrap: anywhere; }
.cmd button { flex: none; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: none; }
.hint { margin-top: 16px; color: var(--dim); font-size: 15px; }
.hint code { font-family: var(--mono); color: var(--ink); }

.foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px 56px; color: var(--dim); font-size: 15px; text-align: center; }
.tanuki { width: 120px; aspect-ratio: 428 / 400; background: var(--ink); -webkit-mask: url(media/tanuki.svg) center / contain no-repeat; mask: url(media/tanuki.svg) center / contain no-repeat; }
.meta { display: flex; gap: 8px; }
.meta a { display: inline-block; padding: 10px 8px; }
.meta a:hover { color: var(--ink); }

/* Buttons jitter once on hover. Keep it to 1-2px and no clip-path: both change the hit area under the pointer. */
@keyframes stutter {
  0%, 100% { transform: none; opacity: 1; }
  20% { transform: translateX(-2px); opacity: .75; }
  40% { transform: translateX(2px); opacity: 1; }
  60% { transform: translateX(-1px); opacity: .88; }
  80% { transform: translateX(1px); opacity: 1; }
}
.pill:hover, .os button:hover, .cmd button:hover, .pill:focus-visible, .os button:focus-visible, .cmd button:focus-visible { animation: stutter .3s steps(1) 1; }

.w { display: inline-block; }
.armed .w { opacity: 0; }
.armed.in .w { animation: stutter-in .46s steps(1) calc(var(--i) * 75ms) both; }
@keyframes stutter-in {
  0% { opacity: 1; transform: translateX(-6px); clip-path: inset(0 0 62% 0); }
  14% { opacity: 1; transform: translateX(6px); clip-path: inset(46% 0 0 0); }
  28% { opacity: 0; }
  40% { opacity: 1; transform: translateX(-4px); clip-path: inset(20% 0 28% 0); }
  54% { opacity: 1; transform: translateX(3px); clip-path: inset(0 0 24% 0); }
  68% { opacity: 1; transform: translateX(-1px); clip-path: inset(0); }
  82%, 100% { opacity: 1; transform: none; clip-path: inset(0); }
}

@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr 1fr; margin-top: 90px; }
  .tile { grid-column: span 2; grid-row: auto; min-height: 240px; padding: 26px; }
  .cold { min-height: 460px; }
  .cold img { left: 26px; top: 200px; width: 860px; }
  .phone { min-height: 680px; }
  .plan, .loop { grid-column: span 1; min-height: 220px; padding: 20px; }
  .approve { left: 20px; bottom: 20px; }
  .loop svg { right: 16px; bottom: 16px; width: 76px; }
  .tile h2 { font-size: 24px; }
  .cold h2, .words { font-size: 36px !important; }
  .flow { min-height: 0; padding: 100px 16px; }
  .nav .links > a:not(.pill) { padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
