/* ============================================================
   MIO MEDIA — Case Study
   Cinematic dark editorial. Charcoal + cream, Barlow Condensed.
   The structural signature is the edit-bay timecode marker.
   ============================================================ */

/* ---------- Design tokens (locked) ---------- */
:root {
  --ink: #0f0f0f;
  --charcoal: #1c1c1c;
  --surface: #262626;
  --surface-2: #2c2c2c;
  --cream: #f0ead6;
  --white: #ffffff;
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.58);
  --hairline: rgba(255, 255, 255, 0.08);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --fs-hero: clamp(56px, 11vw, 150px);
  --fs-h2: clamp(40px, 6vw, 92px);
  --fs-h3: clamp(24px, 3vw, 40px);
  --fs-lead: clamp(18px, 2vw, 23px);
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --section-pad: clamp(5rem, 11vw, 9rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; scroll-padding-top: 6rem; }
body { background: var(--charcoal); color: var(--text); font-family: var(--body); font-weight: 300; line-height: 1.6; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 0.9; letter-spacing: -0.02em; color: var(--white); }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section.wrap { padding-block: var(--section-pad); position: relative; z-index: 2; }
.accent { color: var(--cream); }
em { font-style: italic; color: var(--cream); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal[data-delay="1"] { transition-delay: 0.06s; }
.reveal[data-delay="2"] { transition-delay: 0.12s; }
.reveal[data-delay="3"] { transition-delay: 0.18s; }
.reveal[data-delay="4"] { transition-delay: 0.24s; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation: none !important; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  background: var(--cream);
  color: var(--ink);
  padding: 10px 18px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Atmosphere ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(120px); }
.ambient .glow-1 {
  width: 44vw; height: 44vw;
  top: -16vw; right: -10vw;
  background: radial-gradient(circle, rgba(240, 234, 214, 0.10), transparent 65%);
  animation: drift1 26s var(--ease-out) infinite alternate;
}
.ambient .glow-2 {
  width: 38vw; height: 38vw;
  bottom: -14vw; left: -12vw;
  background: radial-gradient(circle, rgba(240, 234, 214, 0.055), transparent 68%);
  animation: drift2 30s var(--ease-out) infinite alternate;
}
.ambient .grid-fade {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 5%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 5%, transparent 70%);
  opacity: 0.6;
}
@keyframes drift1 { to { transform: translate(-5vw, 4vw) scale(1.1); } }
@keyframes drift2 { to { transform: translate(4vw, -3vw) scale(1.12); } }

/* ---------- Eyebrow (leading-rule label — MIO signature) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cream);
}
.eyebrow::before {
  content: "";
  width: 40px; height: 1px;
  background: var(--cream);
  opacity: 0.55;
}

/* ---------- Timecode marker (the edit-bay structural device) ---------- */
.timecode {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.4rem;
}

/* ---------- Section heads ---------- */
.section-head { max-width: 18ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 {
  font-size: var(--fs-h2);
  max-width: 14ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.15em 2.1em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: gap 0.35s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s, transform 0.35s var(--ease-out);
}
.btn svg { width: 1.15em; height: 1.15em; transition: transform 0.35s var(--ease-out); }
.btn-primary {
  background: var(--cream);
  color: var(--ink);
}
.btn-primary:hover { background: var(--white); gap: 22px; }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--hairline);
}
.btn-ghost:hover { color: var(--cream); border-color: var(--cream); gap: 22px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: padding 0.4s var(--ease-out), background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
.nav.scrolled {
  padding-block: 0.8rem;
  background: rgba(20, 20, 20, 0.78);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom-color: var(--hairline);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65em;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
}
.brand-tag {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
}
.nav-links { display: flex; align-items: center; gap: 2.2rem; }
.nav-links > a:not(.btn) {
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}
.nav-links > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -7px;
  width: 100%; height: 1px;
  background: var(--cream);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav-links > a:not(.btn):hover { color: var(--white); }
.nav-links > a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }
.nav-btn { padding: 0.85em 1.4em; }
.nav-cta-only { display: none; padding: 0.8em 1.4em; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 8rem;
  padding-bottom: 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
}
.hero .eyebrow { margin-bottom: 2rem; }
.hero h1 {
  font-size: var(--fs-hero);
  max-width: 11ch;
}
.hero-sub {
  margin-top: 2rem;
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 44ch;
  font-weight: 300;
}
.hero-cta {
  margin-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-meta {
  margin-top: 3.4rem;
  display: flex;
  gap: clamp(1.5rem, 4vw, 3.2rem);
  flex-wrap: wrap;
}
.hero-meta .stat { display: flex; flex-direction: column; }
.hero-meta dt {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--white);
}
.hero-meta dd {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Hero browser / showreel mock (signature) ---------- */
.showreel-stage {
  position: relative;
  display: grid;
  place-items: center;
}
.browser {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow:
    0 50px 90px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: floaty 8s var(--ease-out) infinite alternate;
}
@keyframes floaty { to { transform: translateY(-12px); } }
.browser-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.browser-bar .dots { display: inline-flex; gap: 7px; }
.browser-bar .dots i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.browser-bar .url {
  font-family: var(--body);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--charcoal);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 0.35em 1em;
  flex: 1;
  text-align: center;
}
.browser-view {
  position: relative;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(240, 234, 214, 0.08), transparent 60%),
    linear-gradient(180deg, #161616, var(--ink));
}
.view-eyebrow {
  position: absolute;
  top: clamp(1.4rem, 3vw, 2rem);
  left: clamp(1.8rem, 4vw, 2.8rem);
  font-family: var(--body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.view-head {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--white);
}
.play {
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 0.5em 1.1em 0.5em 0.55em;
  color: var(--text);
  cursor: default;
}
.play svg {
  width: 28px; height: 28px;
  padding: 6px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
}
.play span {
  font-family: var(--body);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.timestrip {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.timestrip .tc {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.timestrip .track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--hairline);
  border-radius: 2px;
}
.timestrip .track i {
  position: absolute;
  inset: 0 65% 0 0;
  background: var(--cream);
  border-radius: 2px;
}
.float-chip {
  position: absolute;
  z-index: 3;
  font-family: var(--body);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(38, 38, 38, 0.85);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 0.6em 1.1em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}
.float-chip.chip-1 { top: 6%; left: -8%; animation: bob 6s ease-in-out infinite; }
.float-chip.chip-2 { bottom: 10%; right: -6%; animation: bob 6.6s ease-in-out infinite 0.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Brief ---------- */
.brief-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 900px;
}
.brief-body p {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  font-weight: 300;
}

/* ---------- Craft ---------- */
.craft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.5rem);
}
.craft-card {
  position: relative;
  padding: clamp(1.8rem, 3vw, 2.6rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: transform 0.5s var(--ease-out), border-color 0.4s, background 0.4s;
}
.craft-card:hover {
  transform: translateY(-6px);
  border-color: rgba(240, 234, 214, 0.4);
  background: var(--surface-2);
}
.card-mark {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--cream);
  opacity: 0.85;
  margin-bottom: 1.5rem;
}
.craft-card h3 {
  font-size: var(--fs-h3);
  font-weight: 800;
  margin-bottom: 0.9rem;
}
.craft-card p {
  color: var(--text-muted);
  font-size: 1rem;
}
.craft-card code,
.arch-note code,
.brief-body code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.85em;
  color: var(--cream);
  background: rgba(240, 234, 214, 0.08);
  padding: 0.1em 0.45em;
  border-radius: 5px;
}

/* ---------- Architecture ---------- */
.arch-stage {
  padding: clamp(1.8rem, 4vw, 3rem);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 120% at 50% -10%, rgba(240, 234, 214, 0.06), transparent 60%),
    var(--surface);
  border: 1px solid var(--hairline);
}
.arch-flow {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 0;
  counter-reset: none;
}
.arch-node {
  position: relative;
  flex: 1;
  padding: 1.5rem 1.4rem 1.5rem 0;
  border-top: 1px solid var(--hairline);
}
.arch-node::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cream);
  transform: translateY(-50%);
}
.arch-node:not(:last-child)::after {
  /* connector arrow toward the next node */
  content: "→";
  position: absolute;
  top: 1.4rem; right: 0.8rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
}
.node-step {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--cream);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
.arch-node h4 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
  color: var(--white);
  margin: 0.6rem 0 0.5rem;
  line-height: 1;
}
.arch-node p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.arch-note {
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 70ch;
}

/* ---------- Quality ---------- */
.quality-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.5rem);
}
.quality-card {
  padding: clamp(1.5rem, 2.6vw, 2.2rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: transform 0.5s var(--ease-out), border-color 0.4s;
}
.quality-card:hover { transform: translateY(-5px); border-color: rgba(240, 234, 214, 0.35); }
.quality-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}
.quality-card p { color: var(--text-muted); font-size: 0.95rem; }
.quality-caption {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 58ch;
  font-style: italic;
}
.quality-caption::before {
  content: "";
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--cream);
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 1rem;
}

/* ---------- CTA ---------- */
.cta-card {
  position: relative;
  text-align: center;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 140% at 50% 0%, rgba(240, 234, 214, 0.1), transparent 60%),
    var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.cta-card h2 {
  font-size: var(--fs-h2);
  max-width: 16ch;
  margin-inline: auto;
}
.cta-card p {
  margin: 1.4rem auto 2.6rem;
  color: var(--text-muted);
  max-width: 52ch;
  font-size: var(--fs-lead);
  font-weight: 300;
}
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 2.6rem var(--gutter) 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-footer a:hover { color: var(--cream); }
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .arch-flow { flex-direction: column; }
  .arch-node {
    padding: 1.4rem 0 1.4rem 1.6rem;
    border-top: none;
    border-left: 1px solid var(--hairline);
  }
  .arch-node::before { top: 1.4rem; left: 0; transform: translate(-50%, 0); }
  .arch-node:not(:last-child)::after {
    content: "↓";
    top: auto; bottom: 0.4rem; right: auto; left: -0.65rem;
  }
}

@media (max-width: 860px) {
  .hero { min-height: auto; padding-top: 7.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .showreel-stage { order: -1; }
  .brief-body { grid-template-columns: 1fr; }
  .craft-grid { grid-template-columns: 1fr; }
  .quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-cta-only { display: inline-flex; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .quality-grid { grid-template-columns: 1fr; }
  .float-chip.chip-1 { left: 0; }
  .float-chip.chip-2 { right: 0; }
  .site-footer { flex-direction: column; text-align: center; justify-content: center; }
}
