/* =========================================================
   Portfolio — shared styles
   Aesthetic: luxury minimalism, cool gray/white, no warm tones
   Typeface: PP Neue Machina (Plain) — self-hosted
   ========================================================= */

/* ---- Fonts ---- */
@font-face {
  font-family: "Neue Machina";
  src: url("../fonts/NeueMachina-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Machina";
  src: url("../fonts/NeueMachina-Regular.woff2") format("woff2");
  font-weight: 400 600;   /* also serves 500/600 (family has no mid weights) */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Machina";
  src: url("../fonts/NeueMachina-Ultrabold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ---- */
:root {
  --bg:            #F7F6F3;   /* Warm White  — page background */
  --bg-soft:       #F2F1EE;   /* Off White   — cards, sections */
  --bg-tile:       #E8E6E2;   /* Light Gray  — empty media placeholder */
  --line:          #E8E6E2;   /* Light Gray  — hairline borders / dividers */
  --ink:           #2C2A28;   /* Near Black  — primary text */
  --headline:      #4D4A46;   /* Charcoal    — headlines, buttons */
  --ink-2:         #6A6661;   /* Dark Gray   — secondary text, labels */
  --ink-3:         #B8B4AE;   /* Medium Gray — muted / tertiary */

  --maxw:          1200px;
  --gutter:        clamp(20px, 5vw, 64px);
  --nav-h:         72px;

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

/* ---- Reset-ish ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Neue Machina", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- Type helpers ---- */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.08; margin: 0; color: var(--headline); }

/* =========================================================
   Top navigation (interior pages)
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgba(247, 246, 243, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav__links {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
}
.nav__links a {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.25s var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"] { position: relative; }
.nav__links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--ink);
}

/* =========================================================
   Home / full-bleed hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--gutter);
  overflow: hidden;
  background: #0c0c0e url("../images/hero.jpg") 50% 55% / cover no-repeat;
}
/* Scrim for text legibility over a bright image */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10,10,12,0.50) 0%,
      rgba(10,10,12,0.28) 34%,
      rgba(10,10,12,0.34) 62%,
      rgba(10,10,12,0.66) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 920px;
}
.hero__name {
  font-size: clamp(44px, 8.5vw, 108px);
  font-weight: 400;   /* Neue Machina Regular */
  line-height: 0.94;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 2px 44px rgba(0,0,0,0.38);
}
.hero__role {
  font-size: clamp(13px, 1.5vw, 19px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 20px rgba(0,0,0,0.4);
}
.hero__role span { opacity: 0.45; padding: 0 10px; }
.eyebrow--light { color: rgba(255,255,255,0.72); }
.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}
.hero__cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Solid button variants for dark/photographic backgrounds (.btn.btn--x beats base .btn) */
.btn.btn--light { background: #fff; border-color: #fff; color: var(--ink); }
.btn.btn--light:hover { background: rgba(255,255,255,0.82); border-color: rgba(255,255,255,0.82); color: var(--ink); }
.btn.btn--lightghost { background: var(--headline); border-color: var(--headline); color: #fff; }
.btn.btn--lightghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 28px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--headline);
  border-radius: 999px;
  color: var(--headline);
  background: transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { background: var(--headline); color: var(--bg); }
.btn--ghost { border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--ink); }

/* =========================================================
   Page shell (interior)
   ========================================================= */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 24px) var(--gutter) 120px;
}
.page__head {
  margin-bottom: clamp(36px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.page__head--tight { margin-bottom: clamp(18px, 2.4vw, 28px); }
.page__title {
  font-size: clamp(32px, 4.4vw, 54px);
}
.page__title-row {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  flex-wrap: wrap;
}
.header-icons { display: flex; gap: 10px; }

/* About header: circular avatar left of the name */
.about-header {
  flex-direction: row;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}
.about-header__photo {
  flex: none;
  width: clamp(84px, 11vw, 132px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tile);
}
.about-header__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-header__text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Full-width bio beneath the numbers */
.about-bio .about__body p { max-width: none; }
.about-bio__icons { margin-top: 18px; justify-content: center; }
.page__lead {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: clamp(15px, 1.3vw, 17px);
}

/* =========================================================
   Media grids
   ========================================================= */

/* Tabbed panels (Video page) */
.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: clamp(24px, 3vw, 40px);
  padding: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 9px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--headline); color: #fff; }

.work-panel { display: none; }
.work-panel.is-active { display: block; }

/* In-page video lightbox */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 19, 18, 0.62);
  backdrop-filter: blur(8px) saturate(120%);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(880px, 92vw);
  background: #0b0b0c;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.35s var(--ease);
}
.modal--portrait .modal__dialog { width: min(400px, 92vw); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal__frame { position: relative; width: 100%; background: #000; }
.modal--portrait .modal__frame  { aspect-ratio: 9 / 16; }
.modal--landscape .modal__frame { aspect-ratio: 16 / 9; }
.modal__frame iframe,
.modal__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal__frame video { object-fit: contain; background: #000; }
.modal__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 11px 16px;
}
.modal__source {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.modal__source:hover { color: #fff; }
.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease);
}
.modal__close:hover { background: rgba(0, 0, 0, 0.78); }
body.modal-open { overflow: hidden; }

/* Section blocks within a page */
.work-section + .work-section { margin-top: clamp(56px, 8vw, 96px); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); }
.section-head .count { margin-left: auto; color: var(--ink-3); font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; }

/* Vertical video grid (9:16) */
.grid-video {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
/* Horizontal long-form grid (16:9) */
.grid-long {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
/* Photo grid (4:5) */
.grid-photo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}

/* A work item = media tile + meta row */
.work { display: block; }
.work__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  gap: 12px;
}
.work__plat {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.work__views { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; margin-left: auto; }

.tile {
  position: relative;
  background: var(--bg-tile);
  overflow: hidden;
  transition: transform 0.5s var(--ease);
}
.tile--video { aspect-ratio: 9 / 16; }
.tile--long  { aspect-ratio: 16 / 9; }
.tile--photo { aspect-ratio: 4 / 5; }
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.work:hover .tile img { transform: scale(1.04); }
.work:hover .tile { transform: translateY(-4px); }
.tile:hover { transform: translateY(-4px); }

/* Play glyph overlay for any video tile with real media */
.tile--video .play,
.tile--long .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tile--video .play::before,
.tile--long .play::before {
  content: "";
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(23, 23, 26, 0.55);
  backdrop-filter: blur(2px);
  transition: background 0.3s var(--ease);
}
.work:hover .play::before { background: rgba(23, 23, 26, 0.8); }
.tile--video .play::after,
.tile--long .play::after {
  content: "";
  position: absolute;
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(2px);
}
.tile__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
.tile:hover .tile__label { color: var(--ink-2); }
/* subtle play glyph for video tiles */
.tile--video .tile__label::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -140%);
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--ink-3);
  opacity: 0.7;
}

/* =========================================================
   About
   ========================================================= */
.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about__photo {
  position: relative;
}
.about__photo img { width: 100%; height: auto; }
.about__photo .placeholder-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.about__body p {
  color: var(--ink-2);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.7;
  margin: 0 0 20px;
  max-width: 62ch;
}
.about__body p.lead { color: var(--ink); font-size: clamp(18px, 1.8vw, 22px); line-height: 1.5; }
.contact {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Round icon buttons (LinkedIn / email) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--headline);
  color: var(--headline);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn:hover { background: var(--headline); color: var(--bg); }
/* Light variant for the dark hero */
.icon-btn--light { width: 38px; height: 38px; border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.icon-btn--light svg { width: 16px; height: 16px; }
.icon-btn--light:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---- Numbers band (figures + explainer column, above the photo/bio row) ---- */
.stats-band {
  display: grid;
  grid-template-columns: 1fr clamp(170px, 22%, 250px);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  margin-bottom: clamp(32px, 4.5vw, 56px);
  padding-bottom: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}
.stats-band__figures { min-width: 0; }
/* Explainer: font-size is grown by JS until the text fills the figures' height */
.stats-band__caption {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  font-size: 12.5px;   /* JS overrides this to fit the height */
}
.stats-band__caption p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1em;
  line-height: 1.45;
}
.stats-band__caption .stats-band__caption-title {
  color: var(--headline);
  font-weight: 800;
  font-size: 0.85em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
}
.stats-band__socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.stats-band__socials .icon-btn { width: 32px; height: 32px; }
.stats-band__socials .icon-btn svg { width: 15px; height: 15px; }

.stat-block + .stat-block { margin-top: clamp(12px, 1.6vw, 18px); }
.stat-block__label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 clamp(8px, 1vw, 12px);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 44px);
}
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__value { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.stat__num {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 800;              /* Neue Machina Ultrabold */
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--headline);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.stat__raw {
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.stat__label {
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  max-width: 22ch;
}

/* Shared placeholder chip */
.placeholder-label span {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer a { color: var(--ink-3); transition: color 0.25s var(--ease); }
.footer a:hover { color: var(--ink); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; }
  .home__portrait { min-height: 46vh; }
  .home__intro { padding-top: 48px; padding-bottom: 56px; }
  .grid-video, .grid-photo { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 320px; }
  .stats-band { grid-template-columns: 1fr; gap: clamp(20px, 4vw, 32px); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 4vw, 32px); }
}
@media (max-width: 520px) {
  .nav__links { gap: 16px; }
  .nav__brand { font-size: 13px; }
  .grid-video { grid-template-columns: repeat(2, 1fr); }
  .grid-photo { grid-template-columns: 1fr; }
  .stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   Photo masonry gallery (mixed sizes, no cropping)
   ========================================================= */
/* JS masonry: tiles are absolutely positioned into the shortest column in
   DOM order, so photos read left-to-right (top rows first) with even gaps
   and no cropping. Falls back to a simple stack if JS is disabled. */
.masonry { position: relative; }
.masonry .ph {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg-tile);
  overflow: hidden;
  cursor: zoom-in;
}
.masonry .ph img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.7s var(--ease), opacity 0.5s var(--ease);
}
.masonry .ph:hover img { transform: scale(1.03); }

/* No-JS fallback: single readable column */
.masonry.no-js .ph {
  position: static;
  width: 100%;
  margin-bottom: clamp(14px, 1.8vw, 26px);
}

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(20, 19, 18, 0.92);
  backdrop-filter: blur(4px);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: lb-in 0.35s var(--ease);
}
@keyframes lb-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: color 0.25s var(--ease);
  line-height: 1;
  user-select: none;
}
.lightbox__close:hover,
.lightbox__nav:hover { color: #fff; }
.lightbox__close {
  top: clamp(12px, 2vw, 26px);
  right: clamp(16px, 2.5vw, 32px);
  font-size: 34px;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(40px, 6vw, 64px);
  padding: 0 clamp(8px, 1.5vw, 20px);
}
.lightbox__nav--prev { left: clamp(4px, 1vw, 18px); }
.lightbox__nav--next { right: clamp(4px, 1vw, 18px); }
.lightbox__count {
  position: absolute;
  bottom: clamp(14px, 2.5vw, 28px);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  letter-spacing: 0.14em;
}
@media (max-width: 520px) {
  .lightbox__nav { font-size: 34px; }
}
