/* SolClawd: the coding agent terminal. Matrix green on near-black, one mono font, glitch accents.
   Performance rules (phones under viral traffic):
   - animate only transform and opacity; never box-shadow, background-position, left/top, width/height, filter
   - no full-screen animated layers; the background texture is static
   - every looping animation lives in a section that pauseOffscreen() watches (.offscreen pauses it) */
@font-face { font-family: 'JB'; src: url('/fonts/mono.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JB'; src: url('/fonts/mono-bold.woff2') format('woff2'); font-weight: 700 900; font-display: swap; }
:root {
  --bg: #010603; --bg2: #03110a; --card: #020c06; --line: rgba(0, 255, 65, .16); --line2: rgba(0, 255, 65, .32);
  --text: #d4ffdd; --mute: #63a978; --accent: #00ff41; --accent2: #7dffb0; --accent-ink: #001a07; --ok: #00ff41; --warn: #e8ff7a;
  --r: 10px; --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --f-body: 'JB', ui-monospace, 'SF Mono', Menlo, monospace; --f-display: var(--f-body); --f-mono: var(--f-body);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--f-body); overflow-x: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); }
/* static texture: glow + fine grid + scanlines (never animated) */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px),
    radial-gradient(60% 45% at 75% 0%, rgba(0, 255, 65, .13), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(0, 255, 65, .07), transparent 70%),
    linear-gradient(rgba(0, 255, 65, .035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(0, 255, 65, .035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg); }

/* top bar = a terminal tab strip */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(1, 6, 3, .92); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 16px/1 var(--f-display); white-space: nowrap; }
.brand img { border-radius: 8px; border: 1px solid var(--line2); }
.brand b { color: var(--accent); } .brand span { color: var(--mute); font-weight: 400; }
.tabs { display: flex; gap: 2px; align-self: stretch; }
.tabs a { display: flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--mute); font-size: 13px; border-inline: 1px solid transparent; }
.tabs a[aria-current] { color: var(--text); background: var(--card); border-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.tabs a:hover { color: var(--accent); }
@media (max-width: 720px) { .tabs { display: none; } .brand span { display: none; } }
.nav-r { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font: 400 12px/1 var(--f-mono); color: var(--mute); white-space: nowrap; }
.chip b { color: var(--accent); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 700; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: 6px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 700 14px/1.1 var(--f-body); text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 0 22px rgba(0, 255, 65, .28); transition: transform .2s var(--ease), opacity .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.wait { opacity: .6; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line2); box-shadow: none; }
.btn.small { padding: 8px 12px; font-size: 12.5px; }
.btn.big { width: 100%; padding: 17px 20px; font-size: 16px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 1px; background: var(--accent); animation: blink 1.2s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.offscreen, .offscreen * { animation-play-state: paused !important; }

/* terminal window */
.term { position: relative; border: 1px solid var(--line2); border-radius: var(--r); background: rgba(2, 12, 6, .94); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 30px 80px -30px rgba(0, 255, 65, .25); overflow: hidden; overflow: clip; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); color: var(--mute); font-size: 12.5px; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); opacity: .9; flex: none; }
.term-bar i:nth-child(2) { opacity: .55; } .term-bar i:nth-child(3) { opacity: .25; }
.term-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-body { padding: 18px; }
.p-agent { color: var(--accent); font-weight: 700; } .p-you { color: var(--accent2); font-weight: 700; } .p-dim { color: var(--mute); }
.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.18em; background: var(--accent); animation: blink 1s steps(2, jump-none) infinite; }

/* glitch text: two static clipped copies that jitter with transform only */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; }
.glitch::before { color: var(--accent2); clip-path: inset(18% 0 58% 0); animation: gl1 3.2s steps(1) infinite; opacity: .85; }
.glitch::after { color: #00b82e; clip-path: inset(62% 0 12% 0); animation: gl2 2.7s steps(1) infinite; opacity: .9; }
@keyframes gl1 { 0%, 82%, 100% { transform: none; } 84% { transform: translateX(-7px); } 88% { transform: translateX(5px); } 92% { transform: translateX(-3px); } }
@keyframes gl2 { 0%, 70%, 100% { transform: none; } 72% { transform: translateX(8px); } 76% { transform: translateX(-6px); } 80% { transform: translateX(3px); } }

.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 40px 0 60px; color: var(--mute); font-size: 13px; }
.foot a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 4px; text-decoration: none; } .foot a:hover { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* sound toggle (off by default) */
.snd { position: relative; cursor: pointer; background: transparent; color: var(--mute); font: 700 16px/1 var(--f-body); }
.snd:not(.on)::after { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--mute); transform: rotate(-40deg); }
.snd.on { color: var(--accent); border-color: var(--accent); }

/* the agent typing: a solid caret at the end of the line being typed */
.typing-ln::after { content: ''; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -.17em; background: var(--accent); }

/* terminal life: a slow scan bar + random glitch jolts (transform/opacity only) */
.term::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 28%; pointer-events: none; z-index: 2;
  background: linear-gradient(transparent, rgba(0, 255, 65, .055), transparent); transform: translateY(-100%); animation: scanbar 7s linear infinite; }
@keyframes scanbar { to { transform: translateY(460%); } }
.term.jolt .term-body { animation: jolt .26s steps(1) both; }
.term.jolt::before { content: ''; position: absolute; left: 0; right: 0; top: 46%; height: 9%; z-index: 3; pointer-events: none; background: rgba(125, 255, 176, .14); animation: joltbar .26s steps(1) both; }
@keyframes jolt { 0% { transform: translate(0, 0); } 20% { transform: translate(-7px, 1px); } 40% { transform: translate(6px, -1px); } 60% { transform: translate(-3px, 0); } 80% { transform: translate(2px, 1px); } 100% { transform: none; } }
@keyframes joltbar { 0% { transform: translateY(-140%); } 35% { transform: translateY(160%); } 70% { transform: translateY(-60%) scaleY(.4); } 100% { opacity: 0; } }
