/* STN — custom overrides on top of Tailwind CDN */
:root {
  --ink: #0A0A0A;
  --bone: #F5F2ED;
  --paper: #FFFFFF;
  --mist: #8E8E8E;
  --cyan: #00D4FF;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body { background: var(--ink); color: var(--bone); font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.6; overflow-x: hidden; }

.font-display { font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif; font-weight: 500; letter-spacing: -0.02em; line-height: 1.02; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.05em; }

.bg-ink { background-color: var(--ink); }
.bg-bone { background-color: var(--bone); }
.text-ink { color: var(--ink); }
.text-bone { color: var(--bone); }
.text-mist { color: var(--mist); }
.text-cyan { color: var(--cyan); }
.border-mist { border-color: rgba(142,142,142,0.25); }

/* Link hover */
a.link { position: relative; transition: color .2s ease; }
a.link:hover { color: var(--cyan); }
a.link-underline { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s ease, color .2s ease; }
a.link-underline:hover { background-size: 100% 1px; color: var(--cyan); }

/* Nav */
.nav-fixed { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: rgba(10,10,10,0.72); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }
.nav-fixed.on-bone { background: rgba(245,242,237,0.85); color: var(--ink); }

/* Hero */
.hero { position: relative; width: 100vw; height: 100vh; min-height: 560px; overflow: hidden; background: var(--ink); }
.hero video, .hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.hero .yt-wrap { position: absolute; inset: 0; overflow: hidden; }
.hero .yt-wrap iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw;               /* 16:9 based on width  */
  min-height: 100vh; min-width: 177.78vh;      /* 16:9 based on height */
  transform: translate(-50%, -50%);
  pointer-events: none;                        /* block YT UI interaction */
}
.hero .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.4) 0%, rgba(10,10,10,0) 30%, rgba(10,10,10,0) 60%, rgba(10,10,10,.8) 100%); pointer-events: none; z-index: 2; }
.hero .hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding: 0 1.5rem 6rem; z-index: 3; pointer-events: none; }
.hero .brand { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); z-index: 3; text-align: center; pointer-events: none; width: 92%; }

/* Editorial type scale */
.h-display { font-size: clamp(2.5rem, 8vw, 7rem); }
.h-1 { font-size: clamp(2rem, 5.5vw, 4.5rem); }
.h-2 { font-size: clamp(1.5rem, 3.6vw, 2.75rem); }
.h-3 { font-size: clamp(1.15rem, 2.2vw, 1.75rem); }
.eyebrow { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mist); }

/* Work grid card */
.work-card { display: block; padding: 2rem 0; border-top: 1px solid rgba(245,242,237,0.12); transition: color .25s ease; }
.work-card:hover { color: var(--cyan); }
.work-card:hover .card-title { background-size: 100% 1px; }
.card-title { display: inline; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 92%; transition: background-size .35s ease; }
.work-card:last-child { border-bottom: 1px solid rgba(245,242,237,0.12); }
.on-bone .work-card { border-color: rgba(10,10,10,0.12); }

/* Feature grid on home */
.feature-grid { display: grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap: 1px; background: rgba(245,242,237,0.14); border: 1px solid rgba(245,242,237,0.14); }
.feature-grid > * { background: var(--ink); padding: 2.25rem 1.75rem; }
@media (min-width: 700px) { .feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1080px) { .feature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* Mobile menu */
#mobileMenu { position: fixed; inset: 0; background: var(--ink); z-index: 100; display: none; flex-direction: column; padding: 6rem 2rem 2rem; }
#mobileMenu.open { display: flex; }
#mobileMenu a { font-family: 'Playfair Display', serif; font-size: clamp(2.25rem, 8vw, 3.75rem); line-height: 1.2; padding: .5rem 0; color: var(--bone); }
#mobileMenu a:hover { color: var(--cyan); }
#menuToggle, #menuClose { z-index: 110; }

/* Contact form */
.field { display: block; width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(245,242,237,0.24); padding: 1rem 0; color: var(--bone); font-size: 1rem; font-family: inherit; }
.field:focus { outline: none; border-bottom-color: var(--cyan); }
.field::placeholder { color: var(--mist); }
textarea.field { resize: vertical; min-height: 6rem; }
.btn { display: inline-block; padding: 1rem 1.75rem; border: 1px solid var(--bone); color: var(--bone); font-family: 'JetBrains Mono', monospace; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; transition: background .2s ease, color .2s ease; cursor: pointer; background: transparent; }
.btn:hover { background: var(--bone); color: var(--ink); }
.btn-cyan { border-color: var(--cyan); color: var(--cyan); }
.btn-cyan:hover { background: var(--cyan); color: var(--ink); }

/* Bone section variants */
.on-bone { background: var(--bone); color: var(--ink); }
.on-bone .text-mist { color: #6b6b6b; }
.on-bone .field { color: var(--ink); border-bottom-color: rgba(10,10,10,0.2); }
.on-bone .btn { border-color: var(--ink); color: var(--ink); }
.on-bone .btn:hover { background: var(--ink); color: var(--bone); }
.on-bone .work-card { border-color: rgba(10,10,10,0.12); }

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Utility */
img, video, iframe { max-width: 100%; }

/* Footer */
footer.stn-foot { background: #050505; color: var(--bone); padding: 4rem 1.5rem 2.5rem; border-top: 1px solid rgba(245,242,237,0.08); }
footer.stn-foot a { color: var(--bone); }
footer.stn-foot a:hover { color: var(--cyan); }

/* Container */
.stn-container { max-width: 1240px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 900px) { .stn-container { padding-left: 3rem; padding-right: 3rem; } }

/* ---------------------------------------------------------------
   Mobile hardening (≤ 767px) — iPhone SE / 15 / Pro Max coverage
   Fixes: display-type descender collisions, hero-video YT overlay
   showing through on iOS autoplay-blocked, section rhythm crowding,
   tap-target sizing, safe-area for iOS home indicator.
   --------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
main, section, footer, header { max-width: 100%; }

/* Menu buttons — always 44×44 tap target */
#menuToggle, #menuClose {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem .25rem;
}

/* Long inline strings (emails etc.) — break on any char but only when needed */
.break-all { word-break: normal; overflow-wrap: anywhere; }

@media (max-width: 767px) {
  /* Display-type leading — loosen from the desktop 1.02 so wrapped serif
     descenders don't crash into the next line or the paragraph below. */
  .font-display { line-height: 1.12; }
  .h-display   { font-size: clamp(2.25rem, 11vw, 3.5rem); line-height: 1.08; letter-spacing: -0.015em; }
  .h-1         { font-size: clamp(1.85rem, 7.6vw, 2.6rem); line-height: 1.14; }
  .h-2         { font-size: clamp(1.4rem, 5.6vw, 2rem);    line-height: 1.18; }
  .h-3         { font-size: clamp(1.1rem, 4.6vw, 1.5rem);  line-height: 1.24; }

  /* Guaranteed vertical rhythm between headline + following block, even if
     a Tailwind utility fails to load or apply. Adjacent-sibling fallback. */
  .font-display + p,
  .font-display + div,
  h1 + p, h1 + div,
  h2 + p, h2 + div { margin-top: max(1.25rem, 0.75em); }

  /* Hero: use small dynamic viewport unit so iOS address bar doesn't
     inflate the hero and push the next section too far. */
  .hero { height: 100svh; min-height: 520px; }
  .hero .brand { transform: translate(-50%, -60%); width: 88%; }
  .hero .hero-content { padding: 0 1.25rem calc(2.5rem + env(safe-area-inset-bottom, 0px)); }

  /* Cover YouTube's centered play/loading UI on iOS where muted autoplay
     is blocked. Extra tint in the middle band hides the YT chrome without
     killing the video for browsers that do autoplay. */
  .hero .veil {
    background: linear-gradient(180deg,
      rgba(10,10,10,.60) 0%,
      rgba(10,10,10,.28) 22%,
      rgba(10,10,10,.55) 48%,
      rgba(10,10,10,.28) 72%,
      rgba(10,10,10,.92) 100%);
  }

  /* Section rhythm — dial back generous desktop padding on phones.
     Selectors intentionally chained to Tailwind classes so we don't
     over-reach into desktop layouts. */
  section.py-40, section.md\:py-40 { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  section.py-32, section.md\:py-32 { padding-top: 4rem;   padding-bottom: 4rem;   }
  section.py-28, section.md\:py-28 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  section.py-24                    { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  section.py-20                    { padding-top: 3rem;   padding-bottom: 3rem;   }
  section.pt-32                    { padding-top: 6rem; }
  section.pt-40                    { padding-top: 6.5rem; }
  section.pb-24                    { padding-bottom: 4rem; }
  section.pb-32                    { padding-bottom: 5rem; }
  section.pb-16                    { padding-bottom: 3rem; }

  /* Feature grid — reduce cell padding so titles have more breathing room */
  .feature-grid > * { padding: 1.75rem 1.25rem; }

  /* Work-card rhythm on mobile so h-display cards don't feel cramped */
  .work-card { padding: 1.5rem 0; }
  .work-card h2.font-display.h-display,
  .work-card h2.font-display.h-1 { font-size: clamp(1.55rem, 6.8vw, 2.2rem); line-height: 1.12; }

  /* Mobile menu — scroll if short landscape can't fit, tighter type */
  #mobileMenu { padding: 5.5rem 1.75rem 2rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #mobileMenu a { font-size: clamp(1.9rem, 7.5vw, 2.6rem); line-height: 1.2; padding: .55rem 0; }

  /* Networks / press outlet strips — smaller gaps, prevent giant lines wrapping oddly */
  .stn-container .flex.flex-wrap { row-gap: .75rem; column-gap: 1.25rem; }

  /* Selected credits (about.html) — inline network label was crammy */
  .grid.md\:grid-cols-2 > p { line-height: 1.35; }
}

/* Slightly extra safety for very narrow iPhone SE 1st-gen widths */
@media (max-width: 380px) {
  .stn-container { padding-left: 1.15rem; padding-right: 1.15rem; }
  .h-display { font-size: clamp(2rem, 10vw, 2.6rem); }
}

