/* ITMM Photography — shared design system.
   Dark editorial portfolio: Instrument Serif display type over near-black,
   warm paper text, hairline rules, gold accent. Used by index.html and all
   eight portfolio-*.html pages. */

:root {
  --ink: #0b0a09;
  --ink-2: #14120f;
  --ink-3: #1d1a16;
  --paper: #f0ece4;
  --paper-dim: #a29c90;
  --hairline: rgba(240, 236, 228, 0.14);
  --accent: #c9a86b;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--ink); }

/* ---------- Type ---------- */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.display em { font-style: italic; color: var(--accent); }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 18px;
}

.lede { color: var(--paper-dim); max-width: 58ch; }

/* ---------- Reveal gating (JS enhances; no-JS stays visible) ---------- */
html.js .reveal { opacity: 0; }
html.js .reveal.revealed { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; }
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  background: linear-gradient(rgba(11, 10, 9, 0.92), rgba(11, 10, 9, 0));
  pointer-events: none;
}
.site-nav > * { pointer-events: auto; }

.brand {
  font-family: var(--display);
  font-size: 22px;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 34px; list-style: none; }
.nav-links a {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover { color: var(--paper); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--paper);
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;
  position: relative;
  z-index: 80;
}
.nav-toggle::before, .nav-toggle::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: var(--paper);
  transition: transform 0.3s, top 0.3s;
}
.nav-toggle::before { top: 18px; }
.nav-toggle::after { top: 25px; }
.nav-toggle[aria-expanded="true"]::before { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { top: 21px; transform: rotate(-45deg); }

.nav-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--ink-2);
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad);
  transform: translateX(100%);
}
.nav-panel.is-open { display: flex; }
.nav-panel ul { list-style: none; display: grid; gap: 10px; }
.nav-panel a {
  font-family: var(--display);
  font-size: clamp(34px, 9vw, 52px);
  text-decoration: none;
  line-height: 1.15;
}
.nav-panel a:active { color: var(--accent); }
.nav-panel .panel-meta {
  margin-top: 40px;
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
body.nav-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Layout shells ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(70px, 12vh, 130px) 0; }
.rule { border: 0; border-top: 1px solid var(--hairline); }

/* ---------- Hero (homepage) ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  position: relative;
  padding: 0 0 clamp(48px, 8vh, 96px);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The hero placeholder is a full-bleed background — tuck its markers out of
   the way of the nav and hero copy. */
.hero-media .ph { border: none; }
.hero-media .ph::before { display: none; }
.hero-media .ph-label {
  position: absolute;
  top: 96px;
  right: var(--pad);
  max-width: 26ch;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.55;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(11, 10, 9, 0.35), rgba(11, 10, 9, 0.55) 60%, var(--ink));
}
.hero h1 {
  font-size: clamp(48px, 8.5vw, 108px);
  max-width: 11ch;
}
.hero .lede { margin-top: 26px; }
.hero-meta {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- Subpage hero ---------- */
.page-hero {
  padding: clamp(140px, 24vh, 220px) 0 clamp(40px, 7vh, 70px);
}
.page-hero h1 { font-size: clamp(44px, 8vw, 96px); }
.page-hero .lede { margin-top: 22px; }

/* ---------- Section headings ---------- */
.section-head { margin-bottom: clamp(36px, 6vh, 64px); }
.section-head h2 { font-size: clamp(34px, 5vw, 60px); }

/* ---------- Placeholder tiles (until real client photos land) ----------
   Every .ph is a clearly-marked stand-in. Swap for an <img> with real alt
   text; the aspect-ratio utility classes carry over. */
.ph {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(240, 236, 228, 0.025) 14px 28px),
    radial-gradient(120% 90% at 20% 10%, var(--ink-3), var(--ink-2) 70%);
  border: 1px dashed rgba(240, 236, 228, 0.18);
  display: flex;
  align-items: flex-end;
  min-height: 100%;
}
.ph::before {
  content: "PLACEHOLDER";
  position: absolute;
  top: 12px; left: 14px;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(240, 236, 228, 0.35);
}
.ph .ph-label {
  padding: 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--paper-dim);
}

.r-45 { aspect-ratio: 4 / 5; }
.r-32 { aspect-ratio: 3 / 2; }
.r-11 { aspect-ratio: 1 / 1; }
.r-169 { aspect-ratio: 16 / 9; }
.r-916 { aspect-ratio: 9 / 16; }

/* ---------- Service cards (homepage) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 1080px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .services-grid { grid-template-columns: 1fr; } }

.card {
  display: block;
  text-decoration: none;
  will-change: transform;
}
.card .card-media {
  overflow: hidden;
  margin-bottom: 16px;
}
.card .card-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.card .card-media img,
.card .card-media .ph {
  filter: grayscale(1) contrast(1.02);
  transition: filter 0.5s ease;
}
.card:hover .card-media img,
.card:hover .card-media .ph,
.card:focus-visible .card-media img,
.card:focus-visible .card-media .ph {
  filter: grayscale(0);
}
.card h3 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.card h3 .num {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.card p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--paper-dim);
}

/* ---------- Intro split (homepage) ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 820px) { .intro-grid { grid-template-columns: 1fr; } }
.intro-grid .display { font-size: clamp(30px, 4.4vw, 52px); margin-bottom: 20px; }
.intro-grid .lede + .lede { margin-top: 14px; }

/* ---------- Gallery (portfolio pages) ---------- */
.gallery {
  columns: 3 300px;
  column-gap: 20px;
}
.g-item {
  break-inside: avoid;
  margin-bottom: 20px;
  cursor: zoom-in;
  position: relative;
  display: block;
}
.g-item img, .g-item .ph {
  filter: grayscale(0.85);
  transition: filter 0.45s ease, opacity 0.3s;
}
.g-item:hover img, .g-item:hover .ph,
.g-item:focus-visible img, .g-item:focus-visible .ph {
  filter: grayscale(0);
}
.g-item:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.g-item img { width: 100%; height: auto; }

/* ---------- Featured video (Video Production page) ---------- */
.featured-video {
  margin-bottom: 28px;
}
.featured-video video {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--ink-2);
}
.featured-video figcaption {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open { display: flex; }
body.lb-open { overflow: hidden; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 4, 0.94);
  opacity: 0;
}
.lb-stage {
  position: relative;
  z-index: 2;
  width: min(92vw, 1080px);
  max-height: 80svh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  cursor: grab;
  will-change: transform, opacity;
}
.lb-stage:active { cursor: grabbing; }
.lb-stage img {
  max-height: 80svh;
  width: auto;
  max-width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-stage .ph {
  width: min(80vw, 760px);
  aspect-ratio: 4 / 3;
  min-height: 0;
}
.lb-caption {
  position: absolute;
  z-index: 2;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--paper-dim);
  padding: 0 70px;
  pointer-events: none;
}
.lb-count {
  position: absolute;
  z-index: 2;
  top: 22px; left: 24px;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--paper-dim);
}
.lb-btn {
  position: absolute;
  z-index: 3;
  background: rgba(20, 18, 15, 0.7);
  border: 1px solid var(--hairline);
  color: var(--paper);
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s;
}
.lb-btn:hover { background: var(--ink-3); border-color: var(--accent); }
.lb-close { top: 16px; right: 16px; font-size: 24px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 54px; transform: none; }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  .lb-caption { bottom: 118px; padding: 0 24px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--paper);
  color: var(--paper);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 16px 34px;
  border-radius: 999px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  background: none;
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover, .btn:focus-visible {
  background: var(--paper);
  color: var(--ink);
}
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--accent); color: var(--ink); }

/* ---------- Contact / CTA ---------- */
.cta {
  text-align: center;
}
.cta h2 { font-size: clamp(40px, 7vw, 84px); }
.cta .lede { margin: 22px auto 38px; }

.contact-form {
  max-width: 560px;
  margin: 46px auto 0;
  display: grid;
  gap: 16px;
  text-align: left;
}
.contact-form label {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper-dim);
  display: grid;
  gap: 8px;
}
.contact-form input, .contact-form textarea {
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 6px;
  width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn { justify-self: start; margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 54px 0 40px;
  font-size: 13px;
  color: var(--paper-dim);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--paper);
  font-weight: 500;
}
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; transition: color 0.25s; }
.site-footer a:hover { color: var(--paper); }
.footer-brand .brand { font-size: 26px; }
.footer-brand p { margin-top: 12px; max-width: 34ch; }
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.12em;
}
