@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&display=swap");

/* ============================================================
   NEW AI HEALTH
   CORE STYLE SYSTEM

   Ownership:
   - canonical design tokens
   - global normalization
   - shared element defaults
   - shared layout primitives
   - accessibility and motion behavior

   Component and page-specific rules do not belong here.
   ============================================================ */


/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  /* ------------------------------------------------------------
     Publication field
     ------------------------------------------------------------ */

  --page-bg: #fffdfb;

  --surface: #ffffff;
  --surface-soft: #faf9f7;
  --surface-muted: #f5f5f3;

  --surface-hover: #fffaf6;
  --surface-hover-strong: #fff7f1;

  --surface-gloss:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.99) 0%,
      rgba(255, 255, 255, 0.94) 54%,
      rgba(248, 249, 250, 0.92) 100%
    );

  --surface-gloss-hover:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 1) 0%,
      rgba(251, 252, 253, 0.98) 48%,
      rgba(240, 244, 247, 0.96) 100%
    );

  --surface-frosted: rgba(255, 255, 255, 0.88);
  --surface-frosted-strong: rgba(255, 255, 255, 0.96);


  /* ------------------------------------------------------------
     Text
     ------------------------------------------------------------ */

  --text: #17212b;
  --text-primary: var(--text);

  --text-soft: #65717d;
  --text-secondary: var(--text-soft);

  --text-faint: #8b949d;
  --text-inverse: #ffffff;

  --text-strong: #050505;


  /* ------------------------------------------------------------
     Brand
     ------------------------------------------------------------ */

  --red: #ff1f1f;
  --red-dark: #d92020;
  --red-strong: var(--red);

  --blue: #2f6f9f;
  --blue-soft: rgba(47, 111, 159, 0.12);
  --blue-focus: rgba(47, 111, 159, 0.32);


  /* ------------------------------------------------------------
     Borders and separators
     ------------------------------------------------------------ */

  --border: rgba(29, 40, 51, 0.085);
  --border-light: var(--border);

  --border-hover: rgba(29, 40, 51, 0.15);
  --border-strong: rgba(29, 40, 51, 0.21);

  --divider: rgba(29, 40, 51, 0.085);


  /* ------------------------------------------------------------
     Compatibility aliases

     These preserve the current stylesheet contract while the site
     migrates into the new system.
     ------------------------------------------------------------ */

  --white: var(--surface);
  --peach: #fff4ee;

  --light-grey: var(--surface-muted);
  --grey-light: var(--surface-muted);

  --black: var(--text-strong);


  /* ------------------------------------------------------------
     Typography
     ------------------------------------------------------------ */

  --font-sans:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;

  --font-display:
    "Inter Tight",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  --text-display-sm: clamp(2.25rem, 4vw, 3.35rem);
  --text-display: clamp(2.5rem, 5vw, 4rem);
  --text-display-lg: clamp(2.75rem, 5.5vw, 4.4rem);

  --tracking-tight: -0.025em;
  --tracking-display: -0.045em;
  --tracking-hero: -0.055em;


  /* ------------------------------------------------------------
     Spacing
     ------------------------------------------------------------ */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;


  /* ------------------------------------------------------------
     Radius
     ------------------------------------------------------------ */

  --radius-sm: 10px;
  --radius-control: 14px;
  --radius-card: 18px;
  --radius-panel: 20px;
  --radius-pill: 999px;


  /* ------------------------------------------------------------
     Shadows
     ------------------------------------------------------------ */

  --shadow-soft:
    0 1px 2px rgba(20, 27, 34, 0.02),
    0 6px 18px rgba(20, 27, 34, 0.035);

  --shadow-card:
    0 1px 2px rgba(20, 27, 34, 0.025),
    0 8px 24px rgba(20, 27, 34, 0.035);

  --shadow-card-hover:
    0 2px 4px rgba(20, 27, 34, 0.035),
    0 14px 34px rgba(20, 27, 34, 0.06);

  --shadow-panel:
    0 2px 8px rgba(20, 27, 34, 0.035),
    0 18px 48px rgba(20, 27, 34, 0.08);

  --shadow-focus:
    0 0 0 4px rgba(47, 111, 159, 0.1);


  /* ------------------------------------------------------------
     Layout
     ------------------------------------------------------------ */

  --container-width: 960px;
  --shell-width: 1240px;
  --reading-width: 760px;

  --page-gutter: 16px;
  --page-gutter-wide: 20px;

  --grid-gap: 14px;


  /* ------------------------------------------------------------
     Motion
     ------------------------------------------------------------ */

  --duration-fast: 150ms;
  --duration-standard: 180ms;
  --duration-slow: 350ms;

  --ease-standard: ease;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}


/* ============================================================
   GLOBAL NORMALIZATION
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;

  background: var(--page-bg);
  color: var(--text);

  font-family: var(--font-sans);
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-sans);
}

button,
input,
textarea,
select {
  font: inherit;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}


/* ============================================================
   SHARED TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--text);
  text-wrap: balance;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: var(--font-weight-semibold);
}


/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--red);
  text-decoration: none;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;

  transition:
    color var(--duration-standard) var(--ease-standard),
    opacity var(--duration-standard) var(--ease-standard);
}

a:hover {
  color: var(--red-dark);
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--blue-focus);
  outline-offset: 3px;
}

::selection {
  background: var(--blue-soft);
  color: var(--text);
}


/* ============================================================
   SHARED LAYOUT PRIMITIVES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.site-shell {
  width: min(
    var(--shell-width),
    calc(100% - (var(--page-gutter-wide) * 2))
  );
  margin-inline: auto;
}

.reading-column {
  width: min(100%, var(--reading-width));
  margin-inline: auto;
}


/* ============================================================
   SHARED SURFACE PRIMITIVES
   ============================================================ */

.surface {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.surface-gloss {
  position: relative;
  isolation: isolate;

  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-gloss);
  box-shadow: var(--shadow-card);

  transition:
    transform var(--duration-standard) var(--ease-out),
    border-color var(--duration-standard) var(--ease-standard),
    background var(--duration-standard) var(--ease-standard),
    box-shadow var(--duration-standard) var(--ease-out);
}

.surface-gloss::before {
  position: absolute;
  inset: 0;
  z-index: -1;

  border-radius: inherit;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0) 42%
    );

  content: "";
  pointer-events: none;
}

.surface-gloss:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: var(--shadow-card-hover);
}

.surface-frosted {
  border: 1px solid var(--border);
  background: var(--surface-frosted);
  box-shadow: var(--shadow-panel);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  transition:
    border-color var(--duration-standard) var(--ease-standard),
    background var(--duration-standard) var(--ease-standard),
    box-shadow var(--duration-standard) var(--ease-out);
}

.surface-frosted:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: var(--shadow-card-hover);
}

.surface-hover {
  background: var(--surface-hover);
}

.surface-hover-strong {
  background: var(--surface-hover-strong);
}

/* ============================================================
   SHARED VISIBILITY UTILITY
   ============================================================ */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* ============================================================
   RESPONSIVE FOUNDATION
   ============================================================ */

@media (max-width: 760px) {
  :root {
    --page-gutter: 18px;
    --page-gutter-wide: 14px;
  }

  .site-shell {
    width: min(
      var(--shell-width),
      calc(100% - (var(--page-gutter-wide) * 2))
    );
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@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;
  }
}
