/* ===== Motion homepage (dark) ===== */

:root {
  color-scheme: dark;
  --bg: #0b0d0a;
  --bg-2: #121510;
  --text: #eceeea;
  --text-dim: #a3a8a0;
  --text-mute: #6f746c;
  --line: rgba(236, 238, 234, 0.12);
  --accent: #8cc45f;
  --accent-2: #46969f;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.italic { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; }
.accent { color: var(--accent); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Moving glow behind everything */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
body::before {
  top: -25vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(140, 196, 95, 0.12) 0%, transparent 65%);
  animation: drift-a 18s ease-in-out infinite alternate;
}
body::after {
  bottom: -30vmax; right: -20vmax;
  background: radial-gradient(circle, rgba(70, 150, 170, 0.1) 0%, transparent 65%);
  animation: drift-b 22s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(30vw, 40vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-30vw, -45vh) scale(1.2); } }

/* Film grain for texture */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
  100% { transform: translate(1%, 3%); }
}

/* ===== "View" bubble over the case study videos ===== */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(104, 168, 64, 0.78) 0%, rgba(38, 118, 132, 0.68) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
  opacity: 0;
  scale: 0.4;
  transition: opacity 0.2s ease, scale 0.3s var(--ease);
}
.cursor-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.cursor.is-view { opacity: 1; scale: 1; }
@media (hover: hover) and (pointer: fine) {
  .project-media { cursor: none; }
}

/* ===== Nav (matches the project pages) ===== */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 48px 20px;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: #1f221e; }
.nav-links a.nav-cta {
  background: var(--text);
  color: #181a17;
  padding: 10px 18px;
}
.nav-links a.nav-cta:hover { background: var(--accent); color: #0f110e; }

@media (max-width: 1240px) { .nav { padding: 20px 40px; } }
@media (max-width: 860px) { .nav { padding: 16px 60px; } }
@media (max-width: 600px) {
  .nav { padding: 14px 44px; }
  .nav-links a { font-size: 13px; padding: 6px 12px; }
  .nav-links a.nav-cta { padding: 6px 14px; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 80vh;
  min-height: 80svh;
  display: grid;
  place-items: center;
  padding: 120px var(--gutter) 24px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; text-align: center; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(11, 13, 10, 0.5);
  backdrop-filter: blur(8px);
  margin-bottom: 32px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(140, 196, 95, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(140, 196, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(140, 196, 95, 0); }
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.2s var(--ease);
}
.hero-title .line:nth-child(2) > span { transition-delay: 0.12s; }
.hero-title .line:nth-child(3) > span { transition-delay: 0.24s; }
.is-loaded .hero-title .line > span { transform: none; }

.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease) 0.5s, transform 1s var(--ease) 0.5s;
}
.is-loaded .reveal-up, .reveal-up.is-in { opacity: 1; transform: none; }

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 56px auto 0;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.scroll-cue-line {
  width: 1px; height: 48px;
  background: linear-gradient(var(--text-mute), transparent);
  animation: cue 2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ===== Statement ===== */
.statement {
  padding: 0 var(--gutter) 28vh;
  max-width: 1120px;
  margin: 0 auto;
}
.statement-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 3.4vw, 52px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.statement-text .word { opacity: 0.28; transition: opacity 0.5s ease; }
.statement-text .word.is-lit { opacity: 1; }

/* ===== Work ===== */
.work-head {
  padding: 0 var(--gutter) 4vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.work-title {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(56px, 12vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.project { height: 190vh; position: relative; }
.project-stage {
  --frame-w: min(84vw, 96vh, 1400px);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vh, 40px);
  padding-top: 40px;
  overflow: hidden;
}
.project-media {
  position: relative;
  z-index: 1;
  width: var(--frame-w);
  aspect-ratio: 16 / 10;
  border-radius: 28px;
  overflow: hidden;
  transform: scale(0.45);
  transform-origin: 50% 100%;
  will-change: transform, border-radius;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: var(--bg-2);
}
.project-media video { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.project-num {
  position: absolute;
  z-index: 0;
  top: 36vh;
  right: var(--gutter);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(120px, 26vw, 420px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 196, 95, 0.4);
  will-change: transform;
}

.project-bigtitle {
  position: absolute;
  z-index: 0;
  top: 2vh;
  left: var(--gutter);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(64px, 10vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 196, 95, 0.4);
  will-change: transform;
}

.project-info {
  position: relative;
  z-index: 2;
  width: var(--frame-w);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px 48px;
  align-items: end;
  opacity: 0;
  will-change: transform, opacity;
}
.project-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.project-info h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.project-desc {
  font-size: clamp(15px, 1.1vw, 17px);
  color: var(--text-dim);
}
.project-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.project-link span { transition: transform 0.4s var(--ease); }
.project-link:hover span { transform: translateX(6px); }

/* ===== Off the clock (horizontal scroll) ===== */
.offclock { height: 320vh; position: relative; }
.offclock-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5vh;
}
.offclock-head {
  padding: 0 var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.offclock-head h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.offclock-link { font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--accent); white-space: nowrap; }
.offclock-track {
  display: flex;
  gap: 2.5vw;
  padding: 0 var(--gutter);
  width: max-content;
  will-change: transform;
}
.photo {
  height: 62vh;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-2);
}
.photo.tall { aspect-ratio: 3 / 4; }
.photo.wide { aspect-ratio: 3 / 2; }
.photo:nth-child(even) { margin-top: 8vh; }
.photo img {
  width: 120%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  will-change: transform;
}

/* ===== Contact ===== */
.contact {
  min-height: 100vh;
  padding: 20vh var(--gutter) 12vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.contact-kicker { font-size: clamp(18px, 2vw, 28px); color: var(--text-dim); }
.contact-title {
  font-weight: 400;
  font-size: clamp(56px, 10vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 2vh 0 6vh;
  will-change: transform;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.3s var(--ease);
  will-change: transform;
}
.contact-email:hover { background: #a2d67a; }
.contact-socials { display: flex; gap: 32px; margin-top: 40px; }
.contact-socials a { color: var(--text-dim); font-weight: 500; transition: color 0.2s; }
.contact-socials a:hover { color: var(--text); }

.footer {
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-mute);
}

/* ===== Small screens ===== */
@media (max-width: 760px) {
  .project { height: 150vh; }
  .project-stage { --frame-w: calc(100vw - 32px); }
  .project-media { border-radius: 16px; }
  .project-info { grid-template-columns: 1fr; }
  .project-num { top: 30vh; }
  .project-bigtitle { top: 2vh; font-size: 15vw; }
  .photo { height: 52vh; }
}

/* ===== Reduced motion: keep it still and readable ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, body::after, .grain, .scroll-cue-line, .status-dot { animation: none; }
  .hero-title .line > span, .reveal-up { transition: none; transform: none; opacity: 1; }
  .project { height: auto; }
  .project-stage { position: relative; height: auto; padding: 8vh 0; }
  .project-media { transform: none; }
  .project-info { opacity: 1; transform: none; }
  .offclock { height: auto; }
  .offclock-sticky { position: relative; height: auto; padding: 10vh 0; }
  .offclock-track { width: auto; overflow-x: auto; }
  .statement-text .word { opacity: 1; }
}
