/* ─── RESET ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── DESIGN TOKENS ────────────────────────────────────────── */
:root {
  --color-bg:        #FFFFFF;
  --color-ink:       #0A0A0A;
  --color-accent:    #4D32FF;
  --color-muted:     #6B6B6B;
  --color-border:    #E8E8E8;
  --color-hover-row: #F7F7F7;
  --color-tint:      #F6F6F5;
  --color-pill:      #DEDEDC;

  --font-main: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Google Sans Flex', sans-serif;

  --nav-height: 60px;
  --space-xs:    8px;
  --space-s:    16px;
  --space-m:    32px;
  --space-l:    64px;
  --space-xl:   96px;
}

html {
  background-color: #FFFFFF;
}

body {
  font-family: var(--font-body);
  background-color: #FFFFFF;
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-main);
}

/* ─── NAV ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-l);
  background: transparent;
  transition: background 200ms ease, border-color 200ms ease, transform 250ms ease;
  border-bottom: 1px solid transparent;
  z-index: 100;
}
nav.scrolled {
  background: var(--color-bg);
  border-bottom-color: var(--color-border);
}
nav.nav-hidden {
  transform: translateY(-100%);
}
.nav-name {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 150ms ease;
}
.nav-name:hover { opacity: 0.7; }
.nav-name img {
  height: 16px;
  width: auto;
  display: block;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: var(--space-m);
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-ink);
  text-decoration: none;
  transition: color 150ms ease;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-live {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-live-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.nav-live-city {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink);
}
.nav-live-meta {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
  white-space: nowrap;
}
.nav-live-icon {
  flex-shrink: 0;
  width: 43px;
  height: 32px;
  object-fit: contain;
}

/* ─── COFFEE POUR MICROINTERACTION (tap to pour) ────────── */
.nav-live-icon-wrap {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  border-radius: 8px;
}
.nav-live-icon-wrap:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
.coffee-drop {
  position: absolute;
  top: -16px;
  left: 46%;
  width: 5px;
  height: 7px;
  background: #6F4E37;
  border-radius: 0 50% 50% 50%;
  transform: translateX(-50%) rotate(45deg) scale(0.6);
  opacity: 0;
  pointer-events: none;
  animation: coffee-drop-fall 0.6s cubic-bezier(0.45, 0, 0.75, 1) forwards;
}
.coffee-splash {
  position: absolute;
  top: 6px;
  left: 46%;
  width: 11px;
  height: 5px;
  background: #6F4E37;
  border-radius: 50%;
  transform: translateX(-50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  animation: coffee-splash-pulse 0.42s ease-out forwards;
}
.nav-live-icon {
  transform-origin: 50% 85%;
}
.nav-live-icon.is-tilting {
  animation-name: mug-tilt;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
@keyframes coffee-drop-fall {
  0%   { top: -16px; opacity: 0; transform: translateX(-50%) rotate(45deg) scale(0.6); }
  20%  { opacity: 1; transform: translateX(-50%) rotate(45deg) scale(1); }
  80%  { opacity: 1; }
  100% { top: 8px; opacity: 0; transform: translateX(-50%) rotate(45deg) scale(0.7); }
}
@keyframes coffee-splash-pulse {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.3); }
  45%  { opacity: 0.5; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.3); }
}
@keyframes mug-tilt {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(-3deg); }
  75%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}

/* ─── CASE HERO ────────────────────────────────────────────── */
.case-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-l) var(--space-xl);
}
.hero-inner {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: var(--space-l);
  width: 100%;
  align-items: center;
}

/* Left column */
.case-index {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-s);
}
.case-title {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin-bottom: var(--space-m);
}
.case-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
  padding: 6px 0;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: padding 200ms ease, border-color 200ms ease,
              text-decoration-color 200ms ease;
}
.case-cta:hover {
  padding: 6px 18px;
  border-color: var(--color-ink);
  text-decoration-color: transparent;
}
.case-cta .arrow {
  display: inline-block;
  transition: transform 200ms ease;
}
.case-cta:hover .arrow { transform: translateX(4px); }

/* Right column */
.case-tags {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-muted);
  line-height: 2;
  margin-bottom: var(--space-m);
}
.case-desc {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.7;
}

/* ─── GALLERY ──────────────────────────────────────────────── */
.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding-bottom: var(--space-xl);
}

/* Full-width row — no side padding, edge to edge */
.gallery-full .placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Two-up row */
.gallery-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0 var(--space-l);
}
.gallery-pair .placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Asymmetric row — left portrait (~40%), right landscape (~60%) */
.gallery-asymmetric {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4px;
  padding: 0 var(--space-l);
  align-items: start;
}
.gallery-asym-left .placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
}
.gallery-asym-right .placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Shared placeholder */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-label {
  font-family: var(--font-main);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.22);
  text-align: center;
  padding: 0 var(--space-s);
}

/* Actual images (when replacing placeholders) */
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── NEXT CASE ────────────────────────────────────────────── */
.next-case {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: var(--space-l);
  border-top: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  background: transparent;
  transition: background 150ms ease;
}
.next-case:hover { background: var(--color-hover-row); }
.next-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.next-title {
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  color: var(--color-ink);
  text-align: right;
  transition: color 150ms ease;
}
.next-case:hover .next-title { color: var(--color-accent); }

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 767px) {
  nav { padding: 0 var(--space-m); }
  .nav-links { gap: var(--space-s); }
  .nav-live { display: none; }

  .case-hero {
    padding: calc(var(--nav-height) + var(--space-l)) var(--space-m) var(--space-l);
    align-items: flex-start;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-l);
  }

  .gallery-pair {
    grid-template-columns: 1fr;
    padding: 0 var(--space-m);
    gap: var(--space-m);
  }
  .gallery-asymmetric {
    grid-template-columns: 1fr;
    padding: 0 var(--space-m);
    gap: var(--space-m);
    align-items: stretch;
  }

  .next-case { padding: var(--space-m); }
  .next-title { font-size: 16px; }
}

/* ─── SCROLL REVEAL ────────────────────────────────────────── */
/* Explicit [data-reveal] opt-in, plus a curated set of recurring
   section-level classes so long case-study pages get reveals without
   hand-tagging every instance. */
[data-reveal],
.cs-section-heading,
.cs-ba-heading,
.cs-img-wrap,
.section-label,
.gallery-full,
.gallery-pair,
.gallery-asymmetric {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible,
.cs-section-heading.is-visible,
.cs-ba-heading.is-visible,
.cs-img-wrap.is-visible,
.section-label.is-visible,
.gallery-full.is-visible,
.gallery-pair.is-visible,
.gallery-asymmetric.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── SMOOTH DOT + RING CURSOR ─────────────────────────────── */
body.smooth-cursor-active,
body.smooth-cursor-active a,
body.smooth-cursor-active button,
body.smooth-cursor-active img,
body.smooth-cursor-active input,
body.smooth-cursor-active textarea,
body.smooth-cursor-active select {
  cursor: none;
}
.smooth-cursor-dot,
.smooth-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 199;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.smooth-cursor-dot.is-visible,
.smooth-cursor-ring.is-visible {
  opacity: 1;
}
.smooth-cursor-dot {
  width: 8px;
  height: 8px;
  background: #4D32FF;
}
.smooth-cursor-ring {
  width: 28px;
  height: 28px;
  border: 1px solid #4D32FF;
  transition: width 0.3s, height 0.3s, opacity 0.2s ease, border-color 0.2s ease;
}
.smooth-cursor-ring.is-hovering {
  width: 44px;
  height: 44px;
}
.smooth-cursor-dot.is-suppressed,
.smooth-cursor-ring.is-suppressed {
  opacity: 0;
}
@media (hover: none), (pointer: coarse) {
  .smooth-cursor-dot, .smooth-cursor-ring { display: none; }
}

/* ─── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
