/* daverau.me: one stylesheet, in page order.
   1 tokens · 2 base · 3 header · 4 hero · 5 case studies · 6 about · 7 footer
   Light is the default; dark is opt-in (Ctrl+K or the avatar) and still needs tuning. */

/* ---------- 1. tokens ---------- */
:root {
	--bg: #fff;
	--ink: #151413;
	--dim: #6f6a62;
	--line: #e6e6e6;
	--tile: #f3f3f3;
	--accent: #6339b7;
	--wash: color-mix(in srgb, var(--ink) 4%, var(--bg));

	--xl: clamp(44px, 7vw, 112px);
	--m: clamp(24px, 2.6vw, 38px);
	--body: clamp(17px, 1.25vw, 19px);
	--s: 14px;

	--sans: "Archivo", system-ui, sans-serif;
	--d-wght: 800;
	--d-wdth: 108%;
	--d-track: -.04em;
	--d-lh: .95;
	--m-wdth: 104%;
	--b-wght: 400;
	--b-lh: 1.55;

	--pad: clamp(18px, 4vw, 56px);
	--max: 1320px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--bar: 60px;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bg: #111110;
	--ink: #f2eee6;
	--dim: #8f8a81;
	--line: #2c2b28;
	--tile: #1c1b19;
	--accent: #9b7bf0;
	color-scheme: dark;
}

/* theme wipe (site.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---------- 2. base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: var(--bar); }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--b-wght) var(--body)/var(--b-lh) var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
figure, blockquote { margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.dim { color: var(--dim); }

.skip { position: fixed; left: var(--pad); top: 10px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; translate: 0 -200%; }
.skip:focus { translate: none; }

.xl { font-family: var(--sans); font-size: var(--xl); font-weight: var(--d-wght); font-stretch: var(--d-wdth); line-height: var(--d-lh); letter-spacing: var(--d-track); margin: 0; }
.m  { font-family: var(--sans); font-size: var(--m); font-weight: var(--d-wght); font-stretch: var(--m-wdth); line-height: 1.12; letter-spacing: calc(var(--d-track) * .6); margin: 0; }
.label { font-size: var(--s); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; }

/* headline rise (once): each line slides up from behind its mask */
.mask { display: block; clip-path: inset(0 -1em); padding-bottom: .08em; margin-bottom: -.08em; } /* clips top/bottom for the rise, lets the hanging dot show at the line end */
.mask > span { display: block; }
.js .mask > span { translate: 0 105%; transition: translate 1s var(--ease); }
.js .mask:nth-child(2) > span { transition-delay: .1s; }
.js .mask:nth-child(3) > span { transition-delay: .2s; }
.js .is-in .mask > span { translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .js .mask > span { translate: none; transition: none; } }

/* the dot after each project name (the hero one has the period for screen readers) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dot { display: inline-block; width: .17em; height: .17em; margin-left: .05em; margin-right: -.22em; border-radius: 50%; background: var(--accent); }
/* the dot has zero net width (hangs like punctuation) and a word joiner before it, so it never wraps alone */

/* ---------- 3. header ---------- */
.bar {
	position: sticky; top: 0; z-index: 50; height: var(--bar);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 0 max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad))); font-size: var(--s);
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.bar a { text-decoration: none; }
.bar nav a:hover, .bar .who:hover b { text-decoration: underline; }
.who { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.who img { border-radius: 50%; cursor: pointer; }
.mail { color: var(--accent); }

/* hero lockup scrolls up to the header, then the header's identical lockup takes over in the same spot
   (site.js). Instant swap, no fade, so it reads as one lockup locking into place. */
.js .bar .who { opacity: 0; pointer-events: none; }
.js.locked .bar .who { opacity: 1; pointer-events: auto; }
.js.locked .hero-who .lockup { visibility: hidden; }

/* the bar has no background until the lockup locks in, so the name never slides under a tinted bar */
.bar { transition: background-color .2s var(--ease); }
.js:not(.locked) .bar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: none; } /* fade in on lock only; unlocking is instant so the bar never covers the hero lockup */

/* ---------- 4. hero ---------- */
.hero { position: relative; container-type: inline-size; min-height: calc(100vh - var(--bar)); display: flex; flex-direction: column; justify-content: center; padding-block: clamp(48px, 10vh, 120px); }
.hero > h1, .hero > .proof { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(44px, 9.2cqw, 150px); max-width: 40cqw; text-wrap: balance; }
.hero > .proof { font-size: var(--body); line-height: 1.55; max-width: 46cqw; margin-top: clamp(28px, 4vh, 44px); color: var(--dim); }
.proof b { font-family: var(--sans); font-weight: 700; color: var(--ink); }
.proof .ink { color: var(--ink); }
/* availability line: accent purple, "Open" bold */
.proof .open, .proof .open b { color: var(--accent); }
@media (min-width: 901px) { .hero > .proof { white-space: nowrap; } }

/* lockup: same size as the header one */
.hero-who { position: relative; z-index: 1; height: 34px; margin: 0 0 clamp(20px, 4vh, 40px); font-size: var(--s); line-height: 1.15; white-space: nowrap; }
.hero-who .lockup { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.hero-who img { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.hero-who b { font-weight: 700; }

/* collage: the stage is a fixed-proportion box, so every frame (positioned in cqw of the stage) scales together */
.backdrop { position: absolute; z-index: 0; pointer-events: none; right: var(--pad); top: 50%; translate: 0 -50%; width: 48%; aspect-ratio: 1064 / 1030; container-type: inline-size; opacity: var(--fade, 1); }
.frame { position: absolute; display: block; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; background: var(--tile); will-change: transform; animation: drift var(--dur, 14s) ease-in-out var(--delay, 0s) infinite alternate;
	box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 12px 28px -12px rgb(0 0 0 / .3); }
@keyframes drift { from { translate: 0 0; } to { translate: var(--dx, 6px) var(--dy, -8px); } }
.away .frame { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .frame { animation: none; } }

@media (max-width: 900px) {
	.hero h1, .hero > .proof { max-width: 100%; }
	/* collage becomes its own block under the text instead of a faded layer behind it */
	.hero { min-height: 0; justify-content: flex-start; }
	.hero > .backdrop { order: 3; position: relative; inset: auto; translate: none; width: 100%; margin-top: clamp(40px, 8vh, 72px); opacity: 1; }
	.hero > .backdrop .frame { transform: none !important; }
}

/* ---------- 5. case studies ---------- */
.case { position: relative; isolation: isolate; padding-top: clamp(120px, 21vh, 240px); padding-bottom: clamp(40px, 6vh, 80px); }
/* every other project sits on a faint full-bleed wash instead of a rule (--wash is the hook for texture later) */
.case:nth-of-type(even) { padding-bottom: clamp(80px, 12vh, 140px); }
.case:nth-of-type(even)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--wash); box-shadow: 0 0 0 100vmax var(--wash); clip-path: inset(0 -100vmax); }

.case-head { display: grid; gap: 18px; margin-bottom: clamp(32px, 5vh, 56px); }
.case-head h2.xl { font-size: clamp(36px, 5.5vw, 84px); max-width: 16ch; text-wrap: balance; }
.lede { font-size: var(--m); line-height: 1.25; letter-spacing: -.015em; max-width: 38ch; color: var(--dim); }

/* lead image under the case head */
.lead { display: grid; gap: 1rem; margin-bottom: clamp(32px, 6vh, 72px); }
.lead img, .figs img { width: 100%; height: auto; border-radius: 6px; }
figcaption { margin-top: .6rem; font-size: var(--s); color: var(--dim); max-width: 52ch; }
figure.onwhite img { background: #fff; padding: 2rem; }

/* chapters: sticky text left, figures right */
.beat { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; align-items: start; margin: clamp(64px, 12vh, 140px) 0; }
.beat > .txt { grid-column: 1 / span 4; position: sticky; top: calc(var(--bar) + 32px); display: grid; gap: 14px; }
.beat > .txt p { max-width: 24rem; }
.beat > .figs { grid-column: 5 / span 8; display: grid; gap: 2.5rem; }
.beat h3.m { font-size: clamp(22px, 2.2vw, 32px); }
@media (max-width: 900px) { .beat > .txt, .beat > .figs { grid-column: 1 / -1; position: static; } }

/* small "before" inset in the corner of an after image: shows the contrast, the after stays the hero */
.has-inset { position: relative; }
.has-inset .inset { position: absolute; right: 3%; bottom: 4%; width: 26%; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 12px 32px -8px rgb(0 0 0 / .3); overflow: hidden; }
.has-inset .inset img { width: 100%; height: auto; border-radius: 0; }
.has-inset .inset i { position: absolute; top: 8px; left: 8px; font: 600 11px/1 var(--sans); font-style: normal; letter-spacing: .04em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: rgb(0 0 0 / .7); color: #fff; }
@media (max-width: 600px) { .has-inset .inset { width: 38%; right: 2%; bottom: 3%; } .has-inset .inset i { top: 5px; left: 5px; font-size: 9px; padding: 3px 5px; } }

/* second client inside one case study (Inkling: O'Reilly, then Elsevier) */
.subhead { display: grid; gap: 14px; margin-top: clamp(80px, 14vh, 160px); margin-bottom: clamp(32px, 5vh, 56px); }
.subhead::before { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-bottom: 6px; }
.subhead .label { margin: 0; }
.subhead .m { max-width: 28ch; }

/* ---------- 6. about + experience ---------- */
/* the last case study runs straight into the about band: no white gap under the grey wash */
.case + .band { margin-top: 0; }
.band { margin-top: clamp(80px, 14vh, 160px); padding: clamp(64px, 10vh, 120px) 0; background: #130f2b; color: #f2eee6; --ink: #f2eee6; --dim: #a29db5; --line: #2b2647; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-grid > div { display: grid; max-width: 52ch; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

.band blockquote { max-width: 40ch; }
.band blockquote p { margin-bottom: 8px; font-family: var(--sans); font-size: clamp(20px, 2vw, 28px); line-height: 1.3; letter-spacing: -.015em; font-weight: var(--d-wght); font-stretch: var(--m-wdth); }
.band cite { display: block; margin-top: 24px; font-style: normal; font-size: var(--s); color: var(--dim); }
.who-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.who-link span { text-decoration: underline; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.who-link:hover span { text-decoration-color: currentColor; }
.avi { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line); flex: none; }

.art { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); margin-top: clamp(40px, 7vh, 80px); }
.art img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }

.exp { padding-top: clamp(64px, 10vh, 120px); }
.jobs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.jobs li { display: grid; grid-template-columns: 5fr 6fr 2fr; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.jobs .logo { font-family: var(--sans); font-size: var(--m); font-weight: var(--d-wght); font-stretch: var(--m-wdth); line-height: 1.1; letter-spacing: calc(var(--d-track) * .6); }
.jobs .logo i { font: 400 var(--s)/1 var(--sans); font-style: normal; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); margin-left: 8px; }
.jobs .when { text-align: right; color: var(--dim); }
@media (max-width: 900px) {
	.jobs li { grid-template-columns: 1fr auto; gap: 4px 16px; }
	.jobs .logo { grid-column: 1 / -1; }
	.jobs .when { text-align: left; }
}

/* ---------- 7. footer ---------- */
.foot { background: #6339b7; color: #fff; --dim: rgb(255 255 255 / .8); padding: clamp(72px, 14vh, 160px) 0 clamp(24px, 4vh, 40px); }
.foot .resume { margin-top: clamp(40px, 9vh, 88px); font-size: var(--s); display: flex; gap: 24px; }
.foot .resume a { color: #fff; }

/* CTA: the hand slides in from the right when the footer scrolls into view, then nudges toward the text while a light sweep crosses text and underline */
.foot .say { display: inline-flex; align-items: center; gap: .25em; color: #fff; font-size: clamp(34px, 4.6vw, 72px); line-height: .95; text-decoration: none; overflow-wrap: anywhere; --sweep: linear-gradient(100deg, #fff 0 40%, #4a2b9a 50%, #fff 60% 100%) 100% 0 / 250% 100% no-repeat; }
.foot .say .pt { font-size: 1.1em; line-height: 1; filter: brightness(0) opacity(.5); opacity: 0; transform: translateX(1.2em); }
.foot .say .say-t { position: relative; background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.foot .say .say-t::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .075em; border-radius: 2px; background: var(--sweep); }
.foot.in .say .pt { animation: hand-in .6s cubic-bezier(.2,.9,.3,1.2) .15s forwards, nudge 4s ease-in-out 1.2s infinite; }
.foot.in .say .say-t, .foot.in .say .say-t::after { animation: sweep 4s ease-in-out .8s infinite; }
.foot .say:hover .say-t, .foot .say:hover .say-t::after { animation-duration: 1.6s; }
.foot .say:hover .say-t::after { height: .11em; }
@keyframes hand-in { to { opacity: 1; transform: translateX(0); } }
@keyframes sweep { 0% { background-position: 100% 0; } 35%, 100% { background-position: 0 0; } }
@keyframes nudge { 0%, 45%, 100% { transform: translateX(0); } 12% { transform: translateX(-.18em); } 24% { transform: translateX(0); } 34% { transform: translateX(-.12em); } }
@media (prefers-reduced-motion: reduce) {
	.foot .say .pt { opacity: 1; transform: none; animation: none !important; }
	.foot .say .say-t { animation: none !important; background: none; color: #fff; -webkit-text-fill-color: #fff; }
	.foot .say .say-t::after { animation: none !important; background: #fff; }
}

/* hero availability line is the contact link; "Contact" sits at the end of it */
.proof a.open { text-decoration: none; }
.proof a.open .open-cta { font-weight: 700; text-decoration: underline; text-underline-offset: .2em; margin-left: .35em; }
.proof a.open:hover .open-cta { text-decoration-thickness: 2px; }

/* header Contact: hidden until the hero contact line scrolls up behind the header, then slides up into place */
.js .bar .mail { opacity: 0; translate: 0 14px; pointer-events: none; transition: opacity .3s var(--ease), translate .4s var(--ease); }
.js.past-cta .bar .mail { opacity: 1; translate: 0 0; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .js .bar .mail { transition: none; translate: none; } }
