/* =====================================================================
   Yaqoob Ahmed — Portfolio
   Single stylesheet. Vanilla CSS. Mobile-first, fluid typography.
   ===================================================================== */

/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
    --bg:        #0d1117;
    --surface:   #161b22;
    --surface2:  #1c2330;
    --border:    #30363d;
    --text:      #c9d1d9;
    --heading:   #ffffff;
    --muted:     #a3acb8;
    --accent:    #58a6ff;
    --accent-2:  #79baff;
    --green:     #3fb950;
    --warn:      #d29922;
    --red:       #f85149;
    --focus:     #58a6ff;
    --nav-h:     56px;
    --nav-bg:    rgba(13, 17, 23, 0.88);
    --code-bg:   rgba(88, 166, 255, 0.10);
    --shadow:    0 4px 16px rgba(0,0,0,0.25);
    --radius:    8px;
    --radius-lg: 12px;

    /* Fluid root: 15px → 17px between 360px and 1280px */
    font-size: clamp(15px, 0.86rem + 0.35vw, 17px);

    color-scheme: dark light;
}

:root[data-theme="light"] {
    --bg:        #f6f8fa;
    --surface:   #ffffff;
    --surface2:  #f3f4f6;
    --border:    #d0d7de;
    --text:      #24292f;
    --heading:   #0f1419;
    --muted:     #4a5460;
    --accent:    #0969da;
    --accent-2:  #0a59c2;
    --green:     #1a7f37;
    --warn:      #9a6700;
    --red:       #cf222e;
    --focus:     #0969da;
    --nav-bg:    rgba(255, 255, 255, 0.88);
    --code-bg:   rgba(9, 105, 218, 0.10);
    --shadow:    0 4px 14px rgba(15,20,25,0.06);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ── Skip link ──────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 100;
    padding: 10px 18px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.1s;
}
.skip-link:focus { top: 0; }

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

/* ── Layout container ───────────────────────────────────────────────── */
.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 32px);
}

/* ── Theme toggle ───────────────────────────────────────────────────── */
.theme-toggle {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
}
.theme-toggle:hover { color: var(--text); background-color: var(--surface2); }
.theme-icon-dark, .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-light  { display: block; }
:root[data-theme="light"] .theme-icon-dark  { display: block; }

/* ── Navigation ─────────────────────────────────────────────────────── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topnav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px clamp(18px, 4vw, 32px);
    min-height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.topnav-logo {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 8px 0;
    flex: 0 1 auto;
    min-width: 0;
}

.topnav-links {
    display: flex;
    gap: clamp(10px, 2.4vw, 22px);
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.topnav-links li { display: flex; align-items: center; }
.topnav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px 0;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
    white-space: nowrap;
}
.topnav-links a:hover,
.topnav-links a:focus-visible { color: var(--text); }

/* Below 420px the logo gets compact; below 380px it shows only the prompt */
@media (max-width: 420px) {
    .topnav-logo { font-size: 0.84rem; }
    .topnav-links { gap: 12px; }
    .topnav-links a { font-size: 0.86rem; }
}
@media (max-width: 360px) {
    .topnav-logo .tn-user { display: none; }
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
    padding: clamp(40px, 8vw, 80px) 0 clamp(36px, 6vw, 64px);
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
    line-height: 1.55;
    max-width: 70ch;
    color: var(--green);
}
.hero-eyebrow span { display: block; }
.hero-eyebrow span + span { color: var(--muted); margin-top: 2px; }

.hero h1 {
    font-size: clamp(2rem, 6.5vw, 3.4rem);
    font-weight: 800;
    color: var(--heading);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 18px;
}

.hero-bio {
    max-width: 62ch;
    font-size: clamp(1rem, 0.95rem + 0.3vw, 1.12rem);
    color: var(--text);
    line-height: 1.78;
    margin-bottom: 28px;
}
.hero-bio strong { color: var(--heading); font-weight: 700; }

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 6px;
    background-color: var(--surface);
    min-height: 44px;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
    word-break: break-word;
}
.hero-link:hover { color: var(--accent); border-color: rgba(88,166,255,0.5); }

.hero-link-cv {
    background-color: var(--accent);
    color: var(--bg) !important;
    border-color: var(--accent);
    font-weight: 700;
    font-family: inherit;
}
.hero-link-cv:hover { background-color: var(--accent-2); border-color: var(--accent-2); }
:root[data-theme="light"] .hero-link-cv { color: #fff !important; }

/* ── Sections ───────────────────────────────────────────────────────── */
.section {
    padding: clamp(40px, 7vw, 70px) 0;
    border-bottom: 1px solid var(--border);
    /* Anchor jumps land below the sticky nav, not under it */
    scroll-margin-top: calc(var(--nav-h) + 12px);
}
.section:last-of-type { border-bottom: none; }

.section-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.74rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 6px;
}

.section-title {
    font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.75rem);
    font-weight: 700;
    color: var(--heading);
    margin-bottom: clamp(20px, 4vw, 32px);
}

/* ── Featured card ──────────────────────────────────────────────────── */
.featured-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: clamp(20px, 4vw, 36px);
    margin-bottom: 24px;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, background-color 0.15s;
}
.featured-card:hover {
    border-left-color: var(--green);
    background-color: var(--surface2);
}

.featured-eyebrow {
    font-size: 0.74rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.featured-title {
    font-size: clamp(1.15rem, 1rem + 0.8vw, 1.4rem);
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 12px;
    line-height: 1.3;
}

.featured-desc {
    color: var(--text);
    font-size: clamp(0.94rem, 0.9rem + 0.2vw, 1rem);
    line-height: 1.72;
    margin-bottom: 20px;
    max-width: 70ch;
}

.featured-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
@media (max-width: 560px) {
    .featured-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.fstat-val {
    font-size: clamp(1.15rem, 1rem + 0.9vw, 1.4rem);
    font-weight: 700;
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    line-height: 1;
    margin-bottom: 4px;
    display: block;
}
.fstat-label {
    font-size: 0.74rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Tags ───────────────────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 4px;
    background-color: rgba(88,166,255,0.08);
    color: var(--accent);
    border: 1px solid rgba(88,166,255,0.2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    white-space: nowrap;
}
.tag.green { background-color: rgba(63,185,80,0.08); color: var(--green); border-color: rgba(63,185,80,0.2); }
.tag.warn  { background-color: rgba(210,153,34,0.08); color: var(--warn);  border-color: rgba(210,153,34,0.2); }

/* ── Project grid ───────────────────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
    list-style: none;
}

.project-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 24px);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, background-color 0.15s;
}
.project-card:hover {
    border-color: var(--muted);
    background-color: var(--surface2);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.project-card h3 {
    font-size: clamp(1rem, 0.92rem + 0.4vw, 1.1rem);
    font-weight: 700;
    color: var(--heading);
    line-height: 1.35;
}

.card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.6;
}
.card-badge.live    { background-color: rgba(63,185,80,0.12);  color: var(--green);  border: 1px solid rgba(63,185,80,0.3); }
.card-badge.private { background-color: rgba(210,153,34,0.08); color: var(--warn);   border: 1px solid rgba(210,153,34,0.25); }
.card-badge.hardware{ background-color: rgba(248,81,73,0.08);  color: var(--red);    border: 1px solid rgba(248,81,73,0.25); }
.card-badge.progress{ background-color: rgba(88,166,255,0.08); color: var(--accent); border: 1px solid rgba(88,166,255,0.25); }
.card-badge.live::before { content: '● '; font-size: 0.55rem; }

.card-desc {
    color: var(--text);
    font-size: clamp(0.92rem, 0.88rem + 0.18vw, 0.98rem);
    line-height: 1.68;
    flex: 1;
    margin-bottom: 16px;
}

.card-footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* Inline call-to-action inside a card (e.g. "Live →" on the TLS card) */
.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background-color: rgba(63,185,80,0.10);
    color: var(--green);
    border: 1px solid rgba(63,185,80,0.3);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
    transition: background-color 0.15s;
}
.card-cta:hover { background-color: rgba(63,185,80,0.18); }
.card-cta::after { content: '↗'; font-size: 0.9em; opacity: 0.8; }

/* ── Stack table ────────────────────────────────────────────────────── */
.stack-table { width: 100%; border-collapse: collapse; }
.stack-table tr { border-bottom: 1px solid var(--border); }
.stack-table tr:last-child { border-bottom: none; }

.stack-cat {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    padding: 14px 20px 14px 0;
    width: 140px;
    white-space: nowrap;
    vertical-align: top;
}
.stack-val {
    font-size: 0.95rem;
    color: var(--text);
    padding: 14px 0;
    line-height: 1.7;
}

@media (max-width: 600px) {
    .stack-table, .stack-table tbody, .stack-table tr, .stack-table td {
        display: block;
        width: 100%;
    }
    .stack-table tr { padding: 12px 0; }
    .stack-cat { padding: 0 0 4px; width: auto; }
    .stack-val { padding: 0 0 4px; }
}

/* ── About ──────────────────────────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 280px);
    gap: 40px;
    align-items: start;
}
@media (max-width: 720px) {
    .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

.about-text p {
    font-size: clamp(0.96rem, 0.92rem + 0.18vw, 1.02rem);
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.78;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--heading); font-weight: 700; }

.about-facts {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.fact-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    gap: 12px;
}
.fact-row:last-child { border-bottom: none; }
.fact-label { color: var(--muted); flex-shrink: 0; }
.fact-val {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.86rem;
    text-align: right;
    overflow-wrap: anywhere;
}
.fact-val a { color: var(--accent); text-decoration: none; }
.fact-val a:hover { text-decoration: underline; }

/* On narrow phones, stack label above value so long URLs don't crush */
@media (max-width: 480px) {
    .fact-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .fact-val { text-align: left; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: clamp(24px, 5vw, 36px) clamp(18px, 4vw, 32px);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(12px, 3vw, 24px);
    margin-bottom: 18px;
}
.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }

/* Terminal sign-off + engineering credit */
.footer-prompt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0 0 4px;
    line-height: 1.5;
}
.footer-prompt .fp-prompt {
    color: var(--accent);
    font-weight: 700;
    margin-right: 4px;
}
.footer-credit {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 72ch;
    margin: 0 auto;
}

/* ── High-contrast / forced-colors ─────────────────────────────────── */
@media (forced-colors: active) {
    .featured-card, .project-card, .about-facts { border: 2px solid ButtonText; }
    .tag, .card-badge { border: 1px solid ButtonText; }
}

/* ── Mobile typography refinement (≤ 720px) ─────────────────────────
   Lift small-label and body-copy floors on phones. Desktop unaffected.
   Reason: at 15.4px root, sub-14px mobile rendering thins enough to
   feel dim/cramped even when desktop renders the same rems crisply.
   Also slightly heavier weight on labels for better OLED legibility. */
@media (max-width: 720px) {
    /* Eyebrows + section labels */
    .hero-eyebrow      { font-size: 0.86rem; letter-spacing: 0.08em; line-height: 1.6; }
    .section-label     { font-size: 0.82rem; }
    .featured-eyebrow  { font-size: 0.82rem; }
    .meta              { font-size: 1rem; }
    .layer-label       { font-size: 0.82rem; }
    .fstat-label       { font-size: 0.78rem; }
    .metric-label      { font-size: 0.84rem; }

    /* Badges / tags / chips */
    .card-badge        { font-size: 0.74rem; padding: 4px 9px; }
    .tag               { font-size: 0.82rem; padding: 4px 10px; }
    .tech-tag          { font-size: 0.88rem; }

    /* Body copy floors */
    .hero-bio          { font-size: 1.06rem; line-height: 1.72; }
    .featured-desc     { font-size: 1rem; }
    .card-desc         { font-size: 0.98rem; line-height: 1.7; }
    .about-text p      { font-size: 1.02rem; }
    main p             { font-size: 1.06rem; line-height: 1.7; }
    main li            { font-size: 1.04rem; line-height: 1.7; }

    /* Stack table values */
    .stack-cat         { font-size: 0.92rem; }
    .stack-val         { font-size: 1.02rem; line-height: 1.65; }

    /* About-facts */
    .fact-row          { font-size: 0.95rem; }
    .fact-label        { font-size: 0.88rem; }
    .fact-val          { font-size: 0.92rem; }

    /* Timeline / SLO blocks (project deep-dive pages) */
    .timeline-title    { font-size: 1.04rem; }
    .timeline-sub      { font-size: 0.96rem; line-height: 1.65; }
    .slo-label         { font-size: 0.92rem; }
    .slo-val           { font-size: 0.92rem; }

    /* Footer */
    .footer-links a    { font-size: 0.96rem; padding: 10px 10px; }
    .footer-prompt     { font-size: 0.92rem; }
    /* Lift credit color + weight on mobile: thin monospace at 0.86rem
       reads dim on OLED even at AAA contrast — firmer strokes fix it. */
    .footer-credit     { font-size: 0.86rem; line-height: 1.7; padding: 0 12px;
                         color: var(--text); font-weight: 500; }
    .footer-credit .fc-tagline,
    .footer-credit .fc-sep    { color: var(--muted); font-weight: 400; }

    /* Code spans appear larger so monospace doesn't shrink visually */
    code               { font-size: 0.95em; }
}

/* ── Footer credit: stack copyright onto its own line on narrow phones
      so the bullet separator never orphans at line start ──────────── */
@media (max-width: 480px) {
    .footer-credit .fc-sep { display: none; }
    .footer-credit .fc-copy { display: block; margin-top: 4px; }
}

/* ===================================================================
   Project deep-dive page styles
   =================================================================== */
.project-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 30px;
    margin-top: 40px;
}

.project-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    margin: 24px 0 0;
    padding: 8px 0;
    transition: color 0.15s;
}
.project-back:hover { color: var(--accent); }

main h1 {
    font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.6rem);
    margin-bottom: 16px;
    color: var(--heading);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.meta {
    color: var(--muted);
    font-size: 0.95rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    line-height: 1.7;
}

main h2 {
    font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
    color: var(--accent);
    margin: 40px 0 14px;
    line-height: 1.3;
}
main h3 {
    font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.18rem);
    color: var(--text);
    margin: 26px 0 10px;
    line-height: 1.35;
}

main p {
    margin-bottom: 18px;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.07rem);
    line-height: 1.75;
    color: var(--text);
}
main p strong { color: var(--heading); font-weight: 700; }

.highlight-box {
    background-color: var(--surface);
    border-left: 4px solid var(--green);
    padding: 20px 22px;
    margin: 30px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
}
.highlight-box.warn   { border-left-color: var(--warn); }
.highlight-box.danger { border-left-color: var(--red); }

.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tech-tag {
    background-color: var(--code-bg);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    border: 1px solid rgba(88,166,255,0.18);
}
.tech-tag.green { background-color: rgba(63, 185, 80, 0.10); color: var(--green); border-color: rgba(63, 185, 80, 0.22); }
.tech-tag.warn  { background-color: rgba(210, 153, 34, 0.10); color: var(--warn); border-color: rgba(210, 153, 34, 0.22); }

main ul { margin: 0 0 18px; padding-left: 22px; }
main li {
    margin-bottom: 10px;
    font-size: clamp(0.98rem, 0.94rem + 0.18vw, 1.04rem);
    line-height: 1.7;
}
.topnav-links li { margin: 0; padding: 0; }

code {
    background-color: var(--code-bg);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.92em;
    overflow-wrap: anywhere;
}

/* Metrics cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 14px;
    margin: 30px 0;
}
.metric-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
}
.metric-value {
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
    font-weight: 700;
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    display: block;
    margin-bottom: 6px;
    line-height: 1.1;
}
.metric-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Architecture diagram block */
.architecture-diagram {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 30px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    color: var(--green);
    overflow-x: auto;
    line-height: 1.7;
    -webkit-overflow-scrolling: touch;
}
.layer-label {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.layer-block { margin-bottom: 20px; }
.layer-block:last-child { margin-bottom: 0; }

/* Timeline */
.timeline { border-left: 2px solid var(--border); padding-left: 24px; margin: 20px 0; }
.timeline-item { position: relative; margin-bottom: 22px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--green);
    border: 2px solid var(--surface);
}
.timeline-item.warn::before   { background-color: var(--warn); }
.timeline-item.danger::before { background-color: var(--red);  }
.timeline-title { font-weight: 600; color: var(--text); font-size: 0.98rem; }
.timeline-sub   { color: var(--muted); font-size: 0.9rem; margin-top: 4px; line-height: 1.6; }

/* SLO bars */
.slo-bar-wrap {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}
.slo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.slo-row:last-child { margin-bottom: 0; }
.slo-label {
    width: 96px;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    flex-shrink: 0;
}
.slo-track {
    flex: 1 1 140px;
    height: 10px;
    background-color: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.slo-fill { height: 100%; border-radius: 5px; background-color: var(--green); }
.slo-val {
    font-size: 0.85rem;
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Print ──────────────────────────────────────────────────────────── */
@media print {
    .topnav, footer, .skip-link, .theme-toggle, .project-back { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
    .featured-card, .project-card, .about-facts, .highlight-box,
    .architecture-diagram, .slo-bar-wrap, .metric-card {
        background: #fff !important; border-color: #888 !important; box-shadow: none !important;
    }
    .hero, .section { border-color: #888; page-break-inside: avoid; }
}
