/* =====================================================================
   CYPHIA SOLUTIONS LLC — /why
   "SPECIMEN PLATE" — a presentation instrument, not a brochure.

   The aesthetic argument: two voices in tension on every slide.
   · A high-contrast old-style serif (Cormorant) = the human, the counsellor.
   · A technical monospace (IBM Plex Mono) = the machine, the instrument.
   Everything else — registration marks, hairlines, tick rails, grain —
   is drafting-table apparatus. Minimal, but measured to the pixel.

   The stage is a FIXED 1600x900 canvas scaled by JS. What you author is
   exactly what projects, and exactly what prints.

   TONE: each slide paints its own ground (.slide is ink, .slide.paper is
   cream) so that print — which renders all 15 at once — stays correct.
   The viewport/rails follow the live slide via .is-paper on .viewport.
   ===================================================================== */

/* ---------- tokens ---------- */
:root {
    /* ink family — slightly blue-black, colder than the marketing site */
    --ink:        #08080b;
    --ink-2:      #101015;

    /* paper family — for the tone-break slides */
    --paper:      #f2efe8;
    --paper-2:    #e6e2d7;

    /* champagne gold — carried over from cyphiasoft.com, unchanged */
    --gold:       #c9a962;
    --gold-lt:    #e2cd96;
    --gold-dk:    #8a7340;

    /* ink-ground text */
    --chalk:      #eae7df;
    --smoke:      #a39f95;
    --ash:        #6d6a62;
    --slate:      #46443e;

    /* paper-ground text */
    --p-ink:      #17150f;
    --p-body:     #55504a;
    --p-mute:     #837c70;
    --p-ghost:    #a49c8d;

    /* hairlines */
    --wire:       rgba(201, 169, 98, 0.26);
    --wire-soft:  rgba(233, 230, 222, 0.13);
    --wire-ink:   rgba(23, 21, 15, 0.16);

    /* type */
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* canvas geometry (design units == px on the 1600x900 plate) */
    --pad-x: 104px;

    --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
    --ease-sharp: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: #050508; overflow: hidden; }

body {
    font-family: var(--sans);
    color: var(--chalk);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    cursor: default;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; }

/* =====================================================================
   VIEWPORT · the scaled plate
   ===================================================================== */

.viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: radial-gradient(ellipse 120% 100% at 50% 50%, #0c0c11 0%, #050508 100%);
    transition: background 0.7s var(--ease);
}

.viewport.is-paper {
    background: radial-gradient(ellipse 120% 100% at 50% 50%, #eeebe2 0%, #dcd7c9 100%);
}

/* The plate is a FIXED 1600x900 layout box that is almost always larger than
   the window, so it must NOT be centred by flex/grid alignment: centring an
   overflowing item is the one case browsers legitimately disagree on, and a
   browser that clamps it to the start edge puts the scaled plate completely
   off-screen on a phone. Negative margins centre the box arithmetically —
   no alignment involved — and the scale then happens about its own centre. */
.plate {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1600px;
    height: 900px;
    margin: -450px 0 0 -800px;
    transform-origin: center center;
    transform: scale(var(--k, 1));
    background: var(--ink);
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 40px 140px -30px rgba(0, 0, 0, 0.85);
    transition: background 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.viewport.is-paper .plate {
    background: var(--paper);
    box-shadow: 0 40px 140px -40px rgba(60, 52, 30, 0.4);
}

/* ---------- atmosphere: hairline grid, masked to the edges ---------- */
.plate-grid {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-image:
        linear-gradient(90deg, var(--wire-soft) 1px, transparent 1px),
        linear-gradient(0deg,  var(--wire-soft) 1px, transparent 1px);
    background-size: 80px 80px;
    -webkit-mask-image: radial-gradient(ellipse 76% 72% at 50% 50%, transparent 40%, #000 100%);
    mask-image: radial-gradient(ellipse 76% 72% at 50% 50%, transparent 40%, #000 100%);
    transition: opacity 0.7s var(--ease);
}

.viewport.is-paper .plate-grid {
    background-image:
        linear-gradient(90deg, rgba(23, 21, 15, 0.07) 1px, transparent 1px),
        linear-gradient(0deg,  rgba(23, 21, 15, 0.07) 1px, transparent 1px);
}

/* ---------- atmosphere: film grain ----------
   Static by choice. This layer is blended (mix-blend-mode inside the plate's
   isolation context), so the compositor holds an off-screen buffer for it and
   re-rasterizes on every scale change — including pinch-zoom. It used to be
   inset:-50% (200%x200%, 4x the area) and animated; at DPR 3 pinched to 3x
   that buffer hit ~350MB and iOS killed the WebContent process. It is now
   plate-sized and painted once, and dropped entirely on touch devices. */
.plate-grain {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* =====================================================================
   REGISTRATION MARKS — four corner brackets
   ===================================================================== */

.regmarks { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

.regmark { position: absolute; width: 26px; height: 26px; }

.regmark::before,
.regmark::after {
    content: '';
    position: absolute;
    background: var(--gold);
    opacity: 0.4;
}

.regmark::before { width: 26px; height: 1px; }
.regmark::after  { width: 1px;  height: 26px; }

.regmark.tl { top: 38px;    left: 38px; }
.regmark.tr { top: 38px;    right: 38px; }
.regmark.bl { bottom: 38px; left: 38px; }
.regmark.br { bottom: 38px; right: 38px; }

.regmark.tl::before, .regmark.tl::after { top: 0;    left: 0; }
.regmark.tr::before, .regmark.tr::after { top: 0;    right: 0; }
.regmark.bl::before, .regmark.bl::after { bottom: 0; left: 0; }
.regmark.br::before, .regmark.br::after { bottom: 0; right: 0; }

/* =====================================================================
   RAILS
   ===================================================================== */

.rail {
    position: absolute;
    left: var(--pad-x);
    right: var(--pad-x);
    z-index: 4;
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ash);
}

.viewport.is-paper .rail { color: var(--p-mute); }

.rail-top    { top: 46px;    justify-content: space-between; }
.rail-bottom { bottom: 46px; justify-content: space-between; }

.rail-top::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -14px;
    height: 1px;
    background: linear-gradient(90deg, var(--wire), rgba(201, 169, 98, 0.05) 55%, transparent);
}

.rail a:hover { color: var(--gold); }

.rail-mark { color: var(--smoke); letter-spacing: 0.3em; }
.viewport.is-paper .rail-mark { color: var(--p-mute); }

.rail-section {
    color: var(--gold);
    letter-spacing: 0.34em;
    transition: opacity 0.3s var(--ease);
}
.rail-section.swap { opacity: 0; }
.viewport.is-paper .rail-section { color: var(--gold-dk); }

.rail-right { display: flex; align-items: center; gap: 20px; }

.rail-alt {
    color: var(--ash);
    letter-spacing: 0.2em;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.rail-alt:hover { color: var(--gold); border-bottom-color: var(--gold); }
.viewport.is-paper .rail-alt { color: var(--p-mute); }
.viewport.is-paper .rail-alt:hover { color: var(--gold-dk); border-bottom-color: var(--gold-dk); }

.counter { font-variant-numeric: tabular-nums; letter-spacing: 0.18em; }
.counter b { font-weight: 500; color: var(--chalk); }
.counter i { font-style: normal; opacity: 0.35; margin: 0 4px; }
.viewport.is-paper .counter b { color: var(--p-ink); }

/* ---------- left spine ---------- */
.spine {
    position: absolute;
    left: 50px;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    pointer-events: none;
}

.spine-rule {
    width: 1px;
    height: 128px;
    background: linear-gradient(180deg, transparent, var(--wire), transparent);
}

.spine-num {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.42em;
    color: var(--gold);
    opacity: 0.6;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-variant-numeric: tabular-nums;
}

/* ---------- tick progress rail ---------- */
.ticks { display: flex; align-items: center; gap: 7px; }

.tick {
    width: 12px;
    height: 2px;
    background: rgba(233, 230, 222, 0.2);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: width 0.45s var(--ease), background 0.35s var(--ease);
}

.viewport.is-paper .tick { background: rgba(23, 21, 15, 0.18); }

.tick:hover { background: var(--gold-lt); }
.tick.seen  { background: rgba(201, 169, 98, 0.5); }

.tick.now {
    width: 34px;
    background: var(--gold);
    box-shadow: 0 0 14px rgba(201, 169, 98, 0.55);
}

.viewport.is-paper .tick.now { background: var(--gold-dk); box-shadow: none; }

.hint { display: flex; align-items: center; gap: 12px; }

/* ---------- fullscreen toggle ----------
   The glyph is four corner brackets pointing out — the same figure as the
   plate's registration marks, so the control reads as part of the apparatus. */
.fsbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--smoke);
    background: none;
    border: 1px solid var(--wire);
    padding: 4px 9px 4px 7px;
    margin-right: 4px;
    cursor: pointer;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.fsbtn:hover { color: var(--gold); border-color: var(--gold); }

.viewport.is-paper .fsbtn { color: var(--p-mute); border-color: var(--wire-ink); }
.viewport.is-paper .fsbtn:hover { color: var(--gold-dk); border-color: var(--gold-dk); }

.fsbtn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* icon + label each ship an "enter" and an "exit" variant; the class swaps
   which pair is shown, so the label stays translatable per deck */
.fsbtn .fs-in { display: none; }
.fsbtn.is-on .fs-in  { display: inline; }
.fsbtn.is-on .fs-out { display: none; }

.hint kbd {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 3px 7px;
    border: 1px solid var(--wire);
    color: var(--smoke);
}

.viewport.is-paper .hint kbd { border-color: var(--wire-ink); color: var(--p-mute); }

/* =====================================================================
   SLIDES
   ===================================================================== */

.stage { position: absolute; inset: 0; z-index: 2; }

.slide {
    position: absolute;
    inset: 0;
    padding: 130px var(--pad-x) 124px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* the gold bloom is a background layer, not a pseudo-element, so it
       survives regardless of whether .slide forms a stacking context */
    background:
        radial-gradient(ellipse 52% 46% at 80% 94%, rgba(201, 169, 98, 0.10), transparent 66%),
        radial-gradient(ellipse 40% 34% at 6% 2%,  rgba(201, 169, 98, 0.05), transparent 70%),
        var(--ink);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(var(--enter, 26px));
    transition: opacity 0.42s var(--ease), transform 0.55s var(--ease), visibility 0s linear 0.55s;
}

.slide.paper {
    background:
        radial-gradient(ellipse 52% 46% at 80% 94%, rgba(138, 115, 64, 0.10), transparent 66%),
        radial-gradient(ellipse 40% 34% at 6% 2%,  rgba(138, 115, 64, 0.05), transparent 70%),
        var(--paper);
}

.slide.is-live {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s;
}

/* An outgoing slide must NOT play its choreography in reverse — snap every
   animated child back to its start state instantly while it is hidden, so
   re-entering the slide replays the reveal cleanly. */
.slide:not(.is-live) [data-r],
.slide:not(.is-live) .w,
.slide:not(.is-live) .rule,
.slide:not(.is-live) .struck li::after {
    transition-duration: 0s;
    transition-delay: 0s;
}

/* ---------- slide head: tag + drawn hairline ---------- */
.tagline { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }
.tagline.bare { margin-bottom: 0; }

.tag {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}

.paper .tag { color: var(--gold-dk); }

.caret {
    display: inline-block;
    width: 7px;
    height: 12px;
    margin-left: 8px;
    background: var(--gold);
    vertical-align: -1px;
    animation: blink 1.15s steps(1) infinite;
}

.paper .caret { background: var(--gold-dk); }

@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

.rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--wire) 0%, rgba(201, 169, 98, 0.06) 70%, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.9s var(--ease);
    transition-delay: var(--d, 0ms);
}

.paper .rule {
    background: linear-gradient(90deg, rgba(138, 115, 64, 0.4) 0%, rgba(138, 115, 64, 0.08) 70%, transparent);
}

.slide.is-live .rule { transform: scaleX(1); }

/* =====================================================================
   TYPOGRAPHY — the two voices
   ===================================================================== */

.display {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 88px;
    line-height: 1.055;
    letter-spacing: -0.012em;
    color: #fff;
    max-width: 1240px;
}

.paper .display { color: var(--p-ink); }

.display em { color: var(--gold); font-style: italic; }
.paper .display em { color: var(--gold-dk); }

.display.xl { font-size: 104px; }
.display.sm { font-size: 66px; }
.display.xs { font-size: 50px; }

.lede {
    font-weight: 300;
    font-size: 25px;
    line-height: 1.62;
    color: var(--smoke);
    max-width: 900px;
}

.paper .lede { color: var(--p-body); }

.lede strong { font-weight: 500; color: var(--chalk); }
.paper .lede strong { color: var(--p-ink); }

.body {
    font-weight: 300;
    font-size: 21px;
    line-height: 1.75;
    color: var(--smoke);
    max-width: 780px;
}

.paper .body { color: var(--p-body); }

.body strong { font-weight: 500; color: var(--chalk); }
.paper .body strong { color: var(--p-ink); }

.micro {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    line-height: 1.9;
    color: var(--ash);
}

.paper .micro { color: var(--p-mute); }

.micro b { color: var(--gold); font-weight: 500; }
.paper .micro b { color: var(--gold-dk); }

.pull {
    font-family: var(--serif);
    font-weight: 500;
    font-style: italic;
    font-size: 38px;
    line-height: 1.36;
    color: var(--gold);
    max-width: 1180px;
    padding-left: 26px;
    border-left: 1px solid var(--gold);
}

.paper .pull { color: var(--gold-dk); border-left-color: var(--gold-dk); }

.mt-s  { margin-top: 20px; }
.mt-m  { margin-top: 34px; }
.mt-l  { margin-top: 50px; }
.mt-xl { margin-top: 68px; }

/* =====================================================================
   REVEAL CHOREOGRAPHY
   ===================================================================== */

[data-r] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
    transition-delay: var(--d, 0ms);
}

.slide.is-live [data-r] { opacity: 1; transform: none; }

/* word-by-word for the display voice — the host stays visible, words fly */
[data-words] { opacity: 1 !important; transform: none !important; }

.w {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.34em) rotate(0.4deg);
    transition: opacity 0.52s var(--ease), transform 0.66s var(--ease);
    transition-delay: var(--d, 0ms);
}

.slide.is-live .w { opacity: 1; transform: none; }

/* =====================================================================
   COMPONENTS
   ===================================================================== */

/* ---------- struck lines (the wrong pictures) ---------- */
.struck { display: flex; flex-direction: column; gap: 14px; }

.struck li {
    position: relative;
    align-self: flex-start;
    font-family: var(--serif);
    font-size: 44px;
    font-style: italic;
    line-height: 1.3;
    color: var(--slate);
    padding-right: 6px;
}

.paper .struck li { color: var(--p-ghost); }

.struck li::after {
    content: '';
    position: absolute;
    left: 0; top: 53%;
    width: 100%;
    height: 1.5px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.72s var(--ease-sharp);
    transition-delay: var(--ds, 700ms);
}

.paper .struck li::after { background: var(--gold-dk); }

.slide.is-live .struck li::after { transform: scaleX(1); }

/* ---------- two-column argument ---------- */
.cols { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 46px; align-items: start; }

.cols .divider {
    align-self: stretch;
    background: linear-gradient(180deg, transparent, var(--wire) 18%, var(--wire) 82%, transparent);
}

.col-head {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ash);
    margin-bottom: 16px;
}

.paper .col-head { color: var(--p-mute); }

.col-claim {
    font-family: var(--serif);
    font-size: 34px;
    font-style: italic;
    line-height: 1.32;
    color: var(--chalk);
    margin-bottom: 20px;
}

.paper .col-claim { color: var(--p-ink); }

.col-reply { font-weight: 300; font-size: 19px; line-height: 1.72; color: var(--smoke); }
.paper .col-reply { color: var(--p-body); }

.col-reply::before {
    content: '↳';
    display: inline-block;
    margin-right: 10px;
    color: var(--gold);
    font-family: var(--mono);
}

.paper .col-reply::before { color: var(--gold-dk); }

/* ---------- numbered ledger ---------- */
.ledger { border-top: 1px solid var(--wire-soft); }
.paper .ledger { border-top-color: var(--wire-ink); }

.ledger li {
    display: grid;
    grid-template-columns: 62px 1fr;
    align-items: baseline;
    gap: 24px;
    padding: 14px 10px 14px 4px;
    border-bottom: 1px solid var(--wire-soft);
    transition: background 0.35s var(--ease), padding-left 0.35s var(--ease);
}

.paper .ledger li { border-bottom-color: var(--wire-ink); }

.ledger li:hover { background: rgba(201, 169, 98, 0.05); padding-left: 14px; }

.ledger .n {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--gold);
    opacity: 0.72;
    font-variant-numeric: tabular-nums;
}

.paper .ledger .n { color: var(--gold-dk); }

.ledger .t { font-weight: 300; font-size: 22px; line-height: 1.5; color: var(--chalk); }
.paper .ledger .t { color: #2b2820; }

.ledger .t em { color: var(--gold); font-style: italic; }
.paper .ledger .t em { color: var(--gold-dk); }

/* ---------- fault table (the six complaints) ----------
   A per-cell left rule, lit gold on hover — reads as a diagnostic readout
   rather than a bullet list, keeping it distinct from .ledger and .shifts. */
.faults { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 54px; }

.fault {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-left: 20px;
    border-left: 1px solid var(--wire-soft);
    transition: border-color 0.35s var(--ease);
}

.paper .fault { border-left-color: var(--wire-ink); }

.fault:hover { border-left-color: var(--gold); }
.paper .fault:hover { border-left-color: var(--gold-dk); }

.fault .code {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ash);
}

.paper .fault .code { color: var(--p-mute); }

.fault .code b { color: var(--gold); font-weight: 500; margin-right: 11px; }
.paper .fault .code b { color: var(--gold-dk); }

.fault .said {
    font-family: var(--serif);
    font-style: italic;
    font-size: 21px;
    line-height: 1.32;
    color: var(--chalk);
}

.paper .fault .said { color: var(--p-ink); }

.fault .dx { font-weight: 300; font-size: 14.5px; line-height: 1.6; color: var(--smoke); }
.paper .fault .dx { color: var(--p-body); }

/* ---------- three-card grid ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--wire-soft);
    border: 1px solid var(--wire-soft);
}

.paper .cards { background: var(--wire-ink); border-color: var(--wire-ink); }

.card { background: var(--ink); padding: 36px 32px 40px; transition: background 0.5s var(--ease); }
.paper .card { background: var(--paper); }

.card:hover { background: var(--ink-2); }
.paper .card:hover { background: var(--paper-2); }

.card .n {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--gold);
    margin-bottom: 22px;
}

.paper .card .n { color: var(--gold-dk); }

.card h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 34px;
    line-height: 1.16;
    color: #fff;
    margin-bottom: 16px;
}

.paper .card h3 { color: var(--p-ink); }

.card p { font-weight: 300; font-size: 17px; line-height: 1.72; color: var(--smoke); }
.paper .card p { color: var(--p-body); }

/* ---------- the arithmetic ---------- */
.sum { display: flex; align-items: flex-end; gap: 30px; flex-wrap: wrap; }

.term { display: flex; flex-direction: column; gap: 8px; }

.term .k {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ash);
}

.term .v {
    font-family: var(--serif);
    font-size: 76px;
    font-weight: 500;
    line-height: 0.94;
    color: var(--chalk);
    font-variant-numeric: tabular-nums;
}

.op { font-family: var(--serif); font-size: 44px; color: var(--gold); opacity: 0.5; padding-bottom: 12px; }

.total { margin-left: 6px; }
.total .v { font-size: 116px; color: var(--gold); letter-spacing: -0.02em; }
.total .k { color: var(--gold-dk); }

/* ---------- transform ledger ---------- */
.shifts { border-top: 1px solid var(--wire-ink); max-width: 1260px; }

.shifts li {
    display: grid;
    grid-template-columns: 1fr 92px 1.35fr;
    align-items: center;
    gap: 24px;
    padding: 13px 6px;
    border-bottom: 1px solid var(--wire-ink);
    transition: background 0.35s var(--ease);
}

.shifts li:hover { background: rgba(138, 115, 64, 0.07); }

.shifts .from { font-weight: 300; font-size: 20px; color: var(--p-ghost); text-align: right; }

.shifts .arrow { position: relative; height: 1px; background: var(--gold-dk); opacity: 0.7; }

.shifts .arrow::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    width: 7px; height: 7px;
    border-top: 1px solid var(--gold-dk);
    border-right: 1px solid var(--gold-dk);
    transform: translateY(-50%) rotate(45deg);
}

.shifts .to { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.24; color: var(--p-ink); }

/* ---------- case study plate ---------- */
.case {
    border: 1px solid var(--wire);
    border-left: 2px solid var(--gold);
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.05), transparent 46%);
    padding: 38px 44px 42px;
    position: relative;
    overflow: hidden;
}

.case::after {
    content: '';
    position: absolute;
    right: -110px; bottom: -110px;
    width: 300px; height: 300px;
    border: 1px solid rgba(201, 169, 98, 0.16);
    border-radius: 50%;
    pointer-events: none;
}

.case-ask { font-family: var(--serif); font-style: italic; font-size: 34px; color: var(--slate); margin-bottom: 6px; }

.case-do { font-family: var(--serif); font-size: 33px; line-height: 1.34; color: #fff; max-width: 1080px; }
.case-do em { color: var(--gold); font-style: italic; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }

.chip {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--smoke);
    border: 1px solid var(--wire-soft);
    padding: 7px 12px;
    transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.chip:hover { border-color: var(--gold); color: var(--gold-lt); }

/* ---------- the work: four systems ---------- */
.work { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.sys {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding-top: 18px;
    border-top: 1px solid var(--wire);
    transition: border-color 0.35s var(--ease);
}

.sys:hover { border-top-color: var(--gold-lt); }

.sys h3 { font-family: var(--serif); font-weight: 500; font-size: 29px; line-height: 1.14; color: #fff; }

.sys .kind {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
}

.sys p { font-weight: 300; font-size: 15px; line-height: 1.68; color: var(--smoke); flex: 1; }

.sys .url {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--ash);
    border-bottom: 1px solid transparent;
    align-self: flex-start;
    padding-bottom: 2px;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.sys a.url:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- how I work ---------- */
.split { display: grid; grid-template-columns: 1fr 1.12fr; gap: 74px; align-items: start; }

.disc { display: flex; flex-direction: column; }

.disc li {
    padding: 13px 0;
    border-bottom: 1px solid var(--wire-soft);
    font-weight: 300;
    font-size: 19px;
    line-height: 1.5;
    color: var(--chalk);
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 14px;
}

.disc li:first-child { border-top: 1px solid var(--wire-soft); }

.disc li span {
    color: var(--gold);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    padding-top: 6px;
}

.seq { display: flex; flex-direction: column; gap: 20px; }

.step { display: grid; grid-template-columns: 44px 1fr; gap: 20px; align-items: baseline; }

.step .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--gold); opacity: 0.75; }

.step h4 { font-family: var(--serif); font-weight: 500; font-size: 29px; line-height: 1.2; color: #fff; margin-bottom: 3px; }

.step p { font-weight: 300; font-size: 16px; line-height: 1.64; color: var(--smoke); }

/* ---------- the ask ---------- */
.offer { display: grid; grid-template-columns: 1.3fr 1fr; gap: 70px; align-items: end; }

.contact { display: flex; flex-direction: column; border-left: 1px solid var(--wire); padding-left: 32px; }

.contact .k {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ash);
    margin-top: 20px;
    margin-bottom: 2px;
}

.contact .k:first-child { margin-top: 0; }

.contact .v { font-family: var(--serif); font-size: 31px; line-height: 1.28; color: var(--chalk); transition: color 0.3s var(--ease); }

a.v:hover { color: var(--gold); }

/* =====================================================================
   HELP OVERLAY
   ===================================================================== */

.help {
    position: absolute;
    inset: 0;
    z-index: 9;
    display: grid;
    place-items: center;
    background: rgba(5, 5, 8, 0.93);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}

.help.open { opacity: 1; visibility: visible; transition-delay: 0s; }

.help-inner { border: 1px solid var(--wire); padding: 46px 58px; background: var(--ink); }

.help h2 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 28px;
}

.help dl { display: grid; grid-template-columns: auto 1fr; gap: 13px 28px; align-items: center; }

.help dt {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--chalk);
    border: 1px solid var(--wire-soft);
    padding: 5px 11px;
    text-align: center;
    white-space: nowrap;
}

.help dd { font-weight: 300; font-size: 17px; color: var(--smoke); }

/* =====================================================================
   TOUCH DEVICES — drop the expensive compositing
   Pinch-zoom re-rasterizes every composited layer at the new scale. The
   blended grain and the blurred help backdrop are the two layers that
   need an off-screen buffer, and on a phone they are what pushes the
   renderer past the iOS memory ceiling and gets the tab killed.
   Neither is perceptible at the 0.24-0.43 scale a phone plate runs at,
   so they cost nothing to give up here.
   ===================================================================== */

@media (hover: none), (max-width: 1024px) {
    .plate-grain { display: none; }

    .help {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(5, 5, 8, 0.975);
    }
}

/* =====================================================================
   PORTRAIT PHONES
   The plate is 16:9. In portrait on a phone it scales to roughly a
   quarter, which puts body copy under 6px — technically visible,
   practically unreadable. Ask for landscape instead of pretending.
   ===================================================================== */

.rotate-nudge { display: none; }

@media (orientation: portrait) and (max-width: 820px) {
    .rotate-nudge {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: grid;
        place-items: center;
        padding: 10vw 8vw;
        text-align: center;
        background: radial-gradient(ellipse 120% 100% at 50% 45%, #0e0e14 0%, #050508 100%);
    }

    body.nudge-off .rotate-nudge { display: none; }
}

.rotate-icon {
    width: 92px;
    height: auto;
    margin: 0 auto 30px;
    display: block;
    color: var(--gold);
    opacity: 0.9;
}

.rotate-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 30px;
    line-height: 1.3;
    color: #fff;
    margin-bottom: 14px;
}

.rotate-sub {
    font-weight: 300;
    font-size: 15px;
    line-height: 1.75;
    color: var(--smoke);
    max-width: 30ch;
    margin: 0 auto 34px;
}

.rotate-skip {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ash);
    background: none;
    border: 1px solid var(--wire);
    padding: 11px 20px;
    cursor: pointer;
}

.rotate-skip:hover { color: var(--gold); border-color: var(--gold); }

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
    .caret { animation: none; }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* =====================================================================
   PRINT — one slide per landscape page, for PDF export
   ===================================================================== */

/* 297mm x 167mm is 16:9 at A4 width — at 96dpi that is 1122.5 x 631.3 CSS px,
   so the 1600x900 plate is reproduced at zoom 0.7015 with no letterboxing. */
@page { size: 297mm 167mm; margin: 0; }

@media print {
    html, body {
        overflow: visible;
        height: auto;
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .viewport { position: static; display: block; background: none; }

    /* undo the absolute centring — in print the plate is just a stack */
    .plate {
        position: static;
        top: auto;
        left: auto;
        margin: 0;
        transform: none !important;
        width: auto;
        height: auto;
        box-shadow: none;
        overflow: visible;
        background: none;
    }

    /* rails, marks and grid are plate-fixed; they cannot repeat per page */
    .plate-grain, .plate-grid, .regmarks, .rail, .spine, .help,
    .rotate-nudge { display: none !important; }

    .stage { position: static; }

    .slide {
        position: relative;
        inset: auto;
        width: 1600px;
        height: 900px;
        /* zoom (unlike transform) reduces LAYOUT size, so page breaks land right */
        zoom: 0.7015;
        padding: 92px var(--pad-x);
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        page-break-after: always;
        break-after: page;
        break-inside: avoid;
        overflow: hidden;
    }

    .slide:last-child { page-break-after: auto; break-after: auto; }

    [data-r], .w { opacity: 1 !important; transform: none !important; }
    .rule, .struck li::after { transform: scaleX(1) !important; }
    .caret { display: none !important; }

    /* a printed deck wants its slide number back, since the rails are gone */
    .slide::after {
        content: attr(data-sec) '  ·  ' attr(data-page);
        position: absolute;
        left: var(--pad-x);
        bottom: 46px;
        font-family: var(--mono);
        font-size: 11px;
        letter-spacing: 0.26em;
        text-transform: uppercase;
        color: var(--ash);
    }

    .slide.paper::after { color: var(--p-mute); }
}

/* =====================================================================
   NO-FULLSCREEN ENGINES (iPhone Safari)
   The Fullscreen API is absent on iPhone — only <video> can go
   fullscreen there. Rather than leave a dead button on the rail, hide
   it and swap the help panel over to the Add-to-Home-Screen route,
   which is the genuine chrome-free path on iOS.
   ===================================================================== */

.help .fs-alt { display: none; }

body.no-fs .fsbtn { display: none; }
body.no-fs .help .fs-only { display: none; }
body.no-fs .help .fs-alt { display: block; }
