/* ==========================================================================
   PKS INDIA LEGAL LLP — Base: reset, document defaults, typography primitives
   Depends on tokens.css. Loaded second.
   ========================================================================== */

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header (WCAG 2.2 — focus not obscured) */
  scroll-padding-top: calc(var(--header-h-scroll) + var(--sp-3));
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class], ol[class] { list-style: none; padding: 0; }

img, picture, video, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; padding: 0; cursor: pointer; }

table { border-collapse: collapse; }

/* ---- Document ----------------------------------------------------------- */
body {
  background: var(--surface-light);
  color: var(--ink-on-light);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* belt-and-braces; no section may need this */
}

::selection {
  background: var(--gold);
  color: var(--brown-dark);
}

/* ---- Typography primitives ---------------------------------------------- */

/* The wide, flat-terminal grotesk caps that define the profile's voice.
   The width axis only applies where variable fonts are supported; without
   it, Archivo falls back to its normal width rather than rendering wrong. */
.t-display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-display);
  text-wrap: balance;
}

@supports (font-variation-settings: normal) {
  .t-display { font-variation-settings: "wdth" var(--wdth-display); }
  .t-display--hero { font-variation-settings: "wdth" var(--wdth-hero); }
}

h1, h2, h3, h4 {
  font-family: var(--font-text);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--brown-ink);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { max-width: var(--measure); }

.t-lede {
  font-size: var(--fs-lede);
  line-height: 1.6;
  color: var(--ink-on-light-2);
}

/* Size modifier for the hero-scale display line. */
.t-display--hero { font-size: var(--fs-hero); }

.t-accent {
  font-family: var(--font-accent);
  font-weight: 300;
  font-style: italic;
}

.t-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--accent-on-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: none;
}

.t-eyebrow::before {
  content: "";
  inline-size: 26px;
  block-size: 2px;
  background: var(--rule-gold);
  flex: none;
}

/* ---- Ground contexts ----------------------------------------------------
   A section sets its ground, and every ink token inside it resolves from the
   same set. This is what stops one theme's text landing on another's ground. */
.on-dark,
.on-brown {
  color: var(--ink-on-dark);
}
.on-dark  { background: var(--surface-dark); }
.on-brown { background: var(--surface-brown); }

.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4,
.on-brown h1, .on-brown h2, .on-brown h3, .on-brown h4 { color: var(--cream); }

.on-dark .t-eyebrow,
.on-brown .t-eyebrow { color: var(--accent-on-dark); }

.on-dark .t-lede,
.on-brown .t-lede { color: var(--ink-on-dark-2); }

.on-gold { background: var(--surface-gold); color: var(--ink-on-gold); }
.on-gold h1, .on-gold h2, .on-gold h3, .on-gold h4 { color: var(--brown-dark); }
.on-gold .t-eyebrow { color: var(--brown-dark); }
.on-gold .t-lede    { color: var(--brown-dark); }
.on-gold .t-eyebrow::before { background: var(--brown-dark); }

.on-light { background: var(--surface-light); color: var(--ink-on-light); }
.on-white { background: var(--surface-white); color: var(--ink-on-light); }

/* ---- Links --------------------------------------------------------------- */
a {
  color: var(--accent-on-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.on-dark a, .on-brown a { color: var(--accent-on-dark); }

/* ---- Focus — visible, gold, never clipped -------------------------------- */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.on-light :focus-visible,
.on-white :focus-visible,
.on-gold  :focus-visible {
  outline-color: var(--brown-dark);
}

/* ---- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--sp-2);
  inset-block-start: -100%;
  z-index: var(--z-skiplink);
  background: var(--gold);
  color: var(--brown-dark);
  font-weight: 700;
  font-size: var(--fs-small);
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}
.skip-link:focus-visible {
  inset-block-start: var(--sp-2);
  outline-color: var(--brown-dark);
}

/* ---- Layout primitives ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: var(--container-w); }

.section { padding-block: var(--section-block); }

.stack   { display: flex; flex-direction: column; }
.stack-1 { gap: var(--sp-1); } .stack-2 { gap: var(--sp-2); }
.stack-3 { gap: var(--sp-3); } .stack-4 { gap: var(--sp-4); }
.stack-5 { gap: var(--sp-5); } .stack-6 { gap: var(--sp-6); }

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.u-tabular { font-variant-numeric: tabular-nums; }

/* ---- Reveal — driven by main.js, inert without it -------------------------
   Elements only hide once JS has confirmed it will reveal them, so the page
   is fully readable with JavaScript disabled or still loading. */
[data-reveal] { opacity: 1; }

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity   var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---- 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;
    scroll-behavior: auto !important;
  }

  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* ---- Print ----------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .skip-link, .site-header, .site-footer { display: none; }
}
