/* ==========================================================================
   SERENGETI STUDIO — Design System
   Tokens drawn directly from the brand mark (plum + gold).
   Display: Fraunces / Body: Karla / Labels+data: Archivo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Karla:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Archivo:ital,wght@0,500;0,600;0,700;0,800&display=swap');

:root {
  /* ---- Color tokens (from the Serengeti Studio mark) ---- */
  --color-primary: #905078;   /* logo plum */
  --color-surface: #211621;   /* warm charcoal — lifted from near-black for a glossier read */
  --color-accent:  #f0ba12;   /* logo gold */
  --color-text:    #f8f1f5;   /* warm off-white */
  --color-muted:   #c2a7b5;   /* muted mauve, captions/meta */
  --color-border:  #45303f;   /* hairline dividers */

  /* derived, not new hues — tints/shades of the six above */
  --color-surface-raised: #2f2030;
  --color-primary-deep:   #663654;
  --color-text-on-accent: #1a1014;
  --color-overlay: rgba(33, 22, 33, 0.68);
  --color-glass: rgba(47, 32, 48, 0.55);
  --color-glow-plum: rgba(144, 80, 120, 0.35);
  --color-glow-gold: rgba(240, 186, 18, 0.16);

  /* ---- Type ---- */
  --font-display: 'Fraunces', serif;
  --font-body: 'Karla', sans-serif;
  --font-label: 'Archivo', sans-serif;

  --text-display: clamp(2.75rem, 3.2vw + 2rem, 5.75rem);
  --text-h1: clamp(2.1rem, 1.6vw + 1.6rem, 3.25rem);
  --text-h2: clamp(1.6rem, 1vw + 1.3rem, 2.3rem);
  --text-h3: clamp(1.2rem, 0.5vw + 1.05rem, 1.5rem);
  --text-body-lg: 1.1875rem;
  --text-body: 1.0625rem;
  --text-caption: 0.9rem;
  --text-label: 0.78rem;

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-normal: 1.6;

  /* ---- Layout ---- */
  --container-w: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-pad: clamp(4rem, 8vw, 7.5rem);
  --radius: 2px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------- */
/* Reset                                                                   */
/* ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 600px at 8% 0%, var(--color-glow-plum), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 22%, var(--color-glow-gold), transparent 55%),
    radial-gradient(ellipse 800px 700px at 92% 85%, var(--color-glow-plum), transparent 60%),
    var(--color-surface);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* Visible focus states everywhere — never removed without replacement */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------------- */
/* Typography                                                              */
/* ---------------------------------------------------------------------- */
.font-display { font-family: var(--font-display); }

.eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: '';
  width: 1.6em;
  height: 1px;
  background: var(--color-accent);
  display: inline-block;
}

.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
.display em {
  font-style: italic;
  font-weight: 500;
  color: var(--color-accent);
}

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: var(--leading-snug);
}
h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: var(--leading-snug);
}
.lede {
  font-size: var(--text-body-lg);
  color: var(--color-text);
  line-height: var(--leading-normal);
  max-width: 62ch;
}
.body-muted { color: var(--color-muted); }
.caption {
  font-family: var(--font-label);
  font-size: var(--text-caption);
  color: var(--color-muted);
}
.label {
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------- */
/* Layout utilities                                                        */
/* ---------------------------------------------------------------------- */
.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-pad); }
.section-tight { padding-block: calc(var(--section-pad) * 0.55); }
.stack { display: flex; flex-direction: column; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4.5rem);
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1.6rem;
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  position: relative;
  background: linear-gradient(180deg, #ffce42, var(--color-accent));
  color: var(--color-text-on-accent);
  box-shadow: 0 8px 24px -8px rgba(240,186,18,0.55);
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
}
.btn-primary:hover { background: linear-gradient(180deg, #ffd046, #ffce42); transform: translateY(-2px); box-shadow: 0 10px 28px -8px rgba(240,186,18,0.7); }
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); transform: translateY(-2px); }
.btn svg { width: 1.05em; height: 1.05em; }

/* ---------------------------------------------------------------------- */
/* Nav                                                                     */
/* ---------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: 1.4rem;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(26, 16, 20, 0.92);
  backdrop-filter: blur(10px);
  padding-block: 0.9rem;
  border-bottom-color: var(--color-border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-brand img { width: 38px; height: 38px; border-radius: 50%; }
.nav-brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.nav-brand-word span { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.2rem);
  font-family: var(--font-label);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-links a { position: relative; padding-block: 0.3rem; color: var(--color-muted); transition: color 0.3s var(--ease); }
.nav-links a:hover, .nav-links a.is-active { color: var(--color-text); }
.nav-links a.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--color-accent);
}
.nav-cta {
  background: linear-gradient(180deg, #ffce42, var(--color-accent));
  color: var(--color-text-on-accent);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(240,186,18,0.5);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(240,186,18,0.65); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
  }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(80vw, 320px);
    background: var(--color-surface-raised);
    padding: 6rem 2rem 2rem;
    border-left: 1px solid var(--color-border);
  }
}

/* ---------------------------------------------------------------------- */
/* The Migration Line — signature element                                  */
/* A thin gold thread that runs between every section, standing in for     */
/* the continuous route this studio carries a project along.              */
/* ---------------------------------------------------------------------- */
.migration-line {
  position: relative;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.migration-line svg { width: 100%; height: 100%; }
.migration-line .path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
  opacity: 0.55;
  animation: migrate 26s linear infinite;
}
.migration-line .node {
  fill: var(--color-accent);
}
@keyframes migrate {
  to { stroke-dashoffset: -320; }
}

/* Vertical migration line used inside the service constellation */
.thread {
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--color-border) 6%, var(--color-border) 94%, transparent);
}
.thread::before {
  content: '';
  position: absolute;
  left: 50%; top: 0;
  width: 2px; height: 40%;
  background: var(--color-accent);
  transform: translateX(-50%);
  animation: threadflow 7s var(--ease) infinite;
}
@keyframes threadflow {
  0% { top: -40%; }
  100% { top: 100%; }
}
@media (max-width: 720px) {
  .thread { left: 27px; }
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding-block: 8rem 5rem;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(33,22,33,0.36) 0%, rgba(33,22,33,0.4) 40%, var(--color-surface) 97%),
    linear-gradient(90deg, rgba(33,22,33,0.82) 0%, rgba(33,22,33,0.12) 58%);
  z-index: -1;
}
.hero::after {
  /* glossy highlight sweep — static, not animated; the movement budget is spent on the slideshow */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.10) 0%, transparent 22%, transparent 78%, rgba(240,186,18,0.10) 100%);
  mix-blend-mode: overlay;
  z-index: -1;
  pointer-events: none;
}
.hero-inner { max-width: 780px; }
.hero-tagline { margin-top: 1.4rem; }
.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-hero {
  position: relative;
  padding-block: calc(var(--section-pad) + 5rem) var(--section-pad);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(33,22,33,0.58), var(--color-surface) 93%);
  z-index: -1;
}
.page-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.08) 0%, transparent 24%, transparent 78%, rgba(240,186,18,0.09) 100%);
  mix-blend-mode: overlay;
  z-index: -1;
  pointer-events: none;
}

/* ---------------------------------------------------------------------- */
/* Stat strip                                                              */
/* ---------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.stat {
  padding: 2.2rem 1.5rem;
  text-align: center;
  border-left: 1px solid var(--color-border);
}
.stat:first-child { border-left: none; }
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.4vw, 2.6rem);
  color: var(--color-accent);
  font-weight: 600;
}
.stat-label {
  margin-top: 0.4rem;
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
}

/* ---------------------------------------------------------------------- */
/* Service constellation (NOT a 4-card grid)                               */
/* ---------------------------------------------------------------------- */
.constellation { position: relative; padding-left: 76px; }
.service-node {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2rem, 4vw, 3.2rem);
  border-bottom: 1px solid var(--color-border);
}
.service-node:last-child { border-bottom: none; }
.service-node::before {
  content: '';
  position: absolute;
  left: -76px;
  top: clamp(2rem, 4vw, 3.2rem);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
}
.service-node-title { display: flex; align-items: flex-start; gap: 0.9rem; }
.service-node-title svg {
  width: 28px; height: 28px;
  flex-shrink: 0;
  color: var(--color-accent);
  margin-top: 0.2rem;
}
.service-node-links {
  margin-top: 1.1rem;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.service-node-links a {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.service-node-links a:hover { color: var(--color-accent); border-color: var(--color-accent); }

@media (max-width: 720px) {
  .service-node { grid-template-columns: 1fr; }
  .constellation { padding-left: 56px; }
  .service-node::before { left: -56px; }
  .thread { left: 20px; }
}

/* ---------------------------------------------------------------------- */
/* Work / portfolio cards — poster-card treatment, no fabricated stills    */
/* ---------------------------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
}
.work-card {
  position: relative;
  padding: 2rem 1.7rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(155deg, var(--card-a, #663654), var(--card-b, #1a1014));
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.work-card:hover { transform: translateY(-6px); border-color: var(--color-accent); box-shadow: 0 20px 40px -20px rgba(240,186,18,0.35); }
.work-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(240,186,18,0.08) 0 2px, transparent 2px 42px);
  pointer-events: none;
}
.work-card-year {
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  font-weight: 700;
}
.work-card-title {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.work-card-desc {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}
.work-card-credit {
  margin-top: 1rem;
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ---------------------------------------------------------------------- */
/* Generic content cards (creative services sub-blocks etc.)               */
/* ---------------------------------------------------------------------- */
.panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  background: var(--color-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 20px 40px -24px rgba(0,0,0,0.5);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.panel:hover { border-color: rgba(240,186,18,0.4); }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.tag {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

/* ---------------------------------------------------------------------- */
/* CTA band                                                                */
/* ---------------------------------------------------------------------- */
.cta-band {
  background: var(--color-primary);
  background-image: radial-gradient(circle at 15% 20%, rgba(240,186,18,0.16), transparent 45%);
}
.cta-band .h2 { color: var(--color-text); }
.cta-band .eyebrow { color: var(--color-text); } /* gold-on-plum fails AA for small text; swap to off-white */

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 3.5rem 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; }
.footer-links a {
  display: block;
  padding-block: 0.35rem;
  color: var(--color-muted);
  font-size: 0.92rem;
  transition: color 0.3s var(--ease);
}
.footer-links a:hover { color: var(--color-accent); }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ---------------------------------------------------------------------- */
/* Hero slideshow — crossfading stills standing in for video, until real   */
/* footage is loaded in. Each slide gets a slow Ken Burns drift.           */
/* ---------------------------------------------------------------------- */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: var(--color-surface); /* shows while the first image decodes */
}
.hero-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 2s ease;
  will-change: opacity, transform;
}
.hero-bg-slide.is-active {
  opacity: 1;
  animation: kenburns 9s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg-slide.is-active { animation: none; }
}

/* ---------------------------------------------------------------------- */
/* Hero background video — real muted loops, one clip playing at a time,   */
/* crossfading into the next on 'ended'. Falls back to the image          */
/* slideshow above if reduced-motion is set or video fails to load.       */
/* ---------------------------------------------------------------------- */
.hero-bg-video-wrap {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: var(--color-surface);
  overflow: hidden;
}
.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.hero-bg-video.is-visible { opacity: 1; }

.hero-motion-toggle {
  position: absolute;
  z-index: 5;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(33,22,33,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(248,241,245,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero-motion-toggle:hover { background: rgba(33,22,33,0.78); transform: scale(1.06); }
.hero-motion-toggle svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------- */
/* Utility                                                                 */
/* ---------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mx-auto { margin-inline: auto; }
.max-w-prose { max-width: 68ch; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}
