/* =========================================================
   MEDICYCLE — DESIGN TOKENS
   Palette: cool paper white, deep pharmacy teal, muted leaf green,
   clinical blue (used sparingly for "human" data vs. "environment" data),
   and a restrained clay/amber pair for risk semantics.
   ========================================================= */
:root {
  --paper: #F6F8F6;
  --surface: #FFFFFF;
  --ink: #10201B;
  --ink-soft: #4A5C56;
  --line: #DCE5E1;
  --line-soft: #EAF0ED;

  --teal-900: #0B4A40;
  --teal-700: #0F6B5C;
  --teal-500: #1E8C77;
  --teal-100: #E3F2ED;

  --leaf-600: #5C8A3A;
  --leaf-100: #EEF4E5;

  --clinical-blue: #2B6CB0;
  --clinical-blue-100: #E7EFF9;

  --risk-low: #2F8F72;
  --risk-low-bg: #E4F3EC;
  --risk-medium: #B9812B;
  --risk-medium-bg: #FBF0DD;
  --risk-high: #B0483A;
  --risk-high-bg: #FBE7E3;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-panel: 0 1px 2px rgba(16,32,27,0.04), 0 12px 32px -16px rgba(16,32,27,0.16);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.4em; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }
a { color: inherit; }
button { font-family: inherit; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 3px;
}

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

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }

.eyebrow { font-size: 13px; color: var(--teal-700); font-weight: 600; margin-bottom: 10px; }
.lede { font-size: 19px; max-width: 54ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-700); color: #fff; }
.btn-primary:hover { background: var(--teal-900); box-shadow: 0 8px 20px -8px rgba(15,107,92,0.55); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--teal-700); color: var(--teal-700); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246,248,246,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--ink);
}
.brand-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--teal-700); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--teal-700);
  border-radius: 2px;
}
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 36px;
  background: var(--surface);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}
.footer-note {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 46ch;
}
.footer-disclaimer {
  margin-top: 24px;
  padding: 14px 18px;
  background: var(--teal-100);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--teal-900);
  border: 1px solid var(--line-soft);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px;
}
.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-panel);
}

/* Feature cards: pharmacy-label styling — flat, left rule, no shadow */
.rx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-700);
  border-radius: var(--radius-sm);
  padding: 24px 24px 22px;
}
.rx-card h3 { font-size: 18px; margin-bottom: 8px; }
.rx-card p { font-size: 14.5px; margin: 0; }
.rx-card .rx-icon { color: var(--teal-700); margin-bottom: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}

/* ---------- Badges / labels ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
.tag-sim { background: var(--clinical-blue-100); color: var(--clinical-blue); }
.tag-teal { background: var(--teal-100); color: var(--teal-700); }
.tag-leaf { background: var(--leaf-100); color: var(--leaf-600); }

.risk-pill { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; display: inline-block; }
.risk-pill.low { background: var(--risk-low-bg); color: var(--risk-low); }
.risk-pill.medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.risk-pill.high { background: var(--risk-high-bg); color: var(--risk-high); }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.05;
  max-width: 14ch;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-proto-note {
  margin-top: 26px;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Mini pathway diagram used on the landing page hero */
.mini-glow {
  position: absolute;
  width: 520px; height: 520px;
  right: -160px; top: -120px;
  background: radial-gradient(circle, rgba(30,140,119,0.14) 0%, rgba(30,140,119,0) 70%);
  pointer-events: none;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.field select, .field input[type="text"], .field input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field select:focus, .field input:focus {
  border-color: var(--teal-500);
  background: var(--surface);
  outline: none;
}
.radio-row { display: flex; gap: 10px; }
.radio-chip {
  flex: 1;
  text-align: center;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
}
.radio-chip.selected { border-color: var(--teal-700); color: var(--teal-700); background: var(--teal-100); }

/* ---------- Risk gauge ---------- */
.gauge-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.gauge-figure { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.gauge-figure svg { transform: rotate(-90deg); }
.gauge-number {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-number .val { font-family: var(--font-data); font-size: 30px; font-weight: 600; color: var(--ink); }
.gauge-number .lbl { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.factor-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.factor-row .name { width: 190px; font-size: 13.5px; color: var(--ink); flex-shrink: 0; }
.factor-bar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.factor-bar > span { display: block; height: 100%; background: var(--teal-600, var(--teal-700)); border-radius: 99px; }
.factor-row .num { width: 34px; text-align: right; font-family: var(--font-data); font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Pathway (Follow the Medicine) ---------- */
.pathway-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 4px;
}
.pathway-toggle button {
  background: none; border: none; cursor: pointer;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
}
.pathway-toggle button.active { background: var(--teal-700); color: #fff; }

.pathway {
  position: relative;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pathway-node {
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.pathway-node:hover { background: var(--surface); border-color: var(--line); }
.pathway-node.open { background: var(--teal-100); border-color: var(--teal-500); }
.pathway-index {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--teal-700);
  color: var(--teal-700);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-data); font-size: 14px; font-weight: 600;
}
.pathway-node.open .pathway-index { background: var(--teal-700); color: #fff; }
.pathway-label { font-size: 17px; font-weight: 600; }
.pathway-sub { font-size: 13.5px; color: var(--ink-soft); }
.pathway-connector {
  width: 1px;
  height: 26px;
  background: var(--line);
  margin-left: 39px;
}
.pathway-detail {
  margin: 6px 0 6px 58px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 68ch;
  animation: expand 0.22s ease;
}
@keyframes expand { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: translateY(0);} }

/* ---------- Dashboard ---------- */
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.stat-tile .stat-num { font-family: var(--font-data); font-size: 28px; font-weight: 600; color: var(--ink); }
.stat-tile .stat-lbl { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.chart-card h3 { font-size: 16px; margin-bottom: 4px; }
.chart-card .chart-sub { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 18px; }

.demo-slider-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.demo-slider-row .lbl { width: 150px; font-size: 13.5px; }
.demo-slider-row input[type="range"] { flex: 1; accent-color: var(--teal-700); }
.demo-slider-row .num { width: 36px; text-align: right; font-family: var(--font-data); font-size: 13px; }

.suggestion-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suggestion-list li { display: flex; gap: 10px; font-size: 14.5px; color: var(--ink-soft); align-items: flex-start; }
.suggestion-list li svg { flex-shrink: 0; margin-top: 2px; color: var(--teal-700); }

/* ---------- AI Assistant ---------- */
.chat-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
}
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 74%; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.msg.bot { background: var(--teal-100); color: var(--teal-900); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 16px; }
.chat-chip {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 8px 14px; font-size: 13px;
  cursor: pointer; color: var(--ink-soft);
}
.chat-chip:hover { border-color: var(--teal-700); color: var(--teal-700); }
.chat-input-row { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.chat-input-row input {
  flex: 1; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); font-size: 14.5px;
}
.chat-input-row input:focus { outline: none; border-color: var(--teal-500); background: var(--surface); }
.typing-dots span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px;
  background: var(--teal-700); border-radius: 50%;
  animation: bounce 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- Impact ---------- */
.impact-tile { text-align: left; }
.impact-tile .impact-num { font-family: var(--font-data); font-size: 40px; font-weight: 600; color: var(--teal-700); }
.impact-tile .impact-lbl { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Waste prevention planner ---------- */
.planner-result {
  display: flex; align-items: baseline; gap: 10px; margin-top: 4px;
}
.planner-result .n { font-family: var(--font-data); font-size: 34px; font-weight: 600; color: var(--risk-medium); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 40px 0; border: none; }
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--clinical-blue-100);
  border: 1px solid #CFE0F2;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  color: #1F4E85;
}
.callout svg { flex-shrink: 0; margin-top: 1px; }
.callout.warn { background: var(--risk-medium-bg); border-color: #EAD3A2; color: #7A5620; }

.icon-btn { background: none; border: none; cursor: pointer; color: var(--ink-soft); display: inline-flex; }
.icon-btn:hover { color: var(--teal-700); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state svg { margin: 0 auto 16px; color: var(--line); }

.page-head { padding: 56px 0 8px; }
.page-head .eyebrow { margin-bottom: 6px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--teal-700); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* fade transition between pages */
.page-enter { animation: fadeIn 0.28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
