@font-face {
    font-family: "Public Sans";
    src: url("fonts/public-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("fonts/public-sans-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("fonts/public-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("fonts/bricolage-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("fonts/bricolage-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Newsreader";
    src: url("fonts/newsreader-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Newsreader";
    src: url("fonts/newsreader-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Newsreader";
    src: url("fonts/newsreader-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Newsreader";
    src: url("fonts/newsreader-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #f2f4f6;
    --ink: #14181d;
    --muted: #3a4854;
    --line: #d3dae1;
    --code: #e4e9ee;
    --thumb: #b7c2cb;
    --frame: 72rem;
    --sans: "Public Sans", "Segoe UI", sans-serif;
    --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", serif;
    --display: "Bricolage Grotesque", "Public Sans", sans-serif;
    --aurora-1: #6d4dff;
    --aurora-2: #19d3f3;
    --aurora-3: #b6f23a;
    --aurora-4: #ff4fa3;
    --print-c: #19d3f3;
    --print-m: #ff4fa3;
    --print-c-rgb: 25 211 243;
    --print-m-rgb: 255 79 163;
    --shift: 0px;
    --energy: 0;
    --surge: 0;
    --dir: 1;
    --mx: 0;
    --my: 0;
    --tilt: 0;
    --hx: 0;
    --hy: 0;
    --title: clamp(3rem, 9vw, 8rem);
    --night: #0d1116;
    --night-line: rgba(242, 244, 246, 0.16);
    --arrive: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--thumb) var(--paper);
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Browser surfaces carry the design too. */
::selection { background: var(--ink); color: var(--paper); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: text-underline-offset 0.25s var(--arrive), text-decoration-color 0.25s;
}

a:hover { text-underline-offset: 0.28em; }

.skip {
    position: absolute;
    left: 1rem;
    top: 0;
    transform: translateY(-120%);
    background: var(--ink);
    color: var(--paper);
    padding: 0.5rem 0.8rem;
    z-index: 5;
}

.skip:focus { transform: none; }

.frame {
    width: min(var(--frame), calc(100% - 3rem));
    margin-inline: auto;
}

/* Bar */

.bar {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.bar .frame {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.85rem 0;
}

.mark {
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.mark:hover,
.mark:focus-visible { text-decoration: underline; }

.bar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    justify-content: flex-end;
    font-weight: 500;
}

/* Reading progress: a hairline of ink that crosses the bar as you read. */
.reading .bar::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 1px;
    width: 100%;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

@supports (animation-timeline: scroll()) {
    .reading .bar::after {
        animation: progress linear both;
        animation-timeline: scroll(root);
    }
}

@keyframes progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Hero: the chart behind the name */

.hero {
    position: relative;
    min-height: min(88vh, 60rem);
    display: grid;
    align-items: end;
    overflow: hidden;
    background: var(--night);
    color: var(--paper);
    isolation: isolate;
}

.hero .place { color: rgba(242, 244, 246, 0.68); }
.hero a { color: inherit; }
.hero .plate-stack { border-color: var(--night-line); background: #1a2029; }
.hero ::selection { background: var(--paper); color: var(--night); }

.hero-short { min-height: min(62vh, 40rem); }

.hero canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 1.6s ease-out;
    pointer-events: none;
    z-index: 0;
}

.hero.is-drawn canvas { opacity: 1; }

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    column-gap: 2rem;
    align-items: end;
    padding: 5rem 0 2.75rem;
    pointer-events: none;
}

/* The name and the portrait drift against the pointer. */
.hero .mast {
    transform: translate(calc(var(--hx) * 0.5rem), calc(var(--hy) * 0.3rem));
    will-change: transform;
}

.hero .portrait-plate {
    transform: translate(calc(var(--hx) * -1rem), calc(var(--hy) * -0.7rem));
    will-change: transform;
}

.hero-grid a,
.hero-grid img { pointer-events: auto; }

h1 {
    margin: 0 0 0 -0.04em;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(4rem, 12.5vw, 11rem);
    letter-spacing: -0.05em;
    line-height: 0.86;
    text-wrap: balance;
    text-shadow: 0 calc(var(--shift) * -1) 0 rgb(var(--print-c-rgb) / var(--energy)),
                 0 var(--shift) 0 rgb(var(--print-m-rgb) / var(--energy));
}

.line {
    max-width: 30rem;
    margin: 1.6rem 0 0;
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.1vw, 1.85rem);
    line-height: 1.3;
    text-wrap: balance;
}

.hero h1 { word-spacing: 100vw; }

.place {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.mast {
    width: fit-content;
    max-width: 100%;
}

.portrait-plate {
    margin: 0;
    justify-self: end;
}

.portrait-plate .plate-stack { width: 22rem; }

/* Arrival: one authored moment on the home page. */
.home h1,
.home .line,
.home .place,
.home .portrait-plate {
    animation: arrive 0.9s var(--arrive) both;
}

.home .line { animation-delay: 0.1s; }
.home .place { animation-delay: 0.18s; }
.home .portrait-plate { animation-delay: 0.22s; }

@keyframes arrive {
    from { opacity: 0; translate: 0 0.6rem; filter: blur(6px); }
    to { opacity: 1; translate: 0 0; filter: blur(0); }
}

/* Plates */

.plate { margin: 0; }

/* The stack: the photograph, then the focus layers clipped to the mask. */
.plate-stack {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--code);
    isolation: isolate;
}

.plate-move,
.plate-zoom {
    position: relative;
    display: block;
}

.plate-stack img.base {
    display: block;
    width: 100%;
    height: auto;
}

/* Slow zoom on every plate; the hovered plate zooms further and pans toward the pointer. */
.plate-zoom {
    transform: scale(1.04) translate(calc(var(--mx) * -1.2%), calc(var(--my) * -1.2%));
    transition: transform 1.1s var(--arrive);
    will-change: transform;
}

.plate:hover .plate-zoom,
.note-link.is-active .plate-zoom {
    transform: scale(1.1) translate(calc(var(--mx) * -2.5%), calc(var(--my) * -2.5%));
}

/* Posts: the plate drifts with the scroll and breathes. */
@supports (animation-timeline: view()) {
    .plate-head .plate-move {
        animation: parallax linear both;
        animation-timeline: view();
        animation-range: entry 0% exit 100%;
    }
}

@keyframes parallax {
    from { transform: translateY(-4%) scale(1.08); }
    to { transform: translateY(4%) scale(1.08); }
}

.plate-head .plate-zoom,
.portrait-plate .plate-zoom {
    animation: breathe 22s ease-in-out infinite alternate;
}

@keyframes breathe {
    from { transform: scale(1.04) translate(calc(var(--mx) * -1.2%), calc(var(--my) * -1.2%)); }
    to { transform: scale(1.1) translate(calc(var(--mx) * -1.2% + 1%), calc(var(--my) * -1.2% - 1%)); }
}

.focus .layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.focus .color,
.focus .print {
    -webkit-mask-image: var(--mask);
    mask-image: var(--mask);
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.focus .aurora {
    -webkit-mask-image: var(--mask);
    mask-image: var(--mask);
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.focus img.base {
    filter: grayscale(1) contrast(1.04);
    transition: filter 1.2s ease 0.25s;
}

.focus .color {
    background: var(--photo) center / cover no-repeat;
    filter: saturate(0.9);
    transition: filter 0.6s ease;
}

.focus .aurora {
    overflow: hidden;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* The mask stays still; the light turns inside it. */
.focus .aurora::before {
    content: "";
    position: absolute;
    inset: -45%;
    background:
        conic-gradient(from 0deg at 50% 50%, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-1));
    filter: blur(18px);
    animation: aurora 14s linear infinite paused;
}

@keyframes aurora {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

.focus .print {
    opacity: calc(var(--energy) * 0.85);
    mix-blend-mode: multiply;
}

/* Overdrive on fast scrolls: the plate shears with the scroll, the colour flares.
   On touch, --tilt (set while a thumb is on the plate) adds a perspective tilt toward the thumb. */
.plate-stack {
    transform: perspective(900px)
        rotateX(calc(var(--my) * var(--tilt) * 7deg))
        rotateY(calc(var(--mx) * var(--tilt) * -7deg))
        skewY(calc(var(--surge) * var(--dir) * -2.5deg))
        scaleY(calc(1 + var(--surge) * 0.04));
    transform-origin: 50% 50%;
}

@media (pointer: coarse) {
    .plate-stack { transition: transform 0.35s var(--arrive); }
    .plate.is-touched .plate-stack { box-shadow: 0 18px 40px -18px rgba(13, 17, 22, 0.45); }
    .plate.is-touched .plate-zoom {
        transform: scale(1.1) translate(calc(var(--mx) * -2.5%), calc(var(--my) * -2.5%));
    }
    .plate.is-touched .plate-zoom { transition-duration: 0.45s; }
}

.focus .color { filter: saturate(calc(0.9 + var(--surge) * 1.6)) brightness(calc(1 + var(--surge) * 0.25)); transition: none; }
.focus .aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(calc(var(--dir) * 180deg), var(--aurora-2), var(--aurora-4));
    mix-blend-mode: screen;
    opacity: calc(var(--surge) * 0.9);
}
.focus .aurora { opacity: max(var(--aurora-rest, 0), calc(var(--surge) * 0.95)); }

.focus .print {
    background-size: 6px 6px;
    background-position: 0 0;
}

.focus .print-c {
    background-image: radial-gradient(circle, var(--print-c) 1.4px, transparent 1.7px);
    background-color: color-mix(in srgb, var(--print-c) 55%, transparent);
    transform: translateY(calc(var(--shift) * -1));
}

.focus .print-m {
    background-image: radial-gradient(circle, var(--print-m) 1.4px, transparent 1.7px);
    background-position: 3px 3px;
    background-color: color-mix(in srgb, var(--print-m) 55%, transparent);
    transform: translateY(var(--shift));
}

/* A post's plate: the aurora breathes slowly while on screen. */
.plate-head.focus { --aurora-rest: 0.38; }
.plate-head.focus .aurora::before { animation-play-state: running; }

.focus.is-off .aurora::before { animation-play-state: paused; }

/* A row: color comes back on hover, the object first, then the scene. */
.note-link:hover .focus img.base,
.note-link:focus-visible .focus img.base,
.note-link.is-active .focus img.base { filter: grayscale(0) contrast(1); }

.note-link:hover .focus .color,
.note-link:focus-visible .focus .color,
.note-link.is-active .focus .color { filter: saturate(calc(1.1 + var(--surge) * 1.6)) brightness(calc(1 + var(--surge) * 0.25)); }

.note-link:hover .focus,
.note-link:focus-visible .focus,
.note-link.is-active .focus { --aurora-rest: 0.6; }

.note-link:hover .focus .aurora::before,
.note-link:focus-visible .focus .aurora::before,
.note-link.is-active .focus .aurora::before {
    animation-duration: 6s;
    animation-play-state: running;
}

/* The portrait: the person in color, the door behind him in black and white. */
.portrait-plate.focus .aurora::before { animation-duration: 10s; }
.portrait-plate.focus:hover { --aurora-rest: 0.45; }
.portrait-plate.focus:hover .aurora::before { animation-play-state: running; }

.plate figcaption {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.plate-wide {
    margin: 4rem 0 0;
}

/* On a post, the plate materializes from the bottom up: a scan line climbs in
   steps, the image behind it snaps from coarse to sharp, and the focus object
   clicks in last with a short cyan/magenta split. Nothing fades or wipes down,
   so it never reads as a slow load. */
.reading .sheet-head time,
.reading .sheet-head h1 {
    animation: arrive 0.8s var(--arrive) both;
}

.reading .sheet-head h1 { animation-delay: 0.06s; }

.reading .plate-head .plate-stack {
    -webkit-mask-image: linear-gradient(to top, #000 50%, transparent 50%);
    mask-image: linear-gradient(to top, #000 50%, transparent 50%);
    -webkit-mask-size: 100% 200%;
    mask-size: 100% 200%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: materialize 0.85s steps(18, end) 0.12s both;
}

@keyframes materialize {
    from { -webkit-mask-position: 0 0%; mask-position: 0 0%; }
    to { -webkit-mask-position: 0 100%; mask-position: 0 100%; }
}

/* The scan line: the bright edge the image is written behind. */
.reading .plate-head .plate-stack::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--aurora-2), var(--aurora-3), var(--aurora-4));
    box-shadow: 0 0 14px 3px color-mix(in srgb, var(--aurora-2) 55%, transparent);
    pointer-events: none;
    z-index: 2;
    animation: scan 0.85s steps(18, end) 0.12s both, scan-out 0.25s ease-out 0.97s both;
}

@keyframes scan {
    from { top: 100%; }
    to { top: -3px; }
}

@keyframes scan-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Behind the scan line the picture arrives coarse and steps into focus. */
.reading .plate-head img.base {
    animation: crisp 0.85s steps(5, end) 0.12s backwards;
}

@keyframes crisp {
    from { filter: blur(14px) contrast(1.6) grayscale(1); }
    to { filter: blur(0) contrast(1.04) grayscale(1); }
}

.reading .plate-head:not(.focus) img.base { animation-name: crisp-color; }

@keyframes crisp-color {
    from { filter: blur(14px) contrast(1.6); }
    to { filter: none; }
}

/* The focus object clicks in: one split, then it sits. */
.reading .plate-head.focus .color {
    animation: click-in 0.35s steps(3, end) 0.9s backwards;
}

@keyframes click-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reading .plate-head.focus .print-c { animation: snap-c 0.45s steps(4, end) 0.95s backwards; }
.reading .plate-head.focus .print-m { animation: snap-m 0.45s steps(4, end) 0.95s backwards; }

@keyframes snap-c {
    from { opacity: 0.9; transform: translateY(-16px); }
    to { opacity: 0; transform: translateY(0); }
}

@keyframes snap-m {
    from { opacity: 0.9; transform: translateY(16px); }
    to { opacity: 0; transform: translateY(0); }
}

/* Latest, Start here, Go further */

.latest { margin-top: 3.25rem; }

.latest > h2,
.shelf > h2 {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    letter-spacing: -0.04em;
    line-height: 0.95;
}

.deck {
    max-width: 36rem;
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.notes {
    display: grid;
    gap: 0;
    margin-top: 0.5rem;
}

.more { margin: 1.1rem 0 0; }

.note-link {
    display: grid;
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    column-gap: 2.25rem;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.note-plate { margin: 0; }

.note-plate .plate-stack img.base {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.note-plate:not(.focus) img.base {
    filter: saturate(0.45);
    transition: filter 0.6s ease;
}

.note-link:hover .note-plate:not(.focus) img.base,
.note-link:focus-visible .note-plate:not(.focus) img.base { filter: saturate(1); }

.note-link time {
    display: block;
    color: var(--muted);
    font-size: 0.9375rem;
}

.note-link h2 {
    margin: 0.3rem 0 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    letter-spacing: -0.045em;
    line-height: 0.92;
    text-wrap: balance;
    text-shadow: 0 calc(var(--shift) * -1) 0 rgb(var(--print-c-rgb) / var(--energy)),
                 0 var(--shift) 0 rgb(var(--print-m-rgb) / var(--energy));
}

/* The title's underline is drawn, left to right, on hover. */
.note-link h2 .t {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 0% 1px;
    background-position: 0 92%;
    transition: background-size 0.5s var(--arrive);
}

.note-link:hover h2 .t,
.note-link:focus-visible h2 .t,
.note-link.is-active h2 .t {
    background-size: 100% 1px;
}

.note-link p {
    max-width: 38rem;
    margin: 0.7rem 0 0;
    font-size: 1.125rem;
}

/* Sheet (writing index, post) */

.sheet { padding-top: 2.75rem; }

.sheet-head time {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--muted);
}

.sheet .sheet-head h1 {
    position: relative;
    z-index: 1;
    font-size: var(--title);
    line-height: 1;
}

.sheet-head time { margin-bottom: 1rem; }

.sheet .plate { margin-top: 1.5rem; }

.hero h1,
.sheet .sheet-head h1,
.note-link h2,
.latest > h2,
.shelf > h2 {
    transform: scaleY(calc(1 + var(--surge) * 0.1));
    transform-origin: 0 100%;
}

/* The title's lines carry paper, like labels pasted over the top of the plate. */
.reading .sheet-head h1 .t {
    background: var(--paper);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    padding: 0 0.14em 0.02em 0.06em;
    margin-left: -0.06em;
}

.reading .plate-head { margin-top: calc(var(--title) * -0.42); }

.prose {
    max-width: 66ch;
    padding: 2rem 0 0.5rem;
    font-family: var(--serif);
    font-size: 1.1875rem;
    line-height: 1.7;
}

.prose p { margin: 0 0 1.15rem; }

.prose h2,
.prose h3 {
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-wrap: balance;
}

.prose h2 { margin: 2rem 0 0.55rem; font-size: 1.65rem; }
.prose h3 { margin: 1.6rem 0 0.4rem; font-size: 1.3rem; }

.prose ul { margin: 0 0 1.15rem; padding-left: 1.15rem; }
.prose li + li { margin-top: 0.35rem; }

.prose blockquote {
    margin: 0 0 1.15rem;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
    color: var(--muted);
}

.prose code,
.prose pre {
    font-family: ui-monospace, "Cascadia Code", monospace;
    font-size: 0.9em;
}

.prose pre {
    margin: 0 0 1.15rem;
    padding: 0.9rem 1rem;
    background: var(--code);
    overflow: auto;
}

.prose img {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
}

.related {
    max-width: 66ch;
    margin: 1.5rem 0 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.related h2 {
    margin: 0 0 0.9rem;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
}

.related ul { margin: 0; padding: 0; list-style: none; }
.related li + li { margin-top: 1rem; }

.related a {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.25rem;
}

.related p { margin: 0.2rem 0 0; color: var(--muted); }

/* Colophon */

.colophon {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    margin-top: 3.5rem;
    padding: 1.15rem 0 2.75rem;
    border-top: 1px solid var(--line);
}

.colophon p { margin: 0; }

.colophon-name {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.colophon-place { color: var(--muted); }

.colophon-place time { font-variant-numeric: tabular-nums; }

.colophon nav { display: flex; gap: 1.15rem; }

.empty { color: var(--muted); }

.back { margin: 1.25rem 0 0; }

.shelf { margin-top: 2.75rem; }

/* Page to page: the plate travels from the row to the top of the note. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.32s;
    animation-timing-function: ease;
}

::view-transition-group(*) {
    animation-duration: 0.5s;
    animation-timing-function: var(--arrive);
}

@media (max-width: 760px) {
    .frame { width: min(var(--frame), calc(100% - 1.5rem)); }

    .bar .frame { align-items: flex-start; }

    .hero { min-height: 0; }

    .hero-grid {
        grid-template-columns: 1fr;
        padding: 2rem 0 2.25rem;
    }

    .hero .mast,
    .hero .portrait-plate { transform: none; }

    .portrait-plate {
        justify-self: start;
        order: -1;
        margin-bottom: 1.25rem;
    }

    .portrait-plate .plate-stack { width: 11rem; }

    h1 { font-size: clamp(3.4rem, 17vw, 4.6rem); }

    .sheet .sheet-head h1 { --title: clamp(2.6rem, 12vw, 3.6rem); }

    .reading .plate-head { margin-top: calc(var(--title) * -0.35); }

    .note-link h2 { font-size: clamp(2rem, 9vw, 2.6rem); }

    .note-link { grid-template-columns: 1fr; row-gap: 0.75rem; }

    .colophon { grid-template-columns: 1fr; gap: 0.5rem; }
}

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

    .home h1, .home .line, .home .place, .home .portrait-plate,
    .reading .sheet-head time, .reading .sheet-head h1,
    .reading .plate-head .plate-stack, .reading .plate-head .plate-stack::after,
    .reading .plate-head img.base, .reading .plate-head.focus .color,
    .reading .plate-head.focus .print-c, .reading .plate-head.focus .print-m {
        animation: none;
    }

    .reading .plate-head .plate-stack { -webkit-mask-image: none; mask-image: none; }
    .reading .plate-head .plate-stack::after { display: none; }

    .focus .aurora::before { animation: none; }
    .plate-zoom, .plate-move, .plate-head .plate-move { animation: none; transform: none; transition: none; }
    .plate:hover .plate-zoom,
.note-link.is-active .plate-zoom { transform: none; }
    .hero .mast, .hero .portrait-plate { transform: none; }
    .plate-head.focus { --aurora-rest: 0.2; }
    /* The scroll split stays (it answers the reader's own gesture, briefly); overdrive does not. */
    .hero h1, .sheet .sheet-head h1, .note-link h2, .latest > h2, .shelf > h2 { transform: none; }
    .plate-stack { transform: perspective(900px) rotateX(calc(var(--my) * var(--tilt) * 7deg)) rotateY(calc(var(--mx) * var(--tilt) * -7deg)); }
    .plate.is-touched .plate-zoom { transform: scale(1.06) translate(calc(var(--mx) * -1.5%), calc(var(--my) * -1.5%)); transition: transform 0.45s var(--arrive); }
    .focus .aurora::after { display: none; }
    .focus .color, .note-link:hover .focus .color, .note-link.is-active .focus .color { filter: saturate(0.9); }

    .hero canvas { transition: none; }

    .note-plate .plate-stack,
    .focus img.base,
    .focus .color,
    .note-link h2 .t,
    a { transition: none; }

    ::view-transition-group(*),
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

/* About */

.about .sheet-head { padding-bottom: 0; }

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    column-gap: 3rem;
    align-items: start;
}

.about .about-portrait {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 5rem;
    margin-top: calc(var(--title) * -0.42);
}

.about .about-portrait .plate-stack { width: 20rem; }

/* On About the face stays a photograph; the aurora only answers a hover. */
.about .about-portrait.focus { --aurora-rest: 0; }
.about .about-portrait.focus .aurora::before { animation-play-state: paused; }
.about .about-portrait.focus:hover { --aurora-rest: 0.4; }
.about .about-portrait.focus:hover .aurora::before { animation-play-state: running; }

.about .prose {
    grid-column: 1;
    grid-row: 1;
    padding-top: 1.5rem;
}

.about .prose > p:first-child {
    font-size: 1.5rem;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.about .prose h2 {
    font-family: var(--display);
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin: 2.5rem 0 0.7rem;
}

.about .prose strong { font-weight: 600; }

@media (max-width: 760px) {
    .about-grid { grid-template-columns: 1fr; }

    .about .about-portrait {
        grid-column: 1;
        grid-row: 1;
        position: static;
        margin-top: calc(var(--title) * -0.35);
    }

    .about .about-portrait .plate-stack { width: 12rem; }

    .about .prose { grid-row: 2; }
}

/* Language */

.bar nav .lang {
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--line);
    text-decoration: none;
}

.bar nav .lang:hover,
.bar nav .lang:focus-visible {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.only-en {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.notice {
    max-width: 66ch;
    margin: 0.75rem 0 1.25rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line);
    font-family: var(--sans);
}

/* Debug readout: add #debug to the URL. */
.jf-debug {
    position: fixed;
    left: 0.5rem;
    bottom: 0.5rem;
    z-index: 99;
    padding: 0.35rem 0.55rem;
    background: var(--ink);
    color: var(--paper);
    font: 500 0.75rem/1.3 ui-monospace, monospace;
    white-space: pre;
    pointer-events: none;
}
