/* Shared Apple/macOS-inspired foundation layer across ml-hpc, Vera, Vita, Ensarkosi, and TopEdu.
   Loaded first so each site keeps its own editorial palette while sharing crisp typography,
   concentric radii, translucent glass navigation, focus rings, reduced-motion, and skip-links. */

:root {
  --font-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Unified Type Scale (12px floor for labels, 16px+ for body & inputs) */
  --text-xs: 0.75rem;                            /* 12px */
  --text-sm: 0.875rem;                           /* 14px */
  --text-base: 1rem;                             /* 16px */
  --text-md: 1.0625rem;                          /* 17px */
  --text-lg: 1.25rem;                            /* 20px */
  --text-xl: clamp(1.5rem, 2.4vw, 1.875rem);     /* 24–30px */
  --text-2xl: clamp(1.875rem, 3.6vw, 2.5rem);    /* 30–40px */
  --text-hero: clamp(2.25rem, 5.2vw, 3.75rem);   /* 36–60px */

  /* Concentric Radius Ladder */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Motion & Material */
  --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --glass-blur: saturate(200%) blur(24px) brightness(1.03);
  --glass-specular: linear-gradient(180deg, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0.14) 100%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -1px 0 rgba(255, 255, 255, 0.3), 0 4px 20px -6px rgba(24, 42, 37, 0.08);
  --glass-specular-dark: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  --glass-shadow-dark: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.05), 0 6px 24px -6px rgba(0, 0, 0, 0.38);

  /* Layout Chrome */
  --nav-height: 56px;
  --gutter: clamp(16px, 4vw, 40px);
  --shell-max: 1180px;
  --shell-width: min(calc(100% - 2 * var(--gutter)), var(--shell-max));
  --reading-width: min(calc(100% - 2 * var(--gutter)), 680px);

  /* Focus Ring */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent-focus, #0071e3) 35%, transparent);
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Unified keyboard focus visibility across every surface */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--accent-focus, currentColor);
  outline-offset: 2px;
}

/* Accessible skip-to-content link */
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink, #17202e);
  color: var(--paper, #ffffff);
  font: 600 14px/1.2 var(--font-ui);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: top var(--dur-fast) var(--ease-apple);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
}

/* Prevent iOS Safari auto-zoom on touch inputs (<16px triggers viewport zoom) */
@media (pointer: coarse) {
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    font-size: max(16px, 1em);
  }
}

/* Respect Reduced Motion everywhere */
@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;
  }
}
