@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #f5f5f4;
  --fg: #17171a;
  --muted: #6c6c70;
  --accent: #c1443b;
  --line: #dcdcdb;
  --card: #e9e9e8;
  --footer-h: 96px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

/* only the homepage (paged scroll) locks page-level scrolling — case study
   pages don't get this class and scroll normally */
body.paged {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

/* ---------- paged navigation: any real scroll advances exactly one section ---------- */
.snap-container {
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.snap-track {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transition: transform 0.7s cubic-bezier(.65, 0, .35, 1);
}
.snap-section {
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
}

.serif { font-family: 'Space Grotesk', sans-serif; }

a { color: inherit; }

/* ---------- custom cursor ---------- */
html.custom-cursor-active,
html.custom-cursor-active * {
  cursor: none !important;
}
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.28);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 3px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.15s ease, background 0.25s ease;
}
.custom-cursor.visible {
  opacity: 1;
}
.custom-cursor.hover {
  width: 44px;
  height: 44px;
  background: rgba(26, 26, 26, 0.16);
}

/* ---------- top nav ---------- */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  z-index: 50;
  color: var(--fg);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.nav a { text-decoration: none; }
.nav .name { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 16px; }

/* ---------- hero ---------- */
.hero {
  /* height comes from .snap-section (height: 100vh) — don't override it here */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  max-width: 1300px;
  margin: 0 auto;
}
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
  display: flex;
  animation: scroll-hint-bounce 2.4s ease-in-out infinite;
}
@keyframes scroll-hint-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 14px); }
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
}
.hero h1 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  max-width: 20ch;
}
.hero h1 em { color: var(--accent); font-style: normal; font-weight: 600; }
.hero .sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 40px;
}
.stat-row {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* ---------- screen 2: projects + footer, one fixed viewport ---------- */
.screen-2 {
  display: flex;
  flex-direction: column;
}

/* ---------- project accordion (first line always top, hover to expand) ---------- */
.projects-viewport {
  height: calc(100vh - var(--footer-h));
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.project-line {
  flex: 1 0 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: flex-basis 0.5s cubic-bezier(.4,0,.2,1);
}
.project-line:last-child { border-bottom: none; }
/* linked cards (a.project-line) are clickable anywhere in the container —
   image, header, whitespace all count; unlinked/pending cards stay plain divs */
a.project-line {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
/* default state: first line expanded, others collapsed at 120px, last line still pinned above the footer */
.project-line:first-child { flex-basis: calc(100vh - var(--footer-h) - 360px); }
/* while hovering anywhere in the group, collapse all... */
.projects-viewport:hover .project-line { flex-basis: 120px; }
/* ...except whichever line the cursor is actually on */
.projects-viewport:hover .project-line:hover { flex-basis: calc(100vh - var(--footer-h) - 360px); }

.line-header {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 40px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.line-header .left {
  display: flex;
  align-items: baseline;
  gap: 28px;
  min-width: 0;
}
.line-header .idx {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.line-header .tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 168px;
}
.line-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-header .cta {
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.line-header.pending {
  cursor: default;
}
.line-header.pending .cta {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.line-content {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0 40px 40px;
}
.line-content .frame {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(135deg, var(--card), var(--card) 10px, #e2e2e1 10px, #e2e2e1 20px);
  border: 1px dashed #c7c7c5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.line-header.pending ~ .line-content .frame { opacity: 0.55; }
.frame.frame-img {
  background: #0a0a0c;
  border: none;
  padding: 0;
}
.frame-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}
.case-hero .frame.frame-img {
  border: none;
  padding: 0;
}
.case-hero .frame-img img {
  object-fit: cover;
  object-position: center;
}

/* ---------- footer: pinned to the bottom of screen 2, fixed height ---------- */
footer {
  flex: 0 0 var(--footer-h);
  height: var(--footer-h);
  padding: 0 40px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}
footer a { text-decoration: underline; color: var(--fg); }
.footer .location,
footer .location {
  display: flex;
  align-items: center;
  gap: 8px;
}
.location svg { flex-shrink: 0; color: var(--muted); }

/* ---------- case study depth layer ---------- */
.case-hero {
  padding: 120px 40px 40px;
  max-width: 780px;
  margin: 0 auto;
}
.case-hero .back {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 28px;
}
.case-hero .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.case-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}
.case-hero .frame {
  aspect-ratio: 16/9;
  background: repeating-linear-gradient(135deg, var(--card), var(--card) 10px, #e2e2e1 10px, #e2e2e1 20px);
  border: 1px dashed #c7c7c5;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; text-align: center; padding: 20px;
  margin: 32px 0 0;
}

.lightbox-trigger { cursor: zoom-in; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-img {
  max-width: 80vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease;
}
.lightbox-prev svg,
.lightbox-next svg {
  display: block;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.info-banner svg {
  flex-shrink: 0;
  color: var(--muted);
}
.info-banner span {
  flex: 1 1 auto;
}
.info-banner-arrow {
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- summary modal ---------- */
.summary-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.summary-overlay.open {
  opacity: 1;
  visibility: visible;
}
.summary-panel {
  position: relative;
  width: 90vw;
  height: 90vh;
  max-width: 900px;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: 60px;
  overflow-y: auto;
}
.summary-panel h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  letter-spacing: -0.015em;
  margin: 0 0 32px;
}
.summary-panel ol {
  margin: 0;
  padding-left: 24px;
  font-size: 1.1rem;
  line-height: 1.7;
}
.summary-panel ol li {
  margin-bottom: 16px;
}
.summary-panel ol li:last-child {
  margin-bottom: 0;
}
.summary-img {
  display: block;
  width: 100%;
  border-radius: 6px;
  margin-top: 32px;
}
.view-gallery-btn {
  display: block;
  margin: 32px auto 0;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.view-gallery-btn:hover {
  opacity: 0.85;
}
.back-cta-row {
  display: flex;
  justify-content: flex-start;
  padding: 56px 0 0;
}
.back-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  padding: 16px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.back-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.summary-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

.case-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 40px 120px;
}
.beat {
  padding: 36px 0;
}
.beat .label {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.beat p {
  margin: 0;
  font-size: 1.05rem;
}
.beat-img {
  display: block;
  width: 100%;
  border-radius: 6px;
  margin-top: 24px;
}
.beat-img + p {
  margin-top: 24px;
}
.scroll-grow {
  transform-origin: center center;
  will-change: transform;
}
.reveal-up,
.reveal-down {
  will-change: transform;
}
.video-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
}
.video-row video {
  height: auto;
  max-height: 420px;
  width: auto;
  max-width: 100%;
  border-radius: 6px;
}
.image-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.image-row img {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.phone-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: linear-gradient(160deg, #1c2636, #05070c);
  border-radius: 12px;
  padding: 32px;
  overflow: hidden;
}
.phone-row img {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
}
.beat ul {
  margin: 20px 0 0;
  padding-left: 20px;
  font-size: 1.05rem;
}
.beat ul li {
  margin-bottom: 10px;
}
.beat ul li:last-child {
  margin-bottom: 0;
}
.beat.pull p {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
