/* ============ Base ============ */
:root {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --text: #f2f0ec;
  --text-dim: #8a8a86;
  --line: #232323;
  --accent: #f2f0ec;
  --pad: clamp(1.5rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--text); color: var(--bg); }

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), padding 0.4s var(--ease);
}
.nav.scrolled {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.8rem var(--pad);
  border-bottom: 1px solid var(--line);
}
.nav-name {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 var(--pad);
  position: relative;
  overflow: hidden;
}
/* Anchored to the bottom of the frame: taller viewports reveal upward. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/hero.jpg") center bottom / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0.35) 45%, var(--bg) 100%);
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero-name {
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero-name .line {
  display: block;
  overflow: hidden;
}
.hero-name .line span {
  display: block;
  transform: translateY(110%);
  animation: rise 1s var(--ease) forwards;
}
.hero-name .line:nth-child(2) span { animation-delay: 0.12s; }
@keyframes rise { to { transform: translateY(0); } }

.hero-role {
  margin-top: 1.75rem;
  color: rgba(242, 240, 236, 0.88);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 12px rgba(10, 10, 10, 0.5);
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-cue-line {
  display: block;
  width: 1px;
  height: 56px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.scroll-cue-line::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 40%;
  background: var(--text);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(-110%); }
  60%, 100% { transform: translateY(260%); }
}

/* ============ Sections ============ */
.section {
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  max-width: 1560px;
  margin: 0 auto;
}
/* On laptops and up, tie container width to the viewport so side margins
   stay proportional — a MacBook gets the same breathing room as a monitor. */
@media (min-width: 1024px) {
  .section { max-width: min(1560px, 82vw); }
}
.section-head {
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.section-num {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-desc {
  margin-top: 0.6rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 58ch;
}

/* ============ Selected Work ============ */
#work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vh, 4rem) 2rem;
}
#work .section-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.work-media {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.views {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.views svg { display: block; opacity: 0.85; }
.work-media .ph,
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.work-media:hover .ph,
.work-media:hover img { transform: scale(1.03); }

/* Hover swaps the still for the video's thumbnail */
.work-media .work-thumb {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.7s var(--ease);
}
.work-media:hover .work-thumb { opacity: 1; }

.work-meta {
  margin-top: 1.1rem;
}
.work-meta h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.work-tags {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}
.work-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-top: 0.6rem;
  max-width: 60ch;
}

/* ============ Gallery ============ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* never wider than 4 across */
  gap: 2.25rem 1rem;
}
@media (max-width: 1100px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* never fewer than 2 */
}
.tile {
  padding: 0;
  display: flex; /* buttons vertically center their content by default — pin to top so taller neighbors (2-line titles) don't shift the image */
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
}
.tile-media {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* thumbnails are the work — never crop them */
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.tile:hover img { transform: scale(1.05); }

/* YouTube-style meta under each thumb */
.tile-meta { margin-top: 0.7rem; }
.tile-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-channel {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.tile-channel .check { opacity: 0.7; }
.tile-views {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ============ Placeholder art ============ */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(242, 240, 236, 0.45);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.7;
}
.ph-1 { background: linear-gradient(135deg, #1c2a1e, #0d1410); }
.ph-2 { background: linear-gradient(135deg, #2a231c, #14100c); }
.ph-3 { background: linear-gradient(135deg, #1c222a, #0d1014); }
.ph-4 { background: linear-gradient(135deg, #241c2a, #100d14); }
.ph-5 { background: linear-gradient(135deg, #2a1c1e, #140d0e); }
.ph-6 { background: linear-gradient(135deg, #1e2a28, #0d1413); }

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 3rem;
}
.about-photo img {
  display: block;
  width: 100%;
  border-radius: 6px;
}
.about-copy p + p { margin-top: 0.9rem; }
.about-lede {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 1.5rem;
}
.about-copy p:not(.about-lede) { color: var(--text-dim); max-width: 52ch; }

.contact-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.contact-link {
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease);
}
.contact-link:hover { border-color: var(--text); }
.socials {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.socials a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.socials a:hover { color: var(--text); }

/* ============ Footer ============ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.8rem;
}
.footer a { transition: color 0.25s var(--ease); }
.footer a:hover { color: var(--text); }

/* ============ Reveal on scroll ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Lightbox ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: var(--pad);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-media {
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
}
.lightbox-media .ph,
.lightbox-media img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-caption {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.75rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.lightbox-close:hover { color: var(--text); }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  #work { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-name .line span { animation: none; transform: none; }
  .scroll-cue { display: none; }
}
