/* DERMS Teaching Website - Main Stylesheet */

:root {
    color-scheme: dark;
    --bg: #091018;
    --bg-deep: #060b11;
    --surface: rgba(14, 23, 34, 0.88);
    --surface-strong: rgba(19, 31, 45, 0.96);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --surface-tint: rgba(255, 122, 61, 0.12);
    --line: rgba(173, 196, 220, 0.12);
    --line-strong: rgba(255, 255, 255, 0.24);
    --text: #edf3ff;
    --text-soft: #9fb0c9;
    --text-muted: #7d8ca4;
    --accent: #ff7a3d;
    --accent-soft: #ffb088;
    --accent-glow: rgba(255, 122, 61, 0.22);
    --teal: #44d3c5;
    --green: #4ade80;
    --blue: #6ab8ff;
    --yellow: #fbbf24;
    --danger: #f87171;
    --radius: 24px;
    --radius-sm: 16px;
    --shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
    --focus-ring: 0 0 0 3px rgba(106, 184, 255, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(1000px 700px at 10% -10%, rgba(68, 211, 197, 0.16), transparent 60%),
        radial-gradient(1200px 680px at 100% -5%, rgba(255, 122, 61, 0.18), transparent 55%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 80%);
    opacity: 0.18;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: 16px;
    transform: translateY(-160%);
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg-deep);
    font-weight: 700;
    text-decoration: none;
    transition: transform 180ms ease;
}

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

.page {
    width: min(1480px, 94vw);
    margin: 18px auto 42px;
    position: relative;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.span-12 {
    grid-column: span 12;
}

.span-8 {
    grid-column: span 8;
}

.span-6 {
    grid-column: span 6;
}

.span-4 {
    grid-column: span 4;
}

.panel,
.kpi-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
    animation: rise 420ms ease both;
}

.panel::after,
.kpi-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.10), transparent 38%);
    opacity: 0.9;
}

.panel > *,
.kpi-card > * {
    position: relative;
    z-index: 1;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    grid-column: span 12;
    padding: 18px 22px;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--bg-deep);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 40%),
        linear-gradient(135deg, var(--teal), var(--accent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    color: var(--text-soft);
    font-size: 12px;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link,
.button,
.mode-button,
.card-link,
.scenario-item,
.footer a {
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
}

.nav-link:hover {
    border-color: rgba(255, 122, 61, 0.55);
    transform: translateY(-1px);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    background: rgba(255, 122, 61, 0.18);
    border-color: rgba(255, 122, 61, 0.75);
    color: #ffe2d4;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(255, 122, 61, 0.95), rgba(255, 156, 92, 0.95));
    color: var(--bg-deep);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}

.button:hover,
.button.secondary:hover {
    transform: translateY(-1px);
}

.panel-hero,
.hero {
    grid-column: span 12;
    padding: 28px;
}

.panel-hero {
    min-height: 360px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
    gap: 22px;
    align-items: stretch;
}

.hero-copy {
    display: grid;
    align-content: start;
    gap: 18px;
}

.hero-eyebrow,
.eyebrow,
.card-title,
.metric-label,
.section-kicker,
.narrative-title,
.plot-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-soft);
}

.hero h1,
.content-title,
.feature-title,
.stat-value,
.card-value,
.kpi-value,
.completion-title {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
}

.hero h1,
.content-title {
    margin: 0;
    font-size: clamp(34px, 4vw, 62px);
    line-height: 0.98;
    max-width: 13ch;
    text-wrap: balance;
}

.lead,
.hero p,
.content-subtitle {
    margin: 0;
    max-width: 60ch;
    color: #d5deef;
    font-size: 16px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-badges,
.data-strip,
.tag-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge,
.data-pill {
    border-radius: 999px;
    border: 1px solid rgba(255, 122, 61, 0.28);
    background: rgba(255, 122, 61, 0.10);
    color: var(--accent-soft);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
}

.metric-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.metric-tile {
    min-height: 150px;
    padding: 18px;
    border-radius: var(--radius-sm);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(6, 11, 17, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    align-content: space-between;
    gap: 12px;
}

.metric-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 0.95;
}

.metric-meta {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.metric-band {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-chip {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
    display: grid;
    gap: 6px;
}

.metric-chip strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 28px;
    line-height: 1;
}

.metric-chip span {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.5;
}

.card,
.content-section,
.plot-card,
.plot-wide,
.plot-narrow,
.plot-full,
.modes,
.controls,
.narrative {
    padding: 22px;
}

.card-title {
    margin-bottom: 14px;
}

.content-section {
    grid-column: span 12;
}

.content-header {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.content-title {
    font-size: clamp(28px, 3.5vw, 48px);
    max-width: 14ch;
}

.content-subtitle {
    color: var(--text-soft);
}

.content-body {
    max-width: none;
    color: #d7dfee;
    font-size: 15px;
    line-height: 1.7;
}

.content-body h2,
.content-body h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    text-wrap: balance;
    scroll-margin-top: 100px;
}

.content-body h2 {
    font-size: 24px;
}

.content-body h3 {
    font-size: 18px;
}

.content-body p,
.content-body ul,
.content-body ol {
    margin: 0;
}

.content-body ul,
.content-body ol {
    padding-left: 20px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-stack {
    display: grid;
    gap: 18px;
}

.feature-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card,
.card-link {
    text-decoration: none;
    color: inherit;
}

.feature-card {
    min-height: 250px;
    padding: 22px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.feature-card:hover,
.card-link:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 122, 61, 0.38);
}

.feature-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(68, 211, 197, 0.2), rgba(255, 122, 61, 0.2));
    display: grid;
    place-items: center;
    font-size: 24px;
}

.feature-title {
    font-size: 22px;
    line-height: 1.05;
}

.feature-desc,
.scenario-desc,
.plot-subtitle,
.stat-sub,
.kpi-subtitle,
.footer,
.narrative-content,
.modes-copy {
    color: var(--text-soft);
}

.feature-desc,
.scenario-desc,
.narrative-content {
    font-size: 14px;
    line-height: 1.6;
}

.feature-link {
    margin-top: auto;
    color: var(--accent-soft);
    font-size: 13px;
    font-weight: 800;
}

.story-grid,
.summary-grid,
.compare-grid,
.process-grid,
.objective-grid,
.visual-grid {
    display: grid;
    gap: 14px;
}

.story-grid,
.summary-grid,
.compare-grid,
.process-grid,
.objective-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.story-card,
.summary-card,
.compare-card,
.objective-item,
.visual-item {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.objective-item {
    min-height: 140px;
}

.story-step,
.scenario-number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--teal), var(--accent));
}

.story-card h3,
.summary-card h3,
.compare-card h3,
.objective-item h3,
.visual-item h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.story-card p,
.summary-card p,
.compare-card p,
.objective-item p,
.visual-item p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.scenario-list {
    grid-column: span 12;
    display: grid;
    gap: 14px;
}

.scenario-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
}

.scenario-item:hover {
    transform: translateX(4px);
    border-color: rgba(255, 122, 61, 0.36);
}

.scenario-content {
    flex: 1;
    min-width: 0;
}

.scenario-title {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 800;
}

.scenario-arrow {
    color: var(--accent-soft);
    font-size: 22px;
}

.stat-stack {
    display: grid;
    grid-template-rows: repeat(2, minmax(148px, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 20px;
    display: grid;
    align-content: space-between;
    gap: 14px;
}

.stat-title {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-soft);
}

.stat-value {
    font-size: clamp(36px, 4vw, 60px);
    line-height: 0.95;
    color: var(--accent-soft);
}

.stat-sub {
    font-size: 13px;
    line-height: 1.5;
}

.visual-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.visual-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.list-marker {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 122, 61, 0.16);
    color: var(--accent-soft);
    font-size: 12px;
    font-weight: 800;
}

.highlight-box,
.narrative {
    background:
        linear-gradient(180deg, rgba(255, 122, 61, 0.14), rgba(255, 122, 61, 0.05)),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 122, 61, 0.24);
    border-radius: var(--radius-sm);
}

.highlight-box {
    padding: 18px;
    display: grid;
    gap: 10px;
}

.highlight-box-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-soft);
}

.kpi-grid {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kpi-card {
    padding: 18px;
}

.kpi-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.kpi-value {
    margin-top: 12px;
    font-size: 32px;
    line-height: 1;
}

.kpi-subtitle {
    margin-top: 8px;
    font-size: 12px;
}

.kpi-improvement {
    margin-top: 10px;
    min-height: 18px;
    font-size: 12px;
    font-weight: 700;
}

.kpi-improvement.positive {
    color: var(--green);
}

.kpi-improvement.negative {
    color: var(--danger);
}

.modes,
.controls {
    grid-column: span 12;
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.modes-copy {
    font-size: 14px;
    font-weight: 600;
}

.mode-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.mode-button:hover {
    border-color: rgba(255, 122, 61, 0.45);
    transform: translateY(-1px);
}

.mode-button.active,
.mode-button[aria-pressed="true"] {
    background: rgba(255, 122, 61, 0.18);
    border-color: rgba(255, 122, 61, 0.75);
    color: #ffe2d4;
}

.control-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.control-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.control-slider {
    width: 240px;
    accent-color: var(--accent);
}

.plot-card,
.plot-wide,
.plot-narrow,
.plot-full {
    display: grid;
    gap: 10px;
}

.plot-card {
    grid-column: span 6;
}

.plot-wide {
    grid-column: span 8;
}

.plot-narrow,
.narrative {
    grid-column: span 4;
}

.plot-full {
    grid-column: span 12;
}

.plot-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    text-wrap: balance;
}

.plot-subtitle {
    margin-top: -4px;
    font-size: 13px;
    line-height: 1.5;
}

.plot-container {
    min-height: 260px;
}

.chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: stretch;
}

.chart-note {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.chart-note h3,
.chart-note p {
    margin: 0;
}

.chart-note h3 {
    font-size: 15px;
}

.chart-note p {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.chart-note ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e8f7;
    font-size: 13px;
}

.comparison-table th,
.comparison-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.comparison-table th {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-size: 10px;
    font-weight: 800;
}

.comparison-table td:first-child {
    font-weight: 700;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .better {
    color: var(--green);
}

.comparison-table .worse {
    color: var(--yellow);
}

.scroll-x {
    overflow-x: auto;
}

.footer {
    grid-column: span 12;
    padding: 18px;
    text-align: center;
    font-size: 13px;
}

.footer a {
    color: var(--accent-soft);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.completion-banner {
    display: grid;
    place-items: center;
    min-height: 220px;
    text-align: center;
    gap: 12px;
}

.completion-mark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 32px;
    background: linear-gradient(135deg, rgba(68, 211, 197, 0.18), rgba(255, 122, 61, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.completion-title {
    font-size: 28px;
}

.metric-value.display-large {
    font-size: 56px;
}

.lead.centered {
    max-width: 56ch;
    text-align: center;
}

.plot-fallback {
    color: var(--text-soft);
    text-align: center;
    padding: 40px;
}

.error-copy {
    color: var(--danger);
}

.text-accent {
    color: var(--accent-soft);
}

.text-muted {
    color: var(--text-muted);
}

.text-green {
    color: var(--green);
}

.text-blue {
    color: var(--blue);
}

.text-yellow {
    color: var(--yellow);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 1200px) {
    .hero-grid,
    .chart-layout {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-band,
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-8,
    .span-6,
    .span-4,
    .plot-card,
    .plot-wide,
    .plot-narrow,
    .narrative {
        grid-column: span 12;
    }

    .stat-stack {
        grid-column: span 12;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }
}

@media (max-width: 760px) {
    .page {
        width: min(1480px, 96vw);
        margin: 10px auto 28px;
    }

    .grid {
        gap: 12px;
    }

    .site-header,
    .panel-hero,
    .hero,
    .card,
    .content-section,
    .plot-card,
    .plot-wide,
    .plot-narrow,
    .plot-full,
    .modes,
    .controls,
    .narrative,
    .kpi-card {
        padding: 18px;
    }

    .feature-grid,
    .metric-board,
    .metric-band,
    .kpi-grid,
    .stat-stack {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .content-title {
        max-width: 12ch;
    }

    .control-group {
        align-items: stretch;
    }

    .control-slider {
        width: 100%;
    }

    .scenario-item {
        align-items: flex-start;
    }

    .scenario-arrow {
        display: none;
    }
}
