/* ==========================================
   PSGVPM Parent Website — Design Tokens & Base
   "Doorway to the Valley" (Milestone 2)
   Polymath360 Web System — token-first architecture
   Breakpoints (layout-driven): 40rem (640) · 48rem (768) · 62rem (992, two-column layouts) · 75rem (1200, inline navigation)
   ========================================== */

:root {
  /* ---- Brand colour ---- */
  --color-primary: #0f2c52;        /* ink navy — authority: headings, header bar, primary CTA */
  --color-primary-dark: #081b35;   /* deep ink — footer, hover, dark grounds */
  --color-primary-soft: #1b4275;   /* lifted navy for hovers on dark */
  --color-accent: #c8952f;         /* gold — heritage: rules, marks, CTA (the seal's petals) */
  --color-accent-deep: #7f5911;    /* text-safe gold on light/cream grounds */
  --color-accent-mid: #a4761a;     /* large decorative numerals only (>= 3:1 on white/cream) */
  --color-accent-soft: #f0c565;    /* gold on dark grounds */
  --color-support: #2f6f4f;        /* Tapti green — sparing */

  /* ---- Semantic colour ---- */
  --color-bg: #ffffff;
  --color-bg-khadi: #f7f1e3;       /* heritage cream ground */
  --color-bg-khadi-deep: #efe6cf;
  --color-surface: #ffffff;
  --color-text: #1b2433;
  --color-text-muted: #4a566b;
  --color-text-inverse: #ffffff;
  --color-text-on-dark: rgba(255, 255, 255, 0.86);
  --color-border: #ddd3bd;         /* warm rule colour */
  --color-border-cool: #dfe6ef;
  --color-focus: #1a58a8;
  --color-focus-on-dark: #ffd98a;

  /* ---- Typography ---- */
  --font-family-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-family-base: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-marathi: "Tiro Devanagari Marathi", "Noto Serif Devanagari", "Mangal", serif;
  --font-size-base: 1rem;
  --line-height-base: 1.68;
  --line-height-heading: 1.14;

  /* Fluid type scale (one H1 style site-wide) */
  --font-size-h1: clamp(2.05rem, 1.5rem + 2.3vw, 3.3rem);
  --font-size-h2: clamp(1.6rem, 1.3rem + 1.3vw, 2.4rem);
  --font-size-h3: clamp(1.25rem, 1.1rem + 0.65vw, 1.6rem);
  --font-size-h4: 1.0625rem;
  --font-size-lead: clamp(1.1rem, 1.02rem + 0.38vw, 1.3rem);
  --font-size-small: 0.9rem;
  --font-size-caption: 0.8125rem;
  --font-size-label: 0.78rem;

  /* ---- Layout ---- */
  --container-max-width: 1200px;
  --container-max-width-narrow: 820px;
  --container-gutter: 1.25rem;
  --measure: 68ch;

  /* ---- Spacing scale ---- */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 3.25rem;
  --space-2xl: 5rem;
  --section-spacing: var(--space-2xl);
  --section-spacing-compact: var(--space-xl);

  /* ---- Shape ---- */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;
  --radius-photo: 0.25rem;                 /* photographs: near-square corners */
  --color-photo-edge: rgba(15, 44, 82, 0.14);   /* hairline edge for photographs */

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(15, 44, 82, 0.06), 0 2px 6px rgba(15, 44, 82, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 44, 82, 0.12);
  --shadow-lg: 0 24px 56px rgba(15, 44, 82, 0.18);
  --shadow-card: 0 1px 2px rgba(15, 44, 82, 0.06), 0 6px 18px rgba(15, 44, 82, 0.07);
  --shadow-card-hover: 0 4px 8px rgba(15, 44, 82, 0.08), 0 18px 38px rgba(15, 44, 82, 0.15);
  --lift: -4px;                           /* one hover lift for every interactive card */

  /* ---- Motion ---- */
  --transition-fast: 150ms ease;
  --transition-base: 240ms ease;
  --transition-card: 220ms ease;
  --reveal-distance: 14px;

  /* ---- Accessibility ---- */
  --focus-outline-width: 3px;
  --focus-outline-offset: 3px;

  /* ---- Layering ---- */
  --z-nav: 40;
  --z-menu: 50;
  --z-skip-link: 1000;

  /* ---- Header metrics ---- */
  --header-height: 4.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.75rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0 var(--space-sm);
  color: var(--color-primary);
  font-family: var(--font-family-heading);
  line-height: var(--line-height-heading);
  font-weight: 600;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 { font-size: var(--font-size-h1); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h4);
  font-weight: 700;
  letter-spacing: 0;
}

p {
  margin-block: 0 var(--space-sm);
}

p:last-child {
  margin-block-end: 0;
}

.lead {
  font-size: var(--font-size-lead);
  line-height: 1.55;
  color: var(--color-text-muted);
}

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

img {
  height: auto;
}

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

a {
  color: var(--color-primary);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent-deep);
}

:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-focus);
  outline-offset: var(--focus-outline-offset);
}

.on-dark :focus-visible,
.section--dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible,
.quote-band :focus-visible {
  outline-color: var(--color-focus-on-dark);
}

ul,
ol {
  padding-inline-start: 1.25em;
}

blockquote {
  margin: 0;
}

.mr,
[lang="mr"],
[lang="sa"] {
  font-family: var(--font-family-marathi);
}

.container {
  width: min(100% - (var(--container-gutter) * 2), var(--container-max-width));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - (var(--container-gutter) * 2), var(--container-max-width-narrow));
  margin-inline: auto;
}

/* ---- Sections: three grounds, one rhythm ---- */
.section {
  padding-block: var(--section-spacing);
}

.section--compact {
  padding-block: var(--section-spacing-compact);
}

.section--khadi {
  background: var(--color-bg-khadi);
}

.section--dark {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--color-text-inverse);
}

.section--dark a:not(.button) {
  color: var(--color-accent-soft);
}

.section--dark .lead {
  color: var(--color-text-on-dark);
}

.section-heading {
  max-width: var(--container-max-width-narrow);
  margin-block-end: var(--space-lg);
}

.section-heading--center {
  margin-inline: auto;
  text-align: center;
}

.section-heading--center .eyebrow {
  justify-content: center;
}

/* Eyebrow: gold rule + label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-block-end: var(--space-xs);
  color: var(--color-accent-deep);
  font-size: var(--font-size-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
}

.section--dark .eyebrow,
.on-dark .eyebrow {
  color: var(--color-accent-soft);
}

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

@media (max-width: 48rem) {
  :root {
    --section-spacing: var(--space-xl);
    --section-spacing-compact: var(--space-lg);
  }
}

/* ---- Reveal (progressive enhancement; content is visible without JS) ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity 600ms ease, transform 600ms ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  /* Reduced motion: no lifts, no zooms, no settle — states still change colour/shadow */
  .card-lift:hover,
  .button:hover,
  .door:hover,
  .door:focus-within {
    transform: none !important;
  }

  .door:hover .door__media img,
  .door:focus-within .door__media img,
  .photo-hero__media img {
    transform: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .nav-toggle,
  .site-footer .signature {
    display: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
