/* =====================================================================
   NEXA LEGAL — DESIGN SYSTEM
   Premium boutique Indian law chamber. Editorial, restrained, authoritative.
   This file is the single source of truth for tokens + primitives.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------------------- */
:root {
  /* Color — ink & navy */
  --ink: #0A1622;
  --navy-deep: #0F2338;
  --navy: #22405C;

  /* Color — gold accents (used sparingly) */
  --gold: #B08A46;
  --gold-light: #C9A96A;

  /* Color — emerald / green accent (Nexa Worldwide) */
  --emerald: #0F5A46;
  --emerald-light: #1E7A5E;

  /* Color — paper & surfaces */
  --paper: #F6F2E9;
  --surface: #FCFAF4;
  --muted: #5C6672;
  --border: #DED6C6;

  /* Derived tones */
  --ink-70: rgba(10, 22, 34, 0.7);
  --paper-70: rgba(246, 242, 233, 0.72);
  --paper-45: rgba(246, 242, 233, 0.45);
  --hairline-dark: rgba(246, 242, 233, 0.16);
  --hairline-light: rgba(10, 22, 34, 0.12);

  /* Typography */
  --font-serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Fluid type scale (clamp: min, preferred, max) */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.2vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --step-3:  clamp(1.9rem, 1.5rem + 2vw, 2.9rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);
  --step-5:  clamp(3.2rem, 2.2rem + 5vw, 6rem);

  /* Spacing scale */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8.5rem;

  /* Structure */
  --radius: 2px;               /* near-zero radius */
  --radius-pill: 100px;
  --container: 1240px;
  --container-narrow: 880px;
  --header-h: 84px;

  /* Motion (restrained) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.5s;

  /* Shadow (minimal, used rarely) */
  --shadow-soft: 0 18px 50px -30px rgba(10, 22, 34, 0.5);
}

/* ---------------------------------------------------------------------
   2. RESET / BASE
   --------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
picture { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: var(--surface);
}

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

/* ---------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

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

.section { padding-block: clamp(3.5rem, 7vw, var(--space-3xl)); }
.section--tight { padding-block: clamp(2.5rem, 5vw, var(--space-2xl)); }

.stack > * + * { margin-top: var(--flow, 1rem); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------------
   4. TYPOGRAPHY HELPERS
   --------------------------------------------------------------------- */
.display {
  font-family: var(--font-serif);
  font-size: var(--step-5);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}
.eyebrow--plain::before { display: none; }
.eyebrow--light { color: var(--gold-light); }

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-70);
  font-weight: 400;
}

.serif-accent { font-family: var(--font-serif); font-style: italic; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }

/* thin editorial rule */
.rule {
  height: 1px;
  background: var(--border);
  border: 0;
  width: 100%;
}
.rule--dark { background: var(--hairline-dark); }

/* ---------------------------------------------------------------------
   5. BUTTONS / LINKS
   --------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.7rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--gold {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink);
  border-color: var(--gold);
}
.btn--gold:hover { --btn-bg: var(--gold-light); border-color: var(--gold-light); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); }

.btn--ghost-light {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  border-color: var(--hairline-dark);
}
.btn--ghost-light:hover { --btn-bg: var(--paper); --btn-fg: var(--ink); border-color: var(--paper); }

.btn .btn__arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* text link with underline reveal */
.link-underline {
  position: relative;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 2px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------------------
   6. UTILITIES
   --------------------------------------------------------------------- */
.on-dark { color: var(--paper); background: var(--ink); }
.on-navy { color: var(--paper); background: var(--navy-deep); }
.bg-paper { background: var(--paper); }
.bg-surface { background: var(--surface); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Reveal-on-scroll (progressive; content visible without JS) */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }
