/* Home page. Builds on site.css (tokens, type, sitebar) and keeps the Despacio look:
   full-bleed footage, condensed display type, mono labels, one accent colour. */
body.home {
  --gutter: clamp(16px, 4vw, 56px);
  --wide-xl: 104rem;
  --text-soft: #cfd5de;
  padding: 0;
  overflow-x: hidden;
}
.wrap { width: min(var(--wide-xl), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 4px; background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 0.75rem; }
.skip:focus { top: 12px; }

.seg { white-space: nowrap; }

/* ── top bar ─────────────────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: rgba(7, 8, 12, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.topbar a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.topbar a:hover, .topbar .home-link { color: var(--fg); }
.topbar nav { display: flex; gap: clamp(0.9rem, 2.5vw, 2rem); }

/* ── hero: the showreel ──────────────────────────────────── */
.showreel {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  background: #000;
}
.reel { position: absolute; inset: 0; z-index: -2; }
.reel video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.4s ease, transform 10s linear;
}
.reel video.on { opacity: 1; transform: scale(1); }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 8, 12, 0.6) 0%, rgba(7, 8, 12, 0) 20%, rgba(7, 8, 12, 0) 38%, rgba(7, 8, 12, 0.72) 72%, var(--bg) 100%),
    radial-gradient(120% 70% at 0% 100%, rgba(7, 8, 12, 0.55), transparent 65%);
}
.showreel-inner {
  width: min(var(--wide-xl), 100% - 2 * var(--gutter)); margin-inline: auto;
  padding: 7rem 0 clamp(1.6rem, 5vh, 3.5rem);
  display: grid; gap: clamp(0.9rem, 2.2vh, 1.5rem);
}
.showreel .eyebrow { color: var(--accent-2); }

/* The headline is scaled by main.js so its longest line spans the column;
   the clamp is what you see before that runs (or without JavaScript). */
h1.fit {
  font-size: clamp(3rem, 10.5vw, 12rem);
  line-height: 0.84; letter-spacing: -0.004em;
  margin: 0;
}
h1.fit .line { color: var(--fg); display: block; width: max-content; max-width: none; white-space: nowrap; }
h1.fit .accent { color: var(--accent); text-shadow: 0 0 48px color-mix(in srgb, var(--accent) 30%, transparent); }

.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.2rem 2.5rem; margin-top: clamp(0.4rem, 1.5vh, 1rem); }
.hero-lede { max-width: 40rem; font-size: clamp(1.02rem, 1.35vw, 1.28rem); line-height: 1.5; color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.3rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(7, 8, 12, 0.32);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--fg); text-decoration: none;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.pill:hover { border-color: rgba(255, 255, 255, 0.6); transform: translateY(-1px); }
.pill.solid { background: var(--accent); border-color: transparent; color: #05070b; font-weight: 500; }
.pill.solid:hover { filter: brightness(1.08); }

.now-playing {
  position: absolute; z-index: 2;
  top: calc(4.6rem + env(safe-area-inset-top)); right: var(--gutter);
  display: grid; justify-items: end; gap: 0.35rem;
  text-decoration: none; color: var(--fg);
}
.np-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.np-title { font-family: var(--display); font-weight: 800; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.02em; }
.np-title::after { content: " \2192"; color: var(--accent); }
.np-dots { display: flex; gap: 5px; }
.np-dots i { width: 18px; height: 2px; background: rgba(255, 255, 255, 0.25); transition: background 0.4s; }
.np-dots i.on { background: var(--accent); }

/* ── numbers ─────────────────────────────────────────── */
.home-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.4rem 2.5rem;
  margin-block: clamp(2.5rem, 6vw, 4.5rem) 0; padding-block: clamp(1.4rem, 3vw, 2rem);
  border-block: 1px solid var(--line);
}
.home-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.35rem; }
.home-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.8rem, 5vw, 4.2rem); line-height: 0.9; color: var(--accent); text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.home-stats dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); max-width: 30ch; }

/* ── sections ────────────────────────────────────────── */
.block { margin-top: clamp(5rem, 11vw, 10rem); }
.block-head { display: grid; gap: 0.6rem; margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.block h2 { font-size: clamp(3rem, 8vw, 7rem); }
.eyebrow { color: var(--accent-2); }

/* featured project: a full-width panel */
.feature-card {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 21 / 9; border-radius: 6px; background: var(--panel);
  color: var(--fg); text-decoration: none;
}
.feature-card img, .feature-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1), opacity 0.8s; }
.feature-card video { opacity: 0; }
.feature-card.is-playing video { opacity: 1; }
.feature-card:hover img, .feature-card:hover video { transform: scale(1.03); }
.feature-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(7, 8, 12, 0.85) 0%, rgba(7, 8, 12, 0.35) 45%, transparent 75%),
              linear-gradient(0deg, rgba(7, 8, 12, 0.7) 0%, transparent 45%);
}
.feature-body { position: absolute; left: 0; bottom: 0; max-width: 52rem; padding: clamp(1.2rem, 3.5vw, 3rem); display: grid; gap: 0.8rem; }
.feature-body h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 7vw, 6.5rem); line-height: 0.88; margin: 0; }
.feature-body h3 span, .card h3 span { color: var(--accent); white-space: nowrap; }
.feature-body p { color: var(--text-soft); font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.5; max-width: 36rem; }
.go { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.go::after { content: "\2192"; margin-left: 0.45em; display: inline-block; transition: transform 0.25s; }
a:hover .go::after { transform: translateX(4px); }

/* the other projects */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: clamp(1.2rem, 2.4vw, 2rem); margin-top: clamp(1.2rem, 2.4vw, 2rem); }
.card { display: grid; align-content: start; gap: 0.7rem; color: var(--fg); text-decoration: none; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px; background: var(--panel); }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1), opacity 0.6s; }
.card-media video { opacity: 0; }
.card.is-playing .card-media video { opacity: 1; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.04); }
.card-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); transition: box-shadow 0.3s; }
.card:hover .card-media::after { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.card h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 3vw, 2.6rem); line-height: 0.92; margin: 0.2rem 0 0; }
.card p { color: var(--text-soft); font-size: 0.98rem; line-height: 1.5; }
.feature-body .meta-line, .card .meta-line { font-family: var(--mono); font-size: 0.7rem; line-height: 1.5; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.feature-body .meta-line, .card .meta-line:first-of-type { color: var(--accent-2); }

/* apps & tools: a wide card with phone screens */
.other-work { margin-top: clamp(3rem, 7vw, 5.5rem); }
.other-head { display: grid; gap: 0.5rem; margin-bottom: clamp(1rem, 2.4vw, 1.6rem); }
.other-head h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 0.9; }
.other-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.4rem, 3.5vw, 3rem); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: radial-gradient(70% 90% at 80% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--panel);
  color: var(--fg); text-decoration: none; transition: border-color 0.3s;
}
.other-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.other-text { display: grid; gap: 0.75rem; }
.other-text h3 { margin: 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 0.88; }
.other-text h3 span { color: var(--accent); }
.other-text p { color: var(--text-soft); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.5; max-width: 34rem; }
.other-text .meta-line { font-family: var(--mono); font-size: 0.7rem; line-height: 1.5; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.other-text .meta-line:first-of-type { color: var(--accent-2); }
.other-icon { width: clamp(52px, 5vw, 68px); height: auto; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 0 0 1px var(--line), 0 14px 30px -10px color-mix(in srgb, var(--accent) 45%, transparent); }
.other-phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.5rem, 1.6vw, 1.2rem); align-items: center; }
.mini-phone { aspect-ratio: 390 / 844; padding: clamp(3px, 0.5vw, 6px); background: #05070b; border: 1px solid var(--line); border-radius: clamp(12px, 2vw, 24px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); transition: transform 0.6s cubic-bezier(.2, .7, .2, 1); }
.mini-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: clamp(9px, 1.5vw, 18px); }
.mini-phone:nth-child(2) { transform: translateY(-6%); }
.other-card:hover .mini-phone:nth-child(1) { transform: translateY(-3%) rotate(-1.5deg); }
.other-card:hover .mini-phone:nth-child(2) { transform: translateY(-9%); }
.other-card:hover .mini-phone:nth-child(3) { transform: translateY(-3%) rotate(1.5deg); }

/* ── about ───────────────────────────────────────────── */
.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.about-main { display: grid; gap: 1.1rem; }
.about-main h2 { font-size: clamp(2.8rem, 6.5vw, 5.8rem); margin-bottom: 0.4rem; }
.about-text { display: grid; gap: 1rem; max-width: 42rem; }
.about-text p { font-size: clamp(1.05rem, 1.25vw, 1.2rem); line-height: 1.6; color: var(--text-soft); }
.side-label { margin: 2.2rem 0 0.8rem; font-family: var(--mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.side-label:first-child { margin-top: 0.4rem; }
.experience { list-style: none; margin: 0; padding: 0; }
.experience li { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.experience li:last-child { border-bottom: 1px solid var(--line); }
.experience .org { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.4rem; line-height: 1.05; }
.experience .years { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; padding-top: 0.3rem; }
.experience .role { grid-column: 1 / -1; color: var(--text-soft); font-size: 0.95rem; }
/* the feature films made at a job, listed under it */
.credits { grid-column: 1 / -1; list-style: none; margin: 0.55rem 0 0.15rem; padding: 0 0 0 0.9rem; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); display: grid; gap: 0.4rem; }
.credits li { display: grid; grid-template-columns: 1fr auto; gap: 0 0.8rem; padding: 0; border: 0 !important; }
.credits .film { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1rem; line-height: 1.15; }
.credits .film-year { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); padding-top: 0.15rem; }
.credits .film-role { grid-column: 1 / -1; color: var(--muted); font-size: 0.82rem; }
.experience .note { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; font-style: italic; }
.chiplist { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chiplist span { font-family: var(--mono); font-size: 0.74rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; color: var(--fg); }

/* ── contact ─────────────────────────────────────────── */
.contact { display: grid; gap: 1.2rem; }
.contact h2 { font-size: clamp(3rem, 9.5vw, 9.5rem); line-height: 0.86; max-width: 14ch; }
.contact h2 span { color: var(--accent); }
.contact-email {
  justify-self: start; margin-top: 0.8rem;
  font-size: clamp(1.3rem, 3.4vw, 2.4rem); font-weight: 600; color: var(--fg);
  text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 0.15rem;
  overflow-wrap: anywhere; transition: color 0.2s;
}
.contact-email:hover { color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.6rem; }

.home-footer {
  max-width: none;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  margin-top: clamp(5rem, 10vw, 8rem); padding-block: 1.4rem calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.home-footer a { color: var(--muted); text-decoration: none; }
.home-footer a:hover { color: var(--fg); }

/* ── scroll reveal (common.js adds .is-visible) ──────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ── smaller screens ─────────────────────────────────── */
@media (max-width: 1000px) {
  .other-card { grid-template-columns: minmax(0, 1fr); }
  .feature-card { aspect-ratio: 16 / 9; }
  .about { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.2rem; }
  .home-stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .feature-card { aspect-ratio: 4 / 5; }
  .feature-card::after { background: linear-gradient(0deg, rgba(7, 8, 12, 0.92) 0%, rgba(7, 8, 12, 0.4) 55%, transparent 80%); }
  .now-playing { top: auto; bottom: auto; right: auto; left: var(--gutter); top: calc(4rem + env(safe-area-inset-top)); justify-items: start; }
  .showreel-inner { padding-top: 9rem; }
  .hero-actions { width: 100%; }
  .hero-actions .pill { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .reel video, .reveal, .feature-card img, .card-media img { transition: none !important; transform: none !important; }
  .reveal { opacity: 1; }
}
