/* ============================================================
   NS MEDIA — styles
   Landing (a single button) → Portfolio (constellation grid)
   ============================================================ */

:root {
  --bg:        #0a0a0c;
  --bg-2:      #101015;
  --panel:     #14141b;
  --panel-2:   #1a1a23;
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.16);
  --ink:       #f4f2ee;
  --ink-soft:  #b7b4ad;
  --ink-mute:  #7c7a75;
  --accent:    #e8b95a;   /* premium gold */

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #17130a; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- brand mark ---------- */
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--accent);
  color: #17130a;
  padding: 2px 9px;
  border-radius: 8px;
  line-height: 1.1;
}
.brand-word {
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-primary { background: var(--accent); color: #17130a; box-shadow: 0 18px 44px -18px rgba(232,185,90,0.6); }
.btn-primary:hover { transform: translateY(-2px); background: #f2c76f; }
.btn-lg { padding: 17px 34px; font-size: 17px; }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============================================================
   TOP NAV — About (top-right on every page)
   ============================================================ */
.topnav {
  position: fixed;
  top: clamp(18px, 3vh, 30px);
  right: clamp(18px, 4vw, 44px);
  z-index: 40;
  display: flex;
  gap: 26px;
}
.topnav a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.topnav a:hover, .topnav a.active { color: var(--ink); }
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.topnav a:hover::after, .topnav a.active::after { width: 100%; }

/* ============================================================
   INTRO — video de-zoom → hand off to the wordmark
   ============================================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease);
}
.intro.done { opacity: 0; pointer-events: none; }
.intro-frame {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition:
    left 1.25s var(--ease),
    top 1.25s var(--ease),
    width 1.25s var(--ease),
    height 1.25s var(--ease),
    border-radius 1.25s var(--ease),
    box-shadow 1.25s var(--ease);
}
.intro.collapse .intro-frame {
  border-radius: 12px;
  box-shadow: 0 34px 80px -34px #000, 0 0 0 1px var(--line-2);
}
.intro-zoom {
  position: absolute;
  inset: 0;
  transform: scale(1.6);
  transform-origin: center;
  transition: transform 2.8s var(--ease);
}
.intro.dezoom .intro-zoom { transform: scale(1); }
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* animated placeholder shown until videos/intro.mp4 exists */
.intro-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(232,185,90,0.22), transparent 70%),
    linear-gradient(135deg, #16130c, #0a0a0c 55%, #0d0c14);
  background-size: 160% 160%;
  animation: reelPan 10s ease-in-out infinite alternate;
}

/* ============================================================
   LANDING — only a button
   ============================================================ */
.landing {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}
.landing-grid-bg { display: none; }
.landing-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 42px;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.landing-inner.reveal-in { opacity: 1; }
.landing-brand .brand-mark { font-size: 40px; padding: 4px 14px; }
.landing-brand .brand-word { font-size: 26px; letter-spacing: 0.12em; }

/* each MEDIA letter keeps its identity but morphs case / font / weight */
.landing-brand .brand-word .ch {
  display: inline-block;
  width: 1.15em;          /* wide enough for the widest variant (bold/serif/italic M) */
  text-align: center;
  line-height: 1;
  overflow: visible;
  transition: opacity 0.05s var(--ease), transform 0.05s var(--ease), filter 0.05s var(--ease);
}
.landing-brand .brand-word .ch.ch-swap {
  opacity: 0.12;
  filter: blur(3px);
  transform: translateY(-3px) scale(0.86);
}

/* ============================================================
   PORTFOLIO
   ============================================================ */
.portfolio {
  position: relative;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(56px, 8vh, 76px) clamp(16px, 3.5vw, 48px) clamp(14px, 2.4vh, 22px);
  animation: fadeIn 0.55s var(--ease) both;
}
.brand-home {
  position: fixed;
  top: clamp(16px, 3vh, 28px);
  left: clamp(18px, 4vw, 44px);
  z-index: 40;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  transition: opacity 0.25s var(--ease);
}
.brand-home:hover { opacity: 0.8; }
.brand-home .brand-mark { font-size: 18px; }
.brand-home .brand-word { font-size: 13px; }

/* --- constellation: 3x3 grid, logo in the middle --- */
.constellation {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;            /* smaller overall footprint */
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(10px, 1.5vw, 20px);
}

/* every tile + the logo is one identical 16:9 cell (spans 2 of 6 cols) */
.grid .media,
.grid .media-logo { aspect-ratio: 16 / 9; }

/* --- slots: top & bottom pairs pulled to the centre, sides pushed out ---
   top/bottom tiles meet at the midpoint of the NS MEDIA square           */
.slot-0      { grid-column: 2 / 4; grid-row: 1; }   /* top-left    */
.slot-1      { grid-column: 4 / 6; grid-row: 1; }   /* top-right   */
.slot-2      { grid-column: 1 / 3; grid-row: 2; }   /* mid-left    */
.slot-center { grid-column: 3 / 5; grid-row: 2; }   /* NS MEDIA    */
.slot-3      { grid-column: 5 / 7; grid-row: 2; }   /* mid-right   */
.slot-4      { grid-column: 2 / 4; grid-row: 3; }   /* bottom-left */
.slot-5      { grid-column: 4 / 6; grid-row: 3; }   /* bottom-right*/

/* --- media rectangle --- */
.media {
  display: block;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, #101015), #0d0d11);
  border: 1px solid var(--line-2);
  box-shadow: 0 22px 50px -30px #000;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: mediaIn 0.6s var(--ease) forwards;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.media:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 30px 60px -28px #000, 0 0 0 1px var(--accent);
}
.media-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}
/* animated "fictif" showreel — shown until a real .mp4 is dropped in */
.media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 60%, #0c0c10) 0%,
      #0c0c10 48%,
      color-mix(in srgb, var(--accent) 32%, #000) 100%);
  background-size: 220% 220%;
  animation: reelPan 9s ease-in-out infinite alternate;
  animation-delay: calc(var(--delay, 0ms) * -6);
}
/* diagonal light sweep, like a playing clip */
.media-fallback::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.14) 50%, transparent 60%);
  animation: reelSweep 5.5s linear infinite;
  animation-delay: calc(var(--delay, 0ms) * -3);
}
.reel-tag {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  padding: 4px 12px 4px 24px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
/* pulsing "recording" dot inside the tag */
.reel-tag::before {
  content: "";
  position: absolute;
  left: 11px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: reelBlink 1.6s ease-in-out infinite;
}
/* readability scrim behind the labels */
.media::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 58%;
  background: linear-gradient(to top, rgba(0,0,0,0.82), transparent);
  pointer-events: none;
  z-index: 2;
}
.media-vert {
  position: absolute;
  top: 12px; left: 14px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* meta row: name+domain bottom-left, followers bottom-right */
.media-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(12px, 1.6vw, 18px);
}
.media-meta-left { min-width: 0; }
.media-name {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(17px, 1.9vw, 23px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}
.media-domain {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-meta-right { text-align: right; flex: none; display: flex; align-items: center; gap: 7px; }
.media-open {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.media-open-arrow {
  font-size: 14px;
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}
.media:hover .media-open-arrow { transform: translateX(4px); }

/* --- center logo cell --- */
.media-logo {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(11px, 1.3vw, 16px);
  min-height: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(232,185,90,0.12), transparent), #0b0b0e;
  border: 1px solid rgba(232,185,90,0.45);
  box-shadow: 0 0 0 6px rgba(232,185,90,0.05), 0 24px 60px -24px #000;
}
.media-logo .brand-mark { font-size: clamp(22px, 3vw, 34px); padding: 3px 12px; }
.media-logo .brand-word { font-size: clamp(15px, 1.9vw, 22px); }

/* ---------- responsive: stack into a single column ---------- */
@media (max-width: 820px) {
  /* too many tiles for one phone screen — allow normal scrolling here */
  .portfolio { height: auto; min-height: 100svh; overflow: visible; }
  .grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  /* drop the fixed constellation slots — just stack in order */
  .slot-0, .slot-1, .slot-2, .slot-3, .slot-4, .slot-5, .slot-center {
    grid-column: auto;
    grid-row: auto;
  }
  .media, .media-logo { aspect-ratio: 16 / 9; min-height: 0; }
}

/* ============================================================
   ABOUT / CONTACT PAGES
   ============================================================ */
.page {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(90px, 14vh, 130px) clamp(20px, 6vw, 60px) clamp(48px, 8vh, 80px);
}
.page-inner {
  width: 100%;
  max-width: 620px;
  animation: fadeUp 0.6s var(--ease) both;
}
.page-brand { margin-bottom: 30px; }
.page-brand .brand-mark { font-size: 20px; }
.page-brand .brand-word { font-size: 14px; }
.page-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.page-lead {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mediaIn { to { opacity: 1; transform: none; } }
@keyframes reelPan { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes reelSweep { 0% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
@keyframes reelBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ============================================================
   ABOUT — founders / team
   ============================================================ */
.about-team {
  margin-top: clamp(30px, 5vh, 46px);
  padding-top: clamp(22px, 3vh, 30px);
  border-top: 1px solid var(--line);
}
.about-team-label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.founders { display: flex; flex-wrap: wrap; gap: 18px 48px; }
.founder { display: flex; flex-direction: column; }
.founder-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.founder-role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
}

/* ============================================================
   CASE STUDY — a study's full set of demo clips (rows of videos)
   ============================================================ */
.case {
  position: relative;
  min-height: 100svh;
  padding: clamp(72px, 11vh, 104px) clamp(16px, 5vw, 60px) clamp(48px, 8vh, 80px);
  animation: fadeIn 0.5s var(--ease) both;
}
.case-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s, gap 0.25s var(--ease);
  margin-bottom: 26px;
}
.case-back:hover { color: var(--ink); gap: 12px; }
.case-head { margin-bottom: clamp(26px, 4vh, 40px); }
.case-head .page-title { margin-bottom: 10px; }
/* headline stats block */
.case-stats { margin-top: 4px; }
.case-bignums {
  display: flex;
  gap: clamp(16px, 2.5vw, 28px);
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2.5vh, 22px);
}
.bignum { display: flex; align-items: baseline; gap: 7px; }
.bignum-v {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.bignum-l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.case-breakdown { display: flex; flex-direction: column; gap: 12px; }
.stat-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stat-row-label {
  min-width: 112px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 13px;
}
.chip b { font-weight: 600; margin-right: 5px; color: var(--ink); }
.chip-pos b { color: #6fe0a6; }
.chip-neg b { color: #e2896f; }
.chip-neu b { color: var(--ink-soft); }
.case-stat-empty {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* rows of landscape clips (1920×1080) — same tile size as the portfolio */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 273px));
  justify-content: center;
  gap: clamp(12px, 1.6vw, 20px);
}
.demo {
  position: relative;
  aspect-ratio: 16 / 9;      /* 1920 × 1080 */
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), #0d0d11);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -26px #000;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  animation: mediaIn 0.5s var(--ease) forwards;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.demo:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 26px 54px -26px #000, 0 0 0 1px var(--accent);
}
.demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}

@media (max-width: 560px) {
  .demo-grid { grid-template-columns: 1fr; }
}
