/* ============================================================
   RORY NIX / PORTFOLIO
   Design system: broadcast lower-thirds & timecodes as the
   recurring signature motif, the exact graphics a video editor
   builds for clients, repurposed as the site's own structure.
   ============================================================ */

:root {
  color-scheme: light;

  /* Colour */
  --bg: #FAFAF8;
  --bg-raised: #F1EFE9;
  --ink: #121212;
  --ink-soft: #4A4A46;
  --line: #E1DED5;
  --white: #ffffff;

  /* Category accents: each section of work gets its own signal colour,
     the way a broadcast lower-third is colour-coded by segment. */
  --accent-social: #FF3D8A;   /* social content */
  --accent-doc: #FFB020;      /* documentaries */
  --accent-podcast: #2F6FFF;  /* podcasts */
  --accent-motion: #7B5CFA;   /* motion graphics */
  --accent-rec: #FF3B30;      /* live / record cue */

  /* Type */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Scale */
  --container: 1320px;
  --radius-pill: 999px;
  --radius-card: 4px;

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

/* Site is intentionally always the light theme (per brief). The hero,
   results band, and media cards carry their own fixed dark contrast
   below rather than following the OS colour scheme. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent-podcast);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 900px) {
  .container { padding: 0 48px; }
}

/* ---------- Eyebrow / timecode section markers ----------
   Each section opens like scrubbing to a new point on a timeline. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.eyebrow .code { color: var(--ink); font-weight: 600; }
.eyebrow .label { text-transform: uppercase; }

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .section { padding: 140px 0; }
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
  width: calc(100% - 32px);
  max-width: 880px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: auto;
  white-space: nowrap;
}
.nav__brand .rec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-rec);
  animation: pulse 2.4s ease-in-out infinite;
}
.nav__links {
  display: none;
  align-items: center;
  gap: 2px;
}
.nav__links a {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__links a:hover, .nav__links a.active { color: var(--ink); background: var(--bg-raised); }
@media (min-width: 860px) {
  .nav__links { display: flex; }
}
.nav__cta {
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: transform 0.2s var(--ease);
}
.nav__cta:hover { transform: translateY(-1px); }
.nav__toggle {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}
@media (min-width: 860px) {
  .nav__toggle { display: none; }
}
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav__toggle span::before { position: absolute; top: -5px; }
.nav__toggle span::after { position: absolute; top: 5px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

.nav__sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.nav__sheet.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__sheet a {
  font-family: var(--font-display);
  font-size: 12vw;
  line-height: 1.15;
  text-transform: uppercase;
  font-weight: 700;
}
@media (min-width: 860px) { .nav__sheet { display: none; } }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(255,59,48,0); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #0c0c0c;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media video, .hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(5,5,5,0.15) 0%, rgba(5,5,5,0.35) 45%, rgba(5,5,5,0.88) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  color: #F7F5F0;
  padding: 160px 24px 64px;
  width: 100%;
}
@media (min-width: 900px) {
  .hero__content { padding: 200px 48px 88px; }
}
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.75);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.8s var(--ease) 0.2s forwards;
}
.hero__eyebrow .rec {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-rec);
  animation: pulse 2.4s ease-in-out infinite;
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 13vw, 9rem);
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease) 0.35s forwards;
}
.hero__role {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.85);
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.9s var(--ease) 0.55s forwards;
}
.hero__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid rgba(247,245,240,0.18);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(247,245,240,0.65);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.75s forwards;
}
.hero__scroll { display: flex; align-items: center; gap: 8px; }
.hero__scroll svg { width: 12px; height: 12px; animation: bob 1.6s ease-in-out infinite; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- Category grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (min-width: 980px) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.card.ratio-16-9 { aspect-ratio: 16 / 9; }
.card.is-visible { opacity: 1; transform: translateY(0); }
.card:hover, .card:focus-visible { transform: translateY(-4px); }

.card__media {
  position: absolute;
  inset: 0;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }
.card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.75) 100%);
}
.card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.card__play svg { width: 16px; height: 16px; margin-left: 2px; }
.card:hover .card__play, .card:focus-visible .card__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* lower-third: the signature element */
.card__lower {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 14px 16px;
  transform: translateY(4px);
}
.card__bar {
  height: 3px;
  width: 34px;
  border-radius: 2px;
  margin-bottom: 8px;
  transition: width 0.35s var(--ease);
}
.card:hover .card__bar, .card:focus-visible .card__bar { width: 56px; }
.card__client {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  line-height: 1.1;
}
.card__title {
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  margin-top: 3px;
}
.card__stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(255,255,255,0.14);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
}

/* On phones the stat chip crowds out the thumbnail on small social cards —
   keep it for tablet/desktop, drop it below that so only name + type show. */
@media (max-width: 640px) {
  #work .card__stat { display: none; }
}

/* category colour tokens applied via modifier classes */
.cat-social .card__bar, .cat-social .eyebrow .dot { background: var(--accent-social); }
.cat-doc .card__bar, .cat-doc .eyebrow .dot { background: var(--accent-doc); }
.cat-podcast .card__bar, .cat-podcast .eyebrow .dot { background: var(--accent-podcast); }
.cat-motion .card__bar, .cat-motion .eyebrow .dot { background: var(--accent-motion); }

/* ---------- Featured documentary (The War) ---------- */
.feature {
  display: block;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 3/2;
  cursor: pointer;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.feature.is-visible { opacity: 1; transform: translateY(0); }
.feature__media { position: absolute; inset: 0; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.15) 100%); }
.feature__content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px;
  color: #fff;
}
@media (min-width: 700px) { .feature__content { padding: 44px; } }
.feature__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-doc);
  color: #1a1200;
  font-weight: 700;
}
.badge--ghost { background: rgba(255,255,255,0.14); color: #fff; backdrop-filter: blur(6px); }
.feature__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  text-transform: uppercase;
  line-height: 0.9;
}
.feature__desc { max-width: 460px; margin-top: 10px; font-size: 0.95rem; color: rgba(255,255,255,0.8); }
.feature .card__play { width: 68px; height: 68px; }
.feature .card__play svg { width: 20px; height: 20px; }

/* ---------- Results strip ---------- */
.results {
  background: var(--ink);
  color: var(--bg);
}
.results .eyebrow { color: rgba(247,245,240,0.6); }
.results .eyebrow .code { color: var(--bg); }
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgba(247,245,240,0.14);
  border: 1px solid rgba(247,245,240,0.14);
}
@media (min-width: 700px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .results-grid { grid-template-columns: repeat(4, 1fr); }
}
.result {
  background: var(--ink);
  padding: 32px 24px;
  opacity: 0;
  transform: translateY(16px);
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.result.is-visible { opacity: 1; transform: translateY(0); }
.result__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1;
}
.result__label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.65);
  max-width: 22ch;
}

/* ---------- Clients ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (min-width: 640px) { .logo-grid { grid-template-columns: repeat(4, 1fr); } }
.logo-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  aspect-ratio: 2.2 / 1;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 28px;
}
.logo-cell img {
  max-width: 100%; max-height: 42px;
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.3s var(--ease);
}
.logo-cell:hover img { filter: grayscale(0) opacity(1); }

/* ---------- Services ---------- */
.services-list { border-top: 1px solid var(--line); }
.service-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.service-row__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  text-transform: uppercase;
}
.service-row__desc {
  max-width: 340px;
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
@media (max-width: 640px) {
  .service-row { flex-direction: column; gap: 6px; }
  .service-row__desc { text-align: left; }
}

/* ---------- About / Contact ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 900px) {
  .about { grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
}
.about__photo {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-raised);
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__bio p { color: var(--ink-soft); font-size: 1.02rem; }
.about__bio p + p { margin-top: 14px; }
.about__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 32px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
}
.about__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--bg-raised); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- Reveal-on-scroll (generic) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,5,5,0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__inner {
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  position: relative;
}
.lightbox__inner--phone {
  max-width: 400px;
}
.lightbox__frame-wrap {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.lightbox__frame-wrap.ratio-16-9 { aspect-ratio: 16/9; }
.lightbox__frame-wrap.ratio-ig { max-height: 80vh; overflow-y: auto; background: #fff; border-radius: 12px; }
.lightbox__frame-wrap.ratio-9-16 { aspect-ratio: 9/16; max-height: 88vh; }
.lightbox iframe { width: 100%; border: 0; display: block; }
.lightbox__frame-wrap.ratio-16-9 iframe { height: 100%; }
.lightbox__frame-wrap.ratio-16-9 video,
.lightbox__frame-wrap.ratio-9-16 video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.lightbox__frame-wrap.ratio-ig iframe { min-height: 480px; }
.lightbox__close {
  position: absolute;
  top: -44px; right: 0;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
@media (max-width: 640px) {
  .lightbox__close { top: -38px; }
}

/* utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
