/* byhanoe site styles
   Themes: dark (AMOLED black, default) and light, switched via <html data-theme="…">.
   Accent colour comes from Config\Site::$accent (set inline as --accent). */

:root {
  --accent: #FF5B14;
  --bg: #000000;
  --surface: #0D0D0D;
  --surface2: #181818;
  --ink: #F4F2EE;
  --muted: #A19D95;
  --line: #272727;
  --accent-ink: var(--accent);
  --on-accent: #000000;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F3F2EE;
  --surface: #FFFFFF;
  --surface2: #E8E6E0;
  --ink: #0B0B0B;
  --muted: #5B574F;
  --line: #D5D2CA;
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #000);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  overflow-x: hidden;
  transition: background-color .45s ease, color .45s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mono { font-family: var(--mono); }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 40px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  padding: 12px 16px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.skip:focus { top: 16px; color: var(--on-accent); }

/* icons */
.ico { width: 20px; height: 20px; flex: none; }
.ln { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.f-acc { fill: var(--accent); }
.f-bg { fill: var(--bg); }
.f-ink { fill: var(--ink); }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -.03em; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }

.navlinks { display: flex; gap: 28px; align-items: center; }
.navlinks a { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; padding: 12px 0; }
.navlinks a[aria-current="page"] { color: var(--accent-ink); }

.nav-r { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 40px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .06em;
  transition: background-color .3s, color .3s;
}
.lang a:hover { color: var(--ink); }
.lang a.on { background: var(--accent); color: var(--on-accent); }

.tbtn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .5s var(--ease), border-color .3s;
}
.tbtn:hover { transform: rotate(180deg); border-color: var(--accent); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

/* ---------- hero ---------- */
.hero-main { position: relative; }
.dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.eyebrow { position: relative; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.cursor { display: inline-block; width: 10px; height: 18px; background: var(--accent); animation: blink 1s steps(1) infinite; }

.hero-title { position: relative; margin: 0; font-weight: 800; font-size: clamp(48px, 11.5vw, 188px); line-height: .86; letter-spacing: -.045em; text-transform: uppercase; }
.line { display: block; overflow: hidden; padding-bottom: .04em; }
.rise { display: inline-block; animation: rise 1s var(--ease) both; }
.d1 { animation-delay: .12s; } .d2 { animation-delay: .24s; } .d3 { animation-delay: .36s; }
.outline { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.hl { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* cycling word: bigger than "I make"; the old word breaks into outlined echoes that float up
   behind the solid text (so the line can't clip like the others) */
.hero-title .rise { position: relative; z-index: 1; }
.cyc { position: relative; overflow: visible; font-size: min(1.4em, 13.5vw, 190px); line-height: .9; white-space: nowrap; }
.cyc-word { position: relative; z-index: 1; display: inline-block; animation: cycIn .9s var(--ease) .15s both; }
.cyc-word.in { animation: cycIn .7s var(--ease) both; }
.cyc-echo {
  position: absolute; left: 0; top: 0; display: inline-block; pointer-events: none;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) calc(100% - var(--i) * 18%), transparent);
  animation: cycUp 1s var(--ease) calc(var(--i) * 45ms) forwards;
}
@keyframes cycIn { from { transform: translateY(45%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cycUp { from { transform: none; opacity: 1; } to { transform: translateY(calc(var(--i) * -.2em - .08em)); opacity: 0; } }
.star { display: inline-block; width: .42em; height: .42em; vertical-align: .32em; margin-left: .12em; color: var(--ink); animation: spin 9s linear infinite; }

.badge { position: absolute; right: 0; top: 0; width: 184px; height: 184px; }
.badge svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.badge-t { font-family: var(--mono); font-size: 15px; letter-spacing: .2em; font-weight: 600; fill: var(--ink); text-transform: uppercase; }
.badge-c { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.badge-c span { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

.hero-foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-top: 56px; }
.intro { max-width: 460px; margin: 0; font-size: 20px; line-height: 1.5; color: var(--muted); }
.intro b { color: var(--ink); font-weight: 700; }

.index { display: flex; flex-direction: column; min-width: 320px; flex: 0 1 420px; }
.index a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none;
  font-weight: 700; font-size: 24px; letter-spacing: -.01em;
  transition: padding .35s var(--ease), color .2s;
}
.index a:last-child { border-bottom: 1px solid var(--line); }
.index a:hover { padding-left: 12px; }
.index .n { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--accent-ink); margin-right: 16px; }

/* ---------- toolbox word wall ---------- */
.stack-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .36em; row-gap: .04em;
  font-size: clamp(40px, 7.4vw, 118px); line-height: 1;
}
.stack-list li {
  display: inline-block; cursor: default;
  transition: transform .4s var(--ease), color .3s, -webkit-text-stroke-color .3s;
}
.stack-list li:hover { transform: translateY(-.08em) rotate(-3deg); color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.stack-list li.w-outline:hover { color: transparent; }
.w-bold { font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: -.01em; }
.w-serif { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; font-size: .8em; letter-spacing: -.01em; }
.w-accent { color: var(--accent); }
.w-outline { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.w-serif.w-outline { -webkit-text-stroke-width: 1.2px; }
/* words pop in one after another when the wall scrolls into view */
.stack-list.reveal li { opacity: 0; transform: translateY(40%) rotate(4deg); transition: opacity .7s var(--ease), transform .7s var(--ease), color .3s; }
.stack-list.reveal.in li { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 60ms); }
.stack-list.reveal.in li:hover { transform: translateY(-.08em) rotate(-3deg); transition-delay: 0s; }

/* ---------- sections ---------- */
.sec { padding: 120px 0 40px; }
.sec-tight { padding-top: 24px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.sec-num { font-family: var(--mono); font-size: 13px; color: var(--accent-ink); margin: 0 0 10px; letter-spacing: .08em; text-transform: uppercase; }
.sec-title { margin: 0; font-weight: 800; font-size: clamp(52px, 9vw, 140px); line-height: .84; letter-spacing: -.045em; text-transform: uppercase; }

.more {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  transition: background-color .25s, color .25s, border-color .25s;
}
.more:hover, .more-solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.more-solid:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* page header (projects / photos / drawings pages) */
.page-hero { position: relative; padding: 48px 0 40px; }
.page-hero > * { position: relative; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 40px; font-size: 13px; text-decoration: none; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.page-title { margin: 0 0 28px; font-weight: 800; font-size: clamp(60px, 13vw, 210px); line-height: .84; letter-spacing: -.05em; text-transform: uppercase; }
.back-row { margin: 40px 0 0; }

/* ---------- 404 ---------- */
/* an accent panel of three digit reels that spin and land on 4-0-4, copy and links beside it */
/* no header on this page; the copyright line below takes about 60px */
.nf { display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 60px); padding-top: 24px; padding-bottom: 24px; }
.nf-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); align-items: stretch; gap: 40px 56px; }

.nf-panel {
  position: relative; min-height: min(72svh, 640px); border-radius: 24px; overflow: hidden;
  background: var(--accent); color: var(--on-accent);
}
/* rows fade out towards the top and bottom edges so only the landed row reads clearly */
.nf-reels {
  position: absolute; inset: 0; display: flex; justify-content: center; gap: .04em;
  font-size: clamp(120px, min(16vw, 26svh), 300px); font-weight: 800; line-height: 1; letter-spacing: -.04em;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
          mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.nf-reel { position: relative; width: .64em; }
/* the strip rests with digit --k centred; the animation starts it near the top and spins down to it */
.nf-strip {
  position: absolute; top: 50%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center;
  transform: translateY(calc(-.5em - var(--k) * 1em));
  animation: reel calc(1.3s + var(--d) * .45s) cubic-bezier(.3, .9, .25, 1.06) both;
}
.nf-strip span { display: block; height: 1em; color: transparent; -webkit-text-stroke: 2px var(--on-accent); opacity: .55; }
.nf-strip span.on { color: var(--on-accent); -webkit-text-stroke: 0; opacity: 1; }
@keyframes reel { from { transform: translateY(-.5em); } }

.nf-tag, .nf-path { position: absolute; margin: 0; font-size: 12px; letter-spacing: .04em; }
.nf-tag { top: 18px; left: 20px; display: flex; align-items: center; gap: 8px; }
.nf-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); animation: blink 1s steps(1) infinite; }
.nf-path {
  left: 16px; bottom: 16px; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 999px;
  background: var(--on-accent); color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: line-through;
}

.nf-side { display: flex; flex-direction: column; justify-content: flex-start; gap: 22px; min-width: 0; }
.nf .eyebrow { margin: 0; }
.nf-title { margin: 0; font-weight: 800; font-size: clamp(36px, 4.4vw, 68px); line-height: .9; letter-spacing: -.04em; text-transform: uppercase; }
@media (max-width: 900px) {
  .nf-grid { grid-template-columns: minmax(0, 1fr); }
  .nf-panel { min-height: 0; height: clamp(300px, 56svh, 460px); }
  .nf-reels { font-size: clamp(110px, 30vw, 220px); }
  .nf-strip span { -webkit-text-stroke-width: 1.5px; }
}

/* ---------- projects ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* "Selected Work" heading: condensed, no rule underneath, section counter on the right */
.sec-head-plain { align-items: flex-end; flex-wrap: nowrap; padding-bottom: 0; border-bottom: 0; }
.sec-head-plain .sec-title { font-stretch: 75%; letter-spacing: -.01em; }
.sec-count { flex: none; margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
/* sections with a link keep it beside the counter */
.sec-side { flex: none; display: flex; align-items: flex-end; gap: 20px; }
.sec-side .sec-count { margin-bottom: 14px; }
@media (max-width: 640px) { .sec-side .sec-count { display: none; } }

/* text-only card: tag on top, title + description at the bottom, big outlined number behind */
.p-card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  min-height: 260px; padding: 24px;
  border-radius: 18px; overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; scroll-margin-top: 24px;
  transition: transform .45s var(--ease), border-color .3s;
}
.p-card:hover { transform: translateY(-6px); border-color: var(--accent); color: var(--ink); }
.p-card:target { border-color: var(--accent); }

.p-num {
  position: absolute; top: 2px; right: -4px; z-index: -1;
  font-weight: 800; font-stretch: 75%; font-size: 112px; line-height: .9; letter-spacing: -.02em;
  color: transparent; -webkit-text-stroke: 1.5px var(--line);
  transition: -webkit-text-stroke-color .3s;
}
.p-card:hover .p-num { -webkit-text-stroke-color: var(--accent); }

/* README image / GIF / video behind the text, darkened towards the bottom so the text stays readable */
.p-media { position: absolute; inset: 0; z-index: -2; background: var(--surface2); }
.p-media img, .p-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.p-media .wide { object-position: 50% 0; }
.p-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .25) 40%, rgba(0, 0, 0, .9) 100%); }
.p-card:hover .p-media img, .p-card:hover .p-media video { transform: scale(1.05); }
.has-media, .has-media:hover { color: #fff; }
.has-media .p-num { -webkit-text-stroke-color: rgba(255, 255, 255, .4); }
.has-media .p-desc { color: rgba(255, 255, 255, .8); }
.has-media .tag:not(.tag-on) { background: rgba(0, 0, 0, .5); border-color: rgba(255, 255, 255, .7); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.p-top { display: flex; align-items: center; gap: 8px; }
.tag { max-width: 100%; padding: 5px 11px; border: 1px solid var(--ink); border-radius: 999px; background: var(--surface); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.p-title { margin: 0 0 10px; font-weight: 800; font-stretch: 75%; font-size: 40px; line-height: .92; letter-spacing: -.01em; text-transform: uppercase; overflow-wrap: anywhere; }
.p-desc { margin: 0; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--ink) 72%, transparent); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.p-card.all { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.p-card.all:hover { color: var(--on-accent); }
.p-card.all .p-title { margin: 0 0 14px; font-size: 56px; }
.all-go { display: block; width: 44px; height: 44px; transition: transform .4s var(--ease); }
.all-go svg { width: 100%; height: 100%; }
.all-go .ln { stroke-width: 1.4; }
.p-card.all:hover .all-go { transform: translateX(10px); }
.arch { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- photos ---------- */
/* Every photo keeps its own aspect ratio; nothing is cropped. */

/* home slide: random photos scattered around a viewfinder title. Sizes share one area (--u²),
   so a panorama is wide and short and a 9:16 is narrow and tall. site.js fades them in one by one. */
.ap { position: relative; flex: 1; min-height: 0; --u: min(13vw, 19svh); }
.ap-ph {
  position: absolute; display: block; width: calc(var(--u) * var(--w) * var(--k, 1)); height: auto; aspect-ratio: var(--r);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.ap-armed .ap-ph { opacity: 0; transform: translateY(24px) scale(.96); transition: opacity .3s ease, transform .3s ease; }
.ap-armed.in .ap-ph {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease) calc(.15s + var(--i) * .17s), transform 1.2s var(--ease) calc(.15s + var(--i) * .17s);
}
.ap-1 { left: 0; top: 0; }
.ap-2 { left: 25%; top: 9%; --k: .9; }
.ap-3 { left: 55%; top: 0; --k: 1.3; }
.ap-4 { left: 0; top: 42%; --k: .95; }
.ap-5 { right: 0; top: 34%; --k: .85; }
.ap-6 { right: 0; top: 66%; --k: .95; }
.ap-7 { left: 0; bottom: 0; --k: .95; }
.ap-8 { left: 32%; bottom: 0; --k: 1.2; }
.ap-9 { right: 22%; bottom: 0; --k: .8; }

.ap-h { position: absolute; left: 50%; top: 50%; z-index: 2; margin: 0; transform: translate(-50%, -50%); font-weight: 400; }
.ap-title {
  position: relative; display: grid; justify-items: center; gap: 14px; padding: .32em .55em .4em;
  font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(64px, min(10vw, 16svh), 180px);
  color: var(--ink); text-decoration: none; transition: color .3s;
}
/* viewfinder corners, drawn in the text colour and pushed outwards on hover */
.ap-title::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-repeat: no-repeat;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor),
                    linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: .5em 2px, 2px .5em, .5em 2px, 2px .5em, .5em 2px, 2px .5em, .5em 2px, 2px .5em;
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
  transition: inset .5s var(--ease);
}
.ap-title:hover { color: var(--accent-ink); }
.ap-title:hover::before { inset: -.14em; }
.ap-word { line-height: .85; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.ap-sub { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ap-sub .ico { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.ap-title:hover .ap-sub .ico { transform: translateX(6px); }

@media (max-width: 640px) {
  .ap { --u: min(30vw, 15svh); }
  .ap-ph { inset: auto; }
  .ap-1 { left: 0; top: 0; --k: 1; }
  .ap-2 { right: 0; top: 5%; --k: .9; }
  .ap-3 { left: 30%; top: 19%; --k: .75; }
  .ap-4 { left: 0; bottom: 0; --k: 1; }
  .ap-5 { right: 0; bottom: 3%; --k: .95; }
  .ap-6 { left: 36%; bottom: 20%; --k: .75; }
  .ap-7, .ap-8, .ap-9 { display: none; }
  .ap-title { font-size: min(19vw, 11svh); }
}
@media (max-height: 540px) { .ap { min-height: 520px; } }

/* photos page: justified rows. flex-grow follows each ratio, so every photo in a row ends up the
   same height; the ::after filler keeps the last row from stretching. site.js "develops" each
   photo from a negative under an orange safelight as it scrolls in. */
.dr-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.safe { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bulb 1.6s ease-in-out infinite; }
@keyframes bulb { 50% { box-shadow: 0 0 18px 6px color-mix(in srgb, var(--accent) 60%, transparent); } }
.dr { --row: 260px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.dr::after { content: ""; flex-grow: 1000000; }
.dr-it {
  position: relative; flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row)); aspect-ratio: var(--r);
  overflow: hidden; border-radius: 4px; background: var(--surface2);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.dr-it:hover { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--accent); }
.dr-it img { display: block; width: 100%; height: 100%; }
.dr-armed .dr-it:not(.in) img { opacity: 0; }
.dr-it.in img { animation: develop 2.6s var(--d, 0s) both; }
.dr-it.in::after { content: ""; position: absolute; inset: 0; background: var(--accent); mix-blend-mode: multiply; pointer-events: none; animation: safelight 2.6s var(--d, 0s) both; }
@keyframes develop {
  0%   { filter: invert(1) grayscale(1) contrast(.5) blur(8px) brightness(.45); }
  45%  { filter: invert(.55) grayscale(.8) contrast(.7) blur(3px) brightness(.8); }
  100% { filter: none; }
}
@keyframes safelight { 0% { opacity: .9; } 70% { opacity: .2; } 100% { opacity: 0; } }
.dr-type { position: absolute; top: 10px; right: 10px; display: flex; width: 28px; height: 28px; padding: 6px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; }
.dr-type svg { width: 100%; height: 100%; }
.dr-date {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
}
.dr-it:hover .dr-date, .dr-it:focus-visible .dr-date { opacity: 1; transform: none; }
@media (max-width: 1024px) { .dr { --row: 200px; } }
@media (max-width: 640px) {
  .dr { --row: 120px; gap: 6px; }
  .dr-it:hover { transform: none; }
}

/* full-screen viewer (site.js). Sits under the custom cursor (z-index 9999). */
.lb {
  position: fixed; inset: 0; z-index: 9000;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity .3s ease;
}
.lb[hidden] { display: none; }
.lb.open { opacity: 1; }
.lb-fig { min-width: 0; margin: 0; display: grid; justify-items: center; gap: 16px; }
.lb-img {
  display: block; max-width: 100%; max-height: calc(100svh - 170px); width: auto; height: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5); opacity: 0; transform: scale(.96); transition: opacity .3s, transform .45s var(--ease);
}
.lb.open .lb-img.ready { opacity: 1; transform: none; }
.lb figcaption { max-width: 68ch; display: grid; justify-items: center; gap: 6px; text-align: center; }
.lb-n { font-size: 12px; letter-spacing: .1em; color: var(--accent-ink); }
.lb-cap { font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-cap:empty { display: none; }
.lb-date { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lb-x, .lb-nav {
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.lb-x { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); z-index: 1; }
.lb-x:hover, .lb-nav:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lb-x .ico, .lb-nav .ico { width: 22px; height: 22px; }
@media (max-width: 640px) {
  .lb { grid-template-columns: minmax(0, 1fr); padding-bottom: 100px; }
  .lb-nav { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  .lb-img { max-height: calc(100svh - 240px); }
}


/* ---------- coming soon ---------- */
/* a wall of outlined words, each row shifted one letter, with one solid row in the middle */
.soon { position: relative; min-height: 480px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.soon-wall {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  font-size: clamp(44px, 7vw, 104px); font-weight: 800; line-height: .86; letter-spacing: -.01em;
}
.soon-row { flex: none; white-space: nowrap; }
.soon-row span { display: inline-block; color: transparent; -webkit-text-stroke: 1.5px var(--ink); animation: drift 40s linear infinite; }
.soon-row.rev span { animation-direction: reverse; }
.soon-row.on span { color: var(--ink); -webkit-text-stroke: 0; animation: none; transform: translateX(-12.5%); }
/* the solid row is drawn by the wall; this copy is for screen readers */
.soon-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.soon-text {
  position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 32px); margin: 0;
  padding: 8px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 12px; line-height: 1.4; letter-spacing: .02em;
}
.outline-acc { color: transparent; -webkit-text-stroke: 2px var(--accent); }
/* each row holds four copies of the text, so moving it by a quarter loops seamlessly */
@keyframes drift { to { transform: translateX(-25%); } }

/* ---------- footer ---------- */
.foot { margin-top: 120px; padding: 88px 40px 40px; border-top: 1px solid var(--line); }
.talk { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; text-decoration: none; color: var(--ink); }
.talk:hover { color: var(--ink); }
.talk h2 { margin: 0; font-weight: 800; font-size: clamp(56px, 10vw, 168px); line-height: .84; letter-spacing: -.045em; text-transform: uppercase; }
.talk h2 span { display: block; }
.talk-go { width: 132px; height: 132px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; transition: transform .5s var(--ease); }
.talk-go svg { width: 48px; height: 48px; }
a.talk:hover .talk-go { transform: rotate(45deg) scale(1.06); }
.socials { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 48px; }
.bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; font-size: 12px; color: var(--muted); }
/* 404: only the copyright line */
.foot.foot-min { margin-top: 0; padding-top: 0; padding-bottom: 24px; border-top: 0; }
.foot-min .bottom { margin-top: 0; }

/* ---------- motion ---------- */
@keyframes rise  { from { transform: translateY(108%); } to { transform: none; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { transform: scale(.82); opacity: .7; } }

/* Scroll reveal: site.js adds .reveal, so without JavaScript everything is simply visible */
.reveal:not(.stack-list) { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in:not(.stack-list) { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal li { opacity: 1 !important; transform: none !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .wrap { padding: 0 28px; }
  .foot { padding: 72px 28px 40px; }
  .badge { width: 140px; height: 140px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-title { font-size: 34px; }
  .sec { padding: 96px 0 32px; }
  .sec-tight { padding-top: 16px; }
  .index { flex: 1 1 100%; }
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .foot { padding: 56px 16px 32px; margin-top: 72px; }
  .navlinks { order: 3; width: 100%; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
  .navlinks a { font-size: 12px; }
  .lang a { min-width: 44px; padding: 0 8px; }
  .tbtn { width: 46px; height: 46px; }
  .eyebrow { font-size: 13px; margin-bottom: 20px; }
  /* Sits beside the short first lines ("I make / Code,") instead of taking its own row. */
  .badge { top: 36px; width: 92px; height: 92px; }
  .badge-c span { width: 40px; height: 40px; }
  .hero-title { font-size: clamp(44px, 14.5vw, 88px); }
  .outline, .outline-acc { -webkit-text-stroke-width: 1.5px; }
  .intro { font-size: 17px; }
  .index { min-width: 0; }
  .index a { font-size: 20px; }
  .sec { padding: 72px 0 24px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .p-card { min-height: 220px; padding: 20px; }
  .p-num { font-size: 96px; }
  .p-title { font-size: 32px; }
  .soon { min-height: 420px; }
  .soon-text { left: 10px; bottom: 10px; max-width: calc(100% - 20px); font-size: 11px; }
  .bento .p-extra { display: none; }
  .talk-go { width: 84px; height: 84px; }
  .talk-go svg { width: 32px; height: 32px; }
  .back { margin-bottom: 24px; }
}

/* ==========================================================================
   Home: full-screen slides
   Each section is one screen; scrolling snaps to the next one. site.js keeps
   --bar-h equal to the fixed header's height and lights up the pager dot.
   ========================================================================== */
html.snap { scroll-snap-type: y mandatory; }

.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar .nav { padding: 14px 0; }

.slide {
  position: relative; display: flex; flex-direction: column;
  height: 100vh; height: 100svh;
  padding-top: calc(var(--bar-h, 78px) + 24px); padding-bottom: 32px;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.slide-in { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.slide .sec-head { padding-bottom: 18px; margin-bottom: 20px; }
.slide .sec-title { font-size: clamp(44px, min(8vw, 11svh), 132px); }

/* pager dots */
.pager { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 15; display: flex; flex-direction: column; align-items: flex-end; }
.pager a { display: flex; align-items: center; gap: 10px; min-height: 24px; text-decoration: none; }
.pager a::after { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: height .35s var(--ease), background-color .3s; }
.pager a:hover::after { background: var(--muted); }
.pager a.on::after { height: 22px; background: var(--accent); }
.pager span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s var(--ease); }
.pager a:hover span, .pager a:focus-visible span { opacity: 1; transform: none; }

/* 1 · hero */
.hero .slide-in { justify-content: center; }
.snap .hero-title { font-size: clamp(44px, min(11.5vw, 13svh), 188px); }
.snap .hero-foot { margin-top: clamp(24px, 5svh, 56px); }
.snap .index a { padding: 10px 0; }
.scroll-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  animation: nudge 2.2s ease-in-out infinite;
}
.scroll-hint svg { width: 14px; height: 14px; transform: rotate(90deg); }

/* 2 · toolbox */
.stack .slide-in { justify-content: center; }
.slide .stack-list { font-size: clamp(34px, min(7.4vw, 9.5svh), 118px); }

/* 3 · projects: two rows of four cards share the rest of the screen (capped so they don't get too tall) */
.slide .sec-head-plain { padding-bottom: 0; }
.slide .bento { flex: 1; min-height: 0; max-height: 640px; grid-auto-rows: minmax(0, 1fr); }
.slide .p-card { min-height: 0; container-type: size; }
.slide .p-num { font-size: min(112px, 46cqh); }
.slide .p-title { font-size: clamp(22px, min(2.9vw, 17cqh), 40px); }
.slide .p-card.all .p-title { font-size: clamp(24px, min(3.8vw, 22cqh), 56px); }

/* small tiles: keep the title, drop the extras */
@container (max-height: 200px) {
  .p-desc { display: none; }
}
@container (max-height: 130px) {
  .p-top, .arch, .all-go { display: none; }
}

/* 4 · photos: see "photos" above. 5 · drawings: the coming-soon panel fills the rest of the screen */
.slide .soon { flex: 1 1 0; min-height: 0; }
.slide .soon-wall { font-size: clamp(40px, min(7vw, 11svh), 104px); }

/* 6 · contact */
.foot.slide { margin-top: 0; }
.foot.slide .foot-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.foot.slide .bottom { margin-top: 24px; }
.snap .talk h2 { font-size: clamp(56px, min(10vw, 17svh), 168px); }

@keyframes nudge { 50% { transform: translate(-50%, 6px); } }

@media (max-width: 1024px) and (orientation: portrait) {
  .slide .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 900px; }
  .bento .p-extra { display: none; }
}

@media (max-width: 640px) {
  .snap .navlinks { display: none; }
  .slide { padding-top: calc(var(--bar-h, 74px) + 16px); padding-bottom: 24px; }
  .snap .hero-title { font-size: clamp(40px, min(14.5vw, 9.5svh), 88px); }
  .snap .hero-foot { gap: 20px; }
  .slide .stack-list { font-size: clamp(30px, min(11vw, 6.5svh), 56px); }
  .snap .talk h2 { font-size: min(19vw, 12svh); }
  .pager { right: 4px; }
  .pager a { min-height: 20px; }
  .pager a::after { width: 6px; height: 6px; }
  .pager a.on::after { height: 18px; }
  .pager span { display: none; }

  .slide .bento { gap: 10px; }
  .slide .p-card { min-height: 0; padding: 12px 14px; gap: 8px; border-radius: 14px; }
  .slide .p-card:hover { transform: none; }
  .slide .p-title, .slide .p-card.all .p-title { margin-bottom: 4px; font-size: 22px; }
  .slide .p-card.all .arch { display: none; }
  .slide .all-go { width: 28px; height: 28px; }
  .sec-count { font-size: 11px; }
}

/* short screens: drop the extras rather than overflow */
@media (max-height: 700px) {
  .snap .intro, .slide .p-desc { display: none; }
  .snap .hero-title { font-size: clamp(40px, min(11.5vw, 12svh), 188px); }
  .snap .index a { padding: 8px 0; }
}

/* landscape phones and tiny windows: plain scrolling, slides grow with their content */
@media (max-height: 540px) {
  html.snap { scroll-snap-type: none; }
  .slide { height: auto; min-height: 100svh; }
  .slide .soon { flex: none; min-height: 360px; }
  .slide .bento { max-height: none; grid-auto-rows: 200px; }
  .pager, .scroll-hint { display: none; }
}

/* ---------- custom cursor (fine pointers only; enabled by site.js) ---------- */
.has-cur, .has-cur * { cursor: none !important; }
/* .cur is moved by site.js (translate only); its ::before is the circle, grown with scale
   so nothing here triggers layout. Drawn at the large size and scaled down for crisp edges. */
.cur {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 0; height: 0; opacity: 0; transition: opacity .2s; will-change: transform;
}
.cur::before {
  content: ""; position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--accent);
  transform: scale(.25); transition: transform .3s var(--ease), background-color .3s;
}
.cur.on { opacity: 1; }
.cur.big::before { transform: scale(1); background-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.cur.down::before { transform: scale(.18); }
.cur.big.down::before { transform: scale(.8); }
