/* ============================================================
   BASE.CSS
   Design tokens, resets, typography, utilities, global overlays.
   Mobile-first: defaults are mobile, scaled up via min-width MQ.
   ============================================================ */

:root{
  /* Colour tokens */
  --bone:        #F5F5EF;
  --bone-deep:   #EAEAE3;
  --paper:       #FAFAF4;
  --ink:         #000000;
  --ink-soft:    #262626;
  --ash:         #6F6C64;
  --orange:      #E6450D;
  --orange-deep: #B8370A;
  --orange-soft: #F08F6E;
  --rule:        rgba(0,0,0,.14);
  --rule-strong: rgba(0,0,0,.45);

  /* Typography */
  --display:  "Bricolage Grotesque", "Helvetica Neue", sans-serif;
  --tall:     "Anton", "Helvetica Neue", sans-serif;
  --body:     "Space Grotesk", system-ui, sans-serif;
  --mono:     "JetBrains Mono", ui-monospace, monospace;
  --hindi:    "Tiro Devanagari Hindi", serif;

  /* Type scale — every heading / text size on the site maps to one of these */
  --fs-hero:    clamp(34px, 6.2vw, 96px);
  --fs-h2:      clamp(32px, 5.6vw, 80px);
  --fs-h3:      clamp(26px, 3vw, 44px);
  --fs-h4:      clamp(18px, 1.6vw, 22px);
  --fs-lead:    clamp(18px, 1.8vw, 24px);
  --fs-body:    clamp(15px, 1.2vw, 17px);
  --fs-small:   14px;
  --fs-caption: 11px;
  --fs-btn:     12px;

  /* Spatial */
  --pad: clamp(18px, 4vw, 56px);
  --max: 1480px;
  /* Horizontal section padding: never less than --pad, and caps content at --max */
  --gutter: max(var(--pad), calc((100% - var(--max)) / 2));
  --section-y: clamp(36px, 4.5vw, 64px);
  --head-gap:  clamp(32px, 4vw, 56px);
  --gap:       clamp(16px, 2vw, 24px);

  /* Components */
  --btn-h:       52px;
  --btn-h-sm:    44px;
  --btn-px:      24px;
  --field-h:     48px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-pill: 999px;

  /* Easings */
  --ease:        cubic-bezier(.2, .7, .2, 1);
  --ease-io:     cubic-bezier(.7, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ───── RESET ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { background: var(--bone); color: var(--ink); }
body {
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: hidden;
  /* Mobile-first: native cursor; desktop adds custom cursor below */
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button {
  font: inherit; color: inherit;
  background: none; border: 0;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--orange); color: var(--paper); }

/* ───── GRAIN OVERLAY ───── */
.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .12;
  mix-blend-mode: multiply;
}

/* ───── SCROLL PROGRESS ───── */
.progress{
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--orange); z-index: 100;
  transition: width .08s linear;
}

/* ───── CUSTOM CURSOR (desktop only — see responsive.css) ───── */
.cursor, .cursor-trail{
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 95;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  display: none; /* hidden by default; shown on desktop hover-capable devices */
}
.cursor{
  width: 10px; height: 10px; background: #fff;
  transition: width .25s var(--ease), height .25s var(--ease);
}
.cursor-trail{
  width: 38px; height: 38px;
  border: 1.5px solid #fff;
  transition: width .25s var(--ease), height .25s var(--ease);
}
.cursor-trail::after{
  content: attr(data-label);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; transition: opacity .2s;
}

/* ───── SECTION INDEX TICKER (top-right, desktop only) ───── */
.section-tick{
  position: fixed; top: 88px; right: var(--pad); z-index: 70;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ash);
  display: none;  /* shown on desktop via responsive.css */
  align-items: center; gap: 10px;
  opacity: 0; transition: opacity .4s;
}
.section-tick.show{ opacity: 1; }
.section-tick .num{
  background: var(--ink); color: var(--paper);
  padding: 4px 8px; border-radius: 4px; font-weight: 500;
}

/* ───── TYPE HELPERS ───── */
.display{
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "opsz" 96, "wdth" 100;
  line-height: .9;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.tall{
  font-family: var(--tall);
  font-weight: 400;
  line-height: .85;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.hindi{
  font-family: var(--hindi);
  color: var(--orange);
  font-weight: 400;
}
.eyebrow{
  font-family: var(--mono);
  font-size: var(--fs-caption);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before{
  content: ""; width: 8px; height: 8px; border-radius: 999px;
  background: var(--orange);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{
  0%   { box-shadow: 0 0 0 0 rgba(230,69,13,.6); }
  70%  { box-shadow: 0 0 0 10px rgba(230,69,13,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,69,13,0); }
}

/* ───── REVEAL ANIMATIONS ───── */
.reveal{ overflow: hidden; }
.reveal > .line{
  display: block;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform;
}
.reveal.in > .line{
  transform: translateY(0); opacity: 1;
  transition: transform 1s var(--ease), opacity 1s var(--ease);
}
.reveal.in > .line:nth-child(2){ transition-delay: .07s; }
.reveal.in > .line:nth-child(3){ transition-delay: .14s; }
.reveal.in > .line:nth-child(4){ transition-delay: .21s; }
.fade-up{
  opacity: 0; transform: translateY(20px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.fade-up.in{ opacity: 1; transform: none; }

/* ───── ROTATING EST BADGE ───── */
.est-badge{
  width: 110px; height: 110px;
  position: relative;
  flex-shrink: 0;
}
.est-badge svg{
  width: 100%; height: 100%;
  animation: spin 14s linear infinite;
}
.est-badge .center{
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--ink);
}
.est-badge .center svg{ width: 28px; height: 28px; animation: none; }
@keyframes spin{ to { transform: rotate(360deg); } }

/* ───── PRELOADER ───── */
.preload{
  position: fixed; inset: 0; z-index: 110;
  background: var(--bone);
  display: grid; place-items: center;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.preload.done{ opacity: 0; visibility: hidden; }
.preload .pl-inner{
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 0 24px;
}
.preload .pl-mark{
  display: flex; align-items: center; justify-content: center;
}
.preload .pl-mark .pl-logo{
  height: auto;
  width: clamp(180px, 46vw, 320px);
  display: block;
}
.preload .pl-bar{
  width: min(240px, 70vw); height: 2px; background: var(--rule);
  position: relative; overflow: hidden;
}
.preload .pl-bar::after{
  content: ""; position: absolute; left: 0; top: 0; height: 100%;
  background: var(--orange); width: 0%;
  animation: plBar 1.4s var(--ease) forwards;
}
@keyframes plBar{ to { width: 100%; } }
.preload .pl-pct{
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ash);
}

/* ───── MAGNETIC HELPER ───── */
.magnet{ display: inline-block; transition: transform .4s var(--ease); }

/* ───── REDUCED MOTION ───── */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .cursor, .cursor-trail{ display: none !important; }
}
