:root {
  --bg: #F1F1F1;
  --ink: #0E0E0E;
  --muted: #6B6862;
  --line: #CFCBC4;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Nav: liquid glass pill ---------- */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
  animation: drop .9s .5s cubic-bezier(.2, .8, .2, 1) backwards;
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-20px) scale(.92); }
  to { opacity: 1; transform: none; }
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
}

/* Glass (same recipe as the Clyx header). Chromium gets real refraction (html.has-liquid: SVG
   displacement map drawn in main.js); other browsers get frosted glass. The mark flips to white
   while the pill sits over dark imagery (.nav.on-dark, toggled on scroll). */
.glass {
  position: relative; isolation: isolate; pointer-events: auto;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(14px) saturate(1.8); -webkit-backdrop-filter: blur(14px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    inset 0 -1px 0 rgba(255,255,255,.25),
    inset 0 0 0 1px rgba(255,255,255,.28),
    inset 0 0 18px rgba(255,255,255,.18),
    0 10px 30px -10px rgba(0,0,0,.25);
  transition: background .3s;
}
/* Specular sheen across the top edge. */
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 45%),
              radial-gradient(120% 140% at 15% -20%, rgba(255,255,255,.35), transparent 50%);
  mix-blend-mode: soft-light;
}
html.has-liquid .nav-pill {
  background: rgba(255,255,255,.06);
  backdrop-filter: url(#liquid-glass) blur(1.2px) saturate(1.7) brightness(1.06);
}
.nav.on-dark .nav-pill { background: rgba(255,255,255,.1); }
html.has-liquid .nav.on-dark .nav-pill { background: rgba(255,255,255,.04); }
.glass-defs { position: absolute; width: 0; height: 0; }
.nav-mark img { transition: filter .3s; }
.nav.on-dark .nav-mark img { filter: invert(1); }

.nav-mark { width: 50px; display: block; transition: transform .3s; }
.nav-mark img { width: 100%; height: auto; }
.nav-mark:hover { transform: rotate(-6deg) scale(1.05); }

/* CTA: pill + circle fused with a gooey neck */
.cta {
  --h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--h);
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
}
.cta-shape { position: absolute; inset: 0 -8px 0 0; filter: url(#goo); }
.cta-body, .cta-dot { position: absolute; top: 0; background: #111; }
.cta-body { left: 0; bottom: 0; right: calc(var(--h) + 8px + 1px); border-radius: 999px; }
.cta-dot {
  right: 8px;
  width: var(--h);
  height: var(--h);
  border-radius: 50%;
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.cta-label { position: relative; padding: 0 24px 0 22px; white-space: nowrap; }
.cta-arrow {
  position: relative;
  width: var(--h);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-left: 1px;
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.cta:hover .cta-dot, .cta:focus-visible .cta-dot,
.cta:hover .cta-arrow, .cta:focus-visible .cta-arrow { transform: translateX(6px); }
.cta:active .cta-shape { transform: scale(.97); }
.cta:focus-visible { outline: none; }
.cta:focus-visible .cta-label { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 80px;
  gap: clamp(40px, 7vw, 96px);
}
.wordmark img, .wordmark svg { display: block; width: 100%; height: auto; overflow: visible; }
.js .wordmark:not(.ready) { visibility: hidden; }
.intro.reveal { transition-delay: .9s; }

.intro {
  max-width: 26em;
  font-family: "Geist", "Inter Tight", sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 4.3vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.intro p + p { margin-top: .55em; }

/* ---------- Work ---------- */
.work, .services { padding: 0 var(--gutter); }

.work-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding-bottom: 16px;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: var(--gutter);
  border-top: 1px solid var(--line);
  padding: 40px 0 72px;
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.project h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.project-info p {
  font-size: clamp(18px, 1.6vw, 22px);
  max-width: 19em;
  line-height: 1.15;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; max-width: 22em; }
.tags li {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.project-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.media-dark { background: #000; }
.media-red { background: #E84A47; }
.media-kindling { background: #4A3F2C; }
.media-foundation { background: #0A0AB8; }
.project-media video { width: 100%; height: 100%; object-fit: cover; }

.sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font: inherit;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.project-media:hover .sound, .sound:focus-visible { opacity: 1; }

/* ---------- Services ---------- */
.services { padding-top: 24px; padding-bottom: 24px; }
.service-list { border-top: 1px solid var(--line); }
.service-list li {
  display: flex;
  align-items: baseline;
  gap: 24px;
  font-size: clamp(26px, 3.4vw, 48px);
  letter-spacing: -0.035em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.service-list span {
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted);
  width: 2em;
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(96px, 14vw, 180px) var(--gutter);
  position: relative;
}
.contact-kicker { color: var(--muted); font-size: 18px; margin-bottom: 12px; }
.email {
  font-size: clamp(30px, 6.4vw, 96px);
  letter-spacing: -0.045em;
  line-height: 1;
  word-break: break-word;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  transition: background-size .35s ease;
}
.email:hover { background-size: 100% 3px; }
.copied {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  min-height: 1em;
}

/* ---------- Footer ---------- */
.footer {
  background: #000;
  color: var(--bg);
  padding: clamp(96px, 16vw, 240px) var(--gutter) 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.footer-mark { width: min(84%, 1200px); margin: 0 auto clamp(96px, 16vw, 240px); }
.footer-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: #9C988F;
}
.footer-meta a:hover { color: var(--bg); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav-pill { gap: 22px; padding: 6px 6px 6px 16px; }
  .nav-pill,
  html.has-liquid .nav-pill {
    background: rgba(255,255,255,.55);
    backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.75),
      inset 0 0 0 1px rgba(255,255,255,.35),
      0 10px 30px -8px rgba(0,0,0,.3);
  }
  .nav.on-dark .nav-pill,
  html.has-liquid .nav.on-dark .nav-pill { background: rgba(255,255,255,.14); }
  .nav-mark { width: 42px; }
  .cta { --h: 42px; font-size: 15px; }
  .cta-label { padding: 0 18px; }

  .hero {
    min-height: 82svh;
    padding: 72px var(--gutter) 64px;
    gap: 32px;
  }
  .intro { font-size: 31px; }

  .project {
    grid-template-columns: 1fr;
    padding: 24px 0 56px;
    gap: 20px;
  }
  /* image first on mobile — the work leads */
  .project-media { order: -1; border-radius: 4px; }
  .project h2 { margin-bottom: 14px; }
  .project-info { gap: 18px; }
  .sound { opacity: 1; }

  .service-list li { gap: 16px; }

  .footer-mark { width: 92%; }
  .footer-meta { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .nav { opacity: 1; transition: none; animation: none; }
}
