/* Dipanshu Kudiyal, personal portfolio. Design direction "Redline": see DESIGN.md. */

:root {
  --paper: #F2F0EB;
  --paper-2: #E8E5DD;
  --card: #FBFAF7;
  --ink: #141416;
  --text: #2B2A2E;
  --muted: #5F5D58;
  --line: #D6D2C8;
  --red: #FF4A1C;
  --red-ink: #B4300B;
  --red-soft: #FF8763;
  --night: #131315;
  --night-2: #1D1D21;
  --on-night: #F2F0EB;
  --on-night-muted: #A9A7A1;
  --line-night: rgba(255, 255, 255, .14);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --gutter: 20px;
  --max: 1320px;
  --space: clamp(84px, 12vw, 168px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; scroll-padding-top: 80px; scroll-padding-bottom: 100px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 1.0625rem/1.6 var(--display); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 3px; border-radius: 3px; }
.night :focus-visible, .site-footer :focus-visible { outline-color: #fff; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -70px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); font-weight: 600; border-radius: 10px; }
.skip:focus { top: 12px; color: var(--paper); }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.idx { font: 500 .8rem/1 var(--mono); color: var(--red-ink); letter-spacing: .02em; }
.night .idx { color: var(--red-soft); }
svg.i { width: 18px; height: 18px; flex: none; }

/* ---------- Header and navigation ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter); }
/* The blurred bar is a pseudo-element: a backdrop-filter on the header itself would trap the fixed phone dock inside it. */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(242, 240, 235, .94); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .3s; }
.site-header.is-scrolled::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; color: var(--ink); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--paper); font: 600 .7rem var(--mono); letter-spacing: 0; transition: background-color .25s, transform .35s var(--ease); }
.brand:hover { color: var(--ink); }
.brand:hover .brand-mark { background: var(--red); color: var(--ink); transform: rotate(-8deg); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav a { position: relative; display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.site-nav a .n { font: 500 .7rem var(--mono); color: var(--muted); }
.site-nav a svg { display: none; }
.site-nav a:hover { background: rgba(20, 20, 22, .06); color: var(--ink); }
.site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current] .n { color: var(--red-ink); }
.site-nav a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px; background: var(--red); border-radius: 2px; }

/* Phones: the navigation becomes a floating dock within thumb reach. */
@media (max-width: 719.98px) {
  .site-nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; padding: 6px; border-radius: 18px; background: rgba(19, 19, 21, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .5); }
  .site-nav ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .site-nav a { flex-direction: column; justify-content: center; gap: 4px; min-height: 54px; padding: 4px 2px; border-radius: 13px; color: var(--on-night-muted); font-size: .74rem; font-weight: 600; line-height: 1.1; text-align: center; }
  .site-nav a .n { display: none; }
  .site-nav a svg { display: block; width: 20px; height: 20px; }
  .site-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .site-nav a[aria-current] { background: rgba(255, 255, 255, .13); color: #fff; }
  .site-nav a[aria-current]::after { left: 50%; right: auto; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; }
  .site-nav :focus-visible { outline-color: #fff; }
}
@media (forced-colors: active) {
  .site-nav { border: 1px solid CanvasText; }
}

/* ---------- Buttons and links ---------- */
.go { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; color: var(--ink); font-weight: 650; font-size: 1.08rem; text-decoration: none; }
.go .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform .4s var(--ease), background-color .25s, color .25s; }
.go .ico svg { width: 18px; height: 18px; }
.go:hover { color: var(--ink); }
.go:hover .ico { background: var(--red); color: var(--ink); transform: rotate(-45deg); }
.go.down:hover .ico { transform: translateY(4px); }
.go.ext:hover .ico { transform: translate(2px, -2px); }
.go.alt .ico { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.go.alt:hover .ico { background: var(--ink); color: var(--paper); box-shadow: none; }
.night .go, .night .go:hover { color: var(--on-night); }
.night .go .ico { background: var(--on-night); color: var(--night); }
.night .go:hover .ico { background: var(--red); color: var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font: 650 1rem var(--display); text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--red); border-color: var(--red); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Section heads ---------- */
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(40px, 6vw, 84px); }
.sec-head h2 { font-size: clamp(2.6rem, 9vw, 6.2rem); font-weight: 800; letter-spacing: -0.045em; line-height: .95; }
.sec-head p { max-width: 42ch; color: var(--muted); font-size: 1.1rem; }
.night .sec-head h2 { color: var(--on-night); }
.night .sec-head p { color: var(--on-night-muted); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow-x: clip; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--lx, 72%) var(--ly, 42%), rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 38%), radial-gradient(circle at 72% 62%, rgba(255, 74, 28, .09), rgba(255, 74, 28, 0) 34%); }
.hero-sticky { position: relative; padding: 88px 0 40px; }
.hero-grid { position: relative; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); display: grid; grid-template-areas: "name" "stage" "intro"; }
.name { grid-area: name; margin: 0 0 0 -.04em; font-size: clamp(3.4rem, 22vw, 11rem); font-weight: 800; line-height: .84; letter-spacing: -0.055em; color: var(--ink); }
.name .w { display: block; }
.name-3d { position: relative; display: inline-block; }
.name-front { position: relative; z-index: 1; }
.name-depth { position: absolute; inset: 0; color: var(--red); }
.name-depth > span { position: absolute; inset: 0; opacity: calc(1 - var(--i) * .1); transform: translate(calc(var(--i) * var(--ex, 1.5px)), calc(var(--i) * var(--ey, 1.5px))); }
.intro { grid-area: intro; display: grid; gap: 18px; max-width: 35rem; }
.intro-big { color: var(--ink); font-size: clamp(1.65rem, 6.6vw, 2.6rem); font-weight: 650; line-height: 1.08; letter-spacing: -0.03em; }
.apart { display: inline-block; white-space: nowrap; margin-inline: calc((1 - var(--p, 1)) * .55em); }
.apart > span { display: inline-block; color: var(--red-ink); transform: translateX(calc((var(--i) - 2) * (1 - var(--p, 1)) * .26em)) rotate(calc((var(--i) - 2) * (1 - var(--p, 1)) * 5deg)); }
.desc { max-width: 40ch; color: var(--muted); font-size: 1.1rem; }
.cue { display: none; position: absolute; right: var(--gutter); bottom: 26px; align-items: center; gap: 12px; color: var(--muted); font: 500 .76rem var(--mono); opacity: clamp(0, calc(1 - var(--p, 0) * 3), 1); }
.cue::before { content: ""; width: 36px; height: 1px; background: var(--red); }

/* The 3D stage: an exploded website that assembles as --p goes from 0 to 1 (set on .hero by motion.js). */
.stage { grid-area: stage; position: relative; height: 300px; margin: 26px 0 30px; perspective: 1500px; perspective-origin: 50% 35%; --w: 270px; --h: 177px; --gap: 19px; --rt: calc(60% - 13% * var(--p, 0)); --fade: 9; }
.rig { position: absolute; left: 50%; top: var(--rt, 50%); width: var(--w); height: var(--h); margin: calc(var(--h) / -2) 0 0 calc(var(--w) / -2); transform-style: preserve-3d;
  --a: calc(56deg * (1 - var(--p, 0)) + var(--tx, 0deg));
  --b: calc(-38deg * (1 - var(--p, 0)));
  transform: rotateX(var(--a)) rotateY(var(--ty, 0deg)) rotateZ(var(--b)) scale(calc(.86 + .24 * var(--p, 0))); }
.pl { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--z) * (var(--gap) * (1 - var(--p, 0)) + .5px))); }
.pl > i, .m-phone > i { position: absolute; display: block; }
.floor { position: absolute; inset: 8% 5%; border-radius: 24px; background: rgba(20, 20, 22, .34); filter: blur(22px); transform: translateZ(-2px); opacity: calc(.6 - .25 * var(--p, 0)); }
.m-page { inset: 0; border-radius: 12px; background-color: var(--card); background-image: linear-gradient(rgba(20, 20, 22, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 20, 22, .045) 1px, transparent 1px); background-size: 16px 16px; box-shadow: inset 0 0 0 1px rgba(20, 20, 22, .12); }
.m-nav { border-radius: 12px 12px 0 0; background: #fff; box-shadow: inset 0 -1px 0 rgba(20, 20, 22, .1), 0 8px 18px -12px rgba(20, 20, 22, .35); }
.m-logo { border-radius: 50%; background: var(--ink); }
.m-link { border-radius: 4px; background: rgba(20, 20, 22, .28); }
.m-pill { border-radius: 999px; background: var(--ink); }
.m-bar { border-radius: 4px; background: var(--ink); }
.m-bar.hl { background: linear-gradient(90deg, #5B4BE8, #8C6CF2); }
.m-sub { border-radius: 3px; background: rgba(20, 20, 22, .22); }
.m-btn { border-radius: 999px; background: #5B4BE8; box-shadow: 0 6px 14px -6px rgba(91, 75, 232, .7); }
.m-img { border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 70% 30%, #FFE6A8 0 9%, rgba(255, 230, 168, 0) 10%), linear-gradient(170deg, rgba(0, 0, 0, 0) 55%, #3E2C8F 56%), linear-gradient(160deg, rgba(0, 0, 0, 0) 64%, #2A1E66 65%), linear-gradient(180deg, #FFB38A, #FF7A59 55%, #C2509A); box-shadow: 0 12px 24px -12px rgba(20, 20, 22, .4); }
.m-card { border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(20, 20, 22, .1), 0 10px 20px -14px rgba(20, 20, 22, .45); }
.m-card::before { content: ""; position: absolute; left: 10%; top: 16%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #E6E1FF; }
.m-card::after { content: ""; position: absolute; left: 10%; right: 22%; bottom: 20%; height: 12%; border-radius: 3px; background: rgba(20, 20, 22, .2); box-shadow: 0 -9px 0 rgba(20, 20, 22, .1); }
.m-phone { border-radius: 14px; background: var(--card); box-shadow: 0 0 0 3px var(--ink), 0 22px 30px -16px rgba(20, 20, 22, .55); overflow: hidden; }
.m-phone .m-img { border-radius: 6px; box-shadow: none; }
.pin { position: absolute; width: 0; height: 0; transform-style: preserve-3d; }
.pin::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(255, 74, 28, .22); opacity: clamp(0, calc(1 - var(--p, 0) * var(--fade)), 1); }
/* Labels turn back toward the viewer (the inverse of the rig's rotation), so they stay readable in 3D. */
.pin-in { position: absolute; left: -8.5px; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; transform-origin: 8.5px 100%; transform: rotateZ(calc(var(--b) * -1)) rotateY(calc(var(--ty, 0deg) * -1)) rotateX(calc(var(--a) * -1)); opacity: clamp(0, calc(1 - var(--p, 0) * var(--fade)), 1); pointer-events: none; }
.pin-in::after { content: ""; width: 1px; height: 24px; margin-left: 8px; background: var(--red); }
.pin-tag { padding: 5px 8px; border: 1px solid var(--red); border-radius: 6px; background: rgba(251, 250, 247, .9); color: var(--red-ink); font: 500 .66rem/1 var(--mono); white-space: nowrap; }
.pin.minor { display: none; }
.stage-cap { position: absolute; left: 0; right: 0; bottom: -8px; text-align: center; color: var(--muted); font: 500 .74rem/1.4 var(--mono); opacity: clamp(0, calc((var(--p, 0) - .72) * 4), 1); }
.stage-cap b { color: var(--red-ink); font-weight: 500; }

@media (min-width: 720px) {
  :root { --gutter: 36px; }
  .shot { flex-basis: 62%; }
  .stage { height: 470px; margin: 64px 0 30px; --w: 430px; --h: 281px; --gap: 34px; --rt: calc(55% - 7% * var(--p, 0)); }
  .pin.minor { display: block; }
  .pin-tag { font-size: .72rem; }
}
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr; grid-template-areas: none; column-gap: 24px; }
  .name { grid-column: 1 / 8; grid-row: 1; align-self: start; font-size: clamp(6rem, 12.4vw, 12rem); }
  .intro { grid-column: 1 / 6; grid-row: 2; align-self: end; padding-bottom: 8px; }
  .stage-cap { bottom: 6%; }
  .stage { grid-column: 6 / 13; grid-row: 1 / 3; height: auto; min-height: 520px; margin: 0; --rt: 50%; --fade: 2.4; --w: 520px; --h: 340px; --gap: 42px; }
}
/* Desktop: the hero pins for about one screen of scrolling while the layers assemble. */
@media (min-width: 1000px) and (min-height: 600px) {
  .motion-on .hero { height: 185vh; }
  .motion-on .hero-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 72px 0 36px; }
  .motion-on .hero-grid { width: 100%; flex: 1; }
  .motion-on .cue { display: flex; }
}

/* ---------- Selected work ---------- */
.work { padding-top: var(--space); }
.proj { margin-bottom: var(--space); }
.proj-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--ink); }
.proj-title h3 { font-size: clamp(3.4rem, 14vw, 9rem); font-weight: 800; line-height: .84; letter-spacing: -0.055em; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 8px 11px; border: 1px solid currentColor; border-radius: 999px; color: var(--text); font: 500 .72rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.tags li.concept { border-color: var(--red); color: var(--red-ink); }
.night .tags li { color: var(--on-night); }
.night .tags li.concept { color: var(--red-soft); }
.fh-comp { position: relative; padding-bottom: 22%; margin-bottom: 40px; }
.browser { position: relative; display: block; border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: 0 50px 80px -44px rgba(20, 20, 22, .5), 0 0 0 1px rgba(20, 20, 22, .12); color: inherit; text-decoration: none; }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: #E9E6DF; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #CFCAC0; }
.browser-bar span { flex: 1; max-width: 360px; margin-left: 10px; padding: 4px 10px; border-radius: 6px; background: var(--card); color: var(--muted); font: 500 .68rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-view { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; container-type: size; }
/* With a mouse: hovering the frame scrolls the whole page inside it, then back up on leave. */
@media (hover: hover) and (pointer: fine) {
  .browser .scroller { transition: transform 7s cubic-bezier(.45, 0, .55, 1); }
  .browser:hover .scroller { transform: translateY(calc(-100% + 100cqh)); }
}
.scroller { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; }
.device { position: absolute; right: 2%; bottom: 0; width: 30%; max-width: 230px; padding: 6px; border-radius: 26px; background: var(--ink); box-shadow: 0 40px 60px -26px rgba(20, 20, 22, .6); }
.device-view { position: relative; aspect-ratio: 375 / 760; overflow: hidden; border-radius: 20px; background: #fff; }
.proj-info { display: grid; gap: 26px; }
.proj-copy { display: grid; gap: 26px; align-content: start; }
.proj-desc { max-width: 30ch; color: var(--ink); font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.3; letter-spacing: -0.015em; }
.proj-facts { margin: 0; display: grid; border-top: 1px solid var(--line); }
.proj-facts > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.proj-facts dt { color: var(--muted); font: 500 .72rem/1.9 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.proj-facts dd { margin: 0; }

.panel { clip-path: inset(0 calc(var(--q, 1) * min(3vw, 40px)) round calc(var(--q, 1) * 28px)); }
.night { background: var(--night); color: var(--on-night); }
.proj-inside { padding-block: clamp(70px, 10vw, 140px); }
.in-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.in-head h3 { max-width: 14ch; color: var(--on-night); font-size: clamp(2.4rem, 8vw, 5.6rem); font-weight: 800; line-height: .92; letter-spacing: -0.05em; }
.in-desc { max-width: 40ch; color: var(--on-night-muted); font-size: 1.15rem; }
/* Phones and tablets: a swipeable strip. Desktop: a staggered, asymmetric grid. */
.gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.gallery:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.shot { flex: 0 0 84%; display: grid; gap: 14px; align-content: start; margin: 0; scroll-snap-align: center; }
.shot-frame { display: block; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .1); }
.shot img { width: 100%; transition: transform 1.2s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot figcaption { color: var(--on-night-muted); font-size: 1rem; }
.shot figcaption b { display: block; color: var(--on-night); font-size: 1.1rem; font-weight: 650; }
.more { display: flex; align-items: center; gap: 14px; padding-top: clamp(40px, 6vw, 72px); color: var(--muted); }
.more::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(255, 74, 28, .16); }

@media (min-width: 1000px) {
  .fh-comp { padding-bottom: 9%; }
  .browser { width: 80%; }
  .device { right: 1%; width: 19%; }
  .proj-info { grid-template-columns: 6fr 5fr; gap: 64px; align-items: start; }
  .gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px 24px; overflow: visible; margin: 0; padding: 0; }
  .shot:nth-child(1) { grid-column: 1 / 8; }
  .shot:nth-child(2) { grid-column: 8 / 13; margin-top: 140px; }
  .shot:nth-child(3) { grid-column: 2 / 7; margin-top: -30px; }
  .shot:nth-child(4) { grid-column: 7 / 13; margin-top: 60px; }
  .sec-head { grid-template-columns: 1fr auto; align-items: end; column-gap: 40px; }
  .sec-head .idx { grid-column: 1 / -1; }
}

/* ---------- What I do ---------- */
.do { padding-block: var(--space); }
.do-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.do-item { display: grid; gap: 10px; padding: clamp(22px, 3vw, 36px) 0; border-bottom: 1px solid var(--line); }
.do-tag { color: var(--muted); font: 500 .74rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.do-line { max-width: 19ch; color: var(--ink); font-size: clamp(1.9rem, 6.4vw, 4.4rem); font-weight: 700; line-height: 1.03; letter-spacing: -0.04em; }
.do-item.small .do-line { max-width: 34ch; color: var(--text); font-size: clamp(1.3rem, 3.4vw, 2.1rem); font-weight: 600; letter-spacing: -0.025em; }
.fx { position: relative; display: inline-block; white-space: nowrap; }
.fx-scratch svg { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .34em; overflow: visible; color: var(--red); }
.fx-scratch path, .circled path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.fx-dated .old { position: absolute; left: 0; bottom: 0; color: #2346C8; font: italic 400 1em/1.03 "Times New Roman", Times, serif; letter-spacing: 0; text-decoration: underline; text-decoration-thickness: .04em; opacity: 0; }
.fx-broken .ch { display: inline-block; }
.fx-fit::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.12em; height: 8px; border: solid var(--red); border-width: 0 1.5px; background: linear-gradient(var(--red), var(--red)) 0 50% / 100% 1.5px no-repeat; transform-origin: 0 50%; }
@media (min-width: 1000px) {
  .do-item { grid-template-columns: 2fr 10fr; align-items: baseline; gap: 24px; }
}

/* ---------- About ---------- */
.about { padding-block: 0 var(--space); }
/* Here the greeting is the headline, so the section title becomes a small label. */
.about .sec-head { margin-bottom: 28px; }
.about .sec-head h2 { color: var(--muted); font: 500 .8rem/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.about-grid { display: grid; gap: 40px; }
.hello { color: var(--ink); font-size: clamp(3rem, 14vw, 8.6rem); font-weight: 800; line-height: .9; letter-spacing: -0.055em; }
.circled { position: relative; display: inline-block; }
.circled svg { position: absolute; left: -9%; top: -12%; width: 118%; height: 130%; overflow: visible; color: var(--red); pointer-events: none; }
.about-text { display: grid; gap: 18px; max-width: 40ch; font-size: 1.18rem; }
.place { color: var(--muted); font: 500 .82rem/1.6 var(--mono); }
@media (min-width: 1000px) {
  .about-grid { grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 56px; }
  .hello { grid-column: 1 / -1; }
  .about-text { grid-column: 6 / 12; }
}

/* ---------- Contact ---------- */
.contact { position: relative; padding-block: clamp(72px, 10vw, 140px) clamp(56px, 7vw, 96px); border-radius: 28px 28px 0 0; }
.hello-big { margin-bottom: clamp(28px, 4vw, 56px); color: var(--on-night); font-size: clamp(4.2rem, 21vw, 15rem); font-weight: 800; line-height: .84; letter-spacing: -0.06em; }
.contact-grid { display: grid; gap: 44px; }
.contact-side { display: grid; gap: 18px; align-content: start; }
.contact-lead { max-width: 30ch; color: var(--on-night); font-size: 1.3rem; line-height: 1.4; }
.madlib { position: relative; display: grid; gap: 10px; }
.ml-line { color: var(--on-night); font-size: clamp(1.45rem, 3.6vw, 2.2rem); font-weight: 600; line-height: 1.6; letter-spacing: -0.025em; }
.madlib input, .madlib select { width: 9.5em; max-width: 100%; min-height: max(1.5em, 44px); padding: 0 4px; border: 0; border-bottom: 2px solid rgba(255, 255, 255, .55); border-radius: 0; background: transparent; color: #fff; font: inherit; letter-spacing: inherit; transition: border-color .2s, box-shadow .2s; }
/* Where supported, each blank grows with what's typed or chosen, so the sentence reads naturally. */
@supports (field-sizing: content) {
  .madlib input, .madlib select { field-sizing: content; width: auto; min-width: 5ch; }
}
.madlib input::placeholder { color: #8F8D88; opacity: 1; }
.madlib select { width: auto; padding-right: 1.15em; appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2F0EB' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / .55em; cursor: pointer; }
.madlib select option { background: #fff; color: #141416; font-size: 1rem; }
.madlib input:hover, .madlib select:hover { border-bottom-color: #fff; }
.madlib input:focus-visible, .madlib select:focus-visible { outline: none; border-bottom-color: var(--red-soft); box-shadow: 0 3px 0 var(--red-soft); }
.madlib [aria-invalid="true"] { border-bottom-color: #FF9C85; }
.ml-small { font-size: clamp(1.15rem, 2.8vw, 1.6rem); color: var(--on-night-muted); }
.ml-small input { color: var(--on-night); }
.ml-more { display: grid; gap: 8px; margin-top: 14px; }
.ml-more label { color: var(--on-night); font-weight: 600; }
.ml-more label span { color: var(--on-night-muted); font-weight: 400; }
.madlib textarea { width: 100%; min-height: 120px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .42); border-radius: 12px; background: var(--night-2); color: #fff; font: inherit; font-size: 1.05rem; resize: vertical; }
.madlib textarea:hover { border-color: #fff; }
.madlib textarea:focus-visible { outline: 2px solid var(--red-soft); outline-offset: 2px; }
.err-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; color: #FFB4A3; font-size: .98rem; }
.err-list li:empty { display: none; }
.ml-send { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 10px; }
.send { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--red); color: var(--ink); font: 700 1.1rem var(--display); cursor: pointer; transition: background-color .2s, transform .3s var(--ease); }
.send svg { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.send:hover { background: var(--red-soft); transform: translateY(-2px); }
.send:hover svg { transform: translateX(4px); }
.send:disabled { opacity: .7; cursor: progress; transform: none; }
.form-status { max-width: 40ch; color: var(--on-night); }
.form-status:empty { display: none; }
.form-status.is-ok { color: #A6F0C2; }
.form-status.is-error { color: #FFB4A3; }
.hp { position: absolute; left: -9999px; }
.fine { color: var(--on-night-muted); font-size: .9rem; }
@media (min-width: 1000px) {
  .contact-grid { grid-template-columns: 4fr 7fr; gap: 80px; }
}

/* ---------- Footer ---------- */
.site-footer { padding: 26px 0 34px; border-top: 1px solid var(--line-night); background: var(--night); color: var(--on-night-muted); font-size: .9rem; }
.footer-row { display: grid; gap: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-night); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 719.98px) {
  .site-footer { padding-bottom: calc(34px + 78px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1000px) {
  .footer-row { grid-template-columns: 1fr auto; align-items: center; gap: 40px; }
}

/* ---------- Inner pages: case study, handover, thanks ---------- */
.page-head { padding: 120px 0 clamp(36px, 5vw, 60px); border-bottom: 1px solid var(--line); }
.page-head .wrap { display: grid; gap: 20px; }
.page-head h1 { max-width: 13ch; font-size: clamp(3rem, 12vw, 8rem); font-weight: 800; line-height: .88; letter-spacing: -0.055em; }
.crumbs { color: var(--muted); font: 500 .8rem var(--mono); }
.crumbs a { color: var(--muted); }
.lead { max-width: 42ch; color: var(--muted); font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.45; }
.facts { margin: 8px 0 4px; display: grid; max-width: 980px; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font: 500 .72rem/1.8 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.facts dd { margin: 0; }
.cs-block { padding-block: clamp(64px, 9vw, 130px); }
.cs-head { display: grid; gap: 12px; margin-bottom: clamp(32px, 5vw, 60px); }
.cs-head h2 { font-size: clamp(2.3rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -0.045em; line-height: .95; }
.cs-head p { max-width: 42ch; color: var(--muted); font-size: 1.1rem; }
.night .cs-head h2 { color: var(--on-night); }
.night .cs-head p { color: var(--on-night-muted); }
.cs-block .fh-comp { margin-bottom: 0; }
.cs-features { display: grid; gap: 40px; align-items: start; }
.feature-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.feature-list li { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.feature-list h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.feature-list p { color: var(--muted); }
.cs-end { border-top: 1px solid var(--line); }
.cs-end .wrap { display: grid; gap: 28px; }
.cs-end h2 { max-width: 16ch; font-size: clamp(2.3rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.045em; line-height: .95; }
@media (min-width: 1000px) {
  .cs-features { grid-template-columns: 7fr 5fr; gap: 64px; }
}
.figure { margin: 4px 0; }
.figure img { width: 100%; border-radius: 12px; background: #fff; box-shadow: 0 30px 60px -34px rgba(20, 20, 22, .5), 0 0 0 1px rgba(20, 20, 22, .1); }
.figure figcaption { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.thanks { display: grid; align-content: center; gap: 18px; min-height: 70vh; max-width: 760px; margin: 0 auto; padding: 110px var(--gutter) 60px; }
.thanks h1 { font-size: clamp(2.8rem, 10vw, 5.6rem); font-weight: 800; letter-spacing: -0.05em; line-height: .92; }
@media (min-width: 720px) {
  .facts { grid-template-columns: repeat(2, 1fr); column-gap: 40px; }
}

/* ---------- Motion (everything hidden here is keyed to .motion-on, which motion.js adds) ---------- */
.wm { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .2em 0; margin: 0 -.06em -.2em 0; }
.wm > span { display: inline-block; }
.motion-on .reveal-head:not(.is-in) .wm > span { transform: translateY(110%); }
.motion-on .reveal-head.is-in .wm > span { transition: transform 1s var(--ease) calc(var(--i, 0) * 55ms); }
.motion-on [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(30px); }
.motion-on [data-reveal].is-in { transition: opacity .9s var(--ease) calc(var(--d, 0) * 80ms), transform .9s var(--ease) calc(var(--d, 0) * 80ms); }
.motion-on .wipe:not(.is-in) { clip-path: inset(100% 0 0 0); }
.motion-on .wipe.is-in { clip-path: inset(0 0 0 0); transition: clip-path 1.3s var(--ease) .15s; }

/* Hero entrance: the name rises and extrudes; the layers fly in from above. */
@keyframes unhide { to { opacity: 1; } }
.motion .name:not(.is-in) .name-3d { opacity: 0; animation: unhide .01s 3s forwards; }
.motion-on .name:not(.is-in) .name-3d { transform: translateY(.22em); }
.motion-on .name.is-in .name-3d { transition: opacity .8s var(--ease), transform 1s var(--ease); }
.motion-on .name:not(.is-in) .name-depth > span { transform: none; }
.motion-on .name .name-depth > span { transition: transform .9s var(--ease) calc(.4s + var(--i) * 50ms); }
.motion-on .name.ready .name-depth > span { transition: transform .25s ease-out; }
.motion-on .stage:not(.is-in) .pl { translate: 0 0 calc(var(--z) * 60px + 140px); opacity: 0; }
.motion-on .stage.is-in .pl { transition: translate 1.2s var(--ease) calc(.25s + var(--z) * 80ms), opacity .7s ease calc(.25s + var(--z) * 80ms); }

/* What I do: each statement plays "before → after" once, then hovering shows the "before" again. */
.motion-on .do-item:not(.is-done) .fx-scratch path { stroke-dashoffset: 1.05; }
.motion-on .do-item .fx-scratch path { transition: stroke-dashoffset .9s var(--ease); }
.motion-on .fx-dated .old, .motion-on .fx-dated .new { transition: opacity .6s ease, filter .6s ease; }
.motion-on .do-item:not(.is-done) .fx-dated .old { opacity: 1; }
.motion-on .do-item:not(.is-done) .fx-dated .new { opacity: 0; filter: blur(6px); }
.motion-on .fx-broken .ch { transition: transform .6s var(--ease) calc(var(--k) * 40ms); }
.motion-on .do-item:not(.is-done) .fx-broken .ch { transform: translateY(var(--y)) rotate(var(--r)); }
.motion-on .fx-fit::after { transition: transform 1s var(--ease); }
.motion-on .do-item:not(.is-done) .fx-fit::after { transform: scaleX(.35); }
@media (hover: hover) and (pointer: fine) {
  .motion-on .do-item.is-done:hover .fx-dated .old { opacity: 1; }
  .motion-on .do-item.is-done:hover .fx-dated .new { opacity: 0; filter: blur(6px); }
  .motion-on .do-item.is-done:hover .fx-broken .ch { transform: translateY(var(--y)) rotate(var(--r)); }
  .motion-on .do-item.is-done:hover .fx-fit::after { transform: scaleX(.35); }
}

/* About: the red circle draws around the name. */
.motion-on .hello:not(.is-in) .circled path { stroke-dashoffset: 1.05; }
.motion-on .hello.is-in .circled path { transition: stroke-dashoffset 1.1s var(--ease) .5s; }

/* Contact: the big letters lean toward the pointer (motion.js sets --m from 0 to 1 per letter). */
.hello-big .wm { transition: transform .35s var(--ease); transform: translateY(calc(var(--m, 0) * -.12em)) rotate(calc(var(--m, 0) * -4deg)); }

/* A small label that follows the pointer over project previews. */
.cursor-label { position: fixed; left: 0; top: 0; z-index: 80; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 600 .82rem var(--display); white-space: nowrap; pointer-events: none; opacity: 0; scale: .6; transform: translate(-50%, calc(-100% - 14px)); transition: opacity .2s, scale .25s var(--ease); }
.cursor-label.on { opacity: 1; scale: 1; }

/* Page-to-page transition where supported. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .35s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .6s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

@media print {
  .site-header, .site-nav, .skip, .stage, .cue, .cursor-label, .name-depth, .fh-comp .device { display: none !important; }
  .night, .site-footer { background: #fff !important; color: #000 !important; }
  .night *, .site-footer * { color: #000 !important; }
  .panel { clip-path: none !important; }
  .motion-on *, .motion * { opacity: 1 !important; transform: none !important; translate: none !important; clip-path: none !important; animation: none !important; }
  .motion-on .hero { height: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .go .ico, .send, .send svg, .brand-mark, .hello-big .wm, .site-header::before, .shot img { transition: none !important; }
  .browser:hover .scroller, .shot:hover img { transform: none !important; }
  @view-transition { navigation: none; }
}
