/* =========================================================
   MA MEDIA — Direction B: Cel-Print / 90s OVA Pivot
   Brand palette in dark mode: ink · paper · crimson.
   Misregistration shadow uses crimson only.
   ========================================================= */

:root {
  --bg: var(--ink);
  --bg-2: var(--ink-95);
  --fg: var(--paper);
  --fg-dim: var(--fg-on-ink-2);
  --fg-dimmer: var(--fg-on-ink-3);
  --hud-line: rgba(245, 243, 239, 0.16);
}

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* CRT scanline overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 2px,
    rgba(0, 0, 0, 0.18) 2px, rgba(0, 0, 0, 0.18) 3px
  );
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
  opacity: 0.7;
}

/* --- preview nav --- */
.preview-nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  z-index: 100; overflow-x: auto;
}
.preview-nav__links { display: flex; gap: 14px; }
.preview-nav a { color: var(--ink); text-decoration: none; opacity: 0.55; white-space: nowrap; }
.preview-nav a:hover, .preview-nav a[aria-current] { opacity: 1; color: var(--accent); }
.preview-nav__label { opacity: 0.55; white-space: nowrap; padding-right: 16px; }

.page { padding-top: 42px; }

/* --- HUD chrome --- */
.hud-top, .hud-bottom {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 24px; align-items: center;
  padding: 14px 5vw;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--hud-line);
}
.hud-bottom { border-bottom: none; border-top: 1px solid var(--hud-line); }
.hud-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hud-dot--cyan { background: var(--paper); box-shadow: 0 0 8px var(--paper); }
.hud-key { color: var(--fg); font-weight: 600; }
.hud-bar { position: relative; height: 6px; background: rgba(245,243,239,0.08); overflow: hidden; min-width: 120px; }
.hud-bar::after {
  content: ""; position: absolute; inset: 0;
  width: 78%; background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

/* --- HERO --- */
.cp-hero {
  position: relative;
  padding: clamp(40px, 9vw, 110px) 5vw clamp(50px, 9vw, 110px);
  min-height: 78vh;
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center; gap: 24px;
}
.cp-edge {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-align: center;
  border-left: 1px solid var(--hud-line);
  padding-left: 8px;
}
.cp-edge--right { border-left: none; border-right: 1px solid var(--hud-line); padding-left: 0; padding-right: 8px; }
.cp-edge span { color: var(--accent); }

.cp-hero__stage { position: relative; text-align: center; }
.cp-hero__overline {
  display: inline-flex; gap: 14px; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 18px;
}
.cp-hero__overline::before, .cp-hero__overline::after {
  content: ""; width: 36px; height: 1px; background: var(--fg-dim);
}

.cp-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(54px, 11vw, 180px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
  position: relative;
  color: var(--fg);
  text-shadow:
    -3px 0 0 var(--accent),
     3px 0 0 var(--accent);
}
.cp-hero__title-line { display: block; }
.cp-hero__title-line--small {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.46em; letter-spacing: 0.04em;
  color: var(--fg-dim);
  text-shadow: none;
  text-transform: uppercase;
}

.cp-hero__lede {
  margin: 26px auto 0;
  max-width: 56ch;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px; line-height: 1.7;
  color: var(--fg-dim);
}
.cp-hero__lede strong { color: var(--accent); font-weight: 600; }

.cp-hero__serial {
  margin-top: 38px;
  display: flex; justify-content: center; gap: 24px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--fg-dim);
  flex-wrap: wrap;
}
.cp-hero__serial span em { color: var(--accent); font-style: normal; }

/* Frame corners */
.cp-frame { position: absolute; inset: 14px; pointer-events: none; }
.cp-frame::before, .cp-frame::after,
.cp-frame > span::before, .cp-frame > span::after {
  content: ""; position: absolute; width: 28px; height: 28px;
  border: 1.4px solid var(--fg-dim);
}
.cp-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.cp-frame::after { top: 0; right: 0; border-left: none; border-bottom: none; }
.cp-frame > span { position: absolute; inset: 0; }
.cp-frame > span::before { bottom: 0; left: 0; border-right: none; border-top: none; }
.cp-frame > span::after { bottom: 0; right: 0; border-left: none; border-top: none; }

/* --- VIDEO PANEL --- */
.cp-vid { padding: clamp(30px, 6vw, 60px) 5vw; display: grid; place-items: center; }
.cp-vid__inner {
  position: relative;
  width: min(960px, 100%);
  padding: 18px;
  border: 1.4px solid var(--fg);
  background: rgba(245, 243, 239, 0.04);
}
.cp-vid__inner::before, .cp-vid__inner::after {
  content: "";
  position: absolute;
  background: var(--accent);
  width: 14px; height: 14px;
  box-shadow: 0 0 10px var(--accent);
}
.cp-vid__inner::before { top: -8px; left: -8px; }
.cp-vid__inner::after { bottom: -8px; right: -8px; background: var(--paper); box-shadow: 0 0 10px var(--paper); }

.cp-vid__hud {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 12px;
}
.cp-vid__hud .live { color: var(--accent); }
.cp-vid video { width: 100%; height: auto; display: block; filter: contrast(1.06) saturate(1.05); }
.cp-vid__footer {
  display: flex; justify-content: space-between;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--fg-dim);
}

/* --- GLITCH CUT --- */
.cp-cut {
  position: relative;
  padding: 32px 5vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px; align-items: center;
  border-top: 1px solid var(--hud-line);
  border-bottom: 1px solid var(--hud-line);
  background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(245,243,239,0.04) 14px 15px);
}
.cp-cut__rule { height: 1px; background: var(--fg-dim); position: relative; }
.cp-cut__rule::after {
  content: ""; position: absolute; right: 0; top: -4px;
  width: 9px; height: 9px; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.cp-cut__label {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg);
  text-shadow: -2px 0 0 var(--accent), 2px 0 0 var(--accent);
  white-space: nowrap;
}

/* --- BRIEF --- */
.cp-brief {
  padding: clamp(60px, 10vw, 120px) 5vw;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(30px, 5vw, 80px);
  position: relative;
}

.cp-brief__sidebar {
  position: relative;
  padding-right: 20px;
  border-right: 1px solid var(--hud-line);
}
.cp-brief__sidebar-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(80px, 12vw, 160px);
  line-height: 0.85; letter-spacing: -0.04em;
  color: var(--fg);
  margin: 0 0 16px;
  text-shadow: -3px 0 0 var(--accent), 3px 0 0 var(--accent);
}
.cp-brief__sidebar-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--fg-dim);
}
.cp-brief__sidebar-label span { color: var(--accent); display: block; margin-top: 6px; }

.cp-brief__body { display: flex; flex-direction: column; gap: 28px; }
.cp-brief__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0;
}
.cp-brief__title span {
  color: var(--accent);
  text-shadow: 2px 0 0 var(--fg);
}
.cp-brief__prose {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px; line-height: 1.75;
  color: var(--fg-dim);
  max-width: 64ch;
}
.cp-brief__prose strong { color: var(--fg); font-weight: 500; border-bottom: 1.4px solid var(--accent); padding-bottom: 1px; }
.cp-brief__prose em { color: var(--accent); font-style: italic; }

.cp-brief__list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px;
}
.cp-brief__list li {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-dim);
  padding: 10px 0;
  border-top: 1px solid var(--hud-line);
}
.cp-brief__list li b { color: var(--accent); font-weight: 600; }

/* --- FOOTER --- */
.cp-footer {
  position: relative;
  padding: 80px 5vw 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: end;
  border-top: 1px solid var(--hud-line);
}
.cp-footer__big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(90px, 16vw, 240px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--fg);
  text-shadow: -4px 0 0 var(--accent), 4px 0 0 var(--accent);
}
.cp-footer__meta {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-dim);
  line-height: 2; text-align: right;
}
.cp-footer__meta strong { color: var(--accent); font-weight: 600; }

/* RTL */
[dir="rtl"] body { font-family: var(--font-arabic); }

@media (max-width: 900px) {
  .cp-hero { grid-template-columns: 1fr; }
  .cp-edge { display: none; }
  .cp-brief { grid-template-columns: 1fr; }
  .cp-brief__sidebar { border-right: none; border-bottom: 1px solid var(--hud-line); padding-bottom: 18px; }
  .cp-brief__list { grid-template-columns: 1fr; }
  .cp-cut { grid-template-columns: 1fr; text-align: center; }
  .cp-cut__rule { display: none; }
  .cp-footer { grid-template-columns: 1fr; }
  .cp-footer__meta { text-align: left; }
  .hud-top, .hud-bottom { grid-template-columns: 1fr 1fr; gap: 12px; }
}
