/* ================================================================
   KAAPL — Design system
   Tokens, reset, base elements, layout utilities.
   Component styles live in components.css; page styles in css/pages/.

   Palette is brochure-accurate: the navy / royal-blue / gold used
   across the printed brochure and the logo lockup. Token names follow
   docs/02_UI_UX_SYSTEM.md; the values are tuned to the brand assets.
   ================================================================ */

:root {
  /* --- Brand ------------------------------------------------- */
  --color-navy: #0a1f44;          /* dark sections, footer, nav band */
  --color-navy-light: #122c5c;    /* raised surfaces on navy */

  --color-primary: #0f3d91;       /* links, buttons, headings accent */
  --color-primary-light: #2c63c9; /* hover, gradient midpoint */
  --color-primary-dark: #0a2c6b;  /* active / pressed */

  --color-accent: #e9a319;        /* gold rules, icon accents, on-navy text */
  --color-accent-soft: #f5c65b;   /* gold hover on navy */
  --color-accent-ink: #a66f00;    /* the only gold safe as text on white */

  /* --- Neutrals ---------------------------------------------- */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f4f6fa;
  --color-bg-dark: var(--color-navy);
  --color-text-primary: #14213d;
  --color-text-secondary: #4a5568;
  --color-text-muted: #5f6b7f;     /* 5.3:1 on white — AA for body text */
  --color-text-inverse: #ffffff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e0;

  /* --- Semantic ---------------------------------------------- */
  --color-success: #2f855a;
  --color-warning: #b7791f;
  --color-error: #c53030;
  --color-info: #2b6cb0;

  /* --- Gradients --------------------------------------------- */
  --gradient-hero: linear-gradient(135deg, #0a1f44 0%, #0f3d91 55%, #2c63c9 100%);
  /* Light at the top so the building reads, weighted at the bottom so the
   headline holds contrast. A flat 55% across the middle just greys the photo. */
--gradient-overlay: linear-gradient(180deg, rgba(10, 31, 68, 0.42) 0%, rgba(10, 31, 68, 0.18) 38%, rgba(10, 31, 68, 0.62) 72%, rgba(10, 31, 68, 0.90) 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(15, 61, 145, 0.05) 0%, rgba(233, 163, 25, 0.06) 100%);
  --gradient-gold-rule: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-soft) 100%);

  /* --- Typography -------------------------------------------- */
  --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* The company name in the masthead is set in Arial Bold by request. It is
     deliberately the one place that departs from the Outfit/Inter pairing. */
  --font-brand: Arial, 'Helvetica Neue', Helvetica, sans-serif;

  --text-display: 3.5rem;
  --text-h1: 2.5rem;
  --text-h2: 2rem;
  --text-h3: 1.5rem;
  --text-h4: 1.25rem;
  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-xs: 0.75rem;

  --leading-tight: 1.15;
  --leading-heading: 1.25;
  --leading-body: 1.6;

  /* --- Spacing (4px base) ------------------------------------ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Vertical rhythm for page sections — tightens on small screens. */
  --section-y: var(--space-16);

  /* --- Elevation (navy-tinted, not black) --------------------- */
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.06);
  --shadow-md: 0 4px 10px rgba(10, 31, 68, 0.08);
  --shadow-lg: 0 10px 25px rgba(10, 31, 68, 0.12);
  --shadow-xl: 0 20px 40px rgba(10, 31, 68, 0.16);
  --shadow-card-hover: 0 12px 30px rgba(15, 61, 145, 0.18);

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

  /* --- Motion ------------------------------------------------ */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 400ms ease-in-out;
  /* Deviates from docs/02 deliberately: that file specifies an overshooting
     spring for --transition-spring. Bounce reads as playful, which is wrong for
     this firm's voice. Ease-out-expo decelerates hard and settles instead.
     Do not reinstate the overshoot from the docs. */
  --transition-emphasis: 500ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Layout ------------------------------------------------ */
  --container-xl: 1200px;
  --container-max: 1320px;
  --container-pad: var(--space-5);
  --navbar-height: 60px;
  --z-navbar: 1000;
  --z-overlay: 1100;
  --z-skip: 9999;
}

@media (min-width: 640px) {
  :root {
    --container-pad: var(--space-8);
    --section-y: var(--space-20);
  }
}

@media (min-width: 1024px) {
  :root {
    --navbar-height: 72px;
    --section-y: var(--space-24);
  }
}

/* ================================================================
   Reset
   ================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-height) + var(--space-4));
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* Any author `display` beats the UA rule for [hidden], which silently turns
   `el.hidden = true` into a no-op on flex/grid children. Assert it once here
   so every component gets it. */
[hidden] {
  display: none !important;
}

img {
  height: auto;
}

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

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

/* ================================================================
   Base elements
   ================================================================ */

body {
  margin: 0;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--leading-heading);
  color: var(--color-text-primary);
  text-wrap: balance;
}

h1 { font-size: var(--text-h1); font-weight: 700; line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); font-weight: 600; }
h3 { font-size: var(--text-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-weight: 500; }

p {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

strong {
  font-weight: 600;
}

hr {
  height: 1px;
  border: 0;
  background-color: var(--color-border);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Focus ring needs to stay visible against navy sections. */
.on-dark :focus-visible {
  outline-color: var(--color-accent);
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ================================================================
   Layout utilities
   ================================================================ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

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

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

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

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

.grid {
  display: grid;
  gap: var(--space-6);
}

.measure {
  max-width: 68ch;
}

.measure-narrow {
  max-width: 52ch;
}

.lead {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
}

.section--dark .lead {
  color: rgba(255, 255, 255, 0.82);
}

/* The gold rule under a section heading — the brochure's signature mark.
   It is a <span>, so it needs an explicit block display: an inline box ignores
   width, height and vertical margins, which made the rule invisible. */
.rule {
  display: block;
  width: 48px;
  height: 3px;
  margin-block: var(--space-4) var(--space-5);
  border-radius: var(--radius-full);
  background-image: var(--gradient-gold-rule);
}

.rule--center {
  margin-inline: auto;
}

.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-4);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transform: translateY(-110%);
  transition: transform var(--transition-fast);
}

.skip-link:focus-visible {
  color: var(--color-text-inverse);
  transform: translateY(0);
}

/* ================================================================
   Typography scale-up on larger screens
   ================================================================ */

@media (min-width: 640px) {
  h1 { font-size: 3rem; }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--text-display); }
}

/* ================================================================
   Motion
   ================================================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Elements opt in with data-animate; animations.js adds .is-visible on
   intersection. The starting opacity is gated on `scripting: enabled`, so a
   visitor with JavaScript off — or a browser too old to know the query — never
   has the content hidden from them in the first place. This replaces an inline
   bootstrap script, which would have forced 'unsafe-inline' into the CSP. */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  [data-animate] {
    opacity: 0;
  }

  [data-animate].is-visible {
    animation: fadeInUp var(--transition-slow) both;
    animation-delay: var(--animate-delay, 0ms);
  }

  /* Stagger comes from position, not from an inline style attribute. Inline
     styles would require 'unsafe-inline' in style-src, which would weaken the
     Content-Security-Policy for the whole site to buy a framework nicety. */
  [data-animate]:nth-child(2) { --animate-delay: 70ms; }
  [data-animate]:nth-child(3) { --animate-delay: 140ms; }
  [data-animate]:nth-child(4) { --animate-delay: 210ms; }
  [data-animate]:nth-child(5) { --animate-delay: 280ms; }
  [data-animate]:nth-child(6) { --animate-delay: 350ms; }
}

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

/* ================================================================
   Print — the site doubles as a reference document people hand over.
   ================================================================ */

@media print {
  .skip-link,
  .navbar,
  .site-footer {
    display: none !important;
  }

  body {
    color: #000;
  }
}
