/* ============================================
   Site theme: midnight and butter, Instrument Serif and Hanken Grotesk Light.
   Loaded after the older stylesheets, so it re-points their colour and type
   tokens and restyles the shared pieces: the nav, the footer, the hand-drawn
   line with its cat, and the case-study template.
   ============================================ */

:root {
    --bg: #1c2136;
    --ink: #f4e3a8;
    --tile: #2b3150;
    color-scheme: dark;
    --rule: color-mix(in srgb, var(--ink) 24%, transparent);
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: 'Hanken Grotesk', system-ui, sans-serif;
    --gutter: max(16px, 6vw);

    /* the older stylesheets read these */
    --rd-bg: var(--bg);
    --rd-text: var(--ink);
    --rd-muted: color-mix(in srgb, var(--ink) 72%, var(--bg));
    --rd-section-alt: var(--tile);
    --rd-display: var(--serif);
    --rd-body: var(--sans);
    --rd-small-font: var(--sans);
    --rd-gutter: var(--gutter);
}
/* one palette for everyone: midnight and butter, whatever the visitor's system setting */

html { background: var(--bg); }
body.redesign { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; }
body.redesign::after { display: none; } /* the film grain belonged to the old look */
::selection { background: color-mix(in srgb, var(--ink) 22%, transparent); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }

/* NAV: centred, with the cat face in the middle as the way home */
.site-nav { display: flex; justify-content: center; align-items: center; gap: 34px; padding: 39px 16px 0; font-size: 16px; font-weight: 300; flex-wrap: wrap; }
.site-nav a { color: inherit; text-decoration: none; font-weight: 300; }
.site-nav a[aria-current="page"]:not(.scrib-here) { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.site-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.site-nav .logo { width: 28px; height: 27px; display: block; }
@media (max-width: 760px) { .site-nav { gap: 13px; font-size: 14px; flex-wrap: nowrap; } }

/* THE LINE, and the cat who lives on it */
.line { position: relative; width: 100%; height: 52px; }
.line svg.rule { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 14px; overflow: visible; }
.cat { position: absolute; left: 6px; bottom: 7px; width: 25px; height: 42px; overflow: visible; will-change: transform; transform-origin: 12.5px 50%; }

/* FOOTER */
.site-foot { padding-top: clamp(96px, 14vw, 180px); }
.foot-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px 32px; align-items: start; }
.foot-hi h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.4vw, 60px); line-height: 1.05; letter-spacing: 0; margin: 0 0 28px; color: var(--ink); }
.copy { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-size: 17px; font-weight: 400; color: var(--bg); background: var(--ink); border: 0; border-radius: 999px; padding: 15px 24px 15px 20px; cursor: pointer; transition: transform .2s ease; }
.copy:hover { transform: translateY(-1px); }
.copy:active { transform: translateY(1px); }
.copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.copy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.foot-col { display: grid; gap: 10px; justify-items: start; }
.foot-col a { color: inherit; text-decoration: none; font-size: 18px; font-weight: 300; }
.foot-col a:focus-visible, .foot-bar a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
.foot-label { margin: 0 0 6px; font-size: 12px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.foot-label--sub { margin-top: 14px !important; }
.line--foot { margin-top: clamp(96px, 12vw, 160px); cursor: default; }
/* the footer's fish cursor (js/site.js): yellow, hand-drawn, and the real pointer hides while it's there */
.site-foot.has-fish, .site-foot.has-fish * { cursor: none !important; }
.fish-cursor { position: fixed; left: 0; top: 0; z-index: 50; color: var(--ink); pointer-events: none; opacity: 0; transition: opacity .15s ease; }
.fish-cursor.is-on { opacity: 1; }
.fish-cursor svg { display: block; overflow: visible; transform-origin: 20px 12px; }
.fish-cursor.is-eaten { opacity: 0; transition: opacity .18s ease; }
.fish-heart { position: fixed; z-index: 50; color: var(--ink); pointer-events: none; }
.fish-heart svg { display: block; }
/* the pen ticks at the pointer's tip (js/site.js) */
.tick-cursor { position: fixed; left: 0; top: 0; z-index: 50; color: var(--ink); pointer-events: none; opacity: 0; transition: opacity .15s ease; }
.tick-cursor.is-on { opacity: 1; }
.tick-cursor svg { display: block; overflow: visible; transform-origin: 15px 15px; }
.foot-bar { display: flex; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 40px; font-size: 12px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; }
.foot-bar a { color: inherit; text-decoration: none; font-weight: 400; }
.foot-bar span { opacity: .75; }
@media (max-width: 900px) { .foot-top { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 40px; } .foot-hi { grid-column: 1 / -1; } }
@media (max-width: 560px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-bar { flex-direction: column; gap: 10px; } }

/* SCROLL-IN: things ease up as they arrive (only when motion is welcome) */
.anim .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform 1s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
.anim .rv.in { opacity: 1; transform: none; }
.anim .line svg.rule { clip-path: inset(-20px 100% -20px 0); }
.anim .line .cat { opacity: 0; }
.line.in svg.rule { animation: draw 1.1s cubic-bezier(.6,.1,.3,1) .1s both; }
.line.in .cat { animation: drop .75s cubic-bezier(.3,1.5,.55,1) 1.05s both; }
.anim .site-nav > * { opacity: 0; }
.go .site-nav > * { animation: fadeDown .7s cubic-bezier(.2,.7,.2,1) calc(var(--i, 0) * 55ms) both; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { clip-path: inset(-20px 100% -20px 0); } to { clip-path: inset(-20px 0 -20px 0); } }
@keyframes drop { 0% { opacity: 0; translate: 0 -34px; } 40% { opacity: 1; } 100% { opacity: 1; translate: 0 0; } }

/* ============================================
   CASE STUDIES: the same editorial layout, in the new voice.
   Serif headlines, light sans for reading, maroon hairlines, rounded media.
   ============================================ */
.rd-cs { padding-top: clamp(64px, 9vw, 120px); }
.rd-cs-toc { top: 32px; }
.rd-cs-toc__back, .rd-cs-toc ol a { font-family: var(--sans); font-weight: 300; font-size: 15px; color: var(--ink); opacity: .7; }
.rd-cs-toc ol a::before { background: var(--ink); }

.rd-cs-main .rd-cs-label { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .7; }
.rd-cs-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); line-height: 1.05; letter-spacing: 0; color: var(--ink); text-wrap: balance; }
.rd-cs-intro { font-family: var(--sans); font-weight: 300; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; letter-spacing: 0; color: var(--ink); }
.rd-cs-intro em { font-family: var(--serif); font-style: italic; font-size: 1.12em; }

.rd-cs-section { padding-top: clamp(88px, 10vw, 128px); }
.rd-cs-section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 40px); line-height: 1.12; letter-spacing: 0; color: var(--ink); text-wrap: balance; }
.rd-cs-section h3 { font-family: var(--sans); font-weight: 400; font-size: 17px; color: var(--ink); }
.rd-cs-section p, .rd-cs-section li { font-family: var(--sans); font-weight: 300; font-size: 18px; line-height: 1.65; color: var(--ink); }
.rd-cs-cards p, .rd-cs-grid p, .rd-cs-steps p, .rd-cs-decision p { font-size: 16px; line-height: 1.6; }
.rd-cs-section a.rd-cs-link { color: var(--ink); font-weight: 400; border-bottom: 1px solid currentColor; }

.rd-cs-meta, .rd-cs-cards > div, .rd-cs-steps li, .rd-cs-decision, .rd-cs-next { border-top-color: var(--rule); }
.rd-cs-meta dt { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .7; }
.rd-cs-meta dd { font-family: var(--sans); font-weight: 300; font-size: 16px; color: var(--ink); }
.rd-cs-steps__no, .rd-cs-stat { font-family: var(--serif); font-size: 40px; color: var(--ink); }

.rd-cs-media img, .rd-cs-media video { border-radius: 9px; }
.rd-cs-media figcaption { font-family: var(--sans); font-weight: 300; font-size: 14px; color: var(--ink); opacity: .8; }
.rd-video { background: var(--tile); border-radius: 9px; }
.rd-video__button { background: color-mix(in srgb, var(--ink) 70%, transparent); color: var(--bg); }
.rd-video__button:hover { background: var(--ink); }
.rd-cs-embed { border: 0; border-radius: 9px; background: var(--tile); }
.rd-placeholder { background: var(--tile); border-color: var(--rule); color: var(--ink); border-radius: 9px; }

.rd-cs-main .rd-cs-question { border-left: 0; padding-left: 0; font-family: var(--serif); font-size: clamp(28px, 2.8vw, 36px); line-height: 1.18; color: var(--ink); }
.rd-cs-main .rd-cs-question::before { content: ''; display: block; width: 40px; height: 1.5px; margin-bottom: 18px; background: var(--ink); }
.rd-cs-main .rd-cs-cite { margin-left: 0; font-size: 14px; color: var(--ink); opacity: .75; }

.rd-cs-next { margin-top: 0; padding-bottom: 0; }

/* the hand-drawn line stands in for the straight rule above the details and "Next project" */
.line--rule { height: 14px; margin-top: 48px; }
.line--rule + .rd-cs-meta { margin-top: 0; border-top: 0; padding-top: 28px; }
.line--rule:has(+ .rd-cs-next) { margin-top: clamp(120px, 14vw, 180px); }
.line--rule + .rd-cs-next { border-top: 0; padding-top: 28px; }

/* quieter "moments": pull quotes and results sit on a soft tile */
.rd-cs-main .rd-cs-question { background: var(--tile); border-radius: 9px; padding: clamp(28px, 3vw, 40px) clamp(24px, 3vw, 44px); }
.rd-cs-main .rd-cs-question + .rd-cs-cite { margin-top: 12px; }
.rd-cs-cards > div:has(.rd-cs-stat) { background: var(--tile); border-top: 0; border-radius: 9px; padding: 22px 22px 24px; }
.rd-cs-next a { font-family: var(--serif); font-size: clamp(36px, 4vw, 56px); line-height: 1.05; color: var(--ink); }
.rd-cs-next a:hover { opacity: 1; text-decoration: none; }

@media (max-width: 640px) {
    .rd-cs-section h2 { font-size: 30px; }
    .rd-cs-section p, .rd-cs-section li { font-size: 17px; }
}

/* ============================================
   ABOUT: the same three columns, set larger in the new type
   ============================================ */
/* two columns centred under the menu: the portrait, and who I am beside it */
.rd-about { grid-template-columns: minmax(240px, 380px) minmax(0, 600px); grid-template-areas: "pic main"; column-gap: clamp(48px, 6vw, 96px); justify-content: center; min-height: 0; align-content: start; padding: clamp(64px, 9vw, 120px) var(--gutter) 0; }
.rd-about__portrait { grid-area: pic; }
.rd-about__main { grid-area: main; }
.rd-about__portrait { position: relative; }
.rd-about__doodle { position: absolute; top: 0; left: 0; width: 100%; height: auto; aspect-ratio: 1000 / 1250; overflow: visible; color: var(--ink); pointer-events: none; }
/* drawn by default (no script, or reduced motion); js/about.js hides it, then draws, holds, wipes and redraws it */
.rd-about__doodle path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.rd-about__portrait.is-doodling .rd-about__doodle path { stroke-dashoffset: 1; }
.rd-about__portrait img { border-radius: 9px; }
.rd-about__portrait figcaption { font-family: var(--sans); font-weight: 300; font-size: 14px; color: var(--ink); opacity: .75; margin-top: 12px; }
.rd-about__title { font-family: var(--serif); font-size: clamp(40px, 4.2vw, 60px); line-height: 1.05; letter-spacing: 0; }
.rd-about__intro { font-weight: 300; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; letter-spacing: 0; margin-top: 20px; }
/* the second paragraph reads just like the first, a touch further down */
.rd-about__more { margin-top: 18px; }
/* a hand-drawn yellow pen underline under the bright bits. --hl runs 0% to 100% as the pen draws
   across each line. Fully drawn by default (no script, or reduced motion). */
@property --hl { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
.rd-ul { --hl: 100%; padding-bottom: .16em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6.2C14 4.6 26 7 40 5.6S66 4.2 78 5.4 93 6.4 99 4.8' fill='none' stroke='%23f4e3a8' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 100% / var(--hl) .42em no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rd-ul:nth-of-type(2n) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1.2 4.8C18 6.4 30 4 46 5.4S72 6.6 84 5 95 4.6 98.8 6.2' fill='none' stroke='%23f4e3a8' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.rd-about__more.is-hl-waiting .rd-ul { --hl: 0%; transition: --hl .6s cubic-bezier(.5, 0, .3, 1); }
.rd-about__more.is-hl-waiting .rd-ul.is-on { --hl: 100%; }
.rd-about a { font-weight: 400; color: var(--ink); }
@media (max-width: 1000px) { .rd-about { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); } }
@media (max-width: 640px) { .rd-about { padding-top: 48px; } }

/* ============================================
   SIDE QUESTS: a header like the case studies, then the homepage's grid
   ============================================ */
.rd-archive { max-width: 1400px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter) 0; }
.rd-more__label { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .7; margin: 0 0 14px; }
.rd-archive__title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); line-height: 1.05; letter-spacing: 0; color: var(--ink); max-width: 16em; }
.rd-archive__title em { font-style: italic; }
.rd-archive__intro { font-family: var(--sans); font-weight: 300; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--ink); margin: 20px 0 clamp(48px, 6vw, 72px); }
.rd-work.rd-work--archive { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); gap: clamp(28px, 3.5vw, 48px) clamp(16px, 3.5vw, 45px); }
.rd-work--archive .rd-work__item { --tile-bg: var(--tile); aspect-ratio: auto; display: flex; flex-direction: column; gap: 12px; overflow: visible; color: var(--ink); }
.rd-work--archive .rd-work__item::after { display: none; }
.rd-work--archive .rd-work__media { order: 1; flex: none; aspect-ratio: 1092 / 662; border-radius: 9px; }
.rd-work--archive .rd-work__item--glow .rd-work__text { order: 2; position: static; flex-direction: row; justify-content: space-between; gap: 16px; font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.4; color: var(--ink); }
.rd-work--archive .rd-work__label { font-weight: 400; }
.rd-work--archive .rd-work__note { opacity: .8; text-align: right; }
.rd-work--archive .rd-work__item:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 9px; }
@media (max-width: 760px) {
    .rd-work.rd-work--archive { grid-template-columns: minmax(0, 1fr); }
    .rd-work--archive .rd-work__item { aspect-ratio: auto; }
    .rd-work--archive .rd-work__item--glow .rd-work__text { flex-direction: column; gap: 2px; }
    .rd-work--archive .rd-work__note { text-align: left; }
}

/* ============================================
   FILM: the nav, a serif title line, then the photo canvas
   ============================================ */
.rd-film-top { border-bottom: 0; padding-bottom: 6px; }
.rd-film-header { padding: 22px var(--gutter) 14px; gap: 4px 18px; }
/* film: one quiet line, all in the serif */
.rd-film-header .rd-film-eyebrow, .rd-film-hint { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--ink); opacity: .6; }
.rd-film-title { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; color: var(--ink); letter-spacing: 0; text-transform: none; }
.rd-film-organize { font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--ink); opacity: .8; border-bottom-width: .5px; }
.rd-film-organize:hover { color: var(--ink); opacity: 1; }
div.rd-film-ph { background: var(--tile); color: var(--ink); }

/* ============================================
   PASSWORD PAGES: the lock screen and the public preview above it
   ============================================ */
.rd-lock__cat { font-family: var(--sans); color: var(--ink); }
.rd-lock__title { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.1; color: var(--ink); letter-spacing: 0; }
.rd-lock__title em { font-style: italic; }
.rd-lock__note { font-family: var(--sans); font-weight: 300; font-size: 17px; color: var(--ink); }
.rd-lock__note a { color: var(--ink); font-weight: 400; }
.rd-lock__label { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .7; }
.rd-lock__row { border-bottom-color: var(--ink); }
.rd-lock__input { font-family: var(--sans); font-weight: 300; font-size: 18px; color: var(--ink); background: transparent; }
.rd-lock__button { font-family: var(--sans); font-weight: 400; font-size: 15px; color: var(--bg); background: var(--ink); border-radius: 999px; padding: 10px 18px; margin-bottom: 8px; }
.rd-lock__message { font-family: var(--sans); font-size: 14px; color: var(--ink); }
.rd-lock.is-wrong .rd-lock__message { color: var(--ink); font-weight: 400; }
.rd-teaser { max-width: 760px; padding-top: clamp(64px, 9vw, 120px); }
.rd-teaser__stats { border-top: 0; padding-top: 0; gap: 16px; }
.rd-teaser__stats div { background: var(--tile); border-radius: 9px; padding: 20px 20px 22px; }
.rd-teaser__stats dt { font-family: var(--serif); font-size: 40px; color: var(--ink); }
.rd-teaser__stats dd { font-family: var(--sans); font-weight: 300; font-size: 15px; color: var(--ink); }
.rd-lock--after-teaser { border-top-color: var(--rule); }
@media (max-width: 640px) {
    .rd-teaser__stats { gap: 10px; }
    .rd-teaser__stats div { border-top: 0; padding: 16px 18px; }
}

/* links: a hand-drawn circle on hover instead of an underline (drawn by js/site.js) */
a.scrib { position: relative; }
.scribble { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; transition: opacity .18s, stroke-dashoffset 0s .18s; }
a.scrib-on > .scribble path { opacity: 1; stroke-dashoffset: 0; transition: opacity 0s, stroke-dashoffset .42s cubic-bezier(.4, .1, .3, 1); }
@media (prefers-reduced-motion: reduce) { a.scrib-on > .scribble path { transition: none; } }
