/* ============================================================
   Studio 29 — editorial travel-journal × design studio
   ============================================================ */

:root {
  /* paper & ink — dusty rose, matched to the hero video as the browser renders
     it (measured on screen: R0.868 G0.697 B0.715 → #ddb2b6) */
  --paper:      #ddb2b6;
  --paper-2:    #d3a4a9;
  --ink:        #2b171c;
  --ink-soft:   #8a595f;
  --line:       #ca9aa0;

  /* UI accent — deep wine, replaces the old orange */
  --accent: #8e1f45;

  /* warm berry→gold gradient for the display words (reads well on the rose) */
  --wine:   #8e1f45;
  --rasp:   #cf3f66;
  --coral:  #e8703c;
  --gold:   #f2b134;

  --grad: linear-gradient(100deg, var(--wine) 0%, var(--rasp) 34%, var(--coral) 68%, var(--gold) 100%);

  --font-display: "Fraunces", Georgia, serif;
  --font-sans:    "Inter", -apple-system, system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1400px;
}

/* The video is shown in the display's native (P3) gamut, so a plain sRGB #ddb2b6
   renders slightly duller than the video. On P3-capable browsers, set the paper
   directly in display-p3 using the on-screen native values measured from the
   video (0.868 / 0.697 / 0.715) so the background matches the video exactly. */
@supports (background: color(display-p3 1 1 1)) {
  :root {
    --paper:   color(display-p3 0.868 0.697 0.715);
    --paper-2: color(display-p3 0.824 0.642 0.66);
  }
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

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

::selection { background: var(--gold); color: var(--ink); }

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---------- shared bits ---------- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow, .section-head__num, .person__role, .person__coords,
.marquee, .project__index, .project__tags, .contact__eyebrow,
.footer, .nav__links, .project__url {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* reveal-on-scroll — only hide when JS is present (graceful degradation) */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1);
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.nav__mark { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 2rem); font-size: 0.72rem; }
.nav__links a { position: relative; padding: 0.2rem 0; transition: color .25s; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px;
  background: var(--ink); transition: width .3s cubic-bezier(.16,1,.3,1);
}
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  padding: 0.5rem 1rem !important;
  transition: background .25s, color .25s;
}
.nav__cta:hover { background: var(--ink); color: var(--paper); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 8rem) var(--pad) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 34vw, 540px);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.hero__media {
  align-self: center;
}
.hero__video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  /* feather the square's edges into the page so the video dissolves into the pink */
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 92%);
          mask-image: radial-gradient(closest-side, #000 60%, transparent 92%);
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.eyebrow__dot { color: var(--accent); font-size: 0.5em; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 340;
  font-size: clamp(2.5rem, 6.6vw, 6.75rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-optical-sizing: auto;
}
.hero__title span { display: block; }
.hero__title em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.hero__title .grad-text {
  font-weight: 500;
  width: fit-content;
  max-width: 100%;
  /* extend the clip box below the baseline so the "g" descender keeps its gradient */
  padding-bottom: 0.2em;
  margin-bottom: -0.2em;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.hero__lede { max-width: 34ch; font-size: 1.05rem; color: var(--ink-soft); }
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  border: 1.5px solid var(--ink);
  transition: transform .25s cubic-bezier(.16,1,.3,1), background .25s, color .25s;
}
.btn span { transition: transform .3s; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { transform: translateY(-3px); }
.btn--solid:hover span { transform: translateX(4px); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px); }

/* ============================================================
   FLIGHTPATH — scroll-driven plane + emoji burst
   ============================================================ */
.flightpath {
  margin-top: clamp(0.5rem, 1.5vw, 1.25rem);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1;
  pointer-events: none;
}
.flightpath__track {
  position: relative;
  width: 100%;
  height: 1.3em;
}
.flightpath__plane {
  display: inline-block;
  margin-left: -0.08em; /* trim the glyph's left side-bearing so it starts flush */
  transform: translateX(0);
  transition: transform 0.12s linear, opacity 0.25s ease;
  will-change: transform;
}

/* emoji rain — pours from the top of the screen when the plane reaches the top */
.emoji-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.emoji-drop {
  position: absolute;
  top: -80px;
  font-size: clamp(1.75rem, 3.5vw, 3.25rem);
  filter: drop-shadow(0 6px 14px rgba(40,30,10,0.25));
  will-change: transform, opacity;
  animation: drop var(--dur) cubic-bezier(.32,.14,.52,1) var(--delay) forwards;
}
@keyframes drop {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(var(--fall)) translateX(var(--drift)) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .emoji-rain { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flightpath__plane { transition: none; }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1rem 0;
  background: var(--paper-2);
  white-space: nowrap;
  user-select: none;
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  font-size: 1rem;
  will-change: transform;
  animation: scroll 34s linear infinite;
}
.marquee__star { color: var(--accent); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* ============================================================
   SECTION HEADS
   ============================================================ */
.section-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--pad) clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.5rem;
  row-gap: 1rem;
  align-items: baseline;
}
.section-head__num { font-size: 0.75rem; color: var(--accent); padding-top: 0.6rem; }
.section-head__title {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(2rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.section-head__note {
  grid-column: 2;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ============================================================
   US / PEOPLE
   ============================================================ */
.us { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(3rem, 8vw, 6rem); }
.people {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 8vw, 7rem);
  max-width: 960px;
  margin: 0 auto;
}
.person { display: flex; flex-direction: column; align-items: center; }
.person--offset { margin-top: clamp(2rem, 8vw, 6rem); }

.person__photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 5 / 7;
  transition: transform .5s cubic-bezier(.16,1,.3,1), filter .5s;
  filter: drop-shadow(0 30px 45px rgba(40,30,10,0.28));
}
.person__photo--a { transform: rotate(-4deg); }
.person__photo--b { transform: rotate(3.5deg); }
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person:hover .person__photo { transform: rotate(0deg) translateY(-10px) scale(1.02); filter: drop-shadow(0 40px 60px rgba(40,30,10,0.35)); }

.person__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  margin-top: 1.75rem;
}
.person__name { font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; letter-spacing: -0.02em; }
.person__role { font-size: 0.68rem; color: var(--ink-soft); }
.person__coords { font-size: 0.62rem; color: var(--accent); letter-spacing: 0.12em; }

/* ============================================================
   WORK / PROJECTS
   ============================================================ */
.work { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(3rem, 8vw, 6rem); }

.project {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-top: 1px solid var(--line);
  transition: padding-left .4s cubic-bezier(.16,1,.3,1);
}
.project:last-of-type { border-bottom: 1px solid var(--line); }
.project__index { font-size: 0.8rem; color: var(--ink-soft); align-self: start; padding-top: 0.5rem; }
.project__title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2rem, 7vw, 4.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color .3s;
}
.project__desc { max-width: 44ch; color: var(--ink-soft); margin-top: 0.75rem; font-size: 1rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; font-size: 0.62rem; color: var(--ink-soft); }
.project__tags span { border: 1px solid var(--line); border-radius: 100px; padding: 0.3rem 0.75rem; }
.project__link { display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; }
.project__url { font-size: 0.72rem; color: var(--ink-soft); transition: color .3s; }
.project__arrow {
  font-size: 1.4rem;
  display: inline-flex;
  width: 3rem; height: 3rem;
  align-items: center; justify-content: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform .35s cubic-bezier(.16,1,.3,1), background .3s, color .3s;
}

.project[href]:hover { padding-left: clamp(0.5rem, 2vw, 1.5rem); }
.project[href]:hover .project__title { color: var(--accent); }
.project[href]:hover .project__arrow { background: var(--ink); color: var(--paper); transform: rotate(45deg) scale(1.05); }
.project[href]:hover .project__url { color: var(--ink); }

.project--soon { opacity: 0.55; }
.project--soon .project__arrow { border-style: dashed; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 12vw, 10rem) var(--pad);
  text-align: center;
}
.contact__eyebrow { font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.contact__title {
  font-family: var(--font-display);
  font-weight: 340;
  font-size: clamp(3.5rem, 16vw, 12rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 2rem;
}
.contact__mail {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.5vw, 1.35rem);
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.35rem;
  transition: border-color .3s, letter-spacing .3s;
}
.contact__mail:hover { border-color: var(--accent); letter-spacing: 0.06em; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.75rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer__brand { color: var(--ink); justify-self: start; }
.footer__mid { justify-self: center; text-align: center; }
.footer__year { justify-self: end; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: clamp(1rem, 4vw, 2rem);
  }
  .hero__content { order: 1; }
  .hero__media { order: 2; min-height: 0; }
  .hero__video { max-height: 62vh; }
}

@media (max-width: 720px) {
  .nav__links a:not(.nav__cta):not([href="#contact"]) { display: none; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .section-head { grid-template-columns: 1fr; row-gap: 0.5rem; }
  .section-head__num { padding-top: 0; }
  .section-head__note { grid-column: 1; }
  .people { grid-template-columns: 1fr; max-width: 360px; gap: 3.5rem; }
  .person--offset { margin-top: 0; }
  .project { grid-template-columns: auto 1fr; }
  .project__link { grid-column: 1 / -1; justify-content: flex-start; }
  .footer { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 0.5rem; }
  .footer__brand, .footer__mid, .footer__year { justify-self: center; }
}
