/* ==========================================================================
   Laurus College — Design System
   --------------------------------------------------------------------------
   Single source of truth for design tokens, reset, base typography, layout
   utilities, and the button system. Component-specific styling lives in
   css/components/*.css. Pages load this file FIRST, then only the component
   files they need.

   Brand rules enforced here:
     - Navy (#082141) is the primary, page-dominant brand color.
     - Orange (#f99b1c) is an ACCENT ONLY token. It is never used as a text
       color on light backgrounds (fails WCAG contrast) and never as a large
       fill. See --color-orange usage notes below.

   Accessibility decisions are documented inline with "A11Y:" comments so the
   compliance reviewer can audit intent, per the project mandate (WCAG 2.1 AA).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors -------------------------------------------------------- */
  --color-primary: #082141;        /* Primary navy — headers, dark sections   */
  --color-primary-hover: #0d3c76;  /* Mid navy — hover on dark surfaces        */
  --color-accent: #2172c1;         /* Accent blue — buttons, links (4.95:1 on white) */
  --color-accent-hover: #1a5a9b;   /* Darker blue — hover (6.3:1 on white)     */
  --color-orange: #f99b1c;         /* ACCENT ONLY — never text-on-light, never large fills */
  --color-orange-subtle: #fff5e6;  /* Faint warm wash for tiny highlight zones */

  /* Extended navy ramp for layered dark surfaces ----------------------- */
  --color-navy-900: #061a34;
  --color-navy-800: #082141;
  --color-navy-700: #0d3c76;
  --color-navy-600: #134a8e;

  /* Neutrals ------------------------------------------------------------ */
  --color-bg: #ffffff;
  --color-surface: #f8fafc;        /* Section alt background (slate-50)        */
  --color-surface-2: #f1f5f9;      /* Deeper surface (slate-100)               */
  --color-text: #0f172a;           /* Body text (16.1:1 on white)              */
  --color-text-muted: #475569;     /* Secondary text — slate-600, 7.4:1 on white.
                                      A11Y: chosen over slate-500 (4.6:1) for a
                                      comfortable margin above the 4.5:1 floor. */
  --color-text-on-dark: #e8eef6;   /* Body text on navy (12.6:1 on #082141)    */
  --color-text-on-dark-muted: #aebfd6; /* Muted on navy (5.6:1 on #082141)     */
  --color-border: #e2e8f0;         /* Hairlines (slate-200)                    */
  --color-border-strong: #cbd5e1;  /* Stronger dividers / input borders        */

  /* Semantic states ----------------------------------------------------- */
  --color-success: #15803d;        /* green-700 — 4.8:1 on white               */
  --color-success-subtle: #f0fdf4;
  --color-error: #b91c1c;          /* red-700 — 6.4:1 on white                 */
  --color-error-subtle: #fef2f2;
  --color-focus: #2172c1;          /* Focus ring color                         */

  /* Typography ---------------------------------------------------------- */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-headline: 'Newsreader', Georgia, 'Times New Roman', serif;

  /* Fluid type scale (1.20 minor-third on mobile → larger on desktop) --- */
  --text-xs: 0.8125rem;            /* 13px */
  --text-sm: 0.9375rem;            /* 15px */
  --text-base: 1.0625rem;          /* 17px — comfortable reading body size     */
  --text-lg: 1.1875rem;            /* 19px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.8vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.7rem + 2.6vw, 3.25rem);
  --text-display: clamp(2.5rem, 1.8rem + 3.4vw, 4rem);

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;

  /* Spacing — 8px baseline grid ---------------------------------------- */
  --space-1: 0.5rem;   /* 8px  */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 2.5rem;   /* 40px */
  --space-6: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-10: 5rem;    /* 80px */
  --space-12: 6rem;    /* 96px */
  --space-16: 8rem;    /* 128px */

  /* Radii --------------------------------------------------------------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows — soft, navy-tinted ---------------------------------------- */
  --shadow-sm: 0 1px 2px rgb(8 33 65 / 0.06);
  --shadow-md: 0 4px 12px rgb(8 33 65 / 0.08);
  --shadow-lg: 0 12px 32px rgb(8 33 65 / 0.12);
  --shadow-xl: 0 24px 56px rgb(8 33 65 / 0.16);

  /* Layout -------------------------------------------------------------- */
  --content-max: 1200px;
  --content-wide: 1320px;
  --content-narrow: 720px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-height: 76px;          /* the main nav bar's own height */
  --utility-height: 44px;         /* the top utility bar */
  --sticky-top: calc(var(--utility-height) + var(--header-height)); /* full persistent top region */

  /* Motion -------------------------------------------------------------- */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Z-index scale ------------------------------------------------------- */
  --z-sticky: 100;
  --z-header: 200;
  --z-mobile-cta: 250;
  --z-chat: 300;
  --z-cookie: 400;
  --z-modal: 500;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset in-page anchor jumps so the sticky header doesn't cover targets. */
  scroll-padding-top: calc(var(--sticky-top) + var(--space-2));
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga';
  overflow-x: hidden;
}

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

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

button { background: none; border: none; cursor: pointer; }

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

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* Long-word wrapping safety net for headings/links on narrow viewports. */
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* --------------------------------------------------------------------------
   3. BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
  text-wrap: balance; /* Avoid orphan words on supporting browsers. */
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
h5, h6 {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

p { max-width: 68ch; }
.measure-wide { max-width: 78ch; }

strong, b { font-weight: var(--weight-semibold); }

small { font-size: var(--text-sm); }

/* Eyebrow / kicker label above headings. Orange accent kept tiny + paired
   with an uppercase navy-blue label so color is never the sole signal. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-orange); /* The sanctioned tiny orange accent. */
}
/* On dark surfaces the eyebrow switches to a warm light tint — accent blue
   (#2172c1) is only 3.25:1 on navy and fails AA. (#ffd9a3 ≈ 11:1 on navy.) */
.on-dark .eyebrow { color: #ffd9a3; }

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* --------------------------------------------------------------------------
   4. ACCESSIBILITY PRIMITIVES
   -------------------------------------------------------------------------- */

/* A11Y: Skip link — first focusable element on every page. Visually hidden
   until focused, then pinned to the top-left so keyboard users can jump
   straight to <main id="main">. */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-2);
  transform: translateY(-120%);
  z-index: var(--z-modal);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary);
  color: #ffffff;
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* A11Y: Visually-hidden but available to screen readers (labels, context). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* A11Y: Visible focus indicator for keyboard users only (focus-visible).
   3px solid ring + 2px offset. --color-focus (#2172c1) gives ≥3:1 against
   white and light surfaces, satisfying SC 1.4.11 Non-text Contrast. */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* Remove the default outline only where focus-visible is supported, so we
   never strip focus styling from browsers that lack :focus-visible. */
:focus:not(:focus-visible) { outline: none; }

/* On dark surfaces the focus ring switches to white for contrast. */
.on-dark :focus-visible { outline-color: #ffffff; }

/* --------------------------------------------------------------------------
   5. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--content-wide); }
.container--narrow { max-width: var(--content-narrow); }

/* Vertical section rhythm — generous, per strategy (96–128px desktop). */
.section { padding-block: clamp(var(--space-8), 6vw, var(--space-12)); }
.section--tight { padding-block: clamp(var(--space-6), 4vw, var(--space-8)); }
.section--surface { background: var(--color-surface); }
.section--navy {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
}
.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4 {
  color: #ffffff;
}

/* Section heading group */
.section-head { max-width: 60ch; margin-bottom: var(--space-6); }
.section-head--center { margin-inline: auto; text-align: center; }

/* Simple responsive auto-grid for cards. */
.grid { display: grid; gap: var(--space-3); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.stack > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-5); }

.flow > * + * { margin-top: var(--space-2); }

/* Utility text helpers */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-balance { text-wrap: balance; }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }

/* --------------------------------------------------------------------------
   6. BUTTON SYSTEM
   --------------------------------------------------------------------------
   A11Y: All buttons clear the 44×44px WCAG 2.5.5 target via min-height +
   padding. Hover and focus states are distinct from each other. Arrow glyphs
   are decorative (the link text carries the meaning).
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap; /* short CTA labels should never wrap (e.g. "Request Info") */
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

/* Primary — accent blue (4.95:1 white-on-blue passes AA). */
.btn--primary { background: var(--color-accent); color: #ffffff; }
.btn--primary:hover { background: var(--color-accent-hover); box-shadow: var(--shadow-md); }

/* Solid navy — for use on light surfaces where we want the brand anchor. */
.btn--navy { background: var(--color-primary); color: #ffffff; }
.btn--navy:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); }

/* Secondary — outline that reads on light surfaces. */
.btn--secondary {
  background: transparent;
  color: var(--color-accent-hover);
  border-color: var(--color-border-strong);
}
.btn--secondary:hover { border-color: var(--color-accent); background: var(--color-surface); }

/* On navy/photo surfaces: white outline + white-fill-on-hover. */
.btn--ghost-light {
  background: transparent;
  color: #ffffff;
  border-color: rgb(255 255 255 / 0.7);
}
.btn--ghost-light:hover { background: #ffffff; color: var(--color-primary); }

.btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: var(--text-lg); }
.btn--sm { min-height: 40px; padding: 0.5rem 1rem; font-size: var(--text-sm); }
.btn--block { display: flex; width: 100%; }

/* Decorative trailing arrow that nudges on hover. */
.btn__arrow { transition: transform var(--duration-fast) var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Text link with animated underline; orange used ONLY as the hover underline
   accent (decorative), never as the link's resting text color. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-hover);
  text-decoration: none;
}
.link-arrow .btn__arrow { color: var(--color-orange); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* --------------------------------------------------------------------------
   7. SHARED PIECES
   -------------------------------------------------------------------------- */

/* Badge / pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.badge--accent { background: #e7f0fb; color: var(--color-accent-hover); }
/* Orange badge: dark navy text on orange = 7.7:1. Reserved for tiny "New"/
   highlight flags only. */
.badge--accent-orange { background: var(--color-orange-subtle); color: #8a4b00; }

/* Card surface */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

/* Horizontal rule */
.divider { height: 1px; background: var(--color-border); border: 0; }

/* Decorative SVG icons must never convey info alone. */
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* --------------------------------------------------------------------------
   8. REDUCED MOTION
   --------------------------------------------------------------------------
   A11Y: Respect prefers-reduced-motion — neutralize animation, transition,
   and smooth scrolling for users who request it (SC 2.3.3 / vestibular needs).
   -------------------------------------------------------------------------- */
@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;
  }
}

/* A11Y: Honor forced-colors / Windows High Contrast Mode by keeping focus
   outlines visible and not relying on box-shadow for state. */
@media (forced-colors: active) {
  .btn { border: 2px solid currentColor; }
  :focus-visible { outline: 3px solid Highlight; }
}

/* Print: hide interactive chrome, keep content legible. */
@media print {
  .site-header, .site-footer__legal, .sticky-mobile-cta,
  .cookie-consent, #birdeye-chat, .skip-link { display: none !important; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
}
