/* Get Med Ed — site styles
   Dark editorial theme: full-bleed night hero, sharp edges, dense type,
   red trace accent, mono readouts. */

:root {
    --bg: #0c0e10;
    --bg-raised: #121517;
    --text: #f2f0ec;
    --text-dim: rgba(242, 240, 236, 0.6);
    --line: rgba(242, 240, 236, 0.14);
    --red: #ff3b26;
    --red-deep: #d92e1a;
    --red-darker: #b8250f;
    --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Spline Sans Mono", "Courier New", monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

a {
    color: var(--text);
    transition: color 0.18s ease;
}

a:hover {
    color: var(--red);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

section {
    scroll-margin-top: 64px;
}

.container {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--red);
}

/* ---------- Masthead (static, scrolls away) ---------- */

.masthead {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 24px;
    overflow: hidden;
}

/* the trace runs the full width behind the wordmark's plate */
.masthead-trace {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 40px;
    color: var(--red);
    pointer-events: none;
}

/* soft scrim: the trace stays faintly visible behind the wordmark */
.masthead-name {
    position: relative;
    z-index: 1;
    background: radial-gradient(closest-side, rgba(12, 14, 16, 0.9) 55%, rgba(12, 14, 16, 0) 100%);
    padding: 12px 48px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------- Contact bar (fixed, appears on scroll) ---------- */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: rgba(12, 14, 16, 0.78);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}

.site-nav.show-contact {
    transform: translateY(0);
}

.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
}

.brand svg {
    width: 20px;
    height: 20px;
    color: var(--red);
    transform-origin: center;
    animation: heartbeat 2.4s ease-in-out infinite;
}

/* lub-dub, then rest */
@keyframes heartbeat {
    0%, 30%, 100% { transform: scale(1); }
    8% { transform: scale(1.16); }
    14% { transform: scale(1); }
    20% { transform: scale(1.1); }
}

.nav-contact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-contact .chip {
    background: none;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

/* on desktop the photo is a contained block, not full-bleed: the hero
   tracks the image's 16:9 aspect so the full ambulance fits */
@media (min-width: 841px) {
    .hero {
        min-height: min(calc((100vw - 48px) * 0.558), 670px);
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 28%;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12, 14, 16, 0.55) 0%, rgba(12, 14, 16, 0.18) 40%, rgba(12, 14, 16, 0.9) 100%),
        linear-gradient(90deg, rgba(12, 14, 16, 0.8) 0%, rgba(12, 14, 16, 0.35) 45%, rgba(12, 14, 16, 0) 70%);
}

@media (min-width: 841px) {
    .hero-bg {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(1200px, calc(100% - 48px));
    }
}

.hero .container {
    position: relative;
    padding: 84px 0 72px;
}

.hero h1 {
    font-size: clamp(2.8rem, 7.2vw, 6rem);
    max-width: 11em;
    margin-bottom: 28px;
    animation: rise 0.7s ease-out both;
}

.hero h1 .dot {
    color: var(--red);
}

.hero-sub {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    animation: rise 0.7s ease-out 0.15s both;
}

.hero-aside {
    font-size: 0.95rem;
    color: var(--text-dim);
    max-width: 24em;
}

.hero-contact {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(242, 240, 236, 0.35);
    background: rgba(12, 14, 16, 0.55);
}

.chip .chip-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    text-decoration: none;
    padding: 12px 12px 12px 16px;
}

.chip .chip-value:hover {
    color: var(--red);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0 12px;
    border: none;
    border-left: 1px solid rgba(242, 240, 236, 0.2);
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.18s ease;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.copy-btn:hover {
    color: var(--text);
}

.copy-btn:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -2px;
}

.copy-btn .icon-check {
    display: none;
}

.copy-btn.copied {
    color: var(--red);
}

.copy-btn.copied .icon-copy {
    display: none;
}

.copy-btn.copied .icon-check {
    display: block;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Monitor-style ECG: a dim persistent baseline, a fading persistence
   tail, and a bright drawing head sweeping at constant speed */
.trace-base {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.12;
}

.trace-tail {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.3;
    stroke-dasharray: 300 1300;
    animation: trace-run 4s linear infinite;
}

.trace-head {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
    stroke-dasharray: 34 1566;
    filter: drop-shadow(0 0 4px rgba(255, 59, 38, 0.45));
    animation: trace-run-head 4s linear infinite;
}

@keyframes trace-run {
    from { stroke-dashoffset: 1600; }
    to { stroke-dashoffset: 0; }
}

/* head rides the leading edge of the tail: shifted by tail - head length */
@keyframes trace-run-head {
    from { stroke-dashoffset: 1334; }
    to { stroke-dashoffset: -266; }
}

/* ---------- Intro statement ---------- */

.intro {
    border-bottom: 1px solid var(--line);
    padding: 72px 0;
}

.intro p {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
    line-height: 1.45;
    letter-spacing: -0.01em;
}

/* ---------- Why band (closing section) ---------- */

.why {
    border-top: 1px solid var(--line);
    background: var(--bg-raised);
    padding: 84px 0 108px;
}

.why .container {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 48px;
    align-items: start;
}

.why h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    margin-top: 14px;
}

.why p {
    color: var(--text-dim);
    max-width: 36em;
}

.why p + p {
    margin-top: 14px;
}

.why p a {
    color: var(--text);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.why p a:hover {
    color: var(--red);
}

/* ---------- Courses ---------- */

.services {
    padding: 84px 0 72px;
}

.services-head {
    margin-bottom: 40px;
}

.services-head p {
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.price-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 72px;
}

.price-group h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--text);
}

.price-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    position: relative;
}

.price-row .name {
    font-weight: 500;
    font-size: 0.98rem;
    padding: 17px 0;
    flex: 1;
}

.price-row .price {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1rem;
    color: var(--red);
    white-space: nowrap;
}

.price-row .book {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color 0.18s ease;
}

.price-row .book::after {
    content: " →";
}

.price-row:hover {
    background: rgba(242, 240, 236, 0.04);
    color: var(--text);
}

.price-row:hover .book,
.price-row:focus-visible .book {
    color: var(--red);
}

.price-group-wide {
    grid-column: 1 / -1;
    margin-top: 44px;
}

.price-group-wide .price {
    white-space: normal;
    text-align: right;
}

/* ---------- Responsive ---------- */

@media (max-width: 840px) {
    .hero .container {
        padding: 56px 0 44px;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 10vw, 2.8rem);
    }

    /* chips above the aside text on mobile */
    .hero-sub {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 24px;
    }

    .why .container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .price-columns {
        grid-template-columns: 1fr;
    }

    .price-group + .price-group {
        margin-top: 44px;
    }

    .price-row .book {
        font-size: 0.62rem;
    }

    .price-group-wide {
        margin-top: 0;
    }
}

/* both contact chips must fit on one row on narrow screens */
@media (max-width: 480px) {
    .chip .chip-value {
        font-size: 0.68rem;
        letter-spacing: 0.02em;
        padding: 11px 8px 11px 10px;
    }

    .copy-btn {
        padding: 0 8px;
    }

    .copy-btn svg {
        width: 13px;
        height: 13px;
    }

    .site-nav .brand {
        display: none;
    }

    .site-nav .container {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero h1, .hero-sub {
        animation: none;
    }

    .trace-tail {
        animation: none;
        stroke-dashoffset: 0;
        stroke-dasharray: none;
    }

    .trace-head {
        display: none;
    }

    .brand svg,
    .masthead svg {
        animation: none;
    }

    .site-nav {
        transition: none;
    }

    .price-row .book, .copy-btn, .nav-contact {
        transition: none;
    }
}
