/* ==========================================================================
   Makwana Corporate — Global base
   Reset · typography · layout primitives · utilities · motion
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-compact) + 16px);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--muted);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

::selection { background: var(--primary-100); color: var(--primary-dark); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

h1, .h1 { font-size: var(--fs-h1); font-weight: var(--fw-heavy); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); }
h2, .h2 { font-size: var(--fs-h2); font-weight: var(--fw-heavy); letter-spacing: var(--tracking-tight); }
h3, .h3 { font-size: var(--fs-h3); }
h4, .h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); }
h5, .h5 { font-size: 1rem; font-weight: var(--fw-semibold); }

.display {
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  font-weight: var(--fw-heavy);
  line-height: 1.04;
  letter-spacing: -0.032em;
  color: var(--ink);
  text-wrap: balance;
}

p { text-wrap: pretty; }
p + p { margin-top: 1em; }

.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); }
.small, small { font-size: var(--fs-small); }
.xs { font-size: var(--fs-xs); }
strong, b { font-weight: var(--fw-semibold); color: var(--ink); }

.measure { max-width: var(--measure); }
.measure-narrow { max-width: var(--measure-narrow); }

/* Rich text (legal pages, articles) */
.prose { max-width: 72ch; color: var(--muted); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-h3); margin-top: 2.2em; }
.prose h3 { font-size: var(--fs-h4); margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--secondary); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.container--wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); position: relative; }
.section--sm { padding-block: var(--section-y-sm); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

.bg-alt { background: var(--surface-alt); }
.bg-mint { background: var(--surface-tint); }
.bg-dark { background: var(--primary-dark); color: rgba(255, 255, 255, 0.78); }
.bg-dark :is(h1, h2, h3, h4, h5, .display) { color: var(--white); }

/* Section intro: heading block with the logo's vertical rule as its signature */
.section-intro { display: grid; gap: var(--space-4); margin-bottom: clamp(2.5rem, 1.8rem + 2.4vw, 4rem); }
.section-intro p { max-width: var(--measure); }
.section-intro--center { text-align: center; justify-items: center; }
.section-intro--split {
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 900px) {
  .section-intro--split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-10); }
}

/* Grid helpers */
.grid { display: grid; gap: var(--grid-gap, var(--space-6)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 260px)), 1fr)); }

.stack > * + * { margin-top: var(--stack, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster, var(--space-3)); align-items: center; }

/* ---------- Signature motif: the growth trace ----------
   The rising arrow from the logo mark, used as a quiet decorative line.
   Markup: <svg class="trace" ...><path pathLength="1" .../></svg>          */
.trace { position: absolute; pointer-events: none; overflow: visible; color: var(--accent); }
.trace path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trace--draw path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out); }
.trace--draw.is-visible path { stroke-dashoffset: 0; }

/* Dot grid texture (used under hero visuals and panels) */
.dot-grid {
  background-image: radial-gradient(circle at 1px 1px, var(--primary-alpha-14) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.text-ink { color: var(--ink); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.text-white { color: var(--white); }
.mt-0 { margin-top: 0 !important; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.relative { position: relative; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.6em; height: 1.6em; }

/* ---------- Focus & skip link ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.bg-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--primary-200); }

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: calc(var(--z-toast) + 1);
  padding: 12px 18px;
  background: var(--primary-dark);
  color: var(--white);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Reveal on scroll ----------
   Add data-reveal to an element. Optional: data-reveal="left|right|scale|fade",
   data-reveal-delay="120" (ms). Use data-stagger on a parent to cascade children.
   Elements are visible by default if JS fails (.js class gates the hidden state). */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(32px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.96); }
.js [data-reveal="fade"]  { transform: none; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
/* On narrow screens side-entrances become fade-ups so nothing pokes past the viewport */
@media (max-width: 768px) {
  .js [data-reveal="left"]:not(.is-visible),
  .js [data-reveal="right"]:not(.is-visible) { transform: translate3d(0, 24px, 0); }
}
main { overflow-x: clip; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .trace--draw path { stroke-dashoffset: 0; }
}
