/* ==========================================================================
   Nido Films — draft 1
   ========================================================================== */

:root {
  --ink: #0d0b09;
  --ink-2: #161310;
  --bone: #efe8dc;
  --bone-dim: rgba(239, 232, 220, 0.62);
  --line: rgba(239, 232, 220, 0.16);
  --ember: #f2b451;              /* key colour: golden amber (supplied by the client) */

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --gutter: clamp(16px, 3.2vw, 48px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; }

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav.is-solid {
  background: rgba(13, 11, 9, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav__logo {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav__logo span { font-weight: 300; margin-left: 0.4em; }

.nav__links { display: flex; gap: clamp(20px, 3.4vw, 48px); }
.nav__links a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 0;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 0;
  overflow: hidden;
  isolation: isolate;
}

.hero__media { position: absolute; inset: 0; z-index: -1; background: var(--ink); }

.hero__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Trailer loop. Fades in over the poster once it is actually playing. */
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.hero.is-playing .hero__video { opacity: 1; }

.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(13,11,9,0.55) 0, rgba(13,11,9,0) 22%),
    linear-gradient(to top, rgba(13,11,9,0.92) 0, rgba(13,11,9,0.55) 32%, rgba(13,11,9,0.12) 62%, rgba(13,11,9,0.25) 100%);
}

.hero__content { position: relative; padding-bottom: clamp(28px, 5vh, 56px); max-width: 1500px; }

.hero__title {
  margin: 18px 0 0;
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(2.635rem, 9.01vw, 8.925rem);
  line-height: 0.9;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero__title span { display: block; }
.hero__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 1.08em;
  color: var(--ember);
}

.hero__lede {
  margin: clamp(20px, 3vh, 32px) 0 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.5;
  color: var(--bone);
}

.hero__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero__now { margin: 0; display: flex; gap: 14px; min-width: 0; color: var(--bone-dim); }
.hero__now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero__count { color: var(--bone); font-variant-numeric: tabular-nums; }
.hero__now:empty, .hero__now.is-off { visibility: hidden; }

.hero__actions { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); flex: none; }
.scroll span { display: inline-block; animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(5px); } }

/* ---------- Work grid ---------- */

.work { padding: clamp(56px, 9vw, 120px) 0 0; }

.work__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0 var(--gutter) clamp(20px, 3vw, 36px);
}
.work__head h2 {
  margin: 0;
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
  text-transform: uppercase;
}
.work__head p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 800px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .tile--wide { grid-column: 1 / -1; }
}

.tile { position: relative; background: var(--ink-2); overflow: hidden; }
.tile a { display: block; position: relative; aspect-ratio: 16 / 10; }
.tile--wide a { aspect-ratio: 21 / 9; }
@media (max-width: 799px) {
  .tile--wide a { aspect-ratio: 16 / 10; }
}

.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 1.1s var(--ease), filter 0.6s ease;
}

.tile a::after {                       /* legibility scrim for the caption */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,11,9,0.72) 0, rgba(13,11,9,0) 46%);
  opacity: 0.55;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tile__meta {
  position: absolute;
  left: clamp(14px, 2vw, 28px); right: clamp(14px, 2vw, 28px);
  bottom: clamp(12px, 1.8vw, 24px);
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tile__num {
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ember);
}
.tile__num i {
  font-style: normal;
  font-weight: 500;
  font-size: 0.5em;
  margin-left: 0.3em;
  color: var(--bone-dim);
}
.tile__cta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}
.tile__cta b { display: inline-block; color: var(--ember); font-weight: 700; transition: transform 0.4s var(--ease); }

@media (hover: hover) {
  .tile a:hover img,
  .tile a:focus-visible img { transform: scale(1.045); }
  .tile a:hover::after,
  .tile a:focus-visible::after { opacity: 1; }
  .tile a:hover .tile__cta,
  .tile a:focus-visible .tile__cta { opacity: 1; transform: none; }
  .tile a:hover .tile__cta b { transform: translateX(4px); }
}
@media (hover: none) {
  .tile__cta { opacity: 1; transform: none; }
}

/* ---------- Mission ---------- */

.mission {
  padding: clamp(80px, 14vw, 200px) var(--gutter) clamp(72px, 11vw, 160px);
  max-width: 1500px;
  margin: 0 auto;
}
.mission__text {
  margin: 28px 0 0;
  max-width: 24em;
  font-weight: 800;
  font-stretch: 78%;
  font-size: clamp(1.9rem, 4.6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: pretty;
}
.mission__text em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: none;
  color: var(--ember);
  font-size: 1.08em;
}
.mission__sub {
  margin: clamp(32px, 5vw, 64px) 0 0;
  max-width: 44ch;
  margin-left: auto;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  color: var(--bone-dim);
}
@media (max-width: 799px) { .mission__sub { margin-left: 0; } }

/* ---------- Footer ---------- */

.foot {
  padding: clamp(56px, 8vw, 110px) var(--gutter) 28px;
  border-top: 1px solid var(--line);
}
.foot__mail {
  display: inline-block;
  margin-top: 16px;
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(3rem, 12vw, 11rem);
  line-height: 0.95;
  text-transform: uppercase;
  transition: color 0.3s ease;
}
.foot__mail span { display: inline-block; color: var(--ember); transition: transform 0.5s var(--ease); }
.foot__mail:hover { color: var(--ember); }
.foot__mail:hover span { transform: translateX(0.12em); }
.foot__addr {
  display: block;
  width: fit-content;
  margin-top: 18px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ember);
  border-bottom: 1px solid currentColor;
  transition: color 0.3s ease;
}
.foot__addr:hover { color: var(--bone); }
.foot__link {
  display: block;
  width: fit-content;
  margin-top: 22px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s ease;
}
.foot__link span { display: inline-block; color: var(--ember); transition: transform 0.4s var(--ease); }
.foot__link:hover { color: var(--bone); }
.foot__link:hover span { transform: translateX(4px); }
.foot__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(48px, 8vw, 110px);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* ---------- Project pages ---------- */

.project {
  max-width: 1500px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(24px, 4vw, 56px)) var(--gutter) clamp(56px, 9vw, 120px);
}
.project__back {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s ease;
}
.project__back span { display: inline-block; color: var(--ember); transition: transform 0.4s var(--ease); }
.project__back:hover { color: var(--bone); }
.project__back:hover span { transform: translateX(-4px); }

.project__eyebrow { margin-top: clamp(28px, 4.4vw, 60px); }
.project__title {
  margin: 14px 0 0;
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(2.8rem, 9.4vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.project__eyebrow + .project__title { margin-top: 10px; }
.player + .project__title { margin-top: clamp(28px, 4.4vw, 60px); }

/* Video first. Wide as the screen allows, but never taller than the window. */
.player {
  position: relative;
  margin: clamp(16px, 2.4vw, 28px) auto 0;
  width: min(100%, max(320px, calc((100svh - var(--nav-h) - 110px) * 1.7778)));
  aspect-ratio: 16 / 9;
  background: var(--ink-2);
  overflow: hidden;
}
.player img, .player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.player img { object-fit: cover; }
.player::after {                         /* darken the still so the button reads */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,11,9,0.55) 0, rgba(13,11,9,0.1) 50%, rgba(13,11,9,0.3) 100%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.player.is-loaded::after, .player.is-loaded img, .player.is-loaded .player__btn { display: none; }

.player__btn {
  position: absolute; inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.player__icon {
  width: clamp(64px, 9vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ember);
  position: relative;
  transition: transform 0.5s var(--ease);
}
.player__icon::before {                  /* play triangle */
  content: '';
  position: absolute;
  left: 53%; top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.6em 0 0.6em 1em;
  border-color: transparent transparent transparent var(--ink);
  font-size: clamp(1.1rem, 1.9vw, 1.9rem);
}
.player__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
@media (hover: hover) {
  .player__btn:hover .player__icon { transform: scale(1.1); }
}
.player__fallback {
  position: absolute; left: 16px; bottom: 16px; z-index: 2;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}

.project__body {
  margin: clamp(36px, 6vw, 88px) 0 0;
  max-width: 44em;
}
.project__body p {
  margin: 0 0 1.2em;
  font-size: clamp(1.05rem, 1.45vw, 1.3rem);
  line-height: 1.6;
}
.project__body a {
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: color 0.3s ease;
}
.project__body a:hover { color: var(--bone); }
.project__body p:first-child { font-size: clamp(1.2rem, 2vw, 1.75rem); line-height: 1.4; }
@media (min-width: 1000px) { .project__body { margin-left: auto; margin-right: 8%; } }

.project__pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(56px, 9vw, 130px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.project__pager a { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 46%; }
.pager__next { text-align: right; align-items: flex-end; margin-left: auto; }
.pager__title {
  font-weight: 900;
  font-stretch: 70%;
  font-size: clamp(1.4rem, 3.4vw, 3rem);
  line-height: 1;
  text-transform: uppercase;
  transition: color 0.3s ease;
}
.project__pager a:hover .pager__title { color: var(--ember); }

/* ---------- About page ---------- */

.about .project__eyebrow { margin-top: clamp(20px, 3vw, 40px); }
.about__grid {
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(28px, 4.4vw, 60px);
}
.about__photo { margin: 0; }
.about__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  background: var(--ink-2);
}
.about .project__body { margin: 0; max-width: none; }
.about__statement {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.9rem) !important;
  line-height: 1.12 !important;
  margin-top: 1.4em !important;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}
.about__statement em { color: var(--ember); }
@media (min-width: 900px) {
  .about__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .about__photo { position: sticky; top: calc(var(--nav-h) + 24px); }
}
.mission__more {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
}
.mission__more span { display: inline-block; color: var(--ember); transition: transform 0.4s var(--ease); }
.mission__more:hover span { transform: translateX(4px); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Project overlay ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform 0.65s var(--ease);
}
.sheet.is-open { transform: none; }
.sheet[hidden] { display: none; }
body.sheet-open { overflow: hidden; }

.sheet__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 11, 9, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.sheet__close {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 0 10px 16px;
  transition: color 0.3s ease;
}
.sheet__close b {
  display: inline-block;
  margin-left: 0.4em;
  font-size: 1.5em;
  line-height: 0.6;
  vertical-align: -0.1em;
  color: var(--ember);
  transition: transform 0.4s var(--ease);
}
.sheet__close:hover b { transform: rotate(90deg); }
.sheet .project { padding-top: 0; }
.sheet .project__back { display: none; }

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 1s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */

@media (max-width: 599px) {
  :root { --nav-h: 60px; }
  .nav__logo { font-size: 0.92rem; }
  .nav__links { gap: 18px; }
  .nav__links a { font-size: 0.7rem; letter-spacing: 0.14em; }
  .nav__mission { display: none; }        /* mission follows the work grid anyway */
  .hero__bar { font-size: 0.66rem; }
  .hero__count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
