/* ===================================================================
   Portfolio — "Studio Noir" theme
   Warm-charcoal cinematic base, warm-orange accent, mono chrome.
   Tokens live in :root so the whole look is tunable from one place.
=================================================================== */
:root {
  --bg:         oklch(0.17 0.006 65);   /* warm charcoal base */
  --bg-2:       oklch(0.15 0.006 65);   /* darker alt panel */
  --bg-3:       oklch(0.22 0.006 65);   /* chip / raised */

  --text:       oklch(0.95 0.004 80);
  --text-dim:   oklch(0.82 0.005 80);
  --text-mute:  oklch(0.65 0.005 80);

  --border:     oklch(0.27 0.006 65);
  --border-2:   oklch(0.35 0.006 65);   /* chips, inputs */

  --accent:       #e0863f;              /* warm orange */
  --accent-hover: #ed9a55;
  --accent-ink:   #111111;              /* text/icons on accent */

  --maxw:       1440px;
  --ease:       cubic-bezier(.2,.7,.2,1);
  --font-head:  "Space Grotesk", system-ui, sans-serif;
  --font-body:  "Manrope", system-ui, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, monospace;

  --pad-x:      clamp(20px, 4vw, 56px);
  --pad-y:      clamp(56px, 9vw, 90px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* mono label helper */
.mono {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; color: var(--text-dim);
}
.mono--dim { color: var(--text-mute); font-size: 11px; }

/* numbered section kicker */
.kicker {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ===================================================================
   NAV
=================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad-x);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__logo {
  font-family: var(--font-head); font-weight: 700; font-size: 19px;
  letter-spacing: -0.01em; color: var(--text);
}
.nav__logo .dot { color: var(--accent); }
.nav__links {
  display: flex; gap: 34px;
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim);
}
.nav__links a { transition: color .25s var(--ease); }
.nav__links a:hover,
.nav__links a.is-active { color: var(--accent); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); transition: .3s var(--ease); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================================
   HERO
=================================================================== */
.hero__inner {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
.hero__about {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(28px, 3vw, 40px); padding: clamp(48px, 7vw, 72px) var(--pad-x);
  border-right: 1px solid var(--border);
}
.hero__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(3.6rem, 7.2vw, 86px); line-height: 0.98; letter-spacing: -0.03em;
}
.hero__lead {
  margin-top: clamp(18px, 2vw, 28px); max-width: 480px;
  font-size: clamp(16px, 1.3vw, 22px); line-height: 1.55; color: var(--text-dim);
}
.hero__stats {
  display: flex; flex-wrap: wrap; gap: clamp(24px, 2.6vw, 40px);
  font-family: var(--font-mono); font-size: clamp(12px, 0.9vw, 15px);
  letter-spacing: 0.04em; color: var(--text-mute);
}
.hero__stats strong {
  display: block; font-family: var(--font-head); font-weight: 600;
  font-size: clamp(26px, 2.6vw, 38px); color: #fff; letter-spacing: -0.01em;
}
.hero__stats span { display: block; margin-top: 2px; }

.hero__work {
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 22px;
  /* padding matches .hero__about (top & bottom) so the work-head lines up with
     the about kicker and the grid's bottom lines up with the stats row */
  padding: clamp(48px, 7vw, 72px) var(--pad-x);
  background: var(--bg-2);
}
.hero__work-head {
  display: flex; align-items: baseline; justify-content: space-between;
  width: 100%;
}
.hero__work-head .mono { text-transform: uppercase; letter-spacing: 0.16em; }
.hero__work .grid--featured { width: 100%; }

/* ===================================================================
   SECTIONS
=================================================================== */
.section {
  padding: var(--pad-y) var(--pad-x);
  border-top: 1px solid var(--border);
}
.section--alt { background: var(--bg-2); }

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 40px;
}
.section__head--stack { display: block; }
.section__title {
  margin-top: 14px;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 44px); letter-spacing: -0.02em; line-height: 1.05;
}
.section__sub {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  color: var(--text-mute); max-width: 280px; text-align: right;
}

/* ---------- Grids ---------- */
.grid { display: grid; }
.grid--16x9 { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid--9x16 { grid-template-columns: repeat(5, 1fr); gap: 18px; }

/* hero featured: one 9:16 at left, two stacked 16:9 at right.
   Widths flex in the 247:375 ratio so the panel fills its half. */
.grid--featured {
  display: flex; gap: 18px; align-items: flex-start;
}
.grid--featured .card--9x16 { flex: 247 1 0; min-width: 0; width: auto; }
.grid--featured .featured-col {
  flex: 375 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 18px;
}

/* ---------- Card ---------- */
.card {
  position: relative; display: block; width: 100%;
  overflow: hidden; background: var(--bg-3);
  border: 0; padding: 0; cursor: pointer; text-align: left;
  transition: transform .35s var(--ease);
}
.card:hover { transform: translateY(-3px); }
.card--16x9 .card__media { aspect-ratio: 16 / 9; }
.card--9x16 .card__media { aspect-ratio: 9 / 16; }
.card__media { position: relative; overflow: hidden; background: var(--bg-3); }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.card:hover .card__media img { transform: scale(1.05); }
.card__media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card__cover { position: absolute; inset: 0; z-index: 3; cursor: pointer; }
.card.is-playing { cursor: default; }
.card.is-playing:hover { transform: none; }

/* mono corner label */
.card__label {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--text-dim); pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* hover play overlay: accent circle + dark triangle */
.card__play {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  background: color-mix(in oklch, var(--bg) 45%, transparent);
  opacity: 0; transition: opacity .3s var(--ease);
}
.card:hover .card__play { opacity: 1; }
.card.is-playing .card__play { display: none; }
.card__play::before {
  content: ""; width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent);
}
.card__play::after {
  content: ""; position: absolute;
  border-left: 17px solid var(--accent-ink);
  border-top: 10px solid transparent; border-bottom: 10px solid transparent;
  transform: translateX(3px);
}
.card--9x16 .card__play::before { width: 46px; height: 46px; }
.card--9x16 .card__play::after { border-left-width: 15px; border-top-width: 9px; border-bottom-width: 9px; }

/* ===================================================================
   ABOUT
=================================================================== */
.about__grid {
  display: grid; grid-template-columns: 0.6fr 1.4fr; gap: 56px; align-items: start;
}
.about__portrait { aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-3); }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__title {
  margin: 16px 0 0;
  font-family: var(--font-head); font-weight: 700; font-size: clamp(1.8rem, 3.2vw, 40px);
  line-height: 1.08; letter-spacing: -0.02em;
}
.about__text { margin-top: 20px; font-size: 17px; line-height: 1.65; color: var(--text-dim); }

.workflow { margin-top: 60px; }
.workflow .kicker { margin-bottom: 16px; }
.tools { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.tool {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border-2); border-radius: 12px;
}
.tool__logo {
  width: 40px; height: 40px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-3);
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em; color: var(--text-mute);
}
.tool__meta { display: flex; flex-direction: column; }
.tool__name { color: #fff; font-weight: 500; font-size: 14px; }
.tool__role { margin-top: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); }

/* ---------- Clients ---------- */
.clients {
  list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 30px;
}
.client { display: flex; flex-direction: column; gap: 12px; }
.client__frame {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--border);
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.client:hover .client__frame { border-color: var(--accent); transform: translateY(-3px); }
.client__frame img { width: 100%; height: 100%; object-fit: cover; }
.client__name { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

/* ===================================================================
   CONTACT
=================================================================== */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.contact__title {
  margin: 16px 0 24px;
  font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 5vw, 52px);
  line-height: 1; letter-spacing: -0.03em;
}
.contact__links { display: flex; flex-direction: column; }
.contact__row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 14px;
  transition: color .25s var(--ease);
}
.contact__row:hover { color: var(--accent); }

.contact__form { display: flex; flex-direction: column; gap: 16px; }
.contact__form .kicker { margin-bottom: 4px; }
.contact__form input,
.contact__form textarea {
  background: transparent; border: 1px solid var(--border-2); padding: 16px;
  color: #fff; font-family: var(--font-mono); font-size: 13px;
  transition: border-color .25s var(--ease);
}
.contact__form input::placeholder,
.contact__form textarea::placeholder { color: var(--text-mute); }
.contact__form input:focus,
.contact__form textarea:focus { outline: none; border-color: var(--accent); }
.contact__form textarea { resize: none; }
.contact__send {
  background: var(--accent); color: var(--accent-ink); border: none; padding: 18px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  transition: background .25s var(--ease);
}
.contact__send:hover { background: var(--accent-hover); }

/* ===================================================================
   FOOTER
=================================================================== */
.footer {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 28px var(--pad-x); border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-mute);
}

/* ===================================================================
   RESPONSIVE
=================================================================== */
/* ≤1440px: portrait stretches to fill the About grid row (top↔bottom),
   instead of sitting at its natural 4/5 height. Scoped above the
   single-column breakpoint so mobile keeps the aspect-locked portrait. */
@media (min-width: 721px) and (max-width: 1440px) {
  .about__portrait { align-self: stretch; aspect-ratio: auto; }
}

@media (max-width: 1080px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__about { border-right: 0; border-bottom: 1px solid var(--border); }
  .hero__work { align-items: flex-start; }
  .grid--16x9 { grid-template-columns: repeat(2, 1fr); }
  .grid--9x16 { grid-template-columns: repeat(3, 1fr); }
  .clients { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: 0 0 auto 0; top: 0;
    flex-direction: column; align-items: flex-start; gap: 18px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 88px var(--pad-x) 40px; font-size: 15px;
    transform: translateY(-100%); transition: transform .4s var(--ease);
    height: auto;
  }
  .nav.is-open .nav__links { transform: none; }
  .nav__toggle { display: flex; z-index: 60; }

  .section__head { flex-direction: column; align-items: flex-start; }
  .section__sub { text-align: left; max-width: none; }
  .grid--16x9 { grid-template-columns: 1fr; }
  .grid--9x16 { grid-template-columns: repeat(2, 1fr); }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .about__grid,
  .contact__grid { grid-template-columns: 1fr; gap: 40px; }
  .grid--featured { flex-direction: column; }
  .grid--featured .card--9x16,
  .grid--featured .featured-col { flex: none; width: 100%; }
}

/* ===================================================================
   REDUCED MOTION
=================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
