/* ------------------------------------------------------------------
   chandlerwild — site styles
   Palette: warm off-white ground, near-black ink, single accent.
   No pure black anywhere (see brief §6).
   ------------------------------------------------------------------ */

:root {
  --ground: #f4f1ec;      /* warm off-white */
  --ink: #1c1a17;         /* near-black, warm */
  --muted: #7d776d;
  --line: #dcd7ce;
  --accent: #e4572e;      /* single accent — placeholder, easy to swap */
  --screen-dark: #14120f; /* screens are the only near-black surfaces */

  /* --display carries the personality budget; --text stays plain;
     --mono is for meta/credit lines (format · role, era labels). */
  --display: "Bricolage Grotesque", "Avenir Next", Futura, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1200px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* ---------- header / persistent text nav (brief §3) ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark .role {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.45rem;
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  padding: 0.15rem 0.3rem;
}

.site-nav a:hover { color: var(--accent); }

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav .dot {
  color: var(--muted);
  user-select: none;
}

/* ---------- generic page layout ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.page-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 2.5rem 0 2rem;
}

/* ---------- desk scene (homepage) ---------- */

.desk-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.desk-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.desk-scene svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Screen hotspots: real <a> elements over the illustrated screens.
   Positions are % of the 1600x900 scene viewBox. Each carries an
   optional --tilt for per-screen perspective once the final
   illustration lands. */

.screen-link {
  position: absolute;
  display: block;
  background: var(--screen-dark);
  overflow: hidden;
  transform: var(--tilt, none);
  text-decoration: none;
}

.screen-link video,
.screen-link img.still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.screen-link.is-playing video,
.screen-link.has-still img.still {
  opacity: 1;
}

/* Placeholder glow until footage exists — a dim idle screen */
.screen-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, #3a362f 0%, var(--screen-dark) 78%);
  transition: filter 0.25s ease;
}

.screen-link video { z-index: 1; }

/* Hover / focus must be unmistakable (brief §3): screen brightens,
   label appears */
.screen-link:hover::before,
.screen-link:focus-visible::before {
  filter: brightness(1.9);
}

.screen-link:hover video,
.screen-link:focus-visible video {
  filter: brightness(1.15);
}

.screen-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.1vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ground);
  background: color-mix(in srgb, var(--screen-dark) 78%, transparent);
  padding: 0.2em 0.7em;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  pointer-events: none;
}

.screen-link:hover .screen-label,
.screen-link:focus-visible .screen-label {
  opacity: 1;
}

/* Screen positions (percent of 1600x900 scene) — illustrated SVG version */
.screen-link.art        { left: 9.69%;  top: 45.0%;  width: 10.0%;  height: 13.33%; }
.screen-link.films      { left: 28.25%; top: 38.0%;  width: 13.5%;  height: 16.67%; }
.screen-link.commercial { left: 48.0%;  top: 34.22%; width: 24.0%;  height: 24.0%; }
.screen-link.about      { left: 76.69%; top: 49.11%; width: 14.13%; height: 16.22%; }

/* Photo version: 1536x864 poster (assets/img/desk-poster.jpg) */
.desk-scene--photo { aspect-ratio: 1536 / 864; }

.desk-scene--photo .desk-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The photo's screens are already dark — keep the hotspot invisible
   until hover/focus, then lift with a soft light wash. */
.desk-scene--photo .screen-link { background: transparent; }

.desk-scene--photo .screen-link::before {
  background: transparent;
  transition: background 0.25s ease;
}

.desk-scene--photo .screen-link:hover::before,
.desk-scene--photo .screen-link:focus-visible::before {
  filter: none;
  background: rgba(255, 253, 245, 0.16);
}

/* measured from the poster's actual screen pixels
   (v5 crop, punched in: Studio Display · Mac 128K · PowerBook · iMac G3) */
.desk-scene--photo .screen-link.commercial { left: 3.8%;  top: 30.1%; width: 29.2%; height: 30.3%; }
.desk-scene--photo .screen-link.art        { left: 35.8%; top: 38.7%; width: 10.7%; height: 13.5%; }
.desk-scene--photo .screen-link.about      { left: 50.3%; top: 46.5%; width: 17.8%; height: 18.1%; }
.desk-scene--photo .screen-link.films      { left: 74.0%; top: 40.0%; width: 17.8%; height: 20.1%; }

/* ---------- mobile: typographic index replaces the desk (brief §4.2) ---------- */

.type-index { display: none; }

@media (max-width: 720px) {
  .desk-wrap { display: none; }

  .type-index {
    display: block;
    padding: 3rem 1.5rem 1rem;
  }

  .type-index a {
    display: block;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.2rem, 11vw, 3.2rem);
    line-height: 1.25;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding: 0.35em 0;
  }

  .type-index a:hover,
  .type-index a:focus-visible {
    color: var(--accent);
  }

  .type-index .era {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* ---------- reel section (brief §4.3 default: below the fold) ---------- */

.reel {
  max-width: var(--max);
  margin: 4rem auto 0;
  padding: 0 1.5rem;
}

.reel h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 1rem;
}

.reel-frame {
  aspect-ratio: 16 / 9;
  background: var(--screen-dark);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reel-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- work grid (brief §6): 16:9 tiles, two-line captions ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-grid.wide { grid-template-columns: 1fr; }

.tile { margin: 0; }

/* .tile-link is a <div> while a project is a placeholder; convert it
   to an <a href="…"> once its project page exists — styles apply to both. */
.tile .tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.tile-link { cursor: pointer; }

.tile .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--screen-dark);
  overflow: hidden;
}

.tile.scope .frame { aspect-ratio: 2.39 / 1; }

.tile .frame img,
.tile .frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile .frame video {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tile .tile-link:hover .frame video.is-ready,
.tile .tile-link:focus-visible .frame video.is-ready {
  opacity: 1;
}

.tile .frame .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Two lines maximum. Title, then format · role. Nothing else. */
figcaption {
  margin-top: 0.6rem;
}

figcaption .title {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
}

figcaption .meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- about ---------- */

.about-body {
  max-width: 44rem;
}

.about-body .bio {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.6;
}

.credits {
  margin: 2.5rem 0;
  padding: 0;
  list-style: none;
}

.credits li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.credits .role { color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }

.contact a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
}

/* ---------- footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 5rem auto 0;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a { color: inherit; }

/* ---------- reduced motion (brief §4.4) ---------- */

@media (prefers-reduced-motion: reduce) {
  .screen-link video,
  .tile .frame video,
  .screen-label,
  .screen-link::before {
    transition: none;
  }
}
