﻿/* ---------- tokens ---------- */
:root {
  --bg: #040305;
  --surface: #0d0a0f;
  --surface-2: #1a1420;
  --line: #1a151d;
  --ink: #d8d1d4;
  --ink-strong: #f2eded;
  --muted: #7a737c;
  --accent: #b8133f;          /* primary: button, pink-red like the cursor cat */
  --accent2: #f6501c;         /* secondary: amber red */
  --cat-body: #130f16;
  --cat-hi: #221a2a;
  --cat-rim: #9a1a3f;
  --cat-ear: #d63064;
  --cat-nose: #ff7a9a;
  --cat-mouth: #3a2a3c;
  --cat-whisk: #5a4a5a;
  --cat-eye: var(--accent2);
  --radius: 14px;
  --gutter: clamp(16px, 3.4vw, 40px);
  --maxw: 1480px;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Syne", "Space Grotesk", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --step-small: clamp(0.8125rem, 0.78rem + 0.12vw, 0.9375rem);
  --step-body: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  --step-lead: clamp(1.2rem, 1rem + 0.9vw, 1.75rem);
  --step-head: clamp(2.1rem, 1.2rem + 3.6vw, 4.8rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
@media (min-width: 1800px) { html { font-size: 18px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  font-weight: 500;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 4px; border-radius: 4px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; }
figure { margin: 0; }
figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 14px; }
ul { list-style: none; margin: 0; padding: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 16px; }
.hl { font-style: normal; color: var(--accent2); }

/* ---------- atmosphere: canvas dust, vignette, grain ---------- */
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 75% 65% at 50% 40%, transparent 35%, rgba(0, 0, 0, 0.92) 100%);
}
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 2; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
main, .footer, .nav { position: relative; z-index: 3; }

/* ---------- cursor: the pixel cat follows the pointer ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; display: none;
  width: 46px; height: auto; margin: -23px 0 0 -23px; will-change: transform;
  filter: drop-shadow(0 0 8px rgba(246, 80, 28, 0.35));
}
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
  .js, .js a, .js button, .js .card, .js .rows li, .js .cat-head, .js input { cursor: none; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px;
  padding: 14px var(--gutter);
  background: rgba(4, 3, 5, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  backdrop-filter: saturate(140%) blur(18px);
}
.nav-mark { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; text-decoration: none; letter-spacing: -0.03em; color: var(--ink-strong); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 26px); font-size: 15px; font-weight: 600; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--muted); transition: color 200ms; }
.nav-links a:not(.btn):hover { color: var(--accent2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; background: var(--accent); color: var(--ink-strong);
  font-weight: 700; text-decoration: none; transition: transform 200ms var(--ease), background 250ms, color 250ms;
}
.btn:hover { background: var(--accent2); color: var(--bg); }
.btn:active { transform: scale(0.96); }
.btn-small { padding: 8px 16px; font-size: 14px; }

/* ---------- giant background words (parallax layers) ---------- */
.bg-word {
  position: absolute; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.05em; line-height: 0.8; white-space: nowrap;
  font-size: clamp(9rem, 30vw, 36rem);
  color: transparent; -webkit-text-stroke: 1px rgba(246, 80, 28, 0.16);
  will-change: translate;
}
.hero-word { right: -3vw; top: 7vh; -webkit-text-stroke-color: rgba(184, 19, 63, 0.28); }
.bw-a { left: -3vw; top: 12%; }
.bw-b { right: -5vw; top: 12%; }
.bw-c { left: -2vw; top: 56%; -webkit-text-stroke-color: rgba(184, 19, 63, 0.22); }
.bw-d { right: -4vw; top: 3%; }

/* ---------- hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 640px; overflow: hidden;
  padding: 0 var(--gutter);
}
.hero-cat {
  position: absolute; right: clamp(8px, 5vw, 100px); top: clamp(92px, 13vh, 150px);
  width: clamp(220px, 32vw, 520px); will-change: transform; z-index: 1;
}
.hero-copy {
  position: absolute; left: var(--gutter); top: clamp(120px, 26vh, 260px); max-width: 24ch;
  display: grid; gap: 26px; z-index: 1; will-change: translate;
}
.hero-lead { font-size: var(--step-lead); line-height: 1.32; letter-spacing: -0.02em; font-weight: 600; color: var(--ink-strong); }
.hero-note { font-size: var(--step-small); color: var(--muted); }

.wordmark {
  position: absolute; left: 0; right: 0; bottom: clamp(8px, 3vh, 36px); margin: 0; z-index: 2;
  font-size: 11.8vw; font-weight: 800; letter-spacing: -0.05em; line-height: 0.8;
  white-space: nowrap; text-align: center; color: var(--ink-strong);
  transform-origin: 50% 100%; will-change: transform;
}
.wordmark { opacity: 0; transition: opacity 900ms var(--ease); }
.wordmark.ready { opacity: 1; }

/* ---------- pixel cats (built by script.js from a character map) ---------- */
.pixel-cat svg { display: block; width: 100%; height: auto; shape-rendering: crispEdges; overflow: visible; }
.pc-k { fill: var(--cat-body); }
.pc-l { fill: var(--cat-hi); }
.pc-r { fill: var(--cat-rim); }
.pc-p { fill: var(--cat-ear); }
.pc-n { fill: var(--cat-nose); }
.pc-m { fill: var(--cat-mouth); }
.pc-w { fill: var(--cat-whisk); }
.pc-e { fill: var(--cat-eye); }
.pc-x { fill: var(--cat-body); }
.pc-eyes { transform-box: fill-box; transform-origin: 50% 50%; filter: drop-shadow(0 0 3px rgba(246, 80, 28, 0.7)); }
.pc-eyes.blink { animation: blink 260ms steps(3) 1; }
@keyframes blink { 0%, 100% { transform: scaleY(1); } 40%, 60% { transform: scaleY(0.08); } }
.pc-pupils { transition: transform 120ms steps(2); }
.pc-tail { transform-box: view-box; transform-origin: 22px 25px; animation: tail-sway 2.8s steps(5) infinite alternate; }
@keyframes tail-sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.pc-closed { fill: var(--cat-eye); opacity: 0.85; }
.cat-sleepy .pixel-cat svg { animation: breathe 4.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.025); } }

/* ---------- statement ---------- */
.statement { position: relative; height: 240vh; overflow-x: clip; }
.statement-stage { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; padding: 0 var(--gutter); z-index: 1; }
.statement-text {
  max-width: 22ch; text-align: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 0.9rem + 3.2vw, 4.2rem); line-height: 1.12; letter-spacing: -0.04em;
  color: var(--ink-strong);
}
.statement-text .w { display: inline-block; opacity: 0.1; transform: translateY(0.12em); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.statement-text .w.on { opacity: 1; transform: none; }

/* ---------- work ---------- */
.work {
  position: relative; padding: clamp(120px, 18vh, 200px) var(--gutter) clamp(90px, 14vh, 140px);
  max-width: var(--maxw); margin: 0 auto; overflow-x: clip;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 24px); row-gap: clamp(36px, 9vh, 110px);
}
.work > *:not(.bg-word) { position: relative; z-index: 1; }
.section-title { grid-column: 1 / -1; font-size: var(--step-head); color: var(--ink-strong); margin-bottom: 2vh; }
.section-title .w, .card h3 .w, .list-title .w { display: inline-block; transform: translateY(0.25em); opacity: 0; transition: transform 800ms var(--ease), opacity 800ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.in .w, .card.in h3 .w, .card h3.in .w { transform: none; opacity: 1; }

.card {
  display: grid; gap: 16px; align-content: start; position: relative;
  padding: clamp(24px, 3vw, 44px); border-radius: var(--radius); background: var(--surface);
  transform-style: preserve-3d; will-change: transform, translate;
  transition: transform 400ms var(--ease), background 500ms var(--ease);
}
.card::before {
  content: ""; position: absolute; top: clamp(24px, 3vw, 44px); right: clamp(24px, 3vw, 44px);
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent2);
  animation: led 2.6s ease-in-out infinite;
}
@keyframes led { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.card:hover { background: #130e17; }
.card h3 { font-size: clamp(1.45rem, 0.9rem + 1.9vw, 2.9rem); color: var(--ink-strong); transition: color 300ms; padding-right: 24px; }
.card:hover h3 { color: var(--accent2); }
.card p { max-width: 40ch; font-size: var(--step-body); line-height: 1.6; color: var(--ink); }
.card-l { grid-column: 1 / span 7; }
.card-r { grid-column: 6 / span 7; }
.card-c { grid-column: 3 / span 8; }
.card-tight { margin-top: -6vh; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tags li { font-size: var(--step-small); font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); transition: color 250ms, background 250ms; }
.card:hover .tags li { color: var(--ink); }
.tags li:hover { color: var(--bg); background: var(--accent2); }

/* reveal: cards fill in, their parts wipe up */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 900ms var(--ease), transform 1000ms var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }
.rows li:nth-child(2) { transition-delay: 70ms; }
.rows li:nth-child(3) { transition-delay: 140ms; }
.rows li:nth-child(4) { transition-delay: 210ms; }
.rows li:nth-child(5) { transition-delay: 280ms; }
.rows li:nth-child(6) { transition-delay: 350ms; }
.cat-card:nth-child(2) { transition-delay: 120ms; }
.cat-card:nth-child(3) { transition-delay: 240ms; }
.js .card[data-reveal] { opacity: 1; transform: none; background: transparent; transition: transform 400ms var(--ease), background 700ms var(--ease); }
.js .card[data-reveal].in { background: var(--surface); }
.js .card[data-reveal]:not(.in)::before { opacity: 0; }
.js .card[data-reveal] > * { opacity: 0; transform: translateY(18px); clip-path: inset(0 0 100% 0); transition: opacity 700ms var(--ease), transform 900ms var(--ease), clip-path 1000ms var(--ease); }
.js .card[data-reveal].in > * { opacity: 1; transform: none; clip-path: inset(-20% -5% -20% -5%); }
.js .card[data-reveal].in > *:nth-child(2) { transition-delay: 120ms; }
.js .card[data-reveal].in > *:nth-child(3) { transition-delay: 220ms; }
.js .card[data-reveal].in > *:nth-child(4) { transition-delay: 300ms; }

/* ---------- about ---------- */
.about { position: relative; height: 210vh; }
.about-stage { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; overflow: hidden; }
.about-title {
  font-size: clamp(3.4rem, 1rem + 11.5vw, 12.5rem); font-weight: 700; letter-spacing: -0.06em; line-height: 0.85;
  color: var(--ink-strong); white-space: nowrap; display: flex; flex-direction: column; align-items: center;
}
.about-a, .about-b { display: block; will-change: transform; }
.about-a { color: transparent; -webkit-text-stroke: 1px #6a5a68; }
.about-b { color: var(--accent2); }
.about-text {
  position: relative; z-index: 3; max-width: 34ch; margin: clamp(-30vh, -18vh, -12vh) 0 0 auto; padding: 0 var(--gutter) 0 0;
  font-size: var(--step-lead); line-height: 1.38; letter-spacing: -0.02em; font-weight: 600; color: var(--ink-strong); text-align: right;
}

/* ---------- list ---------- */
.list {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(24px, 4vw, 56px);
  max-width: var(--maxw); margin: 0 auto; padding: clamp(120px, 18vh, 180px) var(--gutter) clamp(100px, 16vh, 160px); align-items: start;
}
.list-title { position: sticky; top: 28vh; font-size: var(--step-head); color: var(--ink-strong); }
.rows li {
  position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap;
  padding: clamp(18px, 3vh, 28px) 12px; border-bottom: 1px solid var(--line);
  font-size: clamp(1.1rem, 0.95rem + 0.9vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; color: var(--ink-strong); overflow: hidden; isolation: isolate;
}
.rows li::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--surface);
  transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease);
}
.rows li:hover::before { transform: scaleX(1); }
.rows li span, .rows li em { transition: transform 400ms var(--ease), color 300ms; }
.rows li:hover span { transform: translateX(10px); }
.rows li:hover em { color: var(--accent2); }
.rows em { font-style: normal; font-weight: 600; font-size: var(--step-small); color: var(--muted); }

/* ---------- cats ---------- */
.cats { position: relative; overflow-x: clip; max-width: var(--maxw); margin: 0 auto; padding: clamp(120px, 18vh, 180px) var(--gutter) clamp(100px, 16vh, 160px); }
.cats > *:not(.bg-word) { position: relative; z-index: 1; }
.cats-lead { font-size: var(--step-lead); line-height: 1.38; letter-spacing: -0.02em; font-weight: 600; max-width: 30ch; margin: 0 0 clamp(40px, 8vh, 80px); color: var(--ink-strong); }
.cat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.cat-card { display: grid; align-content: start; }
.cat-head {
  aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--surface);
  display: grid; place-items: center; overflow: hidden; transition: background 400ms;
}
.cat-head:hover { background: #15101a; }
.cat-head .pixel-cat { width: 74%; }

/* ---------- contact ---------- */
.contact {
  min-height: 100svh; display: grid; align-content: center; gap: clamp(24px, 5vh, 36px);
  max-width: var(--maxw); margin: 0 auto; padding: clamp(110px, 16vh, 140px) var(--gutter);
}
.contact-lead { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; max-width: 30ch; color: var(--ink-strong); }
.contact-line {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 1rem + 9vw, 11rem); letter-spacing: -0.05em; line-height: 1; text-decoration: none;
  color: var(--ink-strong); overflow-wrap: anywhere; transition: color 300ms;
}
.contact-line .ch { display: inline-block; transition: transform 500ms var(--ease), color 300ms; transition-delay: calc(var(--i, 0) * 18ms); }
.contact-line:hover { color: var(--accent2); }
.contact-line:hover .ch { transform: translateY(-0.07em); }
.contact-more { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: var(--step-body); font-weight: 600; color: var(--muted); }
.contact-more a { text-decoration: none; color: var(--ink-strong); transition: color 250ms; }
.contact-more a:hover { color: var(--accent2); }
.contact-more strong { color: var(--ink-strong); font-weight: 700; }

/* ---------- footer ---------- */
.footer { padding: clamp(60px, 10vh, 90px) var(--gutter) 28px; display: grid; gap: clamp(28px, 5vh, 44px); }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: var(--step-small); color: var(--muted); max-width: var(--maxw); margin: 0 auto; width: 100%; }
.footer-h { color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.footer-cols a { text-decoration: none; transition: color 200ms; }
.footer-cols a:hover { color: var(--accent2); }
.footer-wordmark { font-family: var(--font-display); font-size: 11.8vw; font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; white-space: nowrap; text-align: center; color: #17121c; }
.footer-legal { font-size: var(--step-small); color: var(--muted); text-align: center; }

/* ---------- adaptive: large screens ---------- */
@media (min-width: 1600px) {
  .hero-cat { width: 470px; right: 8vw; }
}

/* ---------- adaptive: tablets and small laptops ---------- */
@media (max-width: 1024px) {
  .hero-cat { width: clamp(220px, 40vw, 380px); right: 3vw; top: 15vh; }
  .hero-copy { top: 24vh; max-width: 19ch; }
  .card-l, .card-r, .card-c, .card-tight { grid-column: 1 / -1; margin-top: 0; }
  .card-r { margin-left: 8%; }
  .card-l { margin-right: 8%; }
  .list { grid-template-columns: 1fr; }
  .list-title { position: static; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- adaptive: phones ---------- */
@media (max-width: 720px) {
  .nav-links { gap: 8px; }
  .nav-links a:not(.btn) { display: none; }
  .btn-small { padding: 9px 16px; }

  .hero-cat { left: 50%; right: auto; translate: -50% 0; top: clamp(72px, 9svh, 110px); width: min(66vw, 320px); }
  .hero-copy { top: auto; bottom: clamp(110px, 18svh, 190px); max-width: 22ch; gap: 18px; }
  .hero-lead { font-size: clamp(1.15rem, 4.4vw, 1.4rem); }
  .hero-note { font-size: 13px; }
  .wordmark { font-size: 11.4vw; bottom: 3svh; }
  .hero-word { top: 12svh; }

  .work { grid-template-columns: 1fr; row-gap: 56px; padding-top: 130px; }
  .card-l, .card-r, .card-c, .card-tight { grid-column: 1 / -1; margin: 0; padding: 22px; }
  .card-r { margin-left: 6%; }
  .card-l { margin-right: 6%; }
  .card::before { top: 22px; right: 22px; }

  .statement { height: 220vh; }
  .statement-text { font-size: clamp(1.6rem, 6.8vw, 2.2rem); max-width: 16ch; }

  .about { height: 180vh; }
  .about-text { margin: -12svh 0 0 0; text-align: left; padding: 0 var(--gutter); max-width: none; font-size: 1.15rem; }

  .cat-row { grid-template-columns: 1fr; gap: 36px; }
  .cat-head { aspect-ratio: 5 / 4; }
  .cat-head .pixel-cat { width: 52%; }

  .contact-line { font-size: clamp(1.4rem, 10vw, 2.4rem); letter-spacing: -0.04em; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-wordmark { font-size: 11.4vw; }
}

/* ---------- adaptive: small phones ---------- */
@media (max-width: 380px) {
  .nav-mark { font-size: 0.85rem; }
  .btn-small { font-size: 13px; padding: 8px 13px; }
  .hero-lead { font-size: 1.1rem; }
  .wordmark, .footer-wordmark { font-size: 11.2vw; }
}

/* ---------- adaptive: short landscape (phones on their side, small windows) ---------- */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: 560px; }
  .hero-cat { width: 42vh; top: 12vh; }
  .hero-copy { top: 22vh; }
  .wordmark { font-size: 10vw; }
  .statement { height: 220vh; }
}

/* ---------- reduced motion: keep the content, drop the travel ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #dust, .grain, .cursor { display: none; }
  .pc-tail, .cat-sleepy .pixel-cat svg, .pc-eyes.blink, .card::before { animation: none; }
  .wordmark { opacity: 1; transition: none; }
  .js [data-reveal], .js .card[data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .card[data-reveal] > * { opacity: 1; transform: none; clip-path: none; transition: none; }
  .statement-text .w, .section-title .w, .card h3 .w, .list-title .w { opacity: 1; transform: none; transition: none; }
  .js, .js a, .js button { cursor: auto; }
}


