:root {
    --bg: #09090b;
    --panel: rgba(20, 20, 24, .94);
    --line: rgba(255, 255, 255, .1);
    --text: #ecebe6;
    --dim: #b9b7bf;
    --muted: #8d8b94;
    --faint: #6c6a73;
    --green: #7ee787;
    --err: #ff8a80;
    --albums: #ff7ab8;
    --trophy: #ffcb1f;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Inter', -apple-system, system-ui, sans-serif;
    --display: 'Space Grotesk', 'Inter', -apple-system, system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { position: relative; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.wrap { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html:not(.js) .js-only { display: none !important; }

/* The field of 0s and 1s behind everything, filled by main.js */
.bits { position: absolute; inset: 0; font-family: var(--mono); overflow: hidden; font-size: 22px; line-height: 1.3; letter-spacing: .4em; white-space: pre; color: rgba(255, 255, 255, .028); pointer-events: none; user-select: none; }
/* A green copy of the bits, one span per digit; main.js lights the ones near the mouse */
.bits-glow { color: transparent; }
.bits-glow span { color: rgba(126, 231, 135, 0); transition: color .8s ease-out, text-shadow .8s ease-out; }
.bits-glow span.on { color: rgba(126, 231, 135, .42); text-shadow: 0 0 8px rgba(126, 231, 135, .35); transition-duration: .12s; }
.bits-glow span.dim { color: rgba(126, 231, 135, .2); text-shadow: none; }
.bits-glow span.head { color: rgba(210, 255, 214, .9); text-shadow: 0 0 10px rgba(126, 231, 135, .8); transition-duration: 0s; }

/* Header and footer */
.top { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; font-size: 15px; font-weight: 500; }
.brand img { height: 36px; width: auto; }
/* Links sit on the background bits, which light up under the mouse, so hover gives them a chip
   in the terminal's panel colour that covers the digits behind the text */
.top nav, .foot nav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: -12px; }
.top nav a, .foot nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); transition: color .2s, background .2s, box-shadow .2s; }
.top nav a:hover, .foot nav a:hover, .top nav a:focus-visible, .foot nav a:focus-visible { color: var(--text); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 64px; padding-bottom: 48px; align-items: center; color: var(--faint); font-size: 14px; }
.foot-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-brand img { height: 26px; width: auto; opacity: .8; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 20px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 5.6vw, 58px); line-height: 1; letter-spacing: -.04em; }

/* Terminal window */
.term { margin-top: 32px; font-family: var(--mono); border-radius: 20px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 60px 120px -30px rgba(0, 0, 0, .8); overflow: hidden; }
.term:focus-within { box-shadow: inset 0 0 0 1px rgba(126, 231, 135, .45), 0 60px 120px -30px rgba(0, 0, 0, .8); }
/* Title bar, after a macOS window: bigger lights, a slightly lighter bar, and a bold sans title */
.bar { display: flex; align-items: center; gap: 9px; padding: 18px 20px; background: rgba(255, 255, 255, .035); border-bottom: 1px solid rgba(0, 0, 0, .45); box-shadow: 0 1px 0 rgba(255, 255, 255, .04); }
.lights { display: flex; gap: 9px; }
.dot { position: relative; flex: none; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; cursor: default;
    /* Glassy like macOS: lit from below, a darker rim, and a soft highlight across the top */
    background: radial-gradient(circle at 50% 75%, color-mix(in srgb, var(--c) 70%, #fff) 0, var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000) 100%);
    box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--c) 55%, #000), 0 .5px 1px rgba(0, 0, 0, .4); }
.dot::after { content: ''; position: absolute; top: 1px; left: 50%; width: 9px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: linear-gradient(rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); }
.dot.close { --c: #ff5f57; --g: #4d0000; }
.dot.min { --c: #febc2e; --g: #985712; }
.dot.max { --c: #28c840; --g: #006500; }
/* Glyphs appear on all three when the group is hovered or focused, like macOS */
.dot svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; fill: none; stroke: var(--g); stroke-width: 1.4; stroke-linecap: round; opacity: 0; transition: opacity .12s; }
.dot svg .fill { fill: var(--g); stroke: none; }
.lights:hover svg, .lights:focus-within svg { opacity: .85; }
.dot:active { filter: brightness(.82); }
.dot:focus-visible { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 2px; }

/* Window states, set by main.js */
.term { transition: box-shadow .3s, opacity .22s, transform .22s; }
.term.anim .screen { transition: height .35s ease, padding .35s ease; } /* only while minimizing or restoring */
.term.closing { opacity: 0; transform: scale(.96); }
.term.minimized .screen { height: 0 !important; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.term.minimized .bar { cursor: pointer; border-bottom-color: transparent; }
.term.zoomed { position: fixed; inset: 16px; z-index: 50; margin: 0; background: #141418; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px var(--line), 0 0 0 100vmax rgba(9, 9, 11, .7); }
.term.zoomed .screen { flex: 1 1 auto; height: auto; }
html.zoomed { overflow: hidden; }
/* While a phone keyboard is up, main.js pins the terminal edge to edge over the visible part of
   the screen (--kb-top and --kb-h track the visual viewport), so the prompt sits on the keyboard */
.term.kb { position: fixed; inset: var(--kb-top, 0) 0 auto 0; height: var(--kb-h, 100%); z-index: 60; margin: 0; border-radius: 0; background: #141418; display: flex; flex-direction: column; transition: none;
    /* Safari floats its URL pill and the keyboard's accessory bar over the page just above the keys, outside
       the visual viewport, so the panel colour carries on under them instead of the background bits */
    box-shadow: 0 0 0 100vh #141418; }
.term.kb .screen { flex: 1 1 auto; height: auto; min-height: 0; padding-bottom: 14px; }
.term.kb .bar { cursor: pointer; }
html.kb { overflow: hidden; }
.title { margin-left: 5px; font: 600 15px -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { height: var(--screen-h, clamp(480px, 70vh, 760px)); overflow-y: auto; padding: 24px 28px 28px; cursor: text; overscroll-behavior: contain; }
html:not(.js) .screen { height: auto; }
.ps { color: var(--green); white-space: pre; }
.ps i { font-style: normal; color: var(--muted); }

/* Transcript */
.log > * + .cmd { margin-top: 10px; }
.js .log.static { visibility: hidden; }
.out { color: var(--dim); white-space: pre-wrap; }
.out.muted { color: var(--faint); }
.out.err { color: var(--err); }
.out a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.app { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 6px -12px 0; padding: 12px; border-radius: 10px; cursor: pointer; transition: background .2s; }
.app:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.app img { width: 52px; height: 52px; border-radius: 12px; }
.app b { flex: 0 0 140px; font-size: 21px; }
.app.albums b { color: var(--albums); }
.app.trophy b { color: var(--trophy); }
.app span { flex: 1 1 300px; color: var(--dim); }

/* Prompt */
.prompt { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.typing:empty { display: none; }
/* Sized in em so the block cursor follows the smaller phone text (10x20px at the desktop size) */
.typing::after { content: ''; display: inline-block; width: .6em; height: 1.2em; margin-left: 2px; vertical-align: -.2em; background: var(--text); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.field { position: relative; flex: 1 1 auto; min-width: 0; }
.prompt input { position: relative; z-index: 1; width: 100%; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; caret-color: var(--text); }
.prompt input:focus { outline: none; }
.prompt input::placeholder { color: var(--faint); }
.ghost { position: absolute; inset: 0; color: var(--faint); white-space: pre; overflow: hidden; pointer-events: none; }
.ghost i { font-style: normal; visibility: hidden; }
.prompt.busy .field { position: absolute; opacity: 0; pointer-events: none; }

/* Typeahead suggestions under the prompt */
.suggest { display: flex; flex-direction: column; margin: 8px -12px 0; }
.prompt.busy + .suggest { visibility: hidden; }
.suggest button { display: flex; align-items: baseline; gap: 16px; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.suggest button::before { content: '↳'; color: var(--faint); }
.suggest b { font-weight: 500; color: var(--text); }
.suggest span { color: var(--faint); }
.suggest button.on { background: rgba(255, 255, 255, .06); }
.suggest button.on::before { color: var(--green); }

/* Hover highlights only where there's a real pointer: a tap on a phone leaves :hover stuck on what was tapped */
@media (hover: hover) {
    .app:hover, .suggest button:hover { background: rgba(255, 255, 255, .06); }
}
@media (max-width: 640px) {
    body { font-size: 15px; }
    .top { flex-wrap: nowrap; gap: 16px; padding-top: 22px; padding-bottom: 22px; font-size: 14px; }
    .brand img { height: 28px; }
    .top nav { gap: 0; flex-wrap: nowrap; margin-right: -8px; }
    .top nav a { padding: 6px 8px; }
    .wrap { padding-left: 18px; padding-right: 18px; }
    .term { margin-top: 32px; border-radius: 16px; }
    .bar { padding: 14px 16px; }
    .screen { height: clamp(420px, 62vh, 600px); height: clamp(420px, 62svh, 600px); padding: 18px 16px 22px; } /* svh: sized for the toolbars showing, so the prompt isn't under them */
    .screen { font-size: 13px; line-height: 1.55; } /* The prompt can be this small too: index.html stops iOS zooming in on focus */
    .app { gap: 4px 14px; }
    .app img { width: 44px; height: 44px; border-radius: 10px; }
    .app b { flex: 1 1 auto; font-size: 16px; }
    .app span { flex-basis: 100%; order: 3; }
    .suggest button { min-height: 40px; align-items: center; gap: 12px; }
    .suggest span { display: none; }
}
@media (max-width: 360px) {
    .top, .top nav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .typing::after { animation: none; }
    .term, .screen { transition: none; }
}
