/* ==========================================================================
   Crescent Quality Certifications — main.css
   Design tokens, resets, typography, layout primitives, utilities.
   ========================================================================== */

:root {
  /* Color — navy spine */
  --navy-900: #0a1628;
  --navy-800: #0f2444;
  --navy-700: #14305c;
  --navy-600: #1e3a6f;

  /* Color — gold accent */
  --gold-500: #c9a961;
  --gold-600: #d4af37;
  --gold-400: #e3c77f;

  /* Color — ink (body text on light) */
  --ink-900: #0b0f1a;
  --ink-700: #3a4256;
  --ink-500: #6b7388;

  /* Color — cream canvas */
  --cream-50: #f8f5ef;
  --cream-100: #f2ede2;
  --white: #ffffff;

  /* Color — glass surfaces */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-light: rgba(10, 22, 40, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-light: rgba(10, 22, 40, 0.08);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --fs-hero: clamp(2.75rem, 5.5vw, 4.75rem);
  --fs-h1: clamp(2.25rem, 4vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.8vw, 1.625rem);
  --fs-lead: clamp(1.0625rem, 1.2vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  --lh-tight: 1.1;
  --lh-display: 1.15;
  --lh-body: 1.65;
  --ls-display: -0.02em;
  --ls-body: -0.005em;

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  --container: 1240px;
  --container-narrow: 880px;

  /* Radii */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.06), 0 2px 6px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08), 0 12px 32px rgba(10, 22, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.12), 0 28px 64px rgba(10, 22, 40, 0.10);
  --shadow-gold: 0 8px 24px rgba(201, 169, 97, 0.25);
  --shadow-inset-gold: inset 0 0 0 1px rgba(201, 169, 97, 0.35);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 600ms;
  --dur-xslow: 900ms;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--ink-900);
  background: var(--cream-50);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  opacity: 1;
  transition: opacity 300ms var(--ease-out);
}
body.page-transitioning { opacity: 0; }

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-600); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--gold-500); }
a:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: var(--r-xs); }

button { font-family: inherit; cursor: pointer; }
::selection { background: var(--gold-500); color: var(--navy-900); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  margin: 0 0 var(--sp-4);
  color: var(--ink-900);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0 0 var(--sp-4); }
.lead { font-size: var(--fs-lead); color: var(--ink-700); }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-600);
  margin: 0 0 var(--sp-4);
  display: inline-block;
}
.eyebrow--light { color: var(--gold-400); }

.display-italic {
  font-style: italic;
  font-weight: 500;
  color: var(--gold-500);
}

/* ---- Layout primitives ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--sp-5); }
@media (min-width: 768px) {
  .container, .container-narrow { padding-inline: var(--sp-7); }
}
section { padding-block: var(--sp-9); }
@media (min-width: 1024px) {
  section { padding-block: var(--sp-10); }
}

.section--dark {
  background: var(--navy-900);
  color: var(--white);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark .lead { color: rgba(255,255,255,0.75); }

.section--tint { background: var(--cream-100); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--navy-900);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  z-index: 1000;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { top: 0; color: var(--white); }

/* Hairline rule */
.hairline { height: 1px; background: var(--gold-500); opacity: 0.4; width: 64px; margin: var(--sp-4) 0; }
.hairline--light { background: rgba(255,255,255,0.25); opacity: 1; }
.hairline--full { width: 100%; }

/* Grid utilities */
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex utilities */
.row { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.center { display: flex; align-items: center; justify-content: center; }

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Gold accent label */
.accent-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-600);
}
.accent-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold-500);
  display: inline-block;
}

/* ---- Focus ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

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