@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-400-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/fonts/dm-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/assets/fonts/dm-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #080608;
  --bruise: #140a0e;
  --bone: #e8e2dc;
  --bone-soft: rgba(232, 226, 220, 0.72);
  --muted: rgba(232, 226, 220, 0.48);
  --faint: rgba(232, 226, 220, 0.24);
  --wound: #9e2a3a;
  --wound-glow: rgba(158, 42, 58, 0.35);
  --wound-dim: rgba(158, 42, 58, 0.55);
  --line: rgba(158, 42, 58, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --content: 68rem;
  --gutter: clamp(1rem, 4vw, 1.5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
html, body { min-height: 100%; }
body {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--bone);
  background: var(--void);
  overflow-x: clip;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(158, 42, 58, 0.55); color: #fff; }

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

.void {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 38%, rgba(158, 42, 58, 0.07), transparent 62%),
    radial-gradient(ellipse 40% 35% at 8% 88%, rgba(20, 10, 14, 0.9), transparent 55%),
    linear-gradient(180deg, #050405 0%, var(--void) 45%, #030203 100%);
}

.pulse-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(158, 42, 58, 0.06), transparent 42%);
  animation: breathe 8s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { opacity: 0.45; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.72) 100%);
}

.pulse-rail {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 0;
  pointer-events: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wound-dim), transparent);
  opacity: 0.35;
}

.vigil {
  position: relative;
  z-index: 1;
  width: min(var(--content), 100%);
  margin-inline: auto;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr);
  align-items: start;
  padding:
    max(var(--gutter), env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    max(var(--gutter), env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
}

.vitals {
  position: sticky;
  top: max(var(--gutter), env(safe-area-inset-top));
  min-width: 0;
  padding:
    clamp(1rem, 3vw, 1.5rem)
    clamp(0.85rem, 2.5vw, 1.25rem)
    clamp(1rem, 3vw, 1.5rem)
    0;
  border-right: 1px solid var(--line);
  align-self: start;
}

.ekg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--wound-dim);
  margin-bottom: 1.25rem;
  opacity: 0.85;
}
.ekg-path {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: ekg-draw 4.5s ease-in-out infinite;
}
@keyframes ekg-draw {
  0% { stroke-dashoffset: 420; opacity: 0.4; }
  40% { stroke-dashoffset: 0; opacity: 1; }
  60% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -420; opacity: 0.4; }
}

.readout {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.readout div { min-width: 0; }
.readout dt {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.12rem;
}
.readout dd {
  font-size: 0.72rem;
  color: var(--bone-soft);
  overflow-wrap: anywhere;
}
.readout dd.hot { color: var(--wound); }
.readout dd.bar {
  letter-spacing: 0.05em;
  color: var(--muted);
}

.chart-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 0.65rem;
  border-left: 1px solid var(--wound-dim);
}

.ache {
  min-width: 0;
  padding:
    clamp(1rem, 3vw, 1.75rem)
    0
    clamp(1.5rem, 4vw, 2.5rem)
    clamp(1.25rem, 4vw, 2rem);
  container-type: inline-size;
}

.admission {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.ache h1 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  overflow-wrap: anywhere;
  margin-bottom: 0.65rem;
}
.ache .name {
  display: block;
  font-size: clamp(2.4rem, 0.8rem + 10cqw, 4.5rem);
  color: var(--bone);
  text-shadow: 0 0 60px rgba(158, 42, 58, 0.12);
}
.ache .tld {
  font-size: clamp(1rem, 0.55rem + 2.5cqw, 1.45rem);
  letter-spacing: 0.28em;
  color: var(--wound-dim);
  margin-left: 0.12em;
}

.diagnosis {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 0.9rem + 0.6cqw, 1.25rem);
  line-height: 1.6;
  color: var(--bone-soft);
  max-width: 42ch;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.specimen {
  margin: 0 0 clamp(1.25rem, 3vw, 1.75rem);
  padding: 3px;
  background: linear-gradient(135deg, var(--wound-dim), transparent 55%, var(--wound-dim));
  box-shadow: 0 0 48px rgba(158, 42, 58, 0.08);
}
.specimen-inner {
  padding: clamp(0.55rem, 1.5vw, 0.85rem);
  background: rgba(8, 6, 8, 0.92);
  border: 1px solid var(--line);
}
.specimen .logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0.94;
}
.specimen-caption {
  margin-top: 0.5rem;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}

.manifest {
  font-family: var(--serif);
  font-size: clamp(1rem, 0.88rem + 0.45cqw, 1.08rem);
  line-height: 1.7;
  color: var(--bone-soft);
  max-width: 48ch;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  padding-left: 1rem;
  border-left: 2px solid var(--wound);
}
.manifest em {
  font-style: italic;
  color: var(--bone);
}

.release {
  padding-top: clamp(0.85rem, 2.5vw, 1.25rem);
  border-top: 1px solid var(--line);
}
.release h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 0.85rem + 1.5cqw, 1.55rem);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--bone);
  margin-bottom: 0.3rem;
}
.release .sub {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.6rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone);
  background: transparent;
  border: 1px solid var(--wound);
  box-shadow: 0 0 24px var(--wound-glow);
  transition: background 0.2s ease, color 0.2s ease;
}
.actions a:hover {
  background: var(--wound);
  color: #fff;
}
.actions a.secondary {
  border-color: rgba(232, 226, 220, 0.15);
  box-shadow: none;
  color: var(--muted);
}
.actions a.secondary:hover {
  border-color: var(--bone-soft);
  background: transparent;
  color: var(--bone);
}

.mail-line {
  font-size: 0.65rem;
  color: var(--faint);
  margin-bottom: 0.85rem;
}
.mail-line a {
  color: var(--wound-dim);
  text-decoration: none;
}
.mail-line a:hover { color: var(--wound); }

.disclaimer {
  font-size: 0.62rem;
  line-height: 1.55;
  color: var(--faint);
  max-width: 52ch;
}

.site-foot {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(232, 226, 220, 0.06);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.mark-anchor {
  position: fixed;
  top: max(var(--gutter), env(safe-area-inset-top));
  right: max(var(--gutter), env(safe-area-inset-right));
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(8, 6, 8, 0.85);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px rgba(158, 42, 58, 0.12);
}
.mark-anchor img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.error-vigil {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
}
.error-panel {
  max-width: 22rem;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid var(--line);
  background: rgba(20, 10, 14, 0.88);
  box-shadow: 0 0 60px rgba(158, 42, 58, 0.1);
}
.error-panel img {
  width: 48px;
  height: 48px;
  margin-bottom: 0.85rem;
}
.error-panel h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--wound);
  margin-bottom: 0.45rem;
}
.error-panel p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  line-height: 1.55;
}
.error-panel a {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-soft);
  text-decoration: none;
}
.error-panel a:hover { color: var(--wound); }

@media (max-width: 820px) {
  .vigil {
    grid-template-columns: 1fr;
  }

  .vitals {
    position: relative;
    top: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0 0 1.25rem;
  }

  .ache {
    padding-left: 0;
    padding-top: 1.25rem;
  }

  .pulse-rail { display: none; }
  .actions a { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse-field,
  .ekg-path { animation: none; }
  .ekg-path { stroke-dashoffset: 0; opacity: 0.7; }
  .actions a { transition: none; }
}
