/* @ekm-tags: style, ui-shell */
/*
 * Pearl and Pearl Night (design refresh v2; owner 2026-10-23): the EKM website's look, portal-wide.
 * Erin picked Direction B's colour fade ("this color fade not the rest") with Direction A's layout and type:
 *   - the page is the website's Pearl ombre (#E6E1DA to white); Pearl Night is its designed dark counterpart (warm onyx);
 *   - Inter Tight for the interface, Instrument Serif for display titles and figures;
 *   - white sheets with a soft two-layer shadow, a frosted glass top bar;
 *   - one champagne accent; no pills (the pill radius becomes the sheet radius);
 *   - calm motion on the website's ease.
 * Colours come from the THEMES entries (index.html), so the theme engine, contrast fixes and every --c-* rule still apply.
 * This file only adds what a palette cannot: the ombre, the type, shape, depth, motion and the glass bar.
 */
html[data-theme="pearl"],
html[data-theme="pearl_night"] {
  --font-ui: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-metrics: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Serif', 'Cormorant Garamond', 'Iowan Old Style', serif;
  --ekm-ds-font: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-control: 12px;
  --radius-card: 22px;
  --radius-modal: 24px;
  --radius-pill: 14px;
  --hp-radius: 22px;
  --motion-fast: 150ms;
  --motion-base: 220ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
html[data-theme="pearl"] {
  --shadow-card: 0 1px 2px rgba(31, 26, 23, .04), 0 12px 32px rgba(31, 26, 23, .08);
  --shadow-overlay: 0 1px 2px rgba(31, 26, 23, .05), 0 24px 56px -12px rgba(60, 45, 30, .20);
  --shadow-modal: 0 30px 80px -30px rgba(60, 45, 30, .32), 0 1px 2px rgba(31, 26, 23, .06);
  --hp-shadow: 0 1px 2px rgba(31, 26, 23, .04), 0 12px 32px rgba(31, 26, 23, .08);
  --pearl-bar: rgba(230, 225, 218, .80);
  --pearl-bar-edge: rgba(31, 26, 23, .08);
}
html[data-theme="pearl_night"] {
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .30), 0 14px 36px rgba(0, 0, 0, .34);
  --shadow-overlay: 0 1px 2px rgba(0, 0, 0, .35), 0 24px 56px -12px rgba(0, 0, 0, .55);
  --shadow-modal: 0 30px 80px -30px rgba(0, 0, 0, .70), 0 1px 2px rgba(0, 0, 0, .40);
  --hp-shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 14px 36px rgba(0, 0, 0, .34);
  --pearl-bar: rgba(30, 31, 35, .72);
  --pearl-bar-edge: rgba(243, 241, 236, .08);
}

/* the ombre: fixed to the viewport, so every screen sits on the same fade */
html[data-theme="pearl"] body::before {
  opacity: 1;
  background: linear-gradient(180deg, #E6E1DA 0%, #EFEBE5 30%, #F9F7F4 62%, #FFFFFF 100%);
  background-repeat: no-repeat;
}
html[data-theme="pearl_night"] body::before {
  opacity: 1;
  background: linear-gradient(180deg, #2B2C30 0%, #18191C 34%, #0E0F11 68%, #070708 100%);
  background-repeat: no-repeat;
}

/* type: Inter Tight everywhere the UI font reaches; numbers keep even widths */
html:is([data-theme="pearl"], [data-theme="pearl_night"]) body {
  font-family: var(--font-ui);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* the top bar is frosted glass over the ombre */
html:is([data-theme="pearl"], [data-theme="pearl_night"]) .hp-topnav {
  font-family: var(--font-ui);
  background: var(--pearl-bar);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: inset 0 -1px 0 var(--pearl-bar-edge);
}

/* the side rail is frosted too (the engine's generated sidebar token is a cool tint the owner ruled out) */
html[data-theme="pearl"][data-theme-engine] .hp-nav-rail,
html[data-theme="pearl"] .hp-nav-rail {
  background: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
html[data-theme="pearl_night"][data-theme-engine] .hp-nav-rail,
html[data-theme="pearl_night"] .hp-nav-rail {
  background: rgba(28, 29, 33, .55);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

/* the Home greeting, name, date and clock keep their own type (owner 2026-10-24: "I don't want that changed") */

/* patient chart: text on the ink-filled primary button and active rail item is the page colour, never the card's (in dark
   the card token is lifted toward the ink, which left "Generate note" light-on-light) */
html[data-theme="pearl_night"] .pch-root { --pch-on-ink: #121316; }

/* AA on Pearl's own surfaces (contrast guard, 2026-10-23): text the older themes tinted or faded */
html[data-theme="pearl_night"] .hp-awareness-row .hp-hero-greeting,
html[data-theme="pearl_night"] .hp-awareness-row.hp-awareness-row--hero-only .hp-hero-greeting,
html[data-theme="pearl_night"] #home-hero-clock-meta { color: #DADCE0 !important; opacity: 1 !important; }
html[data-theme="pearl"] .cf-chip,
html[data-theme="pearl"] .erc-chip { color: #5C4630; }
html[data-theme="pearl"] .ekm-roadmap-status { color: #2F5F96; }
html[data-theme="pearl"] .msr-day-tab-count-lbl { opacity: 1; }
html[data-theme="pearl"] .ekm-roadmap-status--in_progress { color: #5C4630; }
/* calendar: the License/Renewal type label is painted inline in #b8703f (4:1 on the Pearl Night card) */
html[data-theme="pearl_night"] span[style*="color:#b8703f"] { color: #DDA27A !important; }
/* Academy badges: a locked badge reads as muted text, not as text faded to 45% */
html:is([data-theme="pearl"], [data-theme="pearl_night"]) .csh-badge:not(.is-earned) { opacity: 1; color: var(--c-muted); border-style: dashed; }

@media (prefers-reduced-motion: reduce) {
  html:is([data-theme="pearl"], [data-theme="pearl_night"]) {
    --motion-fast: 0ms;
    --motion-base: 0ms;
  }
}
