/* STN — custom overrides on top of Tailwind CDN
   Renamed display type classes to stn-* to avoid collision with Tailwind's
   height utilities (h-1 = height: 0.25rem in Tailwind), which was collapsing
   headline containers to 4px and letting the glyphs overflow into the next
   block on mobile. Fixed 2026-08-31. */
: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%; }

/* Unmute toggle — bottom-right, unobtrusive, respects iOS safe area */
.hero .hero-mute,
.hero-mute {
  position: absolute;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.hero-mute:hover,
.hero-mute:focus-visible { opacity: 1; outline: none; }
.hero-mute:focus-visible { outline: 1px solid rgba(255,255,255,0.4); outline-offset: 4px; }
.hero-mute .ico { width: 18px; height: 18px; }
.hero-mute .ico-unmuted { display: none; }
.hero-mute[aria-pressed="true"] .ico-muted { display: none; }
.hero-mute[aria-pressed="true"] .ico-unmuted { display: block; }

/* Editorial type scale — stn-* prefix so Tailwind h-N utilities cannot
   collapse the container height. `height: auto` is a belt-and-braces
   guard for any residual class collisions. */
.stn-display,
.stn-h1,
.stn-h2,
.stn-h3 { height: auto; display: block; }

.stn-display { font-size: clamp(2.5rem, 8vw, 7rem);        line-height: 1.04; }
.stn-h1      { font-size: clamp(2rem,   5.5vw, 4.5rem);    line-height: 1.08; }
.stn-h2      { font-size: clamp(1.5rem, 3.6vw, 2.75rem);   line-height: 1.14; }
.stn-h3      { font-size: clamp(1.15rem, 2.2vw, 1.75rem);  line-height: 1.24; }

.eyebrow { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--mist); }

/* Work grid card — force baseline flow so h2 headline never overlaps
   the credit-line meta paragraph beneath it on any viewport. */
.work-card { display: block; padding: 2rem 0; border-top: 1px solid rgba(245,242,237,0.12); transition: color .25s ease; overflow: hidden; }
.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); }
.work-card h2 { margin: 0 0 .5rem 0; }
.work-card h2 + p,
.work-card > div > p { margin-top: .35rem; }

/* 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 — never hide layout height, only opacity/transform, so
   an observer that misfires can't leave content in a collapsed state. */
.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; } }

/* Safety net: any section with an editorial headline gets overflow guard so
   glyphs / descenders never bleed into the next block, regardless of the
   inline utility soup on the element. */
section { overflow: hidden; }

/* ---------------------------------------------------------------
   Mobile hardening (≤ 767px) — iPhone SE / 15 / Pro Max coverage
   --------------------------------------------------------------- */
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) {
  .font-display { line-height: 1.12; }
  .stn-display { font-size: clamp(2.1rem, 10vw, 3.4rem);   line-height: 1.08; letter-spacing: -0.015em; }
  .stn-h1      { font-size: clamp(1.75rem, 7.2vw, 2.5rem); line-height: 1.14; }
  .stn-h2      { font-size: clamp(1.3rem,  5.4vw, 1.9rem); line-height: 1.20; }
  .stn-h3      { font-size: clamp(1.05rem, 4.4vw, 1.4rem); line-height: 1.28; }

  /* Guarantee air below every display headline, even without utility margin. */
  .font-display,
  .stn-display, .stn-h1, .stn-h2, .stn-h3 { margin-bottom: 1.25rem; }
  .font-display + p,
  .font-display + div,
  .stn-display + p, .stn-h1 + p, .stn-h2 + p, .stn-h3 + p,
  .stn-display + div, .stn-h1 + div, .stn-h2 + div, .stn-h3 + div,
  h1 + p, h1 + div,
  h2 + p, h2 + div { margin-top: 1.5rem; }

  .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)); }

  .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 */
  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 > * { padding: 1.75rem 1.25rem; }

  /* Work-card mobile: stack title above credit line with breathing room. */
  .work-card { padding: 1.75rem 0; }
  .work-card > div { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .work-card h2 { margin-bottom: .5rem; }
  .work-card h2.font-display.stn-h1,
  .work-card h2.font-display.stn-h2,
  .work-card h2.font-display.stn-display { font-size: clamp(1.35rem, 6.2vw, 2rem); line-height: 1.16; }
  .work-card p { line-height: 1.4; }

  /* Contact CTA — button never draws over headline */
  .cta-headline + .btn,
  .cta-headline ~ .btn { display: block; margin-top: 1.5rem; }

  #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; }

  .stn-container .flex.flex-wrap { row-gap: .75rem; column-gap: 1.25rem; }
  .grid.md\:grid-cols-2 > p { line-height: 1.35; }
}

/* Extra safety for very narrow iPhone SE 1st-gen widths */
@media (max-width: 380px) {
  .stn-container { padding-left: 1.15rem; padding-right: 1.15rem; }
  .stn-display   { font-size: clamp(1.85rem, 9vw, 2.4rem); }
}
