@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono-Bold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/assets/fonts/SpaceMono-BoldItalic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
    --bg: #090c11;
    --bg-grid: #0d1118;
    --surface: #12161d;
    --surface-2: #181e27;
    --line: #262d38;
    --line-soft: #1a2029;

    --text: #e9edf3;
    --text-dim: #8d97a6;
    --text-faint: #545e6e;

    --accent-rx: #ff5470;      /* prescription-label red   */
    --accent-rx-dim: #7a2a37;
    --accent-scan: #49e0c8;    /* clinical scan-line teal  */
    --accent-scan-dim: #1f5850;
    --accent-amber: #ffb454;   /* amber pill-bottle glow   */

    --container: 1180px;
    --edge: 2px;
}

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

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(ellipse at 20% -10%, rgba(73, 224, 200, 0.06), transparent 45%),
        radial-gradient(ellipse at 85% 0%, rgba(255, 84, 112, 0.05), transparent 40%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Space Mono', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* faint fixed dot-grid, like graph paper under a specimen */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

.mono {
    letter-spacing: 0.04em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-scan);
}
.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-scan);
    box-shadow: 0 0 8px var(--accent-scan);
}

.section {
    position: relative;
    padding: 88px 0;
    z-index: 1;
}
.section-head {
    max-width: 640px;
    margin-bottom: 44px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 38px); }
.section-head p { font-size: 16px; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.btn:hover { border-color: var(--accent-scan); transform: translateY(-1px); }
.btn-primary {
    background: var(--accent-rx);
    border-color: var(--accent-rx);
    color: #16060a;
    font-weight: 700;
}
.btn-primary:hover { background: #ff6b83; border-color: #ff6b83; }
.btn-ghost:hover { color: var(--accent-scan); }

/* ---------------------------------------------------------------
   Nav
   --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(9, 12, 17, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
}
.brand .mark {
    width: 34px;
    height: 34px;
    border: 1px solid var(--accent-scan);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: var(--accent-scan);
    position: relative;
}
.brand .mark::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid var(--accent-scan);
    opacity: 0.25;
}
.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 0.18em;
    color: var(--text-faint);
    font-weight: 400;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 13px;
    letter-spacing: 0.04em;
}
.nav-links a {
    color: var(--text-dim);
    position: relative;
    padding: 4px 0;
    transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: var(--accent-rx);
}
.nav-runtime {
    color: var(--text-faint);
    font-size: 11px;
    white-space: nowrap;
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
    padding: 90px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 48px;
    align-items: center;
}
.rx-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--accent-rx-dim);
    color: var(--accent-rx);
    background: rgba(255, 84, 112, 0.06);
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 22px;
}
.hero h1 {
    font-size: clamp(38px, 5.6vw, 66px);
    max-width: 15ch;
}
.hero h1 .accent { color: var(--accent-scan); }
.hero-sub {
    max-width: 46ch;
    font-size: 17px;
    margin-top: 18px;
}
.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.hero-meta {
    display: flex;
    gap: 28px;
    margin-top: 46px;
    font-size: 12px;
    color: var(--text-faint);
    flex-wrap: wrap;
}
.hero-meta strong { color: var(--text-dim); display: block; font-size: 11px; letter-spacing: 0.1em; }

/* the vial: signature hero graphic */
.vial {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3 / 4;
}
.vial svg { width: 100%; height: 100%; }
.scan-sweep {
    position: absolute;
    left: 6%;
    right: 6%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-scan), transparent);
    box-shadow: 0 0 12px var(--accent-scan);
    animation: sweep 3.6s ease-in-out infinite;
}
@keyframes sweep {
    0%   { top: 8%; opacity: 0; }
    10%  { opacity: 1; }
    50%  { top: 88%; opacity: 1; }
    60%  { opacity: 0; }
    100% { top: 88%; opacity: 0; }
}

/* ---------------------------------------------------------------
   Marquee — "active ingredients"
   --------------------------------------------------------------- */
.marquee-wrap {
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface);
    padding: 16px 0;
    overflow: hidden;
    position: relative;
}
.marquee-label {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    padding-right: 16px;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--accent-amber);
    z-index: 2;
}
.marquee-track {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: marquee 32s linear infinite;
    width: max-content;
    padding-left: 180px;
}
.marquee-track span {
    font-size: 13px;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    gap: 10px;
}
.marquee-track span::before { content: '+'; color: var(--accent-scan); }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------
   Capsule divider — signature element between sections
   --------------------------------------------------------------- */
.capsule-divider {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 46px 0;
}
.capsule-divider .line { flex: 1; height: 1px; background: var(--line); }
.capsule-divider svg { flex-shrink: 0; }
.capsule-divider .code {
    font-size: 10px;
    color: var(--text-faint);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* ---------------------------------------------------------------
   Post grid & cards
   --------------------------------------------------------------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s ease, transform 0.25s ease;
    position: relative;
}
.post-card:hover { border-color: var(--accent-scan); transform: translateY(-3px); }
.post-card .thumb {
    aspect-ratio: 16 / 11;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    position: relative;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .thumb::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(9,12,17,0.5));
}
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-tagrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.card-tagrow .cat { color: var(--accent-rx); }
.card-tagrow .dose { color: var(--text-faint); }
.post-card h3 { font-size: 19px; }
.post-card p { font-size: 14px; margin-bottom: 4px; }
.card-foot {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 10.5px;
    color: var(--text-faint);
}
.card-foot .read-link { color: var(--accent-scan); }

.tag-pill {
    display: inline-block;
    border: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 10.5px;
    padding: 3px 8px;
    letter-spacing: 0.04em;
}

.grid-footer {
    display: flex;
    justify-content: center;
    margin-top: 44px;
}

/* ---------------------------------------------------------------
   Category strip / formulary index
   --------------------------------------------------------------- */
.formulary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.formulary a {
    background: var(--surface);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background 0.2s ease;
}
.formulary a:hover { background: var(--surface-2); }
.formulary .idx { font-size: 11px; color: var(--accent-amber); }
.formulary h4 { font-size: 16px; margin: 0; }
.formulary p { font-size: 13px; margin: 0; }
.formulary .count { font-size: 11px; color: var(--text-faint); margin-top: auto; }

/* ---------------------------------------------------------------
   Filter bar (journal listing)
   --------------------------------------------------------------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-bar a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    color: var(--text-dim);
}
.filter-bar a.active {
    border-color: var(--accent-rx);
    color: var(--accent-rx);
    background: rgba(255, 84, 112, 0.06);
}
.filter-bar a:hover { border-color: var(--accent-scan); color: var(--text); }

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
    font-size: 13px;
}
.pagination a, .pagination span {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    color: var(--text-dim);
}
.pagination a:hover { border-color: var(--accent-scan); color: var(--text); }
.pagination .current { border-color: var(--accent-rx); color: var(--accent-rx); }

/* ---------------------------------------------------------------
   Single post — patient information leaflet framing
   --------------------------------------------------------------- */
.post-header { padding: 60px 0 30px; }
.breadcrumb {
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 26px;
    letter-spacing: 0.06em;
}
.breadcrumb a:hover { color: var(--accent-scan); }
.post-header h1 { font-size: clamp(30px, 5vw, 48px); max-width: 20ch; }

.label-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    margin: 30px 0 36px;
}
.label-strip div {
    padding: 16px 18px;
    border-right: 1px solid var(--line);
}
.label-strip div:last-child { border-right: none; }
.label-strip .k {
    display: block;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 6px;
}
.label-strip .v {
    font-size: 14px;
    color: var(--accent-scan);
}
.label-strip .v.rx { color: var(--accent-rx); }
.label-strip .v.amber { color: var(--accent-amber); }

.post-featured {
    border: 1px solid var(--line);
    aspect-ratio: 21 / 9;
    overflow: hidden;
    margin-bottom: 50px;
}
.post-featured img { width: 100%; height: 100%; object-fit: cover; }

.post-body {
    max-width: 720px;
    font-size: 17px;
}
.post-body p { color: var(--text); color: #cdd5e0; }
.post-body em { color: var(--accent-amber); font-style: normal; }

.compound-list {
    margin-top: 56px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}
.compound-list .eyebrow { margin-bottom: 14px; }
.compound-list .tags { display: flex; gap: 8px; flex-wrap: wrap; }

.related {
    margin-top: 70px;
    padding-top: 50px;
    border-top: 1px solid var(--line-soft);
}

.subject-record {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 40px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
}
.subject-photo {
    position: relative;
    width: 16rem;
    height: 20rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}
.subject-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: luminosity;
}
.subject-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 30px;
    margin: 22px 0 8px;
    font-size: 13px;
}
.subject-fields div span { display: block; color: var(--text-faint); font-size: 10px; letter-spacing: 0.1em; margin-bottom: 4px; }
.subject-fields div strong { color: var(--text); font-weight: 500; }

.hangup-log {
    margin-top: 60px;
}
.hangup-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line-soft);
}
.hangup-item:last-child { border-bottom: none; }
.hangup-item .tag { font-size: 11px; color: var(--accent-amber); letter-spacing: 0.06em; }
.hangup-item h4 { font-size: 17px; margin-bottom: 6px; }
.hangup-item p { font-size: 14px; margin: 0; }

/* ---------------------------------------------------------------
   404
   --------------------------------------------------------------- */
.error-page {
    padding: 140px 0;
    text-align: center;
}
.error-code {
    font-size: 13px;
    color: var(--accent-rx);
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}
.error-page h1 { font-size: clamp(32px, 6vw, 56px); }
.error-page p { max-width: 46ch; margin: 16px auto 34px; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line-soft);
    padding: 56px 0 34px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 40px;
}
.footer-grid h5 {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 16px;
}
.footer-grid ul li { margin-bottom: 10px; font-size: 14px; }
.footer-grid ul li a:hover { color: var(--accent-scan); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
    font-size: 11px;
    color: var(--text-faint);
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------------------------------------------------------------
   Reveal-on-scroll (scan-in)
   --------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .vial { max-width: 220px; margin-top: 20px; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .subject-record { grid-template-columns: 1fr; }
    .subject-photo { max-width: 200px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .nav-links { position: fixed; top: 66px; left: 0; right: 0; bottom: 0;
        background: var(--bg); flex-direction: column; align-items: flex-start;
        padding: 30px 28px; gap: 22px; transform: translateX(100%);
        transition: transform 0.3s ease; z-index: 40; }
    .nav-links.open { transform: translateX(0); }
    .nav-toggle { display: flex; }
    .nav-runtime { display: none; }
    .post-grid { grid-template-columns: 1fr; }
    .label-strip { grid-template-columns: 1fr 1fr; }
    .label-strip div:nth-child(2) { border-right: none; }
    .formulary { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
}
