:root {
    --ink: #0f172a;
    --sun: #f6ad55;
    --mint: #8dd3bb;
    --paper: #fffaf0;
    --berry: #9f1239;
    --shadow: rgba(15, 23, 42, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, #ffe4c4 0%, var(--paper) 45%, #f0f9ff 100%);
}

.hero-shell {
    background: #050d1a;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-shell::after {
    content: '';
    position: absolute;
    right: -5rem;
    top: -4rem;
    width: 16rem;
    height: 16rem;
    background: rgba(50, 140, 193, 0.12);
    border-radius: 50%;
}

.header-logo-link {
    display: inline-block;
    line-height: 0;
}

.header-logo-long {
    height: clamp(3.5rem, 8vw, 6rem);
    width: auto;
    display: block;
}

.header-page-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-brand-logo {
    height: 2rem;
    width: auto;
}

.home-hero-logo {
    max-width: min(680px, 90%);
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 0.75rem;
}

/* Training highlight tiles */
.highlight-tile {
    background: #f0f6ff;
    border: 1px solid #cde0f5;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.highlight-tile:hover {
    box-shadow: 0 4px 16px rgba(5, 13, 26, 0.10);
    border-color: #328cc1;
}

.highlight-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #0b3c5d;
    border-radius: 0.3rem;
    padding: 0.15rem 0.5rem;
}

/* Playground cards */
.playground-card {
    background: #0a0e1a;
    color: #e8eaf0;
    border: 1px solid #1e2a40;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.playground-card:hover {
    border-color: #328cc1;
    box-shadow: 0 4px 20px rgba(50, 140, 193, 0.2);
}

.playground-card .small {
    color: #aab4c4;
}

.playground-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

.playground-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* TensorFlow Playground iframe */
.tf-playground-shell {
    position: relative;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    background: #fff;
}

.tf-playground-frame {
    width: 100%;
    height: 860px;
    border: none;
    display: block;
    min-height: 860px;
}

/* Dataset table link button */
.btn-xs {
    font-size: 0.75rem;
    padding: 0.1rem 0.3rem;
}

/* Stack tiles */
.stack-tile {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.stack-tile:hover {
    box-shadow: 0 4px 16px rgba(5, 13, 26, 0.10);
    border-color: #328cc1;
}

.stack-tile-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.stack-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.83rem;
    color: #495057;
}

.stack-list li {
    padding: 0.15rem 0;
}

.stack-list li::before {
    content: '→ ';
    color: #328cc1;
    font-weight: 600;
}

.site-title {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 600;
}

.header-layout {
    position: relative;
    z-index: 1;
}

.header-copy {
    max-width: 58rem;
}

.site-tagline,
.kicker,
.nav-link,
.footer-title {
    letter-spacing: 0.02em;
}

.header-headshot-shell {
    flex: 0 0 auto;
    width: clamp(8.5rem, 12vw, 11.5rem);
    aspect-ratio: 1;
    border-radius: 1.4rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(6px);
}

.header-headshot {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.1rem;
}

.nav-shell {
    background-color: #ffffffde;
    border-bottom: 1px solid #dbe4ee;
    backdrop-filter: blur(8px);
}

.nav-link {
    font-weight: 600;
    color: #0f172a;
}

.nav-link.active,
.nav-link:hover {
    color: var(--berry);
}

.content-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 28px var(--shadow);
    border: 1px solid #e2e8f0;
}

.section-title {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
}

.footer-shell {
    background: #0f172a;
    color: #e2e8f0;
}

.footer-shell a {
    color: #fbd38d;
    text-decoration: none;
}

.policy-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.chart-shell {
    min-height: 260px;
}

@media (max-width: 991.98px) {
    .header-layout {
        align-items: center !important;
        text-align: center;
    }

    .header-copy {
        max-width: none;
    }
}

.hero-image-slot {
    border: 1px solid #dbe4ee;
    text-align: center;
}

.capstone-summary-card,
.capstone-summary-copy {
    text-align: left;
}

.capstone-summary-card .capstone-summary-label {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.hero-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 0.8rem;
    border: 1px solid #cbd5e1;
    background-color: #fff;
}

.hero-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0b3c5d;
    background: #e0f2fe;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.artifact-card,
.requirement-card,
.evidence-card {
    min-width: 0;
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    background: #f8fafc;
}

.row > [class*="col"] > .artifact-card,
.row > [class*="col"] > .requirement-card,
.row > [class*="col"] > .evidence-card,
.row > [class*="col"] > .integration-console {
    height: 100%;
}

.artifact-label,
.requirement-id {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0b3c5d;
}

.code-shell {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.9rem;
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid #1e293b;
}

.code-shell code,
.code-shell pre {
    color: inherit;
    margin: 0;
    font-size: 0.92rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.artifact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.artifact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.artifact-actions .btn {
    flex: 1 1 10rem;
}

.artifact-card p,
.requirement-card p,
.evidence-card p,
.evidence-card li,
.requirement-card li {
    overflow-wrap: anywhere;
}

.artifact-card a:not(.btn),
.requirement-card a:not(.btn),
.evidence-card a:not(.btn),
.artifact-card code,
.requirement-card code,
.evidence-card code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pdf-embed-frame {
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    overflow: hidden;
    background: #f8fafc;
    min-height: 640px;
}

.pdf-embed-frame iframe {
    display: block;
    width: 100%;
    min-height: 640px;
    border: 0;
    background: #fff;
}

.interactive-lab-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.interactive-lab-presets .btn {
    flex: 1 1 14rem;
}

.interactive-lab-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(11, 60, 93, 0.25);
    background: rgba(11, 60, 93, 0.08);
    color: #0b3c5d;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.interactive-lab-shell {
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(11, 60, 93, 0.08) 0%, rgba(50, 140, 193, 0.08) 100%);
}

.lab-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(90deg, rgba(11, 60, 93, 0.14) 0%, rgba(50, 140, 193, 0.09) 100%);
}

.lab-header p {
    color: #334155;
    line-height: 1.45;
}

.interactive-lab-frame,
.teachable-machine-frame {
    display: block;
    width: 100%;
    border: 0;
    background: #fff;
}

.interactive-lab-frame {
    min-height: 78rem;
}

.teachable-machine-frame {
    min-height: 72rem;
}

.teachable-machine-frame--demo {
    min-height: 54rem;
}

.teachable-machine-frame--trainer {
    min-height: 54rem;
}

.training-walkthrough {
    border: 1px solid #dbe4ee;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(236, 246, 255, 0.9) 100%);
}

.status-note {
    border-left: 4px solid #d9b310;
    background: #fff7db;
    border-radius: 0.9rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.status-note p {
    position: relative;
    z-index: 1;
    margin: 0 0 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.status-note p:last-child {
    margin-bottom: 0;
}

.integration-console {
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
}

.console-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.console-lights {
    display: flex;
    gap: 0.4rem;
}

.console-lights span {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
}

.console-lights span:nth-child(1) {
    background: #f87171;
}

.console-lights span:nth-child(2) {
    background: #fbbf24;
}

.console-lights span:nth-child(3) {
    background: #34d399;
}

.console-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.console-state {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.console-state.is-ready {
    color: #052e16;
    background: #bbf7d0;
}

.console-state.is-pending {
    color: #78350f;
    background: #fde68a;
}

@media (max-width: 768px) {
    .pdf-embed-frame,
    .pdf-embed-frame iframe {
        min-height: 480px;
    }

    .interactive-lab-frame {
        min-height: 54rem;
    }

    .teachable-machine-frame {
        min-height: 60rem;
    }

    .teachable-machine-frame--demo,
    .teachable-machine-frame--trainer {
        min-height: 42rem;
    }
}

.console-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #052e16;
    background: #bbf7d0;
    text-decoration: none;
    border: 1px solid rgba(5, 46, 22, 0.15);
}

.console-launch:hover,
.console-launch:focus-visible {
    color: #052e16;
    background: #86efac;
}

.console-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.console-panel {
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 0.9rem;
    padding: 1rem;
}

.console-frame {
    width: 100%;
    min-height: 34rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
}

.console-notebook-preview {
    max-height: 34rem;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
}

.console-notebook-preview .notebook-view {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.console-notebook-preview .notebook-cell {
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    background: #f8fafc;
    overflow: hidden;
}

.console-notebook-preview .notebook-cell__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.console-notebook-preview .notebook-markdown {
    padding: 1rem;
}

.console-notebook-preview .notebook-markdown > :last-child {
    margin-bottom: 0;
}

.console-notebook-preview .notebook-markdown code,
.console-notebook-preview .notebook-output code {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 0.4rem;
    padding: 0.1rem 0.35rem;
}

.console-notebook-preview .viewer {
    margin-top: 0;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    padding: 1rem;
    overflow: auto;
}

.console-notebook-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.5;
}

.console-notebook-preview .notebook-code {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.console-notebook-preview .notebook-output {
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #dbe4ee;
}

.console-notebook-preview .notebook-output__label {
    margin-bottom: 0.5rem;
    color: #0b3c5d;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.console-notebook-preview .notebook-output pre {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #dbe4ee;
    border-radius: 0.75rem;
    padding: 0.85rem;
}

.console-placeholder {
    min-height: 20rem;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    border: 1px dashed #94a3b8;
    border-radius: 0.75rem;
    color: #475569;
    background: #f8fafc;
}

.console-list {
    margin: 0;
    padding-left: 1.1rem;
}

.console-list li + li {
    margin-top: 0.65rem;
}

@media (max-width: 767px) {
    .policy-list {
        grid-template-columns: 1fr;
    }

    .console-toolbar {
        flex-wrap: wrap;
    }

    .console-frame {
        min-height: 26rem;
    }

    .console-notebook-preview {
        max-height: 26rem;
    }
}
