/* Shared tokens, nav, hero, tabs and the code viewer are in shared/site.css. */
/* ======= Terminal Mock ======= */

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
}

.t-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.t-dot-red    { background: #ff5f57; }
.t-dot-yellow { background: #febc2e; }
.t-dot-green  { background: #28c840; }

.terminal-titlebar-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: 6px;
    letter-spacing: 0.06em;
}

/* Terminal color classes */
.t-red    { color: #f85149; }
.t-amber  { color: #d29922; }
.t-green  { color: #3fb950; }
.t-cyan   { color: #79c0ff; }
.t-dim    { color: #7d8590; }
/* ======= Code Explorer ======= */

.tab-bar {
    display: flex;
    overflow-x: auto;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    background: none;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.05em;
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab:hover:not(.active) {
    color: var(--text);
}

.hljs {
    background: transparent !important;
}

/* ======= Data Structures section ======= */

.ds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ds-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.2s;
}

.ds-card:hover {
    border-color: var(--accent);
}

.ds-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text);
}

.ds-desc {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

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

/* ======= Top-level tab switching (Terminal / Code) ======= */

.tab-content {
    display: none;
    animation: fadeUp 0.35s ease both;
}
.tab-content.active { display: block; }

/* ======= DS card text helpers ======= */
.ds-icon {
    font-size: 1.4rem;
    margin-bottom: 12px;
}
.ds-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text);
}

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

/* ======= Animated airport ======= */

.ap { margin-bottom: 40px; }

.ap-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 640;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #1b2a1e;
    box-shadow: 0 30px 60px -30px rgba(0,0,0,0.55);
}
.ap-frame canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.ap-tip {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    background: rgba(12,16,22,0.88);
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 10px;
    font: 0.72rem/1.45 var(--font-mono);
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ap-tip b { font-weight: 400; color: #fff; }
.ap-tip .dim { color: #94a3b8; }

.ap-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.ap-controls input[type=range] {
    flex: 1;
    min-width: 140px;
    accent-color: var(--accent);
}
.ap-clock {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    min-width: 104px;
    text-align: right;
}
.ap-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ap-btn:hover { color: var(--text); }
.ap-btn.ap-play {
    min-width: 84px;
    color: var(--accent);
    background: var(--accent-dim);
    border-color: color-mix(in oklab, var(--accent) 35%, transparent);
}
.ap-speeds { display: flex; gap: 6px; }
.ap-speeds .ap-btn[aria-pressed="true"] {
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 55%, transparent);
}

.ap-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
    margin-top: 28px;
}
.ap-panel > * { min-width: 0; }
.ap-h {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.ap-scenarios { display: grid; gap: 8px; }
.scenario {
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-mono);
    transition: border-color 0.2s;
}
.scenario strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 2px;
}
.scenario span { color: var(--muted); font-size: 0.68rem; }
.scenario:hover { border-color: color-mix(in oklab, var(--accent) 35%, transparent); }
.scenario[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.ap-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 18px;
}
.ap-stats div { display: flex; flex-direction: column; }
.ap-stats dt { color: var(--muted); font-size: 0.66rem; order: 2; }
.ap-stats dd {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.ap-legend {
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--muted);
}
.ap-legend li { display: flex; align-items: center; gap: 10px; }
.ap-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }

.ap-events {
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 0.7rem;
    line-height: 1.5;
    min-height: 9em;
}
.ap-events li { color: var(--muted); }
.ap-events li.new { animation: apSlideIn 0.35s cubic-bezier(.16,1,.3,1); }
.ap-events b { font-weight: 400; color: var(--accent); margin-right: 6px; }
@keyframes apSlideIn { from { opacity: 0; transform: translateY(-6px); } }

.ap-details { margin-top: 28px; }
.ap-details summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text);
}
.ap-note {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.6;
    max-width: 70ch;
    margin-top: 10px;
}
.ap-term {
    background: var(--panel);
    color: var(--panel-ink);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 16px 18px;
    overflow-x: auto;
    margin-top: 12px;
}
.ap-term pre { margin: 0; font: 0.72rem/1.38 var(--font-mono); }
.ap-term .b { font-weight: 700; }
.ap-term .c31 { color: #f87171; } .ap-term .c32 { color: #4ade80; } .ap-term .c33 { color: #facc15; }
.ap-term .c34 { color: #60a5fa; } .ap-term .c35 { color: #e879f9; } .ap-term .c36 { color: #22d3ee; }
.ap-term .c37 { color: #f4f4f5; } .ap-term .c90 { color: #71717a; }

.ap button:focus-visible, .ap input:focus-visible, .ap summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .ap-panel { grid-template-columns: 1fr; gap: 24px; }
    .ap-term pre { font-size: min(0.72rem, calc((100vw - 80px) / 44)); }
}
@media (prefers-reduced-motion: reduce) {
    .ap-events li.new { animation: none; }
}
