/* fluid-unit base (frozen above 1440px) */
:root{--vw:1vw}
@media (min-width:1440px){:root{--vw:14.4px}}
/* ============================================================
   MERIDIAN — Premium Digital Agency
   Design system & global styles
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Color */
  --paper:    #f3f2ee;   /* warm off-white */
  --paper-2:  #eae8e2;   /* slightly deeper paper */
  --ink:      #0b0b0c;   /* charcoal black */
  --ink-2:    #141417;   /* graphite */
  --ink-3:    #1f1f23;   /* raised graphite */
  --grey:     #6c6c70;   /* soft grey text */
  --grey-2:   #9a9a9d;
  --line:     rgba(11,11,12,0.12);
  --line-2:   rgba(11,11,12,0.07);
  --line-d:   rgba(243,242,238,0.14); /* on dark */
  --line-d2:  rgba(243,242,238,0.07);
  --accent:   #e5402e;   /* controlled red */
  --accent-d: #c5301f;

  /* Type */
  --sans: "Helvetica Neue", "Helvetica", "Arial Nova", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing / layout */
  --maxw: 1440px;
  --gut:  clamp(20px, calc(5*var(--vw)), 80px);
  --sect: clamp(80px, 12vh, 180px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; background: #070708; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   TYPE SCALE
   ============================================================ */
.display {
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-size: clamp(40px, calc(7*var(--vw)), 116px);
  text-wrap: balance;
}
.h1 { font-weight: 700; line-height: 0.98; letter-spacing: -0.03em; font-size: clamp(36px, calc(6*var(--vw)), 88px); text-wrap: balance; }
.h2 { font-weight: 700; line-height: 1.02; letter-spacing: -0.025em; font-size: clamp(30px, calc(4.4*var(--vw)), 60px); text-wrap: balance; }
.h3 { font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; font-size: clamp(22px, calc(2.6*var(--vw)), 34px); }
.lead { font-size: clamp(18px, calc(1.9*var(--vw)), 24px); line-height: 1.45; letter-spacing: -0.01em; color: var(--grey); text-wrap: pretty; }
.body { font-size: 16px; line-height: 1.6; color: var(--grey); text-wrap: pretty; }

/* mono eyebrow / label */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex: none;
}
.eyebrow.no-dot::before { display: none; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.section { padding-block: var(--sect); position: relative; }
.dark { background: var(--ink); color: var(--paper); }
.dark .lead, .dark .body { color: var(--grey-2); }
.dark .eyebrow { color: var(--grey-2); }
.darker { background: #070708; color: var(--paper); }
.rule { height: 1px; background: var(--line); border: 0; }
.dark .rule { background: var(--line-d); }

/* section header pattern */
.sec-head { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 920px; }
.sec-head .h2 { margin-top: 6px; }

/* index numbering */
.idx { font-family: var(--mono); font-size: 12px; color: var(--grey); letter-spacing: 0.1em; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px;
  background: var(--bg); color: var(--fg);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  border-radius: 100px;
  overflow: hidden; isolation: isolate;
  transition: transform 0.5s var(--ease), color 0.4s var(--ease);
  white-space: nowrap;
}
.btn .btn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; transition: transform 0.5s var(--ease); }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}
.btn:hover::after { transform: translateY(0); }
.btn:hover { color: #fff; }
.btn:hover .btn-dot { transform: scale(0); }
.btn:active { transform: scale(0.97); }

.btn.accent { --bg: var(--accent); --fg: #fff; }
.btn.accent .btn-dot { background: #fff; }
.btn.accent::after { background: var(--ink); }
.btn.accent:hover { color: var(--paper); }

.btn.ghost { --bg: transparent; --fg: var(--ink); border: 1px solid var(--line); }
.dark .btn.ghost { --fg: var(--paper); border-color: var(--line-d); }
.btn.ghost::after { background: var(--ink); }
.dark .btn.ghost::after { background: var(--paper); }
.dark .btn.ghost:hover { color: var(--ink); }
.btn.ghost:hover { color: var(--paper); }
.btn.ghost .btn-dot { background: var(--accent); }

.btn.lg { padding: 19px 32px; font-size: 16px; }

/* arrow link */
.alink {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  position: relative; padding-bottom: 3px;
}
.alink .arr { transition: transform 0.4s var(--ease); }
.alink::after { content:""; position:absolute; left:0; bottom:0; width:100%; height:1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease); opacity: 0.45; }
.alink:hover::after { transform: scaleX(1); transform-origin: left; }
.alink:hover .arr { transform: translate(4px, -4px); }

/* ============================================================
   REVEAL ANIMATIONS (keyframe-based, gated on live timeline)
   Base state is VISIBLE. Hiding only activates under .js-reveal,
   which JS adds ONLY when the animation timeline is confirmed live.
   ============================================================ */
@keyframes om-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes om-line { from { transform: translateY(110%); } to { transform: none; } }

.js-reveal [data-reveal]:not(.in) { opacity: 0; transform: translateY(26px); }
.js-reveal [data-reveal].in { animation: om-rise 0.9s var(--ease) both; }
.js-reveal [data-reveal-delay="1"].in { animation-delay: 0.08s; }
.js-reveal [data-reveal-delay="2"].in { animation-delay: 0.16s; }
.js-reveal [data-reveal-delay="3"].in { animation-delay: 0.24s; }
.js-reveal [data-reveal-delay="4"].in { animation-delay: 0.32s; }
.js-reveal [data-reveal-delay="5"].in { animation-delay: 0.40s; }

/* line-by-line text reveal */
.reveal-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.reveal-line > span { display: block; }
.js-reveal .reveal-line:not(.in) > span { transform: translateY(110%); }
.js-reveal .reveal-line.in > span { animation: om-line 1s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .js-reveal [data-reveal]:not(.in) { opacity: 1; transform: none; }
  .js-reveal .reveal-line:not(.in) > span { transform: none; }
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor { position: fixed; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); pointer-events: none; z-index: 9999; transform: translate(-50%,-50%); transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s; mix-blend-mode: normal; }
.cursor.big { width: 56px; height: 56px; background: rgba(229,64,46,0.12); border: 1px solid var(--accent); }
@media (pointer: coarse) { .cursor { display: none; } }
