/* puq code announcement — after claude.dev, in its dark theme: flat ground, ink, mono headlines, puqqy's blue as the one accent. */

:root {
    --bg: #141413;
    --panel: #1E1D1B;
    --raised: #1A1A18;
    --paper: #141413;
    --ink: #FAF9F5;
    --ink-2: #B0AEA5;
    --ink-3: #87867F;
    --line: rgba(250, 249, 245, 0.11);
    --line-strong: rgba(250, 249, 245, 0.24);
    --accent: #4C8DFF;
    --accent-deep: #3F74FF;
    --puqqy: #4C8DFF;
    --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    /* viewport-fit=cover lets the page run under the notch in landscape; the gutter clears it. */
    --gutter: max(clamp(20px, 2.5vw, 36px), env(safe-area-inset-left), env(safe-area-inset-right));
    --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* iOS inflates text in landscape otherwise. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.pc {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 18px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.pc a { color: inherit; }
.pc code { font-family: var(--mono); font-size: 0.92em; }
.pc ::selection { background: var(--accent); color: var(--bg); }

.pc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pc-wrap {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Navigation ---------- */

/* claude.dev's bar: a 12-column grid, brand on the left, keyed links across columns 4–10, the button flush right.
   The content grid retains the original 1440px page cap. */
.pc-nav {
    /* A page-coloured halo keeps the links legible over the hero's pixels while the bar is clear. */
    --nav-halo: 0 0 3px var(--bg), 0 0 10px var(--bg);
    position: fixed;
    inset: 0 0 auto;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
    padding: 22px var(--gutter) 14px;
    padding-inline: max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter)));
    /* Clear over the hero so its picture runs up under the bar; the backdrop arrives once the page scrolls. */
    background: transparent;
    transition: box-shadow 0.4s ease, background-color 0.4s ease, -webkit-backdrop-filter 0.4s ease, backdrop-filter 0.4s ease;
}

.pc-nav.is-scrolled {
    background: rgba(20, 20, 19, 0.86);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--line);
}

/* Page-wide pointer pixels (data-field="trail", assets/js/pixel-field.js): fixed under all content, so they show
   wherever a section has no background of its own. The hero and Begin keep theirs and draw their own night skies
   (hero-field.js, sky-field.js).
   JS sizes the canvas to whole art pixels; the browser only scales it by an integer, nearest neighbour. */
.pc-trail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    display: block;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* A faint scatter of night pixels behind the sections between the hero and Begin (assets/js/night-field.js).
   JS places it in page coordinates and sizes it to whole art pixels. */
.pc-night {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    display: block;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.pc-nav__mark {
    grid-column: 1 / 4;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    font: 400 15.75px/1 var(--mono);
    text-decoration: none;
    text-shadow: var(--nav-halo);
}

.puqqy--nav { width: 44px; height: auto; }
.puqqy--nav .puqqy__shadow { display: none; }
.pc-nav__word i { font-style: normal; color: var(--accent); }

.pc-nav__links { display: contents; }

.pc-nav__links a {
    font: 400 13.5px/1.5 var(--mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    text-shadow: var(--nav-halo);
    transition: color 0.2s ease;
}

/* Keyed links occupy the middle columns of the page grid. */
.pc-nav__keys {
    grid-column: 4 / 11;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.pc-key { margin-right: 6px; color: var(--ink-2); transition: color 0.2s ease; }

/* Links are already full ink, so hover and the current section light the key in the accent.
   Hover rules sit behind (hover: hover) throughout: a tap leaves :hover stuck on touch screens. */
.pc-nav__links a.is-active .pc-key { color: var(--accent); }
@media (hover: hover) { .pc-nav__links a:hover .pc-key { color: var(--accent); } }

.pc-nav__links .pc-nav__cta {
    grid-column: 11 / 13;
    justify-self: end;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--bg);
    font: 400 16px/1 var(--sans);
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

@media (hover: hover) { .pc-nav__links .pc-nav__cta:hover { background: var(--ink-2); color: var(--bg); } }

/* Reading progress along the bottom edge of the scrolled nav; --progress is set by assets/js/code.js. */
.pc-nav__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pc-nav.is-scrolled .pc-nav__progress { opacity: 1; }

/* Shared drawing and closing-title primitives. Hero styling lives in hero.css. */
.pc-field { position: absolute; top: 0; left: 0; z-index: -1; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pc-char { display: inline-block; }
.pc-caret { display: inline-block; width: 0.5em; height: 0.74em; margin-left: 0.08em; background: var(--ink); animation: pc-caret 1.1s steps(1) infinite; }

/* Install pill */

.pc-install {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--raised);
    border-radius: 0;
    transition: border-color 0.3s ease;
}

@media (hover: hover) { .pc-install:hover { border-color: var(--ink); } }

.pc-install__cmd {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    font-size: 14px !important;
    color: var(--ink);
}

.pc-install__cmd::-webkit-scrollbar { display: none; }
.pc-install__cmd span { color: var(--accent); }

/* Set while the command runs past the edge; fades the cut instead of chopping a word. */
.pc-install__cmd.is-clipped {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent);
}

.pc-install__copy {
    flex: 0 0 auto;
    min-width: 86px;
    border: 0;
    padding: 0 18px;
    background: var(--ink);
    color: var(--bg);
    font: 400 16px/1 var(--sans);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pc-install__copy.is-copied { background: var(--accent-deep); color: var(--bg); }
@media (hover: hover) { .pc-install__copy:hover { background: var(--accent-deep); color: var(--bg); } }

.pc-install__copy:focus-visible,
.pc-mood:focus-visible,
.pc-nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}


.puqqy {
    display: block;
    overflow: visible;
}

.px-D { fill: #0A28B4; }
.px-B { fill: #0A48FF; }
.px-H { fill: #3F74FF; }
.px-L { fill: #28D4FF; }
.px-W { fill: #FDFAF5; }
.px-K { fill: #061C8C; }
.px-P { fill: #FF9EC7; }

/* Web puqqy keeps its own sky blue, which is also the page's one accent. The terminal replica keeps the TUI's #0A48FF. */
.puqqy .px-B { fill: var(--puqqy); }

.puqqy__shadow {
    fill: rgba(0, 0, 0, 0.45);
    transform-box: fill-box;
    transform-origin: center;
}

.puqqy__shadow-edge { fill-opacity: 0.5; }

/* Feet stay the pivot: squash, leap, stretch, land. */
.puqqy__figure {
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

/* The head follows the gaze (--look-x -1..1, --look-y 0..1 from code.js): a lean and tilt from the neck. */
.puqqy__head {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: translate(calc(var(--look-x, 0) * 0.45px), calc(var(--look-y, 0) * 0.4px)) rotate(calc(var(--look-x, 0) * 5deg));
    transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.4, 1);
}

/* Drag/throw physics (assets/js/code.js, portraitPlay) writes the pose transform; it spins around the body centre. */
.puqqy__pose {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

.puqqy--portrait { touch-action: none; }
.puqqy--portrait .puqqy__pose { cursor: grab; }
.puqqy--portrait.is-held .puqqy__pose { cursor: grabbing; }

/* Pixel dust kicked up where puqqy hits a wall or the floor; it flies out and fades in steps, like the hero's
   embers. --s, --dx, --dy come from portraitPlay. */
.pc-dust {
    position: absolute;
    width: var(--s);
    height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    background: var(--puqqy);
    pointer-events: none;
    animation: pc-dust 0.6s steps(5) forwards;
}

.pc-dust--cyan { background: #28D4FF; }

.puqqy.is-bounce .puqqy__figure { animation: pc-bounce 0.56s cubic-bezier(0.3, 0.7, 0.4, 1); }
.puqqy.is-bounce .puqqy__shadow { animation: pc-bounce-shadow 0.56s cubic-bezier(0.3, 0.7, 0.4, 1); }

.pc-zz {
    position: absolute;
    top: 18%;
    right: 20%;
    font: 400 30px/1 var(--mono);
    letter-spacing: 0.2em;
    color: var(--ink);
    opacity: 0;
    pointer-events: none;
}

.puqqy.is-sleep + .pc-zz { animation: pc-zz 2.6s steps(6) infinite; }

/* ---------- Model ribbon ---------- */

.pc-ribbon {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    /* No background: the page's pointer pixels show through the sections between the hero and Begin. */
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.pc-ribbon__track {
    display: flex;
    width: max-content;
    animation: pc-marquee 48s linear infinite;
}

@media (hover: hover) { .pc-ribbon:hover .pc-ribbon__track { animation-play-state: paused; } }

.pc-ribbon__set {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.pc-ribbon__set span {
    padding: 0 24px;
    font: 400 clamp(16px, 1.5vw, 20px)/1 var(--mono);
    letter-spacing: -0.01em;
    color: var(--ink-2);
    white-space: nowrap;
}

/* The hero's four-point star in puqqy's blue: a bright centre, arms, and dimmer tips, one 2px pixel each. */
.pc-star {
    flex: none;
    width: 2px;
    height: 2px;
    margin: 4px;
    background: var(--accent);
    box-shadow:
        2px 0 var(--accent), -2px 0 var(--accent), 0 2px var(--accent), 0 -2px var(--accent),
        4px 0 rgba(76, 141, 255, 0.4), -4px 0 rgba(76, 141, 255, 0.4), 0 4px rgba(76, 141, 255, 0.4), 0 -4px rgba(76, 141, 255, 0.4);
}

/* ---------- Manifesto ---------- */

.pc-manifesto {
    position: relative;
    padding: clamp(80px, 10vw, 140px) 0;
    overflow: hidden;
}

.pc-manifesto .pc-wrap { position: relative; }

.pc-manifesto__text {
    margin: 32px 0 0;
    max-width: 28ch;
    font: 400 clamp(26px, 3.2vw, 46px)/1.25 var(--sans);
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
}

.pc-manifesto__text em { font-style: normal; color: var(--accent); }

/* data-lit: assets/js/code.js wraps each word in .pc-word and sets --on (0 → 1) from scroll. */
.pc-word { opacity: calc(0.16 + var(--on, 1) * 0.84); transition: opacity 0.25s linear; }

/* ---------- Shared type ---------- */

.pc-paper {
    position: relative;
    z-index: 2;
    color: var(--ink-2);
    border-block: 1px solid var(--line);
}

.pc-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    font: 400 13.5px/1 var(--mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.pc-label--light { color: var(--ink-3); }

.pc-h2 {
    margin: 0 0 24px;
    font: 400 clamp(30px, 3.3vw, 48px)/1.15 var(--mono);
    letter-spacing: -0.04em;
    color: var(--ink);
}

.pc-h2 em { font-style: normal; color: var(--accent); }
.pc-h2--light { color: var(--ink); }

.pc-caption {
    margin-top: 28px;
    font: 400 12.5px/1.4 var(--mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ---------- Session ---------- */

.pc-session { padding: clamp(96px, 13vw, 180px) 0; }

.pc-session__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
}

.pc-session__text p:not(.pc-label):not(.pc-caption) {
    max-width: 30em;
    font-size: 18px;
}

/* The replay is drawn like puq code itself: titanium theme, band composer, framed tool cards.
   A cell is 1ch x 1.6em; frame lines sit mid-cell, where box-drawing glyphs put them. */
.pc-term {
    --t-bg: #151820;
    --t-card: #0f1216;
    --t-text: #e8ecf4;
    --t-muted: #9ca3b0;
    --t-dim: #6b7280;
    --t-line: #2a3038;
    --t-accent: #00b4ff;
    --t-green: #00ff88;
    --t-red: #ff4757;
    --t-gold: #d4c090;
    --t-amber: #ffb347;
    --t-mark: #3998bf;
    /* Once a turn starts the band takes the model's thinking-level hue and keeps it (captured: auto → #ff9400). */
    --t-work: #ff9400;
    --t-work-mark: #bf8739;
    --t-work-icon: #a67f4b;
    --t-row: 1.6em;
    margin: 0;
    background: var(--t-bg);
    color: var(--t-text);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
}

.pc-term__bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: #1c2029;
    border-bottom: 1px solid #0b0d11;
}

.pc-term__bar i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
}

.pc-term__bar i:nth-child(2) { background: #febc2e; }
.pc-term__bar i:nth-child(3) { background: #28c840; }

.pc-term__bar span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font: 500 12px/1 var(--sans);
    color: rgba(232, 236, 244, 0.6);
}

.pc-term__screen,
.pc-term__composer { font: 400 12.5px/1.6 var(--mono); }

.pc-term__screen {
    height: 440px;
    padding: 12px 14px 10px;
    overflow: hidden;
    scroll-behavior: smooth;
}

.pc-term__screen p { margin: 0; }
.pc-term i { font-style: normal; }
.pc-term b { font-weight: 600; }

.t-dim { color: var(--t-dim); }
.t-muted { color: var(--t-muted); }
.t-acc { color: var(--t-accent); }
.t-ok { color: var(--t-green); }
.t-del { color: var(--t-red); }
.t-gold { color: var(--t-gold); }
.t-ws { opacity: 0.45; }

/* Welcome box: rounded frame, version in the top border, two columns split by a rule. */
.t-welcome {
    position: relative;
    display: grid;
    grid-template-columns: 26ch minmax(0, 1fr);
    column-gap: 1ch;
    padding: var(--t-row) 1ch;
}

.t-welcome::before,
.t-card::before {
    content: '';
    position: absolute;
    inset: 0.8em 0.5ch;
    border: 1px solid var(--t-frame, var(--t-dim));
    border-radius: 0.6em;
    pointer-events: none;
}

.t-welcome::after {
    content: '';
    position: absolute;
    top: var(--t-row);
    bottom: 0.8em;
    left: 27.5ch;
    border-left: 1px solid var(--t-dim);
}

.t-welcome__title {
    position: absolute;
    top: 0;
    left: 4ch;
    padding: 0 1ch;
    background: var(--t-bg);
    color: var(--t-muted);
}

.t-welcome__left { padding-top: var(--t-row); text-align: center; }

.puqqy--term {
    width: auto;
    height: calc(var(--t-row) * 5);
    margin: var(--t-row) auto;
}

.t-welcome__right { padding-bottom: var(--t-row); color: var(--t-muted); }
.t-welcome__right p { padding-left: 1ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-welcome i { color: var(--t-dim); }
.t-welcome .t-h { font-weight: 600; color: var(--t-accent); }

.t-welcome hr {
    height: var(--t-row);
    margin: 0 1ch;
    border: 0;
    background: linear-gradient(var(--t-dim), var(--t-dim)) center / 100% 1px no-repeat;
}

.t-tip { padding-left: 1ch; color: var(--t-muted); }
.t-tip b { font-weight: 400; color: var(--t-gold); }

/* Transcript. Every block is separated by one blank row. */
.t-block { margin-top: var(--t-row); }
.t-row { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.t-user { padding: var(--t-row) 1ch; background: var(--t-card); }
.t-inline { padding-left: 1ch; }
.t-answer { padding: 0 1ch; }
.t-think { padding: 0 1ch; color: var(--t-muted); }

/* Tool card: ╭─── title ───╮ … ├─── label ───┤ … ╰───╯. --t-fill is the card ground; LSP cards have none. */
.t-card {
    position: relative;
    padding: 0 2ch var(--t-row);
    background: var(--t-fill, var(--t-card));
}

.t-card--quiet { --t-frame: #1f252d; }
.t-card--live { --t-frame: var(--t-accent); }
.t-card--bare { --t-fill: var(--t-bg); }

/* Edit diffs start at the frame: the gutter (│  -5│) sits against the border. */
.t-card--flush { padding-left: 1ch; }
.t-card--flush .t-card__title { margin-left: -1ch; }

.t-card__title {
    position: relative;
    height: var(--t-row);
    margin: 0 -2ch;
    padding-left: 4ch;
    white-space: nowrap;
    overflow: hidden;
}

.t-card__rule {
    position: relative;
    height: var(--t-row);
    margin: 0 -1.5ch;
    padding-left: 3.5ch;
}

.t-card__rule::before {
    content: '';
    position: absolute;
    inset: 0.8em 0 auto;
    border-top: 1px solid var(--t-frame, var(--t-dim));
}

.t-card__title > span,
.t-card__rule > span {
    position: relative;
    padding: 0 1ch;
    background: var(--t-fill, var(--t-card));
}

.t-card__title > span:empty,
.t-card__rule > span:empty { display: none; }

/*
 * Composer, cell for cell from a captured default-config session (titanium theme, unicode symbols):
 *   "  ⎋ Working…                              Session Title"
 *   " puq > ◒ Opus 5.5 > 📁 ~/atlas > S0.00 > ⑂ main ▶─1%──────────╎─┃────1M─"
 *   "╰─ "
 * The pill's spaces are literal (white-space: pre), so every gap is one cell like the TUI's.
 */
.pc-term__composer { padding: 4px 14px 14px; }

.t-status {
    display: flex;
    justify-content: space-between;
    gap: 2ch;
    height: var(--t-row);
    padding-left: 2ch;
    white-space: pre;
    overflow: hidden;
}

/* The label is dim; code.js sweeps a work-hued window across it, bold at the core. */
.t-status__act { color: var(--t-dim); }
.t-status__act:not(:empty)::before { content: '⎋ '; color: var(--t-work-icon); }
.t-status__act .is-warm { color: var(--t-work); }
.t-status__act .is-hot { font-weight: 700; color: var(--t-work); }
.t-status__title { overflow: hidden; text-overflow: ellipsis; font-style: italic; }

.t-band {
    display: flex;
    height: var(--t-row);
    white-space: pre;
}

.t-band__pill {
    flex: none;
    background: var(--t-card);
}

.t-band__pill i { color: var(--t-line); }
.t-band__lead { color: var(--t-dim); }
.t-model { color: var(--t-accent); }
.t-band__path { color: var(--t-text); }
.t-cost { color: var(--t-red); }
.t-git { color: var(--t-green); }
.t-git.is-dirty { color: var(--t-amber); }

.t-band__cap {
    flex: none;
    width: 1ch;
    color: var(--t-card);
}

.t-band__gauge {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--t-line);
}

.t-band__gauge b { font-weight: 400; color: var(--t-accent); }
.t-band__gauge em { font-style: normal; color: var(--t-mark); }

/* The run between the percentage and 1M; ╎ sits at 80% of it and ┃ at 85%, as the TUI places them. */
.t-band__track {
    position: relative;
    flex: 1;
    min-width: 4ch;
    overflow: hidden;
}

.t-band__track::before { content: '────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────'; }

.t-band__track > * {
    position: absolute;
    top: 0;
    width: 1ch;
    background: var(--t-bg);
}

.t-band__track i { left: 80%; color: var(--t-muted); }
.t-band__track em { left: 85%; }

.t-input { height: var(--t-row); overflow: hidden; white-space: pre; }
.t-input b { font-weight: 400; color: var(--t-accent); }

/* is-working: the lead turns into spinner + timer. has-level: the session has a resolved thinking level. */
.is-working .t-band__lead,
.has-level .t-model,
.has-level .t-band__gauge b,
.has-level .t-input b { color: var(--t-work); }
.has-level .t-band__gauge em { color: var(--t-work-mark); }

.t-cursor {
    display: inline-block;
    width: 1ch;
    height: 1.2em;
    vertical-align: -0.22em;
    background: var(--t-text);
    animation: pc-caret 1s steps(1) infinite;
}

/* ---------- Savings: the optimizer's bill. ---------- */

.pc-savings {
    position: relative;
    padding: clamp(110px, 12vw, 160px) 0 clamp(24px, 3vw, 40px);
}

/* Savings and plates use claude.dev's rail: the heading in the left third, the list on the right. */
.pc-savings .pc-wrap,
.pc-plates .pc-wrap {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
}

.pc-savings__head,
.pc-plates__head { grid-column: 1 / 5; padding-right: 40px; }

/* The heading spans both rows so the note sits right under the figures instead of below the heading. */
.pc-savings__head { grid-row: 1 / span 2; }
.pc-figures { grid-row: 1; }
.pc-savings__note { grid-row: 2; }

.pc-figures,
.pc-savings__note,
.pc-plates__grid { grid-column: 5 / 13; }

.pc-savings__lede {
    margin: 0;
    color: var(--ink-2);
}

.pc-figures {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.pc-figure {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 36px 20px 38px 0;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
    transition-delay: calc(var(--i, 0) * 260ms + 200ms);
}

.pc-figure + .pc-figure { padding-left: 24px; border-left: 1px solid var(--line); }

/* Cards land one after another; code.js counts each percentage up on the same beat. */
.js .pc-figures:not(.is-in) .pc-figure { opacity: 0; transform: translateY(12px); }

.pc-figure b {
    font: 400 clamp(44px, 4.6vw, 72px)/1 var(--mono);
    letter-spacing: -0.05em;
    color: var(--ink);
    white-space: nowrap;
}

.pc-figure--lead b { color: var(--accent); }

.pc-figure span {
    font: 400 13.5px/1.3 var(--mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.pc-figure small { font: 400 15.75px/1.5 var(--sans); color: var(--ink-2); }

.pc-savings__note {
    margin: 18px 0 0;
    font: 400 13.5px/1.6 var(--mono);
    color: var(--ink-3);
}

/* ---------- Plates: claude.dev post rows ---------- */

.pc-plates {
    position: relative;
    padding: clamp(96px, 11vw, 150px) 0;
}

.pc-plates__grid {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.pc-plate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    grid-template-areas: "num title" "num body" "num spec";
    align-items: start;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms + 100ms);
}

/* The list reveals once; rows land one after another, and code.js types each specimen on the same beat. */
.js .pc-plates__grid:not(.is-in) .pc-plate { opacity: 0; transform: translateY(12px); }

/* Hovering one row fades the others back, as claude.dev's post list does. */
.pc-plate > * { transition: opacity 0.4s var(--ease); }
@media (hover: hover) { .pc-plates__grid:hover .pc-plate:not(:hover) > * { opacity: 0.35; } }

.pc-plate__numeral {
    grid-area: num;
    font: 400 15.75px/1.7 var(--mono);
    color: var(--ink-3);
}

.pc-plate__numeral::before { content: '['; }
.pc-plate__numeral::after { content: ']'; }

.pc-plate__title {
    grid-area: title;
    margin: 0;
    font: 400 18px/1.5 var(--sans);
    color: var(--ink);
}

.pc-plate__body {
    grid-area: body;
    max-width: 40em;
    margin: 4px 0 0;
    font-size: 15.75px;
    line-height: 1.6;
    color: var(--ink-2);
}

.pc-plate__specimen {
    grid-area: spec;
    justify-self: start;
    margin-top: 10px;
    padding: 2px 8px;
    white-space: nowrap;
    border: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 13.5px !important;
}

/* The typing caret must not grow the line box, or the row height twitches while it types. */
.pc-plate__specimen .t-cursor {
    height: 1em;
    vertical-align: -0.15em;
    background: currentColor;
}

/* ---------- Portrait ---------- */

.pc-portrait { padding: clamp(96px, 12vw, 170px) 0; }

.pc-portrait__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(40px, 7vw, 120px);
}

/* Positioned above the label: portraitPlay lets puqqy roam the whole section, over the text too. */
.pc-portrait__frame {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: clamp(22px, 3.4vw, 46px);
}

.pc-portrait__canvas {
    position: relative;
    aspect-ratio: 1;
    background: transparent;
}

.puqqy--portrait { width: 100%; height: 100%; }
.pc-portrait__canvas .pc-zz { top: 4%; right: 6%; font-size: 44px; }

.pc-portrait__label > p:not(.pc-label):not(.pc-portrait__medium) { max-width: 30em; color: var(--ink-2); }

.pc-portrait__medium {
    margin: -8px 0 22px;
    font: 400 18px/1.4 var(--sans);
    color: var(--ink-2);
}

.pc-moods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}

.pc-mood {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 92px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

@media (hover: hover) { .pc-mood:hover { border-color: var(--ink); } }
.pc-mood.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* Each button wears puqqy in that mood, at 2px per cell. */
.pc-mood__face { display: block; line-height: 0; }
.puqqy--mood { width: 42px; height: 42px; shape-rendering: crispEdges; }
.puqqy--mood .puqqy__shadow { display: none; }
.pc-mood__name { font: 400 11.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }

/* ---------- Begin ---------- */

.pc-begin {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    background: var(--bg);
    border-top: 1px solid var(--line);
}

.pc-begin__inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 140px;
    padding-bottom: 120px;
    text-align: center;
}

.pc-begin__inner .pc-label { justify-content: center; }

.pc-begin__title {
    margin: 0 0 64px;
    font: 400 clamp(76px, 13vw, 200px)/0.9 var(--mono);
    letter-spacing: -0.05em;
}

.pc-begin__title em { font-style: normal; }

.pc-begin__title .pc-char { animation: pc-char 1ms steps(1) both; animation-delay: calc(var(--c, 0) * 70ms + 200ms); }
.js .pc-begin__inner:not(.is-in) .pc-char { animation-play-state: paused; }

.pc-install--center { width: min(100%, 880px); }
.pc-install--center .pc-install__cmd { padding: 18px 20px; text-align: left; }

/* Sits on the install box and cheers when the command is copied. */
.puqqy--mini {
    position: absolute;
    right: 22px;
    bottom: calc(100% - 3px);
    width: 56px;
    height: auto;
}

.pc-begin__from {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 18px;
    margin-top: 28px;
}

.pc-begin__from p { margin: 0; font-size: 15.75px; color: var(--ink-2); }

.pc-begin__from ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pc-begin__from code {
    display: block;
    padding: 7px 12px;
    border: 1px solid var(--line);
    background: var(--raised);
    font: 400 13px/1.2 var(--mono);
    color: var(--ink);
    white-space: nowrap;
}

.pc-begin__from code span { color: var(--accent); }

/* claude.dev's footer: the wordmark and keyed columns on the 12-column grid, then a base rule. It carries on
   Begin's night sky (sky-field.js) with no rule between them, so the two read as one picture. */
.pc-foot {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    row-gap: 72px;
    padding: 64px max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter))) calc(28px + env(safe-area-inset-bottom));
    background: var(--bg);
}

.pc-foot__brand { grid-column: 1 / 6; padding-right: 32px; }

.pc-foot__mark { font: 400 22.5px/1.1 var(--mono); letter-spacing: -0.02em; text-decoration: none; }
.pc-foot__mark i { font-style: normal; color: var(--accent); }

.pc-foot__note {
    margin: 20px 0 0;
    max-width: 26em;
    color: var(--ink-2);
    line-height: 1.6;
}

.pc-foot__col { grid-column: span 3; }
.pc-foot__col:nth-of-type(1) { grid-column: 7 / 10; }

.pc-foot__col h2 {
    margin: 0 0 18px;
    font: 400 13.5px/1.5 var(--mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.pc-foot__col ul {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pc-foot a { text-decoration: none; transition: color 0.2s ease; }
@media (hover: hover) {
    .pc-foot__col a:hover,
    .pc-foot__top:hover { color: var(--accent); }
}

.pc-foot__base {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font: 400 12px/1.4 var(--mono);
    letter-spacing: 0.02em;
    color: var(--ink-3);
}

.pc-foot__base small { font: inherit; }
.pc-foot__top { color: var(--ink-3); }

.puq-brand { text-transform: none; }

/* ---------- Motion ---------- */

/* Short, staggered and blur-free, like claude.dev's .stag reveals. */
.pc-rise { animation: pc-rise 0.5s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms + 90ms); }

.js .pc-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
}

.js .pc-reveal.is-in { opacity: 1; transform: none; }
.js .pc-term.pc-reveal.is-in { transform: none; }

@keyframes pc-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes pc-char {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pc-ping {
    0% { box-shadow: 0 0 0 0 rgba(76, 141, 255, 0.6); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(76, 141, 255, 0); }
}

@keyframes pc-bounce {
    0% { transform: none; }
    16% { transform: scale(1.1, 0.86); }
    42% { transform: translateY(-2.6px) scale(0.93, 1.09); }
    64% { transform: none; }
    78% { transform: scale(1.07, 0.92); }
    100% { transform: none; }
}

@keyframes pc-bounce-shadow {
    16% { transform: scaleX(1.08); }
    42% { transform: scaleX(0.66); opacity: 0.55; }
    78% { transform: scaleX(1.05); }
}

@keyframes pc-dust {
    to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

@keyframes pc-zz {
    0% { opacity: 0; transform: translate(0, 10px); }
    30%, 70% { opacity: 1; }
    100% { opacity: 0; transform: translate(12px, -18px); }
}

@keyframes pc-marquee { to { transform: translateX(-50%); } }
@keyframes pc-caret { 50% { opacity: 0; } }

/* ---------- Responsive ---------- */



@media (max-width: 991px) {
    .pc-session__grid,
    .pc-portrait__grid { grid-template-columns: minmax(0, 1fr); }
    .pc-savings__head,
    .pc-plates__head,
    .pc-figures,
    .pc-savings__note,
    .pc-plates__grid { grid-column: 1 / -1; grid-row: auto; }
    .pc-savings__head,
    .pc-plates__head { padding-right: 0; margin-bottom: 32px; }
    .pc-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-figure:nth-child(odd) { padding-left: 0; border-left: 0; }
    .pc-figure:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .pc-foot__brand { grid-column: 1 / 7; }
    .pc-foot__col:nth-of-type(1) { grid-column: 7 / 10; }
    .pc-foot__col { grid-column: span 3; }
}

@media (max-width: 760px) {
    .pc-nav { display: flex; justify-content: space-between; padding-top: 14px; }
    .pc-nav__keys { display: none; }
}

@media (max-width: 640px) {
    .pc-plate { grid-template-columns: minmax(0, 1fr); grid-template-areas: "num" "title" "body" "spec"; }
    .pc-figures { grid-template-columns: minmax(0, 1fr); }
    .pc-figure,
    .pc-figure + .pc-figure { padding: 20px 0; border-left: 0; }
    .pc-figure + .pc-figure { border-top: 1px solid var(--line); }
    .pc-foot { row-gap: 48px; padding-top: 48px; }
    .pc-foot__brand { grid-column: 1 / -1; }
    .pc-foot__col:nth-of-type(1),
    .pc-foot__col { grid-column: span 6; }
    .pc-begin__from { flex-direction: column; }
    .pc-term__screen { height: 420px; padding: 10px 10px 8px; }
    .pc-term__screen,
    .pc-term__composer { font-size: 11px; }
    .pc-term { transform: none; }
    .pc-term__composer { padding: 4px 10px 12px; }

    /* The desktop clamps bottom out at different minimums (80 to 140px); one rhythm on phones. */
    .pc-manifesto,
    .pc-session,
    .pc-plates,
    .pc-portrait { padding-block: 88px; }
    .pc-savings { padding-top: 88px; }
    .pc-begin__inner { padding-block: 88px 96px; }
    /* 76px "Begin." plus the caret wraps under 360px. */
    .pc-begin__title { margin-bottom: 48px; font-size: min(76px, 22vw); }

    /* Equal columns instead of a ragged right edge. */
    .pc-moods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pc-mood { min-width: 0; }
}

/* "Announcement N° 01" and "Now available" run past the gutter at 320px. */
@media (max-width: 400px) {
}

/* 44px touch targets; negative margins keep the footer's visual rhythm. */
@media (pointer: coarse) {
    .pc-nav__links .pc-nav__cta { padding-block: 14px; }
    .pc-foot__col a,
    .pc-foot__top { display: inline-block; padding-block: 11px; margin-block: -11px; }
}

/* Too narrow for the second column: the TUI drops it the same way. */
@media (max-width: 520px) {
    .t-welcome { grid-template-columns: minmax(0, 1fr); }
    .t-welcome::after,
    .t-welcome__right,
    .t-band__path { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html,
    .pc-term__screen { scroll-behavior: auto; }

    .pc *,
    .pc *::before,
    .pc *::after {
        animation: none !important;
        transition: none !important;
    }

    .js .pc-reveal,
    .js .pc-figures:not(.is-in) .pc-figure,
    .js .pc-plates__grid:not(.is-in) .pc-plate { opacity: 1; transform: none; }
    .puqqy.is-sleep + .pc-zz { opacity: 1; }
}
