/* =========================================================================
   CARE·CORE INSIGHT — style.css
   Design tokens + custom components layered on top of Tailwind CDN utilities.
   ========================================================================= */

:root {
  --canvas: #0C141C;
  --surface: #14212A;
  --elevated: #1B2C35;
  --header: #071016;
  --cta: #0EA5A4;
  --secondary: #67D3C5;
  --highlight: #D6B56A;
  --success: #72C58A;
  --danger: #E08A7D;
  --text: #F1F7F6;
  --muted: #A8BABD;
  --border: rgba(168, 186, 189, 0.16);
}

* {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html,
body {
  background-color: var(--canvas);
  color: var(--text);
}

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

.font-mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
     Logo badge
     ------------------------------------------------------------------------- */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(27, 44, 53, 0.7), rgba(20, 33, 42, 0.7));
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.brand-badge:hover,
.brand-badge:focus-visible {
  border-color: rgba(103, 211, 197, 0.55);
  box-shadow: 0 0 0 1px rgba(103, 211, 197, 0.25), 0 0 24px rgba(14, 165, 164, 0.35);
}

.brand-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 5px;
  background: radial-gradient(circle at 30% 30%, rgba(103, 211, 197, 0.35), rgba(14, 165, 164, 0.12));
  border: 1px solid rgba(103, 211, 197, 0.4);
  color: var(--secondary);
}

.brand-badge-name {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}

/* -------------------------------------------------------------------------
     Navigation
     ------------------------------------------------------------------------- */
.site-header {
  background-color: var(--header);
  border-bottom: 1px solid var(--border);
}

header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.nav-link {
  position: relative;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.65rem;
  height: 2px;
  background: var(--cta);
  border-radius: 2px;
}

#navMenu {
  transition: max-height 0.35s ease;
}

@media (max-width: 1023px) {
  #navMenu {
    max-height: 0;
    overflow: hidden;
  }

  #navMenu.nav-open {
    max-height: 32rem;
  }
}

/* -------------------------------------------------------------------------
     Buttons
     ------------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  background: var(--cta);
  color: #06201F;
  font-weight: 600;
  font-size: 0.94rem;
  border-radius: 6px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 8px 24px -10px rgba(14, 165, 164, 0.55);
}

.btn-primary:hover {
  background: #12BAB8;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid rgba(103, 211, 197, 0.4);
  color: var(--text);
  font-weight: 500;
  font-size: 0.94rem;
  border-radius: 6px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.btn-secondary:hover {
  border-color: var(--secondary);
  background: rgba(103, 211, 197, 0.08);
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  transition: gap 0.2s ease, color 0.2s ease;
}

.btn-ghost-sm:hover {
  gap: 0.5rem;
  color: var(--text);
}

/* -------------------------------------------------------------------------
     Cards & panels
     ------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.panel-elevated {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.specialty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.4rem;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.specialty-card:hover {
  border-color: rgba(103, 211, 197, 0.45);
  transform: translateY(-3px);
  background: var(--elevated);
}

.specialty-icon-badge {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 20%, rgba(14, 165, 164, 0.28), rgba(20, 33, 42, 0.4));
  border: 1px solid rgba(103, 211, 197, 0.3);
  color: var(--secondary);
}

.clinical-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--highlight);
  border: 1px solid rgba(214, 181, 106, 0.35);
  border-radius: 999px;
  background: rgba(214, 181, 106, 0.08);
}

.clinical-badge.success {
  color: var(--success);
  border-color: rgba(114, 197, 138, 0.35);
  background: rgba(114, 197, 138, 0.08);
}

.clinical-badge.cta {
  color: var(--secondary);
  border-color: rgba(103, 211, 197, 0.35);
  background: rgba(103, 211, 197, 0.08);
}

/* -------------------------------------------------------------------------
     Forms
     ------------------------------------------------------------------------- */
.field-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: block;
}

.field-input {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.2s ease;
}

.field-input:focus {
  border-color: var(--secondary);
}

.field-input.field-invalid {
  border-color: var(--danger);
}

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.35rem;
}

.symptom-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.symptom-result:last-child {
  border-bottom: none;
}

.symptom-result:hover {
  background: var(--elevated);
}

/* -------------------------------------------------------------------------
     Filters
     ------------------------------------------------------------------------- */
.filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.625rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pill:hover {
  border-color: rgba(103, 211, 197, 0.4);
  color: var(--text);
}

.filter-pill.filter-active {
  background: var(--cta);
  border-color: var(--cta);
  color: #06201F;
  font-weight: 600;
}

/* -------------------------------------------------------------------------
     Ambient background elements
     ------------------------------------------------------------------------- */
.ambient-grid {
  background-image:
    linear-gradient(rgba(103, 211, 197, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 211, 197, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

.ambient-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

@keyframes driftSlow {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(24px, -18px) scale(1.08);
  }
}

.animate-drift {
  animation: driftSlow 14s ease-in-out infinite;
}

@keyframes driftSlow2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-20px, 16px) scale(1.05);
  }
}

.animate-drift-alt {
  animation: driftSlow2 18s ease-in-out infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-120px);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--secondary);
  animation: floatParticle 8s linear infinite;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-sequence>* {
  animation: heroFadeUp 0.8s ease both;
}

.hero-sequence>*:nth-child(1) {
  animation-delay: 0.05s;
}

.hero-sequence>*:nth-child(2) {
  animation-delay: 0.18s;
}

.hero-sequence>*:nth-child(3) {
  animation-delay: 0.32s;
}

.hero-sequence>*:nth-child(4) {
  animation-delay: 0.46s;
}

.hero-sequence>*:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.hero-gradient {
  background: linear-gradient(120deg, #0C141C 0%, #103C40 32%, #0F5D5B 52%, #14212A 78%, #0C141C 100%);
  background-size: 220% 220%;
  animation: gradientShift 16s ease infinite;
}

.divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.stat-figure {
  font-family: 'Fraunces', Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.section-alt {
  background: var(--surface);
}

.card-tilt {
  transform: perspective(1000px) rotateX(0deg);
  transition: transform 0.4s ease;
}

.card-tilt:hover {
  transform: perspective(1000px) rotateX(2deg) translateY(-2px);
}

::selection {
  background: rgba(14, 165, 164, 0.35);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--cta);
  color: #06201F;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* -------------------------------------------------------------------------
     Article body
     ------------------------------------------------------------------------- */
.article-num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(103, 211, 197, 0.35);
  border-radius: 6px;
  background: rgba(14, 165, 164, 0.1);
  flex-shrink: 0;
}

.article-know-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.15rem 1.35rem;
  position: relative;
  overflow: hidden;
}

.article-know-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cta), transparent);
}

.article-lead {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--muted);
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 2px solid var(--cta);
}

.article-block {
  margin-top: 3.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 6.5rem;
}

.article-block-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.article-figure {
  position: relative;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 14rem;
}

.article-figure img {
  width: 100%;
  height: 100%;
  min-height: 14rem;
  object-fit: cover;
  display: block;
}

.article-figure figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4rem 1rem 0.85rem;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: linear-gradient(transparent, rgba(7, 16, 22, 0.92));
}

.article-metric {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1rem;
}

.article-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 211, 197, 0.28);
  background: rgba(14, 165, 164, 0.08);
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 500;
}

.article-pull {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.6rem;
  position: relative;
}

.article-pull::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  border-radius: 3px;
  background: var(--cta);
}

.article-pull p {
  padding-left: 0.6rem;
}

.article-screen-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.article-screen-card:hover {
  border-color: rgba(103, 211, 197, 0.4);
  background: var(--elevated);
}

.article-safety {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 3.25rem;
  padding: 1.4rem 1.5rem;
  background: rgba(214, 181, 106, 0.07);
  border: 1px solid rgba(214, 181, 106, 0.32);
  border-radius: 10px;
}

.article-safety-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(214, 181, 106, 0.14);
  border: 1px solid rgba(214, 181, 106, 0.4);
  color: var(--highlight);
  flex-shrink: 0;
}

.article-source {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.article-toc-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.45rem;
  font-size: 0.86rem;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.article-toc-link span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--secondary);
  width: 1.4rem;
}

.article-toc-link:hover {
  color: var(--text);
  background: rgba(103, 211, 197, 0.07);
}

/* Hide Scrollbar */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Offset for fixed header */
body {
  padding-top: 3rem;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}