/* Drop the licensed PP fonts into /fonts to get the exact look;
   otherwise the Google fallbacks below are used. */
@font-face { font-family: "PP Mondwest"; src: url("fonts/PPMondwest-Regular.woff2") format("woff2"), url("fonts/PPMondwest-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "PP Neue Montreal"; src: url("fonts/PPNeueMontreal-Book.woff2") format("woff2"), url("fonts/PPNeueMontreal-Book.otf") format("opentype"); font-weight: 400; font-display: swap; }

:root {
  /* Palette: #F6F5F1 cream, #222322 charcoal, #D05C36 orange (primary accent), #3159D8 blue (secondary, used sparingly) */
  --cream-rgb: 246, 245, 241;
  --fg-rgb: 246, 245, 241;
  --accent-rgb: 208, 92, 54;
  --blue-rgb: 49, 89, 216;
  --bg: #0B0B0B;          /* near pitch black page */
  --card: #171817;
  --card-2: #222322;       /* palette charcoal, for raised surfaces */
  --line: rgba(var(--fg-rgb), 0.09);
  --text: #F6F5F1;
  --muted: rgba(var(--fg-rgb), 0.68);
  --dim: rgba(var(--fg-rgb), 0.45);
  --accent: #D05C36;
  --blue: #3159D8;
  --display: "PP Mondwest", "Instrument Serif", Georgia, serif;
  --body: "PP Neue Montreal", "Inter Tight", system-ui, sans-serif;
  --radius: 40px;
  --max: 1000px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.1; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ── Nav ─────────────────────────────── */
.nav {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 0 32px; height: 64px; border-radius: 999px;
  background: rgba(34, 35, 34, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  white-space: nowrap;
}
.nav .logo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--text); color: var(--bg); font-family: var(--display); font-size: 18px; }
.nav .logo img { width: 100%; height: 100%; object-fit: contain; }
.nav .sep { width: 1px; height: 18px; background: var(--line); }
.nav a.link { color: var(--muted); font-size: 16px; transition: color 0.2s; }
.nav a.link:hover { color: var(--text); }

/* ── Hero ────────────────────────────── */
.hero { position: relative; min-height: clamp(640px, 100vh, 1000px); display: grid; place-items: center; text-align: center; padding: 160px 20px 120px; overflow: hidden; }
.hero h1 { font-size: clamp(48px, 9.5vw, 132px); line-height: 1; letter-spacing: -0.03em; position: relative; }
.hero p { color: var(--muted); font-size: 18px; max-width: 780px; margin: 40px auto 48px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 58px; border-radius: 999px;
  background: linear-gradient(180deg, #3A3B3A, var(--card));
  border: 1px solid var(--line); color: rgba(var(--fg-rgb), 0.85); font-size: 16px;
  transition: transform 0.3s var(--ease), background 0.3s;
}
.pill:hover { transform: translateY(-2px); background: linear-gradient(180deg, #3A3B3A, var(--card)); }

/* ── Sections ────────────────────────── */
section.block { padding: 100px 0; }
.section-title { font-size: clamp(40px, 6vw, 56px); text-align: center; margin-bottom: 56px; }

.card { background: var(--card); border-radius: var(--radius); border: 1px solid rgba(var(--fg-rgb), 0.04); position: relative; overflow: hidden; }

/* ── Work grid ───────────────────────── */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.work-col { display: flex; flex-direction: column; gap: 24px; }
.project { display: flex; flex-direction: column; padding: 40px; min-height: 600px; transition: transform 0.5s var(--ease); }
.project:hover { transform: translateY(-4px); }
.project .meta { color: var(--dim); font-size: 16px; text-transform: uppercase; letter-spacing: 0.01em; }
.project h3 { font-size: 40px; margin: 12px 0 16px; }
.project .sum { color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 420px; position: relative; z-index: 2; }
/* Round arrow that stretches into a "Read more →" pill on hover */
.project .go {
  margin-top: auto; align-self: flex-start; position: relative; z-index: 3;
  height: 48px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.08), rgba(var(--fg-rgb), 0.16)), rgba(34, 35, 34, 0.6);
  border: 1px solid rgba(var(--fg-rgb), 0.08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--text); font-size: 17px; white-space: nowrap;
  transition: padding 0.45s var(--ease), background 0.3s;
}
.project .go-label { max-width: 0; opacity: 0; overflow: hidden; transition: max-width 0.45s var(--ease), opacity 0.3s, margin 0.45s var(--ease); }
.project:hover .go { padding: 0 22px; }
.project:hover .go-label { max-width: 140px; opacity: 1; margin-right: 10px; }
.project .media { position: absolute; right: 40px; bottom: 0; width: 56%; aspect-ratio: 3 / 4; }
.project .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 28px 28px 0 0; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.project .media img.alt { opacity: 0; }
.project:hover .media img.alt { opacity: 1; }
.project:hover .media img { transform: translateY(-8px); }
.project.feature { grid-column: 1 / -1; min-height: 390px; }
.project.feature .sum { max-width: 480px; }
.project.feature .media { width: 260px; right: 96px; }
.work-col .project { min-height: 720px; }
.work-col .project.short { min-height: 600px; }
.work-col .project .media { left: 50%; right: auto; transform: translateX(-50%); width: 260px; }

.ph {
  position: absolute; inset: 0; border-radius: 28px 28px 0 0;
  background: repeating-linear-gradient(135deg, var(--card-2) 0 14px, var(--card) 14px 28px);
  border: 1px dashed rgba(var(--fg-rgb), 0.12); border-bottom: 0;
  display: grid; place-items: center; color: var(--dim); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; padding: 12px;
}
.ph.round { border-radius: inherit; border-bottom: 1px dashed rgba(var(--fg-rgb), 0.12); }

/* ── About ───────────────────────────── */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.about-grid .card { padding: 40px; }
.about-grid h3 { font-size: 40px; margin-bottom: 24px; }
.about-grid p { color: var(--muted); font-size: 16px; line-height: 1.75; }
.about-grid p + p { margin-top: 12px; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; } .span-9 { grid-column: span 9; }
.span-6 { grid-column: span 6; }
.portrait { padding: 0 !important; min-height: 290px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.tl-head { display: flex; justify-content: space-between; align-items: baseline; }
.tl-head a { font-size: 16px; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.tl-head a:hover { opacity: 0.7; }
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 40px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 46px; height: 1px; background: var(--line); }
.timeline .period { color: var(--dim); font-size: 14px; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text); margin: 20px 0 24px; position: relative; }
.timeline .t { color: var(--text); font-size: 16px; }
.timeline .p { color: var(--dim); font-size: 14px; }

.hobby { min-height: 470px; }
.covers { position: absolute; left: 112px; bottom: -30px; display: grid; grid-template-columns: repeat(3, 120px); gap: 16px; align-items: end; }
.covers > div { display: flex; flex-direction: column; gap: 16px; }
.covers .c { width: 120px; aspect-ratio: 1; border-radius: 22px; overflow: hidden; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: transform 0.4s var(--ease); }
.covers .c:hover { transform: rotate(-4deg) scale(1.06); }
.covers .c img { width: 100%; height: 100%; object-fit: cover; }
.covers > div:nth-child(1) { padding-bottom: 76px; }
.covers > div:nth-child(2) { padding-bottom: 46px; }
.hand { position: absolute; left: 34px; bottom: 34px; color: var(--dim); font-family: "Caveat", cursive; font-size: 20px; }
.hand svg { display: block; margin-bottom: 4px; margin-left: 6px; }

.gallery { padding: 0 !important; min-height: 470px; }
.gallery .slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery .dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px 8px; border-radius: 99px; background: rgba(0,0,0,0.3); backdrop-filter: blur(8px); z-index: 2; }
.gallery .dots button { width: 6px; height: 6px; border-radius: 50%; border: 0; background: rgba(var(--fg-rgb), 0.45); cursor: pointer; padding: 0; }
.gallery .dots button.on { background: var(--text); }

/* ── Contact ─────────────────────────── */
.contact { text-align: center; padding: 260px 0 0; overflow: hidden; }
.contact .section-title { margin-bottom: 16px; }
.contact p { color: var(--muted); font-size: 18px; }
.socials { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 64px; }
.round-btn { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); color: var(--muted); transition: transform 0.3s var(--ease), color 0.3s; }
.round-btn:hover { transform: translateY(-4px); color: var(--text); }
.email-btn { width: 360px; height: 80px; padding: 0; border-radius: 999px; position: relative; overflow: hidden; font-size: 18px; }
.email-btn span { position: absolute; inset: 0; display: grid; place-items: center; transition: transform 0.45s var(--ease); }
.email-btn span + span { transform: translateY(100%); }
.email-btn:hover span:first-child { transform: translateY(-100%); }
.email-btn:hover span + span { transform: translateY(0); }

/* ── Case study ──────────────────────── */
.cs { padding: 24px 0 120px; }
.back { width: 48px; height: 48px; }
.cs-head { text-align: center; margin: 40px 0 56px; }
.cs-head h1 { font-size: clamp(44px, 7vw, 64px); }
.cs-head .meta { color: var(--dim); text-transform: uppercase; margin-top: 16px; }
.cs-hero { overflow: hidden; aspect-ratio: 5 / 3; position: relative; background: var(--card); }
.cs-hero img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 40px 0; margin: 80px 0 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts h4 { color: var(--dim); font-weight: 300; font-size: 14px; text-transform: uppercase; margin-bottom: 8px; }
.facts p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.cs-text { margin-top: 72px; }
.cs-text h2 { font-size: 36px; margin-bottom: 16px; }
.cs-text p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.cs-text p + p { margin-top: 14px; }
.cs-img { margin-top: 56px; }
.cs-img .frame { overflow: hidden; background: var(--card); position: relative; min-height: 360px; }
.cs-img figcaption { color: var(--dim); font-size: 14px; text-align: center; margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-top: 56px; }
.stats .card { padding: 32px; }
.stats .v { font-size: 56px; }
.stats .l { color: var(--muted); }
.cs-cta { text-align: center; margin-top: 120px; }
.cs-cta p { color: var(--muted); max-width: 520px; margin: 16px auto 40px; }

/* ── Reveal on scroll ────────────────── */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .ch { opacity: 1; transform: none; filter: none; animation: none; transition: none; }
}

/* ── Responsive ──────────────────────── */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .project.feature .media, .project .media { width: 220px; right: 50%; left: auto; transform: translateX(50%); }
  .project, .work-col .project, .work-col .project.short, .project.feature { min-height: 620px; }
  .about-grid > * { grid-column: 1 / -1 !important; }
  .portrait { min-height: 380px; }
  .covers { left: auto; right: 12px; grid-template-columns: repeat(3, 92px); }
  .covers .c { width: 92px; border-radius: 18px; }
}
@media (max-width: 640px) {
  .nav { gap: 18px; padding: 0 20px; height: 54px; top: 16px; }
  .nav a.link { font-size: 14px; }
  .nav .sep { display: none; }
  .project, .about-grid .card { padding: 28px; }
  .project h3, .about-grid h3 { font-size: 32px; }
  .timeline { grid-auto-flow: row; gap: 24px; }
  .timeline::before { display: none; }
  .timeline .dot { margin: 10px 0 12px; }
  .socials { flex-wrap: wrap; gap: 14px; }
  .round-btn { width: 64px; height: 64px; }
  .email-btn { order: -1; width: 100%; }
  .facts { grid-template-columns: 1fr; gap: 24px; }
  .contact { padding-top: 160px; }
}

/* ── Additions: journey, photo caption, footnote ── */
.section-title { max-width: 820px; margin-left: auto; margin-right: auto; }

.journey { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding: 48px 40px; }
.journey::before { content: ""; position: absolute; left: 40px; right: 40px; top: var(--line-y, 99px); height: 1px; background: var(--line); }
.journey .period { color: var(--dim); font-size: 14px; }
.journey .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text); margin: 20px 0 28px; position: relative; }
.journey h4 { font-size: 24px; margin-bottom: 14px; }
.journey p { color: var(--muted); font-size: 15px; line-height: 1.7; }

.footnote { color: var(--dim) !important; font-size: 15px !important; margin-top: 40px; }

@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr 1fr; }
  .journey::before { display: none; }
}
@media (max-width: 640px) {
  .journey { grid-template-columns: 1fr; padding: 28px; gap: 28px; }
  .journey .dot { margin: 10px 0 14px; }
}

/* ── Hero name ── */
.hero h1.name .word { display: inline-block; white-space: nowrap; }
.hero h1.name .ch {
  display: inline-block; padding-bottom: 0.14em; margin-bottom: -0.14em; opacity: 0; transform: translateY(0.35em) rotate(4deg); filter: blur(10px);
  animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms);
  background: linear-gradient(180deg, var(--text) 40%, rgba(var(--fg-rgb), 0.55)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline {
  font-family: "Caveat", cursive; font-size: clamp(22px, 2.4vw, 30px); color: var(--muted);
  margin-top: 20px; transform: rotate(-2deg);
  opacity: 0; animation: rise 1s var(--ease) 0.8s forwards;
}
.hero .tagline::before { content: "- "; color: var(--accent); }
.hero p { margin-top: 32px; }

/* Art note sits under the paragraph, arrow curving toward the covers */
.hobby .hand { position: static; margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 21px; line-height: 1.2; max-width: 200px; }
.hobby .hand svg { order: 2; width: 40px; height: 60px; margin: 0 0 0 12px; }

@media (prefers-reduced-motion: reduce) {
  .hero h1.name .ch, .hero .tagline { opacity: 1; transform: none; filter: none; animation: none; }
  .hero .tagline { transform: rotate(-2deg); }
}

/* ── Project covers ── */
.project.cover-phone .media, .project.cover-shot .media { aspect-ratio: auto; top: 250px; bottom: 0; }
.project.feature.cover-phone .media, .project.feature.cover-shot .media { top: 40px; }
.project.cover-phone .media img { inset: 0 auto auto 0; height: auto; object-fit: initial; border-radius: 0; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5)); }
.project.cover-shot .media { width: 300px; }
.project.cover-shot .media img { background: #f2f2f2; border-radius: 24px 24px 0 0; object-position: center top; }

/* ── Case study blocks ── */
.cs-hero { aspect-ratio: auto; }
.cs-hero:has(.ph) { aspect-ratio: 5 / 3; }
.cs-hero img, .cs-img .frame img { width: 100%; height: auto; }
.cs-img .frame { min-height: 0; }
.cs-img .frame:has(.ph) { min-height: 360px; }
.cs-text ul { margin-top: 16px; padding-left: 20px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.cs-text li + li { margin-top: 10px; }
.cs-text li::marker { color: var(--accent); }
.cs-quote { margin-top: 56px; padding-left: 24px; border-left: 2px solid var(--accent); font-size: clamp(22px, 3vw, 30px); line-height: 1.3; color: var(--text); }
.cs-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cs-gallery .frame { aspect-ratio: 1; }
.cs-gallery .frame img { height: 100%; object-fit: cover; }
.stats .card { padding: 28px; }
.stats .v { font-size: 48px; }

@media (max-width: 900px) {
  .project .media, .project.feature .media, .project.cover-phone .media, .project.cover-shot .media { top: auto !important; height: 340px; }
  .project.cover-shot .media { width: 260px; }
}
@media (max-width: 640px) {
  .cs-gallery { grid-template-columns: 1fr 1fr; }
}

/* ── Screen cover (flat app screen in a CSS phone frame) & screens block ── */
.project.cover-screen .media { aspect-ratio: auto; top: 250px; bottom: 0; }
.project.feature.cover-screen .media { top: 40px; }
.project.cover-screen .media img { height: auto; background: var(--text); border: 7px solid #3A3B3A; border-bottom: 0; border-radius: 38px 38px 0 0; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.project.cover-shot .media img { object-position: var(--pos, center top); }
.cs-screens { display: flex; justify-content: center; gap: 20px; padding: 32px; background: var(--card); }
.cs-screens .screen { flex: 1; max-width: 240px; text-align: center; }
.cs-screens .screen img { width: 100%; height: auto; border-radius: 22px; border: 5px solid #3A3B3A; background: var(--text); }
.cs-screens .screen span { display: block; margin-top: 12px; color: var(--dim); font-size: 14px; }
@media (max-width: 900px) {
  .project.cover-screen .media { top: auto !important; height: 340px; }
}
@media (max-width: 640px) {
  .cs-screens { gap: 10px; padding: 16px; flex-wrap: wrap; }
  .cs-screens .screen { flex: 1 1 40%; }
}

/* ── Backdrop (hero + contact): colour field, grain, line stack, red circle ── */
.hero, .contact { position: relative; isolation: isolate; }
.hero > :not(.backdrop), .contact > :not(.backdrop) { position: relative; z-index: 1; }
.backdrop { position: absolute; left: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 0; background: var(--bg); }
.backdrop-top { top: 0; height: 100vh; min-height: 720px; }
.backdrop-bottom { bottom: 0; height: 800px; }

/* Soft blurred colour blobs, slowly drifting */
.bg-field { position: absolute; inset: -120px; filter: blur(100px); opacity: 0.4; }
.bg-field span { position: absolute; left: 50%; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.bg-field span:nth-child(1) { width: 900px; height: 640px; margin-left: -450px; background: var(--accent); }
.bg-field span:nth-child(2) { width: 700px; height: 520px; margin-left: -760px; background: var(--blue); animation-duration: 22s; animation-direction: alternate-reverse; }
.bg-field span:nth-child(3) { width: 700px; height: 520px; margin-left: 60px; background: #6B2E1B; animation-duration: 26s; }
.backdrop-top .bg-field span { top: 0; }
.backdrop-bottom .bg-field span { bottom: -160px; }
@keyframes drift { from { transform: translate(-60px, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.12); } }

/* Grain: multiply keeps black black and textures the red */
.bg-noise { position: absolute; inset: 0; background: url("assets/noise.png") repeat; background-size: 120px; opacity: 0.5; mix-blend-mode: multiply; }

/* Faint vertical line stack */
.bg-lines { position: absolute; left: 50%; transform: translateX(-50%); width: min(1000px, 100%); height: 75%; display: flex; justify-content: space-between; opacity: 0.04; }
.bg-lines span { width: 2px; height: 100%; }
.backdrop-top .bg-lines { top: 0; align-items: flex-start; }
.backdrop-top .bg-lines span { background: linear-gradient(var(--text), rgba(var(--fg-rgb), 0)); }
.backdrop-top .bg-lines span:nth-child(odd) { height: 55%; }
.backdrop-bottom .bg-lines { bottom: 0; align-items: flex-end; }
.backdrop-bottom .bg-lines span { background: linear-gradient(rgba(var(--fg-rgb), 0), var(--text)); }
.backdrop-bottom .bg-lines span:nth-child(odd) { height: 55%; }

/* The red circle */
.sun { position: absolute; left: 50%; width: 480px; height: 480px; margin-left: -240px; border-radius: 50%; background: var(--accent); }
.backdrop-top .sun { top: -372px; }
.backdrop-bottom .sun { bottom: -440px; transition: transform 1.4s var(--ease); }
.contact:has(.footnote.in) .backdrop-bottom .sun { transform: translateY(-60px); }
.contact { padding-bottom: 240px; }

@media (max-width: 640px) {
  .sun { width: 320px; height: 320px; margin-left: -160px; }
  .backdrop-top .sun { top: -250px; }
  .backdrop-bottom .sun { bottom: -290px; }
  .contact { padding-bottom: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-field span { animation: none; }
  .backdrop-bottom .sun { transition: none; }
}

/* Glass buttons, as in the reference */
.pill, .round-btn { background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.08), rgba(var(--fg-rgb), 0.16)); border-color: rgba(var(--fg-rgb), 0.08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pill:hover { background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.12), rgba(var(--fg-rgb), 0.22)); }

/* ── Project card hover: themed gradient + dot pattern (gradient values from the reference) ── */
.project { --angle: 40deg; --c1: #262019; --c2: #5E2B1A; --dot: rgba(var(--accent-rgb), 0.45); }
.project[data-theme="blue"] { --angle: 32deg; --c1: #1C2030; --c2: #213A8A; --dot: rgba(var(--blue-rgb), 0.55); }
.project[data-theme="orange"] { --angle: 48deg; --c1: #2A1F1A; --c2: #6A2F1B; --dot: rgba(var(--accent-rgb), 0.5); }
.project::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--angle), var(--c1), var(--c2)); opacity: 0; transition: opacity 0.5s var(--ease); }
.project .pattern {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s var(--ease);
  background: radial-gradient(circle, var(--dot) 1.6px, transparent 2.2px) 0 0 / 14px 14px;
  -webkit-mask: radial-gradient(ellipse 70% 60% at 65% 85%, #000 0%, transparent 70%);
  mask: radial-gradient(ellipse 70% 60% at 65% 85%, #000 0%, transparent 70%);
}
.project:hover::before, .project:hover .pattern { opacity: 1; }
.project:hover { border-color: rgba(var(--fg-rgb), 0.08); }
.project > .meta, .project > h3 { position: relative; z-index: 2; }
.project:hover .meta { color: rgba(var(--fg-rgb), 0.5); }
.project:hover .sum { color: rgba(var(--fg-rgb), 0.7); }

/* ── Custom cursor dot ── */
.cursor { position: fixed; top: 0; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgba(var(--fg-rgb), 0.92); pointer-events: none; z-index: 9999; opacity: 0; transition: opacity 0.25s, width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease); }
.cursor.on { opacity: 1; }
.cursor.big { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: rgba(var(--fg-rgb), 0.55); }
html.has-cursor, html.has-cursor * { cursor: none !important; }

/* ── Photography slider ── */
.gallery { touch-action: pan-y; user-select: none; }
.gallery .track { position: absolute; inset: 0; display: flex; transition: transform 0.7s var(--ease); }
.gallery .track.dragging { transition: none; }
.gallery .slide { position: relative; flex: 0 0 100%; height: 100%; }
.gallery .slide img { pointer-events: none; -webkit-user-drag: none; }
.gallery h3 { position: absolute; top: 40px; left: 40px; z-index: 2; text-shadow: 0 2px 24px rgba(0,0,0,0.45); }
@media (max-width: 640px) { .gallery h3 { top: 28px; left: 28px; } }

/* ── Pixel portrait ── */
.portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.portrait[data-src] { background: var(--card); }

/* ── Journey hover: focus a step, light its dot, draw the line up to it ── */
.journey .fill { position: absolute; left: 40px; top: calc(var(--line-y, 99px) - 0.5px); height: 2px; width: 0; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0), var(--accent)); transition: width 0.7s var(--ease); z-index: 0; }
.journey .step { position: relative; z-index: 1; transition: opacity 0.4s var(--ease); }
.journey:hover .step { opacity: 0.4; }
.journey .step:hover, .journey .step.passed { opacity: 1; }
.journey .step.passed { opacity: 0.6; }
.journey .step:hover { opacity: 1; }
.journey .dot { transition: transform 0.45s var(--ease), background 0.3s, box-shadow 0.45s var(--ease); }
.journey .step.passed .dot { background: var(--accent); }
.journey .step:hover .dot { transform: scale(1.8); background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2), 0 0 22px rgba(var(--accent-rgb), 0.7); }
.journey .period { transition: color 0.3s; }
.journey .step:hover .period { color: var(--text); }
.journey h4 { transition: transform 0.45s var(--ease); }
.journey .step:hover h4 { transform: translateY(-3px); }
@media (max-width: 900px) { .journey .fill { display: none; } }

/* ── Token diagram (case study) ── */
.cs-tokens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cs-tokens .tok { background: var(--card); border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.cs-tokens .tok.hl { border-color: rgba(0, 204, 221, 0.6); }
.cs-tokens h4 { font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.cs-tokens h4 span { display: block; color: var(--dim); margin-top: 4px; }
.cs-tokens ul { list-style: none; display: grid; gap: 12px; }
.cs-tokens li { display: flex; align-items: center; gap: 12px; color: rgba(var(--fg-rgb), 0.85); font-size: 14px; font-family: ui-monospace, Menlo, monospace; }
.cs-tokens li i { width: 22px; height: 22px; flex: none; border: 1px solid rgba(var(--fg-rgb), 0.25); }
.cs-tokens .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-tokens .chips span { padding: 6px 14px; border-radius: 999px; background: rgba(var(--fg-rgb), 0.08); color: rgba(var(--fg-rgb), 0.85); font-size: 14px; }
.cs-tokens p { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.6; }
@media (max-width: 900px) { .cs-tokens { grid-template-columns: 1fr; } }

/* ── Case study structure: header, at-a-glance, chapters with contents ── */
.cs-top { max-width: 1000px; }
.cs-head { text-align: left; margin: 48px 0 48px; }
.cs-head .meta { margin: 0 0 14px; font-size: 14px; letter-spacing: 0.04em; }
.cs-head .lede { color: var(--muted); font-size: 20px; line-height: 1.6; max-width: 680px; margin-top: 20px; }
.facts { grid-template-columns: repeat(3, 1fr); margin: 56px 0 0; }
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.glance > div { background: var(--card); border: 1px solid var(--line); padding: 28px; }
.glance > div:nth-child(2) { border-color: rgba(var(--accent-rgb), 0.35); }
.glance span { display: block; color: var(--text); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.glance span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; }
.glance p { color: var(--muted); font-size: 15px; line-height: 1.65; }

.cs-body { max-width: 1080px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 64px; margin-top: 64px; align-items: start; }
.cs-body article { max-width: 780px; }
.cs-toc { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.cs-toc a { display: flex; gap: 12px; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--dim); font-size: 14px; transition: color 0.25s, border-color 0.25s; }
.cs-toc a b { font-weight: 400; font-variant-numeric: tabular-nums; opacity: 0.7; }
.cs-toc a:hover { color: var(--text); }
.cs-toc a.on { color: var(--text); border-left-color: var(--accent); }

.chapter { padding-top: 72px; scroll-margin-top: 96px; }
.chapter:first-child { padding-top: 8px; }
.ch-label { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.ch-label b { color: var(--accent); font-weight: 400; }
.ch-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chapter > .cs-text:first-of-type { margin-top: 28px; }
.chapter .cs-text { margin-top: 48px; }
.chapter .cs-img, .chapter .cs-quote, .chapter .stats { margin-top: 40px; }

.cs-end { max-width: 1000px; }
.next-case { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 24px; margin-top: 120px; padding: 36px 40px; background: var(--card); border: 1px solid var(--line); transition: border-color 0.3s; }
.next-case span { color: var(--dim); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.next-case strong { grid-column: 1; font-size: clamp(30px, 4vw, 44px); font-weight: 400; }
.next-case i { grid-row: 1 / 3; grid-column: 2; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--fg-rgb), 0.08); transition: transform 0.4s var(--ease), background 0.3s; }
.next-case:hover { border-color: rgba(var(--fg-rgb), 0.18); }
.next-case:hover i { transform: translateX(6px); background: var(--accent); }

@media (max-width: 1000px) {
  .cs-body { grid-template-columns: 1fr; gap: 0; }
  .cs-toc { display: none; }
}
@media (max-width: 640px) {
  .glance { grid-template-columns: 1fr; }
  .cs-head .lede { font-size: 17px; }
  .next-case { padding: 28px; }
}

/* ── Bento project grid ── */
.work-wrap { max-width: 1180px; }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 460px; gap: 16px; grid-auto-flow: dense; }
.bento .project { min-height: 0; padding: 28px; border-radius: 28px; }
.bento .project.wide { grid-column: span 2; }
.bento .project::before { opacity: 0; }
.bento .project:hover::before { opacity: 1; }
.bento .project .meta { font-size: 12px; letter-spacing: 0.06em; }
.bento .project h3 { font-size: 28px; line-height: 1.1; margin: 10px 0 12px; }
.bento .project.wide h3 { font-size: 36px; max-width: 50%; }
.bento .project .sum { font-size: 15px; line-height: 1.55; max-width: 46%; }
.bento .project.small .sum { display: none; }
.bento .project .go { height: 42px; font-size: 15px; }

/* Cover art: wide cards on the right, small cards rising from the bottom */
.bento .project .media,
.bento .project.cover-phone .media, .bento .project.cover-screen .media, .bento .project.cover-shot .media {
  position: absolute; aspect-ratio: auto; transform: none; left: auto; right: 28px; top: 28px; bottom: 0; width: 42%; height: auto;
}
.bento .project.small .media,
.bento .project.small.cover-phone .media, .bento .project.small.cover-screen .media, .bento .project.small.cover-shot .media {
  top: 44%; right: 0; left: 30%; width: auto;
}
.bento .project .media img { position: absolute; inset: 0 auto auto 0; width: 100%; height: auto; object-fit: initial; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.bento .project.cover-shot .media img { height: 100%; object-fit: cover; object-position: var(--pos, left top); }
.bento .project.cover-screen .media img { border-width: 6px; border-radius: 30px 30px 0 0; }
.bento .project.cover-shot .media img { border-radius: 18px 0 0 0; }
.bento .project.wide.cover-shot .media img { border-radius: 18px 18px 0 0; }
.bento .project:hover .media img { transform: translateY(-8px); }

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 440px; }
  .bento .project .media, .bento .project.cover-phone .media, .bento .project.cover-screen .media, .bento .project.cover-shot .media { top: 46% !important; height: auto !important; }
  .bento .project.wide .sum { max-width: 60%; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: 460px; }
  .bento .project.wide { grid-column: span 1; }
  .bento .project.wide .sum { display: none; }
  .bento .project.small .media, .bento .project .media { left: 22% !important; right: 0 !important; width: auto !important; }
}
.chapter .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.chapter .stats .card { border-radius: 0; padding: 24px; }
.chapter .stats .v { font-size: 44px; }
.chapter .stats .l { font-size: 14px; line-height: 1.5; }
/* Blue stays a hint in the backdrop; orange leads */
.bg-field span:nth-child(2) { opacity: 0.35; width: 560px; height: 420px; margin-left: -700px; }

/* Hero heading: one line per entry */
.hero h1.name .line { display: block; }
.hero h1.name .line + .line { margin-top: 0.04em; }

/* Nav hidden at rest, slides in while scrolling */
.nav { transition: transform 0.5s var(--ease), opacity 0.4s var(--ease); transform: translate(-50%, calc(-100% - 32px)); opacity: 0; }
.nav.show, .nav:focus-within { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .nav { transition: opacity 0.2s; } }

/* ── The wall: visitor notes ── */
.wall { overflow: hidden; }
.wall-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.wall-eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.wall-head h2 { font-size: clamp(40px, 6vw, 64px); max-width: 680px; }
.wall-head p { color: var(--muted); font-size: 18px; max-width: 520px; margin-top: 16px; }
.wall-actions { display: flex; gap: 12px; }
.wall-btn { font: inherit; font-size: 15px; color: var(--text); background: rgba(var(--fg-rgb), 0.06); border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px; cursor: pointer; transition: background 0.3s, transform 0.3s var(--ease); }
.wall-btn:hover { background: rgba(var(--fg-rgb), 0.12); transform: translateY(-2px); }
.wall-btn.primary { background: var(--accent); border-color: var(--accent); color: #F6F5F1; }
.wall-btn.primary:hover { background: #B94E2C; }
.wall-btn.small { padding: 8px 14px; font-size: 13px; }
.wall-btn.wide { width: 100%; padding: 15px; }
.wall-btn:disabled { opacity: 0.6; cursor: progress; }

.wall-row { margin-top: 56px; overflow: hidden; padding: 24px 0 40px; -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.wall-track { display: flex; gap: 24px; width: max-content; padding: 0 24px; }
.wall-track.moving { animation: wallDrift var(--dur, 40s) linear infinite; }
.wall-row:hover .wall-track { animation-play-state: paused; }
@keyframes wallDrift { to { transform: translateX(-50%); } }
.wall-empty { color: var(--dim); padding: 40px 0; margin: 0 auto; }

.note { position: relative; width: 280px; min-height: 210px; flex: none; padding: 30px 24px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; transform: rotate(var(--tilt)); box-shadow: 0 14px 30px rgba(0,0,0,0.25); color: #222322; transition: transform 0.4s var(--ease); }
.note:hover { transform: rotate(0deg) translateY(-6px) scale(1.03); z-index: 2; }
.note p { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.note footer { display: flex; align-items: center; gap: 10px; }
.note footer img { width: 36px; height: 36px; border-radius: 50%; background: #F6F5F1; border: 1px solid rgba(34,35,34,0.12); }
.note footer b { display: block; font-weight: 500; font-size: 14px; }
.note footer span { display: block; font-size: 12px; opacity: 0.6; }
.note .tape { position: absolute; top: -10px; left: 50%; width: 80px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: rgba(246,245,241,0.55); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tint-cream { background: #F6F5F1; }
.tint-orange { background: #F2C9B6; }
.tint-blue { background: #C7D3F5; }
.tint-grey { background: #D9D8D3; }

.wall-modal { margin: auto; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 24px; }
.wall-modal.wide { width: min(1100px, calc(100vw - 32px)); }
.wall-modal::backdrop { background: rgba(10, 10, 10, 0.6); backdrop-filter: blur(6px); }
.wall-form { position: relative; padding: 32px; display: grid; gap: 16px; }
.wall-form h3 { font-size: 36px; margin-top: -6px; }
.wall-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); position: relative; }
.wall-form input, .wall-form textarea { font: inherit; font-size: 16px; color: var(--text); background: rgba(var(--fg-rgb), 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; }
.wall-form input:focus, .wall-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wall-form .count { position: absolute; right: 10px; bottom: 8px; color: var(--dim); font-size: 12px; }
.wall-avatar { display: flex; align-items: center; gap: 14px; }
.wall-avatar img { width: 64px; height: 64px; border-radius: 50%; background: #F6F5F1; }
.wall-tints { display: flex; gap: 10px; }
.wall-tints input { position: absolute; opacity: 0; }
.wall-tints span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.wall-tints input:checked + span { border-color: var(--accent); }
.wall-tints input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.wall-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; }
.wall-msg { color: var(--accent); font-size: 14px; min-height: 1em; }
.wall-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(var(--fg-rgb), 0.08); color: var(--text); font-size: 22px; cursor: pointer; }
.wall-all-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; background: var(--card); border-bottom: 1px solid var(--line); }
.wall-all-head h3 { font-size: 32px; }
.wall-all-head .wall-x { position: static; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; padding: 36px 32px; }
.wall-grid .note { width: auto; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 14px 22px; border-radius: 999px; font-size: 15px; z-index: 100; transition: opacity 0.3s, transform 0.4s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .wall-track.moving { animation: none; } .wall-row { overflow-x: auto; } }
@media (max-width: 640px) { .wall-actions { width: 100%; } .wall-actions .wall-btn { flex: 1; } .note { width: 240px; } }

/* ── Light mode: cream page, charcoal text; orange and blue keep their roles ── */
:root[data-theme="light"] {
  --fg-rgb: 34, 35, 34;
  --bg: #F6F5F1;
  --card: #ECEAE3;
  --card-2: #E2E0D8;
  --text: #222322;
  color-scheme: light;
}
:root:not([data-theme="light"]) { color-scheme: dark; }
:root[data-theme="light"] .nav { background: rgba(246, 245, 241, 0.75); }
:root[data-theme="light"] .nav .logo { background: #222322; color: #F6F5F1; }
:root[data-theme="light"] .bg-noise { opacity: 0.18; }
:root[data-theme="light"] .bg-field { opacity: 0.22; }
:root[data-theme="light"] .project { --c1: #F4E2D8; --c2: #EBC1AB; --dot: rgba(var(--accent-rgb), 0.35); }
:root[data-theme="light"] .project[data-theme="blue"] { --c1: #E3E8F7; --c2: #BCCAF1; --dot: rgba(var(--blue-rgb), 0.4); }
:root[data-theme="light"] .project .go { background: rgba(255,255,255,0.7); color: #222322; }
:root[data-theme="light"] .cs-screens .screen img, :root[data-theme="light"] .project.cover-screen .media img { border-color: #222322; }
:root[data-theme="light"] .wall-modal::backdrop { background: rgba(34, 35, 34, 0.35); }
:root[data-theme="light"] .note { box-shadow: 0 12px 26px rgba(34,35,34,0.14); }
:root[data-theme="light"] .portrait[data-src] { background: var(--card); }
body { transition: background-color 0.4s; }

/* Theme toggle in the nav */
.theme-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(var(--fg-rgb), 0.06); color: var(--text); cursor: pointer; }
.theme-btn:hover { background: rgba(var(--fg-rgb), 0.12); }
.theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun-i { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: block; }
.back-row { display: flex; justify-content: space-between; align-items: center; }
.gallery h3 { color: #F6F5F1; }
:root[data-theme="light"] .bg-noise { opacity: 0.07; }
:root[data-theme="light"] .bg-field { opacity: 0.32; }
:root[data-theme="light"] .bg-field span:nth-child(2) { opacity: 0; }
:root[data-theme="light"] .bg-field span:nth-child(3) { background: #F2C9B6; }
.wall-form label small { display: inline; }

/* Wall: centre the empty message */
.wall-track:has(.wall-empty) { width: 100%; justify-content: center; }

/* ── Bubble wrap: glass bubbles spread around the sun at the foot of the page ── */
.contact { padding-bottom: 0; }
.bubble-wrap { position: relative; z-index: 1; margin-top: 120px; padding: 40px 0 56px; touch-action: none; user-select: none; -webkit-user-select: none; }
.bubble-field { display: flex; flex-direction: column; align-items: center; gap: calc(var(--gap) * 0.55); }
.bubble-row { display: flex; gap: var(--gap); }
.bubble {
  width: var(--size); height: var(--size); border-radius: 50%; cursor: pointer; position: relative;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.7) 0 6%, transparent 7%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(var(--fg-rgb), 0.18) 55% 60%, transparent 62%),
    radial-gradient(circle at 50% 55%, rgba(var(--fg-rgb), 0.02), rgba(var(--fg-rgb), 0.1) 70%, rgba(var(--fg-rgb), 0.22) 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18), inset 0 -3px 6px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(var(--fg-rgb), 0.18);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  transition: transform 0.25s var(--ease), opacity 0.3s;
}
.bubble:hover { transform: scale(1.08); }
.bubble.gone { visibility: hidden; pointer-events: none; }
.bubble.popped {
  cursor: default; transform: scale(0.92);
  background: radial-gradient(circle, rgba(var(--fg-rgb), 0.05), rgba(var(--fg-rgb), 0.02) 70%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(var(--fg-rgb), 0.1);
  animation: pop 0.22s var(--ease);
}
.bubble.popped::after { content: ""; position: absolute; inset: 30%; border-top: 1.5px solid rgba(var(--fg-rgb), 0.25); border-radius: 50%; transform: rotate(-20deg); }
@keyframes pop { 0% { transform: scale(1.14); } 100% { transform: scale(0.92); } }
.contact .bubble-label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; margin: 0; pointer-events: none;
  font-family: var(--body); font-weight: 600; font-style: normal; font-size: 15px; letter-spacing: 0.04em; color: var(--text) !important; white-space: nowrap;
}

/* Theme switch: a soft dissolve, the old theme melting away into the new one */
::view-transition-group(root) { animation-duration: 0.7s; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); animation-duration: 0.7s; }
::view-transition-old(root) { animation-name: dissolve-out; z-index: 2; }
::view-transition-new(root) { animation-name: none; z-index: 1; }
@keyframes dissolve-out {
  from { opacity: 1; filter: blur(0); }
  to   { opacity: 0; filter: blur(6px); }
}
.contact .backdrop-bottom { height: 100%; -webkit-mask: linear-gradient(transparent, #000 25%); mask: linear-gradient(transparent, #000 25%); }

/* Wall notes: pinned in place, max 5 per row, centred; over 10 notes become a two-row sideways scroll */
.wall-row { -webkit-mask: none; mask: none; overflow: visible; }
.wall-track { width: auto; max-width: calc(5 * 280px + 4 * 24px); margin: 0 auto; flex-wrap: wrap; justify-content: center; gap: 36px 24px; padding: 0 24px; animation: none !important; }
.wall-track.scroll { max-width: none; display: grid; grid-auto-flow: column; grid-template-rows: auto auto; grid-auto-columns: 280px; justify-content: start; overflow-x: auto; padding: 16px 24px 28px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.wall-track.scroll .note { scroll-snap-align: start; }
.wall-row:has(.scroll) { overflow: hidden; }
@media (max-width: 640px) { .wall-track:not(.scroll) .note { width: min(280px, 100%); } .wall-track.scroll { grid-auto-columns: 240px; } }
.wall-track:not(.scroll) { max-width: calc(5 * 280px + 4 * 24px + 56px); }
.wall-track:not(.scroll) { max-width: calc(5 * 232px + 4 * 22px + 48px); gap: 32px 22px; }
.wall-track:not(.scroll) .note { width: 232px; min-height: 190px; }

/* ── Performance: fewer live blurs and endless animations ── */
.bg-field span { animation: none !important; }            /* drifting 100px blurs re-rendered every frame */
.bg-field { transform: translateZ(0); }                     /* rasterise the glow once as its own layer */
.bubble { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.nav { will-change: transform; }
.portrait canvas, .bento .project .media img { will-change: auto; }

/* Messy bubble wrap, tucked closer to the footnote */
.bubble-wrap { margin-top: 8px; padding-top: 12px; }
.bubble-field { gap: 4px; }
.bubble-row { gap: calc(var(--gap) * 0.6); }
.bubble { transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(var(--r)); }
.bubble:hover { transform: translate(var(--dx), var(--dy)) scale(calc(var(--s) * 1.08)) rotate(var(--r)); }
.bubble.popped { transform: translate(var(--dx), var(--dy)) scale(calc(var(--s) * 0.92)) rotate(var(--r)); animation: none; }
.contact .footnote { margin-bottom: 0; }

/* External case study links (Behance, Medium) */
.cs-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cs-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), 0.05); font-size: 15px; transition: background 0.3s, border-color 0.3s; }
.cs-link:hover { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.5); }

/* Open to work badge: always visible, top right, with a live green dot */
.otw { position: fixed; top: 24px; right: 24px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 14px; border-radius: 999px; font-size: 14px; color: var(--text); background: rgba(var(--fg-rgb), 0.06); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity 0.3s, transform 0.3s var(--ease), background 0.3s; }
.otw:hover { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.4); transform: translateY(-1px); }
.otw-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 8px rgba(34, 197, 94, 0.8); }
.otw-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22C55E; animation: otw-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes otw-ping { 0% { transform: scale(1); opacity: 0.8; } 80%, 100% { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .otw-dot::after { animation: none; } }
/* On narrow screens the nav fills the top while scrolling; tuck the badge away then */
@media (max-width: 900px) {
  .otw { top: auto; bottom: 16px; right: 16px; font-size: 13px; padding: 8px 14px 8px 12px; background: rgba(var(--fg-rgb), 0.1); }
}

/* ── Mobile & touch fixes ── */
/* Erasing the portrait pixels with a finger shouldn't scroll the page */
.portrait[data-src] { touch-action: none; }
/* Back button stays compact everywhere */
.round-btn.back { width: 44px; height: 44px; }
/* Touch screens: no hover animations to sit through before a card opens */
@media (hover: none) {
  .project:hover { transform: none; }
  .project:hover .media img { transform: none; }
  .project .go, .project .go-label, .project::before, .project .pattern { transition: none !important; }
  .project:hover .go-label { max-width: 0; opacity: 0; margin-right: 0; }
  .project:hover .go { padding: 0 16px; }
  .project:hover::before, .project:hover .pattern { opacity: 0; }
  .bubble:hover { transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(var(--r)); }
}
/* Header on phones: inset from the edges, links share the space evenly */
@media (max-width: 640px) {
  .nav { width: calc(100% - 24px); justify-content: space-between; gap: 6px; padding: 0 8px 0 10px; height: 52px; top: 12px; }
  .nav a.link { font-size: 13px; }
  .nav .logo { width: 30px; height: 30px; flex: none; }
  .nav .theme-btn { width: 32px; height: 32px; flex: none; }
  .nav a.link svg { display: none; }
  .bubble-field { gap: 6px; }
  .bubble-wrap { margin-top: 0; padding: 20px 0 48px; }
  .contact .bubble-label { font-size: 14px; }
}
