/* ============================================================
   Max McCoy — Heart Led Storytelling
   Black background · EB Garamond · no italics · gallery wall
   ============================================================ */

:root {
  --paper: #000000;
  --paper-2: #000000;
  --ink: #ece4d2;
  --ink-soft: #8a8478;
  --rule: #1f1d1a;
  --accent: #c9a66b;
  --tile-gap: 0px;
  --serif: "EB Garamond", "Apple Garamond", "Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  z-index: 50;
  color: var(--ink);
  pointer-events: none;
}
.topbar a { pointer-events: auto; }
.topbar .mark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.02em;
}
.topbar nav {
  display: flex;
  gap: 28px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.06em;
}
.topbar nav a { opacity: 0.7; transition: opacity 160ms ease, color 160ms ease; }
.topbar nav a:hover { opacity: 1; color: var(--accent); }

.eyebrow {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 28px;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 5.75vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
  color: var(--ink);
  white-space: nowrap;
}
.display.sm {
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  margin: 8px 0 22px;
  white-space: normal;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin: 0;
}
.lede .sep { opacity: 0.4; }

/* ---------- Gallery wall ----------
   Row-height = 100vw / 2.35 / 6 rows = 7.092vw. This makes hero (12×6) EXACTLY 2.35:1
   anamorphic, so Montana Hero (1920×820, aspect 2.34) fills without any crop.
   As a bonus, wide (8×4) = 66.67vw × 28.37vw = 2.35 (also perfect anamorphic),
   md/lg (6×4) = 50vw × 28.37vw = 1.76 ≈ 16:9 (perfect for landscape stills),
   sm (4×4) = 33.33 × 28.37 = 1.17 near-square, tall (4×6) = 33.33 × 42.55 = 0.78 ≈ 4:5. */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 7.092vw;
  grid-auto-flow: dense;
  gap: var(--tile-gap);
  padding: var(--tile-gap);
  background: var(--paper-2);
}

.tile {
  position: relative;
  overflow: hidden;
  background: #000;
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.tile.in { opacity: 1; transform: none; }

.tile img,
.tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1100ms cubic-bezier(.2,.7,.2,1), filter 600ms ease;
  filter: brightness(0.94);
}
.tile:hover img,
.tile:hover video {
  transform: scale(1.04);
  filter: brightness(1);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.78) 100%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.tile:hover::after { opacity: 1; }

/* Play indicator on video tiles */
.tile.video::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  background:
    rgba(0,0,0,0.45)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polygon points='9,6 19,12 9,18' fill='%23c9a66b'/></svg>")
    center/14px no-repeat;
  border: 1px solid rgba(201,166,107,0.5);
  border-radius: 50%;
  z-index: 2;
  opacity: 0.9;
  transition: opacity 220ms ease, transform 220ms ease, background-color 220ms ease;
  backdrop-filter: blur(6px);
}
.tile.video:hover::before {
  opacity: 1;
  transform: scale(1.08);
}
.tile.hero.video::before { width: 52px; height: 52px; background-size: 18px; top: 18px; right: 18px; }

.tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms ease;
  z-index: 1;
}
.tile:hover figcaption { opacity: 1; transform: none; }

.t-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.t-meta {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

/* All widths divide 12 (4/6/8/12) so rows always pack full: 12, 6+6, 8+4, 4+4+4.
   Row-heights chosen so wides/lgs/mds match at 4 and portraits/hero take taller spans. */
.tile.hero {
  grid-column: span 12;
  grid-row: span 6;
  /* 12 cols × 100vw/12 wide × 6 rows × 7.092vw tall = 100vw × 42.55vw = exact 2.35:1 */
}
.tile.wide { grid-column: span 8;  grid-row: span 4; }   /* 66vw wide, aspect ~2.4:1 */
.tile.lg   { grid-column: span 6;  grid-row: span 4; }   /* 50vw wide, near 16:9 */
.tile.md   { grid-column: span 6;  grid-row: span 4; }   /* same as lg */
.tile.sm   { grid-column: span 4;  grid-row: span 4; }   /* 33vw wide, near-square */
.tile.tall { grid-column: span 4;  grid-row: span 6; }   /* 33vw wide, ~4:5 portrait */

/* ---------- Banner tile (12-col strip with the site copy over max-film.jpg) ---------- */
.tile.banner {
  grid-column: span 12;
  grid-row: span 3;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2vw 6vw;
  cursor: default;
  overflow: hidden;
  opacity: 1;
  transform: none;
  position: relative;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
/* Max Film image at 50% opacity behind the copy */
.tile.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/max-film.jpg") center/cover no-repeat;
  opacity: 0.5;
  z-index: 0;
  display: block;
  filter: grayscale(0.15) contrast(1.02);
}
.tile.banner::after { display: none; }
.tile.banner .eyebrow,
.tile.banner .display,
.tile.banner .lede {
  position: relative;
  z-index: 1;
}
.tile.banner .eyebrow { margin: 0 0 14px; }
.tile.banner .display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
.tile.banner .lede {
  font-family: var(--serif);
  font-size: clamp(15px, 1.3vw, 22px);
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

/* ---------- About page ---------- */
/* Skinny field-notes strip at the top: uniform height, quiet, not a wall */
.about-strip {
  display: flex;
  gap: 2px;
  height: 164px;
  background: var(--paper);
}
.about-strip img {
  flex: 1;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.85);
  transition: filter 400ms ease;
}
.about-strip img:hover { filter: saturate(1) brightness(1); }

.about-page {
  min-height: calc(100vh - 166px);
  padding: 100px 56px 100px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(201,166,107,0.04), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--rule);
}
.about-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 88px;
  align-items: center;
  width: 100%;
}
.about-text p {
  max-width: 56ch;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 1em;
}
.about-text .display.sm { max-width: 22ch; }
.about-text .eyebrow { color: var(--accent); }
.about-contact {
  margin-top: 44px !important;
  font-size: 15px !important;
  letter-spacing: 0.12em;
  color: var(--ink-soft) !important;
}
.about-contact a {
  transition: color 160ms ease;
}
.about-contact a:hover { color: var(--accent); }
.socials.about-socials { justify-content: flex-start; margin-top: 28px; }
.about-portrait {
  margin: 0;
  border: 1px solid var(--rule);
  padding: 10px;
  background: #0a0a09;
  position: relative;
}
.about-portrait::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(201,166,107,0.25);
  pointer-events: none;
}
.about-portrait img {
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}

/* ---------- Brass button ---------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 16px 36px;
  cursor: pointer;
  background: transparent;
  transition: background 200ms ease, color 200ms ease;
}
.btn:hover { background: var(--accent); color: #000; }

/* ---------- Contact form page ---------- */
.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 100px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(201,166,107,0.045), transparent 60%),
    var(--paper);
}
.form-wrap { width: min(560px, 100%); }
.form-wrap .eyebrow { text-align: center; margin-bottom: 40px; }
.contact-form label {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 26px 0 8px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  padding: 14px 16px;
  outline: none;
  border-radius: 0;
  transition: border-color 200ms ease;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form .btn { margin-top: 36px; width: 100%; }
.form-note {
  text-align: center;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-top: 22px;
}
.form-note a { color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
.form-note a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Watch page (on-site player) ---------- */
.watch-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 100px 20px 60px;
  background: #000;
}
.watch-frame {
  width: min(1240px, 96vw);
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--rule);
}
.watch-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.watch-back {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.watch-back:hover { color: var(--accent); }

/* ---------- Quiet quote blocks ---------- */
.quiet-quote {
  padding: 140px 32px;
  text-align: center;
}
.quiet-quote p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(19px, 1.8vw, 26px);
  line-height: 1.45;
  color: var(--ink);
  max-width: 44ch;
  margin: 0 auto;
}
.quiet-quote cite {
  font-style: normal;
  display: block;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Contact ---------- */
/* homepage button runs half-size */
.contact .btn {
  font-size: 12px;
  padding: 9px 20px;
}
.contact {
  padding: 200px 40px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(201,166,107,0.045), transparent 60%),
    var(--paper);
  border-top: 1px solid var(--rule);
}
.contact-email {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.12em;
  margin: 0 0 26px;
}
.contact-email a {
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.contact-email a:hover { color: var(--accent); }

.socials {
  display: flex;
  justify-content: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.14em;
}
.socials a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 160ms ease, color 160ms ease;
  color: var(--ink-soft);
}
.socials a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  justify-content: center;
  padding: 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar { padding: 10px 12px; }
  /* bigger tap targets on mobile */
  .topbar nav { gap: 6px; font-size: 14px; }
  .topbar nav a { padding: 12px 10px; }

  .gallery {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 10.638vw;   /* 100vw / 2.35 / 4 rows — hero at 6×4 = 2.35:1 exact */
  }
  /* Heights must interlock: mds/sm are 3 rows, talls 6 (= two stacked mds),
     full-width strips 4 (exact 2.35). Keeps the wall void-free on mobile. */
  .tile.hero { grid-column: span 6; grid-row: span 4; }   /* 100vw × 42.55vw = 2.35:1 anamorphic on mobile */
  .tile.wide { grid-column: span 6; grid-row: span 4; }   /* full-width 2.35 strip, no crop on Set loop */
  .tile.lg   { grid-column: span 6; grid-row: span 4; }   /* full-width, cinematic crop of the 16:9 still */
  .tile.md   { grid-column: span 3; grid-row: span 3; }
  .tile.sm   { grid-column: span 3; grid-row: span 3; }
  .tile.tall { grid-column: span 3; grid-row: span 6; }   /* 50vw × 63.8vw ≈ 4:5 portrait, same as desktop */

  .tile.banner { grid-column: span 6; grid-row: span 3; padding: 4vw 5vw; }
  .tile.banner .display {
    font-size: clamp(22px, 5vw, 40px);
    white-space: normal;
  }
  .tile.banner .lede { font-size: 14px; }

  .contact { padding: 100px 22px; }
  .foot { padding: 22px 18px 28px; }

  .about-strip { height: 96px; }
  /* fewer, bigger frames on small screens */
  .about-strip img:nth-child(n+5) { display: none; }
  .about-page { min-height: auto; padding: 70px 22px 80px; }
  .about-wrap { grid-template-columns: 1fr; gap: 36px; }
  .about-portrait { max-width: 360px; order: 2; }
  .about-text { order: 1; }
  .about-text p { font-size: 16px; }
  .about-contact { font-size: 14px !important; }

  .eyebrow { font-size: 12px; letter-spacing: 0.16em; }
  .lede { font-size: 14px; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 10.638vw; }   /* 100vw / 2.35 / 4 = hero 4×4 = 2.35:1 exact */
  .tile.hero, .tile.lg, .tile.wide, .tile.banner { grid-column: span 4; }
  .tile.tall { grid-column: span 2; grid-row: span 6; }   /* pairs with two stacked mds */
  .tile.md   { grid-column: span 2; grid-row: span 3; }
  .tile.sm   { grid-column: span 2; grid-row: span 3; }
  .tile figcaption { opacity: 1; padding: 10px 12px 8px; }
  .t-title { font-size: 16px; }
  .t-meta { font-size: 10px; }
  .eyebrow { line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile img, .tile video, .tile figcaption { transition: none !important; animation: none !important; }
  .tile { opacity: 1 !important; transform: none !important; }
}
