/* ============================================================
   SU ITS Data & AI — Design Tokens
   ============================================================
   Foundation layer. Loaded first on every page.
   Codifies the Syracuse design vocabulary plus the
   docs-shaped additions (type scale, spacing, motion)
   that clementine.syr.edu's stylesheet didn't have but
   a knowledge-base site needs.
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────── */

@font-face {
  font-family: "Sherman Sans";
  src: url("./assets/fonts/shermansans-book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sherman Sans";
  src: url("./assets/fonts/shermansans-bookitalic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Sherman Sans";
  src: url("./assets/fonts/shermansans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

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

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* ── Design Tokens ──────────────────────────────────────── */

:root {
  /* Color — primary */
  --su-blue: #000e54;
  --su-blue-medium: #203299;
  --su-blue-light: #2b72d7;
  --su-orange: #f76900;
  --su-orange-light: #ff8e00;
  --su-orange-medium: #ff431b;
  --su-orange-dark: #d74100;
  --su-orange-accessible: #c43b00;
  --su-orange-deep: #9f2d00;
  --su-white: #ffffff;

  /* Color — greyscale */
  --su-black: #000000;
  --su-dark-grey: #404040;
  --su-medium-grey: #707780;
  --su-light-grey: #adb3b8;
  --su-xlight-grey: #eff0f1;
  --su-pale-gray: #f4f5f6;

  /* Color — tints */
  --su-blue-90: #1a2665;
  --su-blue-80: #333e76;
  --su-blue-10: #e6e7ee;
  --su-orange-10: #fef0e6;

  /* Color — gradients */
  --grad-blue: linear-gradient(118deg, #000e54 30.08%, #203299 98.9%);
  --grad-orange: linear-gradient(84deg, #ff431b 0%, #f76900 50.67%, #ff8e00 100%);
  --grad-card-border: linear-gradient(135deg, #f76900 0%, #2b72d7 100%);

  /* Semantic color roles */
  --color-text: #1a1a1a;
  --color-text-muted: var(--su-medium-grey);
  --color-text-inverse: var(--su-white);
  --color-bg: var(--su-white);
  --color-bg-subtle: var(--su-pale-gray);
  --color-bg-elevated: var(--su-white);
  --color-border: rgba(0, 14, 84, 0.08);
  --color-border-strong: rgba(0, 14, 84, 0.16);
  --color-accent: var(--su-orange);
  --color-accent-deep: var(--su-blue);
  --color-link: var(--su-orange-dark);
  --color-link-hover: var(--su-orange-accessible);

  /* Typography */
  --font-sans: "Sherman Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Verdana, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  /* Type scale — fluid, designed for both landing display and doc reading */
  --fs-display: clamp(3rem, 5.5vw, 4.75rem); /* hero h1 */
  --fs-eyebrow: 0.75rem; /* small uppercase tag */
  --fs-h1: clamp(2rem, 3.6vw, 2.75rem); /* doc page h1 */
  --fs-h2: clamp(1.5rem, 2.4vw, 1.875rem); /* section h2 */
  --fs-h3: 1.25rem; /* h3 / card title */
  --fs-h4: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-tiny: 0.75rem;

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --tracking-tight: -0.02em;
  --tracking-eyebrow: 0.14em;

  /* Spacing — 4px base, half-step at the small end for fine work */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.5rem; /* 24px */
  --space-6: 2rem; /* 32px */
  --space-7: 3rem; /* 48px */
  --space-8: 4rem; /* 64px */
  --space-9: 6rem; /* 96px */
  --space-10: 8rem; /* 128px */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 14, 84, 0.06);
  --shadow-md: 0 2px 16px rgba(0, 14, 84, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 14, 84, 0.1), 0 4px 16px rgba(0, 14, 84, 0.05);
  --shadow-accent: 0 12px 40px rgba(247, 105, 0, 0.18), 0 4px 16px rgba(0, 14, 84, 0.08);
  --shadow-glow-orange: 0 4px 20px rgba(247, 105, 0, 0.35);
  --shadow-glow-blue: 0 4px 20px rgba(0, 14, 84, 0.25);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 0.15s;
  --duration-base: 0.25s;
  --duration-slow: 0.45s;

  /* Layout */
  --container-narrow: 760px;
  --container-reading: 1100px;
  --container-wide: 1280px;
  --nav-height: 64px;
  --sidebar-width: 280px;
  --toc-width: 240px;

  /* Z-index */
  --z-base: 0;
  --z-elevated: 10;
  --z-sticky: 50;
  --z-nav: 100;
  --z-modal: 1000;
  --z-skip-link: 10000;
}

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }
}

/* ── Base ──────────────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(215, 65, 0, 0.4);
  transition: color var(--duration-fast) ease, text-decoration-color var(--duration-fast) ease;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--su-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--su-orange-10);
  color: var(--su-blue);
}

/* ── Accessibility primitives ───────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-skip-link);
  background: var(--su-orange-accessible);
  color: var(--su-white);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: var(--fs-body);
  text-decoration: none;
  transition: top var(--duration-base) var(--ease-out);
}

.skip-link:focus {
  top: 0;
  color: var(--su-white);
}

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

/* ── Reusable components ────────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.875rem 1.625rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--su-orange-accessible);
  color: var(--su-white);
  box-shadow: var(--shadow-glow-orange);
}

.btn-primary:hover {
  background: var(--su-orange-deep);
  color: var(--su-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(247, 105, 0, 0.45);
  text-decoration: none;
}

.btn-secondary {
  background: var(--su-white);
  color: var(--su-blue);
  border-color: rgba(0, 14, 84, 0.18);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  color: var(--su-blue);
  border-color: var(--su-orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--su-white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--su-orange);
  color: var(--su-white);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Eyebrow tag (small uppercase label) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--su-orange-dark);
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--su-orange);
  border-radius: 1px;
}

/* Badge (pill chip — Beta, status, tags) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--su-blue-10);
  color: var(--su-blue);
}

.badge--accent {
  background: var(--su-orange-10);
  color: var(--su-orange-deep);
}

.badge--solid {
  background: var(--su-blue);
  color: var(--su-white);
}

/* Container utilities */
.container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-7);
}

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

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

@media (max-width: 768px) {
  .container,
  .container--reading,
  .container--narrow {
    padding: 0 var(--space-5);
  }
}

/* Nav (shared between landing + docpage) */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 0 var(--space-7);
  height: var(--nav-height);
  background: rgba(0, 14, 84, 0.85);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--duration-base) ease;
}

.site-nav.scrolled {
  background: rgba(0, 14, 84, 0.95);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  min-width: 0;
  color: var(--su-white);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--su-white);
  text-decoration: none;
}

.nav-brand img {
  height: 26px;
  width: auto;
}

.nav-brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
}

.nav-brand-label {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--su-white);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color var(--duration-fast) ease;
}

.nav-link:hover {
  color: var(--su-orange-light);
  text-decoration: none;
}

.nav-link--active {
  color: var(--su-white);
  position: relative;
}

.nav-link--active::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--su-orange);
  border-radius: 1px;
}

@media (max-width: 768px) {
  .site-nav {
    padding: 0 var(--space-4);
    gap: var(--space-4);
  }

  .nav-brand img {
    height: 22px;
  }

  .nav-brand-label {
    display: none;
  }

  .nav-right {
    gap: var(--space-4);
  }

  .nav-link {
    font-size: 0.875rem;
  }
}

@media (max-width: 600px) {
  .site-nav {
    padding: 0 var(--space-3);
    gap: var(--space-3);
  }

  .nav-brand {
    gap: var(--space-2);
  }

  .nav-brand img {
    height: 20px;
  }

  .nav-brand-divider {
    display: none;
  }

  .nav-right {
    gap: var(--space-3);
    flex-shrink: 0;
  }

  .nav-link {
    font-size: 0.8125rem;
  }

  .nav-link--external {
    display: none;
  }
}

@media (max-width: 380px) {
  .site-nav {
    padding: 0 var(--space-2);
    gap: var(--space-2);
  }

  .nav-right {
    gap: var(--space-2);
    flex-shrink: 0;
  }

  .nav-link {
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

.external-link::after {
  content: " ↗";
  font-size: 0.85em;
  color: currentColor;
}

/* Shared external indicator for footer/trust http links not already marked */
.site-footer a[href^="http"]:not(.external-link)::after,
.trust-banner a[href^="http"]:not(.btn)::after {
  content: " ↗";
  font-size: 0.85em;
  color: currentColor;
}

/* Footer (shared) */
.site-footer {
  background: var(--su-blue);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-8) var(--space-7) var(--space-6);
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
}

.footer-inner {
  max-width: var(--container-reading);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-7);
}

.footer-brand img {
  height: 28px;
  width: auto;
  margin-bottom: var(--space-4);
  filter: brightness(0) invert(1);
}

.footer-brand p {
  max-width: 320px;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.7);
}

.footer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--su-white);
  margin-bottom: var(--space-4);
  letter-spacing: 0.01em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer-links a:hover {
  color: var(--su-orange);
  text-decoration: none;
}

.footer-bottom {
  max-width: var(--container-reading);
  margin: var(--space-6) auto 0;
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--fs-tiny);
  color: rgba(255, 255, 255, 0.55);
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-style: italic;
}

@media (max-width: 768px) {
  .site-footer {
    padding: var(--space-7) var(--space-5) var(--space-5);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ── Reduced motion ─────────────────────────────────────── */

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