:root {
  color-scheme: light;
  --ink: #12171a;
  --muted: #5f6b70;
  --paper: #f7f8f5;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --line: rgba(18, 23, 26, 0.12);
  --teal: #0f766e;
  --deep-teal: #0b4f49;
  --clay: #b65f4a;
  --amber: #c98722;
  --steel: #2f5d7c;
  --shadow: 0 24px 80px rgba(36, 45, 50, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, #f7f8f5 0%, #eef4f1 54%, #fbf5ec 100%);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
}

body::selection {
  background: rgba(15, 118, 110, 0.2);
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 20;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  padding: 0.65rem 0.9rem;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  border: 1px solid rgba(18, 23, 26, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 36px rgba(31, 43, 47, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 0.65rem;
  min-height: 2.75rem;
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.45rem;
  font-size: 0.96rem;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--deep-teal), var(--teal) 58%, #7cb9a4);
  box-shadow: inset 0 -8px 16px rgba(255, 255, 255, 0.24);
}

.brand-mark span {
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border-left-color: transparent;
}

.nav-links {
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.3rem;
}

.nav-links a {
  min-height: 2.1rem;
  border-radius: 999px;
  padding: 0.56rem 0.82rem;
  color: rgba(18, 23, 26, 0.72);
  font-size: 0.88rem;
  font-weight: 700;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(15, 118, 110, 0.1);
  color: var(--deep-teal);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 86vh;
  padding: 8.5rem max(1rem, calc((100vw - 1180px) / 2)) 5rem;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(247, 248, 245, 0.98) 0%, rgba(247, 248, 245, 0.92) 36%, rgba(247, 248, 245, 0.34) 64%, rgba(247, 248, 245, 0.04) 100%),
    linear-gradient(180deg, transparent 72%, rgba(238, 244, 241, 0.92) 100%);
  pointer-events: none;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(18, 23, 26, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 23, 26, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, transparent 0%, black 20%, black 100%);
}

.workflow-board {
  position: absolute;
  top: clamp(6rem, 12vh, 9rem);
  right: max(-12rem, calc((100vw - 1260px) / 2));
  width: min(820px, 72vw);
  transform: perspective(1500px) rotateY(-12deg) rotateX(5deg);
  transform-origin: center right;
}

.board-shell {
  overflow: hidden;
  border: 1px solid rgba(18, 23, 26, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.board-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
}

.window-controls {
  display: flex;
  gap: 0.42rem;
}

.window-controls span {
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
}

.window-controls span:nth-child(1) {
  background: var(--clay);
}

.window-controls span:nth-child(2) {
  background: var(--amber);
}

.window-controls span:nth-child(3) {
  background: var(--teal);
}

.topbar-search,
.topbar-status {
  min-width: 0;
  border: 1px solid rgba(18, 23, 26, 0.08);
  border-radius: 999px;
  background: rgba(247, 248, 245, 0.78);
  color: rgba(18, 23, 26, 0.68);
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar-search {
  padding: 0.72rem 1rem;
}

.topbar-status {
  padding: 0.72rem 0.85rem;
  color: var(--deep-teal);
}

.board-body {
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) 220px;
  gap: 0;
  min-height: 430px;
}

.encounter-rail,
.note-panel,
.evidence-panel {
  min-width: 0;
  padding: 1.2rem;
}

.encounter-rail {
  border-right: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.72);
}

.rail-label {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.patient-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  margin-bottom: 0.64rem;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.72rem;
}

.patient-item.active {
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.08);
}

.patient-item strong,
.patient-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-item strong {
  font-size: 0.82rem;
}

.patient-item small {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.13);
  color: var(--deep-teal);
  font-size: 0.74rem;
  font-weight: 850;
}

.avatar.slate {
  background: rgba(47, 93, 124, 0.13);
  color: var(--steel);
}

.avatar.coral {
  background: rgba(182, 95, 74, 0.13);
  color: var(--clay);
}

.note-panel {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.84rem;
  font-weight: 800;
}

.panel-heading span {
  color: rgba(18, 23, 26, 0.74);
}

.panel-heading strong {
  color: var(--deep-teal);
}

.note-line {
  height: 0.86rem;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(18, 23, 26, 0.12), rgba(18, 23, 26, 0.04));
}

.note-line.wide {
  width: 92%;
}

.note-line:not(.wide):not(.short) {
  width: 78%;
}

.note-line.short {
  width: 56%;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 2rem;
}

.resource-grid div {
  min-width: 0;
  border: 1px solid rgba(18, 23, 26, 0.08);
  border-radius: 16px;
  background: rgba(247, 248, 245, 0.76);
  padding: 0.82rem;
}

.resource-grid span,
.resource-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.resource-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.resource-grid strong {
  margin-top: 0.32rem;
  font-size: 0.82rem;
}

.evidence-panel {
  background: rgba(247, 248, 245, 0.62);
}

.timeline {
  display: grid;
  gap: 0.68rem;
  margin: 1.3rem 0 1.6rem;
}

.timeline span {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
}

.timeline span:nth-child(1) {
  width: 90%;
}

.timeline span:nth-child(2) {
  width: 70%;
  background: rgba(47, 93, 124, 0.12);
}

.timeline span:nth-child(3) {
  width: 82%;
  background: rgba(182, 95, 74, 0.12);
}

.evidence-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.64rem;
  align-items: start;
  margin-bottom: 0.72rem;
}

.evidence-row span {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: var(--teal);
}

.evidence-row p {
  min-width: 0;
  margin: 0;
  color: rgba(18, 23, 26, 0.7);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.hero-copy {
  width: min(650px, 100%);
  padding: 1.5rem 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--deep-teal);
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  font-weight: 860;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.3rem, 13vw, 9.6rem);
  font-weight: 880;
  letter-spacing: 0;
  line-height: 0.84;
}

.hero-lede {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: rgba(18, 23, 26, 0.72);
  font-size: clamp(1.12rem, 2.8vw, 1.55rem);
  font-weight: 520;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  max-width: 100%;
  border: 1px solid rgba(18, 23, 26, 0.12);
  border-radius: 999px;
  padding: 0.82rem 1.1rem;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.1;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button.primary {
  background: var(--ink);
  color: white;
  box-shadow: 0 16px 34px rgba(18, 23, 26, 0.18);
}

.button.primary:hover,
.button.primary:focus-visible {
  box-shadow: 0 18px 42px rgba(18, 23, 26, 0.23);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.signal-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-block: 1px solid rgba(18, 23, 26, 0.1);
  background: rgba(18, 23, 26, 0.1);
}

.signal-item {
  min-width: 0;
  background: rgba(255, 255, 255, 0.62);
  padding: clamp(1.25rem, 4vw, 2.2rem);
}

.signal-item span {
  display: block;
  margin-bottom: 1.4rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 860;
}

.signal-item strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.2;
}

.signal-item p {
  max-width: 22rem;
  margin: 0.72rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0;
  color: rgba(18, 23, 26, 0.62);
  font-size: 0.84rem;
  font-weight: 650;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .hero {
    min-height: 86vh;
    padding-top: 7.5rem;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgba(247, 248, 245, 0.98) 0%, rgba(247, 248, 245, 0.9) 42%, rgba(247, 248, 245, 0.28) 100%),
      linear-gradient(180deg, transparent 72%, rgba(238, 244, 241, 0.94) 100%);
  }

  .workflow-board {
    top: 42vh;
    right: -18rem;
    width: 760px;
    opacity: 0.82;
    transform: perspective(1400px) rotateY(-18deg) rotateX(7deg) scale(0.9);
  }

  .signal-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    width: min(100% - 1rem, 1180px);
    padding-top: 0.7rem;
  }

  .brand {
    min-height: 2.55rem;
    padding-right: 0.72rem;
  }

  .nav-links a {
    padding-inline: 0.66rem;
    font-size: 0.82rem;
  }

  .hero {
    min-height: 84vh;
    padding: 7rem 1rem 4rem;
  }

  .hero-copy {
    padding-top: 0.5rem;
  }

  .hero-lede {
    max-width: 29rem;
  }

  .hero-actions {
    gap: 0.65rem;
    margin-top: 1.6rem;
  }

  .button {
    flex: 1 1 12rem;
    padding-inline: 0.9rem;
  }

  .workflow-board {
    top: 48vh;
    right: -22rem;
    width: 720px;
    opacity: 0.78;
    transform: perspective(1200px) rotateY(-20deg) rotateX(8deg) scale(0.74);
  }

  .board-body {
    grid-template-columns: 200px 280px 210px;
  }

  .site-footer {
    display: grid;
    width: calc(100% - 2rem);
  }
}

@media (max-width: 420px) {
  .nav-links {
    display: none;
  }

  h1 {
    font-size: clamp(4.1rem, 22vw, 5.4rem);
  }

  .hero-lede {
    font-size: 1.05rem;
  }

  .workflow-board {
    top: 52vh;
    right: -24rem;
    transform: perspective(1100px) rotateY(-22deg) rotateX(8deg) scale(0.64);
  }
}

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