/* =============================================================
   enhance.css — ADDITIVE enhancement layer for the "ME" site.
   Nothing here overrides the site's structure; it only appends
   new component styles and an opt-in [data-theme="dark"] layer.
   Loaded AFTER style.css so equal-specificity rules win by order.
   ============================================================= */

/* ---------- Availability banner ---------- */
.availability-banner {
    background: #eef2ff;
    border-bottom: 1px solid #e0e7ff;
    color: #1e293b;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.6rem 20px;
}
.availability-banner strong { color: var(--primary-color); }
.availability-banner .ab-dot { opacity: 0.4; margin: 0 0.4rem; }
.availability-banner .ab-link {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

/* ---------- Hero additions ---------- */
.hero-positioning {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: -0.25rem 0 1.5rem;
    letter-spacing: 0.01em;
    animation: fadeInUp 0.8s ease 0.5s;
    animation-fill-mode: backwards;
}
.btn-resume {
    background: #0f172a;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-resume:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: #1e293b;
}

/* ---------- AI twin CTA + prompt chips ---------- */
.ai-twin-cta {
    margin-top: 2.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    animation: fadeInUp 0.8s ease 1s;
    animation-fill-mode: backwards;
}
.ai-twin-cta .twin-lead {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin: 0;
}
.ai-twin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563eb, #5b8cff);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ai-twin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.45);
}
.twin-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 660px;
}
.twin-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.twin-chip:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ---------- App category filter ---------- */
.app-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.app-filter-btn {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #334155;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.app-filter-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.app-filter-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ---------- App card enrichment ---------- */
.app-tagline {
    font-size: 0.85rem;
    color: var(--secondary-color);
    line-height: 1.45;
    margin: 0.1rem 0 0.75rem;
    min-height: 2.4rem;
}
.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.25rem;
}
.app-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #eef2ff;
    color: #3557d4;
    border: 1px solid #e0e7ff;
}
.btn-screens {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #f3f4f6;
    color: var(--text-color);
    border: 1px solid #e5e7eb;
    transition: background 0.3s ease, transform 0.3s ease;
    font-family: inherit;
}
.btn-screens:hover { background: #e5e7eb; transform: translateY(-2px); }

/* ---------- Featured screens / case studies ---------- */
.featured .case-study {
    margin-bottom: 3.5rem;
}
.featured .case-study:last-child { margin-bottom: 0; }
.case-head {
    max-width: 760px;
    margin: 0 auto 1.75rem;
    text-align: center;
}
.case-head h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.case-head p {
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
}
.case-shots {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    align-items: flex-start; /* RULE 4: never stretch phone frames */
    flex-wrap: wrap;
}
.phone-frame {
    position: relative;
    width: 100%;
    max-width: 210px;
    border: 8px solid #111418;
    border-radius: 34px;
    background: #111418;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}
.phone-frame:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24);
}
.phone-frame img {
    display: block;
    width: 100%;   /* RULE 4 */
    height: auto;  /* RULE 4 */
    border-radius: 26px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-content {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    max-width: 96vw;
    padding: 8px;
    align-items: flex-start;
}
.lb-frame {
    flex: 0 0 auto;
    border: 8px solid #111418;
    background: #111418;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lb-frame img {
    display: block;
    width: auto;
    height: min(78vh, 720px);
    border-radius: 24px;
}
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 22px;
    font-size: 2.4rem;
    line-height: 1;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------- Tech stack ---------- */
.tech-stack .techstack-intro {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 760px;
    margin: 0 auto 3rem;
}
.techstack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.techstack-group {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.techstack-group:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.techstack-group h3 {
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
}
.tech-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tech-pill {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* ---------- Skills in action ---------- */
.skills-in-action { margin-top: 3rem; }
.sia-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}
.sia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.sia-item {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}
.sia-skill {
    display: block;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}
.sia-proof { font-size: 0.92rem; color: var(--secondary-color); line-height: 1.6; }
.sia-proof a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.sia-proof a:hover { text-decoration: underline; }

/* ---------- Footer availability line ---------- */
.footer-availability {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.5;
}

/* ---------- Theme toggle button ---------- */
.nav-theme-li { display: flex; align-items: center; }
.theme-toggle {
    background: none;
    border: 1px solid #e5e7eb;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.25s ease, color 0.25s ease;
}
.theme-toggle:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* =============================================================
   DARK MODE — opt-in additive override layer.
   Default (no attribute) leaves the original white site untouched.
   ============================================================= */
:root[data-theme="dark"] {
    --text-color: #e7e9ee;
    --secondary-color: #9aa4b2;
    --bg-color: #0f1115;
    --section-bg: #0f1115;
    --primary-color: #5b8cff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Page + section backgrounds (beat the hard-coded white !important rules) */
html[data-theme="dark"] { background: #0f1115 !important; }
[data-theme="dark"] body { background: #0f1115 !important; color: #e7e9ee; }
[data-theme="dark"] section { background: #0f1115 !important; }
[data-theme="dark"] section:nth-child(even) { background: #14171d !important; }
[data-theme="dark"] .about,
[data-theme="dark"] .coursework,
[data-theme="dark"] .apps,
[data-theme="dark"] .skills,
[data-theme="dark"] .contact,
[data-theme="dark"] .projects { background: #0f1115 !important; }
[data-theme="dark"] .hero { background: #0f1115 !important; color: #e7e9ee !important; }

/* Navbar */
[data-theme="dark"] .navbar { background: #14171d !important; box-shadow: 0 1px 0 #232833; }
[data-theme="dark"] .nav-brand a,
[data-theme="dark"] .nav-link { color: #e7e9ee; }
[data-theme="dark"] .nav-toggle span { background: #e7e9ee; }
[data-theme="dark"] .nav-menu { background-color: #14171d; }
[data-theme="dark"] .theme-toggle { border-color: #2a2f3a; color: #e7e9ee; }

/* Hero text (override the literal #000 !important rules) */
[data-theme="dark"] .hero-title,
[data-theme="dark"] .hero-subtitle,
[data-theme="dark"] .hero-description { color: #e7e9ee !important; }
[data-theme="dark"] .hero-subtitle:last-of-type { color: #9aa4b2 !important; }
[data-theme="dark"] .social-links a { color: #e7e9ee !important; }
[data-theme="dark"] .hero-buttons .btn-secondary {
    background: transparent !important;
    color: #e7e9ee !important;
    border: 2px solid #e7e9ee !important;
}
[data-theme="dark"] .hero-buttons .btn-secondary:hover {
    background: #e7e9ee !important;
    color: #0f1115 !important;
    border-color: #e7e9ee !important;
}

/* Section titles / body copy */
[data-theme="dark"] .section-title { color: #e7e9ee; }
[data-theme="dark"] .contact-intro { color: #cbd2dc; }
[data-theme="dark"] .contact-method { color: #e7e9ee; }
[data-theme="dark"] .course-list strong,
[data-theme="dark"] .education-item h4,
[data-theme="dark"] .app-card h3,
[data-theme="dark"] .project-card h3 { color: #e7e9ee; }

/* Surfaces / cards */
[data-theme="dark"] .education-item,
[data-theme="dark"] .coursework-category,
[data-theme="dark"] .skill-category,
[data-theme="dark"] .project-card,
[data-theme="dark"] .techstack-group,
[data-theme="dark"] .sia-item { background: #171a21 !important; border-color: #262c37; }
[data-theme="dark"] .app-card { background: #171a21 !important; border-color: #262c37; }
[data-theme="dark"] .course-list li { border-bottom-color: #262c37; }

/* App icons keep a subtle plate so light icons don't float */
[data-theme="dark"] .app-icon { background: #0f1115; }

/* Buttons / tags in cards */
[data-theme="dark"] .btn-website,
[data-theme="dark"] .btn-screens {
    background: #232833;
    color: #e7e9ee;
    border-color: #323945;
}
[data-theme="dark"] .btn-website:hover,
[data-theme="dark"] .btn-screens:hover { background: #2c3340; }
[data-theme="dark"] .app-tag { background: #1b2440; color: #9db4ff; border-color: #26325a; }
[data-theme="dark"] .tech-pill { background: #1b2029; color: #cbd2dc; border-color: #2a3038; }

/* New components */
[data-theme="dark"] .availability-banner {
    background: #161d2e;
    border-bottom-color: #223052;
    color: #cbd6e6;
}
[data-theme="dark"] .app-filter-btn {
    background: #171a21;
    color: #cbd2dc;
    border-color: #2a3038;
}
[data-theme="dark"] .app-filter-btn.active {
    background: var(--primary-color);
    color: #0f1115;
    border-color: var(--primary-color);
}
[data-theme="dark"] .twin-chip {
    background: #1b2029;
    color: #cbd2dc;
    border-color: #2a3038;
}
[data-theme="dark"] .twin-chip:hover { background: var(--primary-color); color: #0f1115; border-color: var(--primary-color); }
[data-theme="dark"] .btn-resume { background: #e7e9ee; color: #0f1115 !important; }
[data-theme="dark"] .btn-resume:hover { background: #ffffff; }

/* Footer already dark; keep it darker than the page in dark mode */
[data-theme="dark"] .footer { background: #0a0c10 !important; color: #e7e9ee; }

/* ---------- Reduced motion: disable the enhancement transitions ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-positioning,
    .ai-twin-cta { animation: none !important; }
    .ai-twin-btn,
    .twin-chip,
    .app-filter-btn,
    .phone-frame,
    .techstack-group,
    .btn-resume,
    .btn-screens { transition: none !important; }
    .phone-frame:hover,
    .techstack-group:hover { transform: none !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 768px) {
    .phone-frame { max-width: 44vw; }
    .availability-banner { font-size: 0.82rem; }
}

/* =============================================================
   ROUND 2 — additive premium layer.
   Appended below the round-1 layer; nothing above is modified.
   ============================================================= */

/* ---------- Hero: direct PDF résumé link ---------- */
.btn-resume-pdf {
    background: #ffffff;
    color: #0f172a !important;
    border: 2px solid #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-resume-pdf:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: #0f172a;
    color: #ffffff !important;
}

/* ---------- Nav: command palette hint ---------- */
.cmdk-hint {
    background: none;
    border: 1px solid #e5e7eb;
    color: var(--secondary-color);
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    transition: border-color 0.25s ease, color 0.25s ease;
}
.cmdk-hint:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* ---------- Ship Log ---------- */
.shiplog-intro {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 760px;
    margin: 0 auto 3rem;
}
.shiplog-timeline { max-width: 820px; margin: 0 auto; }
.shiplog-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.shiplog-list::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e2e8f0;
}
.shiplog-entry {
    position: relative;
    padding: 0 0 1.6rem 2.2rem;
}
.shiplog-entry:last-child { padding-bottom: 0.4rem; }
.shiplog-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary-color);
    box-sizing: border-box;
}
.shiplog-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
}
.shiplog-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary-color);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.shiplog-app {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.02rem;
}
.shiplog-app:hover { color: var(--primary-color); }
.shiplog-version {
    font-size: 0.78rem;
    font-weight: 700;
    color: #3557d4;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    padding: 0.1rem 0.5rem;
}
.shiplog-notes {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    color: var(--secondary-color);
    line-height: 1.55;
    max-width: 66ch;
}
.shiplog-toggle {
    display: block;
    margin: 2rem auto 0;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #334155;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease;
}
.shiplog-toggle:hover { border-color: var(--primary-color); color: var(--primary-color); }
.shiplog-caption {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}
.shiplog-fallback {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1rem;
}

/* ---------- Engineering deep dive ---------- */
.arch-intro {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 780px;
    margin: 0 auto 3rem;
}
.arch-diagram-wrap {
    max-width: 960px;
    margin: 0 auto 2.5rem;
    overflow-x: auto;
}
.arch-svg {
    display: block;
    width: 100%;
    height: auto;
    min-width: 640px;
}
.arch-box { fill: #ffffff; stroke: #e2e8f0; stroke-width: 1.5; }
.arch-box-accent { fill: #eef2ff; stroke: #c7d2fe; }
.arch-box-provider { fill: #f8fafc; }
.arch-title { font: 700 17px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #0f172a; }
.arch-provider { font: 700 15px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #0f172a; }
.arch-item { font: 500 13.5px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #334155; }
.arch-item-muted { font: 500 12px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #94a3b8; }
.arch-rule { stroke: #e2e8f0; stroke-width: 1; }
.arch-arrow { stroke: #94a3b8; stroke-width: 2; fill: none; }
.arch-arrowhead { fill: #94a3b8; }
.arch-label { font: 600 12.5px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; fill: #64748b; }
.arch-label-strong { fill: #2563eb; }
.arch-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.arch-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.arch-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.arch-card h3 {
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.arch-card p { font-size: 0.92rem; color: var(--secondary-color); line-height: 1.6; }
.arch-card code {
    font-size: 0.85em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
}

/* ---------- Open Source & Activity ---------- */
.gh-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.gh-stat {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.1rem 2.2rem;
    text-align: center;
    min-width: 150px;
}
.gh-stat-num {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}
.gh-stat-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
}
.gh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.gh-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gh-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gh-card h3 { font-size: 1.05rem; margin: 0; }
.gh-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.gh-card h3 a:hover { color: var(--primary-color); }
.gh-card h3 i { color: var(--secondary-color); font-size: 0.95rem; }
.gh-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.gh-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin: 0;
}
.gh-meta .gh-lang-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-right: 0.35rem;
    vertical-align: baseline;
}
.gh-fallback {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 1rem;
}
.gh-fallback a { color: var(--primary-color); font-weight: 600; }
.gh-caption {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}
.gh-caption a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.gh-caption a:hover { text-decoration: underline; }

/* ---------- How I Work ---------- */
.hiw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.hiw-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.6rem 1.6rem 1.4rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hiw-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.hiw-card h3 {
    font-size: 1.08rem;
    color: var(--text-color);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.hiw-card h3 i { color: var(--primary-color); font-size: 1rem; }
.hiw-card p { font-size: 0.93rem; color: var(--secondary-color); line-height: 1.65; }
.hiw-card a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.hiw-card a:hover { text-decoration: underline; }

/* ---------- Recruiter FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 0.9rem;
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 3rem 1.1rem 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    position: relative;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 1.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--secondary-color);
    transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:hover { color: var(--primary-color); }
.faq-item p {
    padding: 0 1.4rem 1.2rem;
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.65;
}
.faq-item a { color: var(--primary-color); font-weight: 600; }
.faq-twin-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Contact quick actions ---------- */
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.2rem;
}
.btn-contact-action {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.btn-contact-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}
.btn-contact-action i { color: var(--primary-color); }
.btn-contact-action.copied { border-color: #16a34a; color: #16a34a; }
.btn-contact-action.copied i { color: #16a34a; }

/* ---------- Coursework → proof chips ---------- */
.applied-chips {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.applied-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-right: 0.2rem;
}
.applied-chip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3557d4;
    border: 1px solid #e0e7ff;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.applied-chip:hover { background: var(--primary-color); color: #ffffff; border-color: var(--primary-color); }

/* ---------- Command palette ---------- */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 18, 0.55);
    backdrop-filter: blur(2px);
    z-index: 4000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 20px;
}
.cmdk-overlay[hidden] { display: none; }
.cmdk-box {
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.cmdk-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-color);
    background: transparent;
    border-bottom: 1px solid #eef0f4;
    box-sizing: border-box;
}
.cmdk-list {
    max-height: 46vh;
    overflow-y: auto;
    padding: 0.4rem;
}
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
}
.cmdk-item i {
    width: 1.2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.cmdk-item .cmdk-item-hint {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--secondary-color);
}
.cmdk-item.active, .cmdk-item:hover { background: #eef2ff; }
.cmdk-item.active i, .cmdk-item.active { color: #1e3a8a; }
.cmdk-empty {
    padding: 1.2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.92rem;
}
.cmdk-footer {
    border-top: 1px solid #eef0f4;
    padding: 0.55rem 1.2rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}
.cmdk-kbd {
    display: inline-block;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #f8fafc;
    padding: 0 0.35rem;
    font-family: inherit;
    font-size: 0.72rem;
    color: #334155;
}
.cmdk-help-title {
    padding: 0.7rem 1rem 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

/* ---------- A11y: visible focus rings ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ---------- Perf: skip offscreen rendering for below-fold sections ---------- */
@supports (content-visibility: auto) {
    .coursework, .apps, .ship-log, .featured, .architecture,
    .open-source, .how-i-work, .skills, .tech-stack, .faq, .contact {
        content-visibility: auto;
        contain-intrinsic-size: auto 900px;
    }
}

/* ---------- Dark mode for round-2 components ---------- */
[data-theme="dark"] .btn-resume-pdf {
    background: transparent;
    color: #e7e9ee !important;
    border-color: #e7e9ee;
}
[data-theme="dark"] .btn-resume-pdf:hover { background: #e7e9ee; color: #0f1115 !important; }
[data-theme="dark"] .cmdk-hint { border-color: #2a2f3a; color: #9aa4b2; }
[data-theme="dark"] .cmdk-hint:hover { border-color: var(--primary-color); color: var(--primary-color); }
[data-theme="dark"] .ship-log,
[data-theme="dark"] .architecture,
[data-theme="dark"] .open-source,
[data-theme="dark"] .how-i-work,
[data-theme="dark"] .faq { background: #0f1115 !important; }
[data-theme="dark"] .shiplog-list::before { background: #262c37; }
[data-theme="dark"] .shiplog-dot { background: #0f1115; }
[data-theme="dark"] .shiplog-app { color: #e7e9ee; }
[data-theme="dark"] .shiplog-app:hover { color: var(--primary-color); }
[data-theme="dark"] .shiplog-version { background: #1b2440; color: #9db4ff; border-color: #26325a; }
[data-theme="dark"] .shiplog-toggle { background: #171a21; color: #cbd2dc; border-color: #2a3038; }
[data-theme="dark"] .arch-box { fill: #171a21; stroke: #262c37; }
[data-theme="dark"] .arch-box-accent { fill: #1b2440; stroke: #26325a; }
[data-theme="dark"] .arch-box-provider { fill: #14171d; }
[data-theme="dark"] .arch-title,
[data-theme="dark"] .arch-provider { fill: #e7e9ee; }
[data-theme="dark"] .arch-item { fill: #cbd2dc; }
[data-theme="dark"] .arch-item-muted { fill: #6b7686; }
[data-theme="dark"] .arch-rule { stroke: #262c37; }
[data-theme="dark"] .arch-label { fill: #9aa4b2; }
[data-theme="dark"] .arch-label-strong { fill: #9db4ff; }
[data-theme="dark"] .arch-card,
[data-theme="dark"] .gh-stat,
[data-theme="dark"] .gh-card,
[data-theme="dark"] .hiw-card,
[data-theme="dark"] .faq-item { background: #171a21 !important; border-color: #262c37; }
[data-theme="dark"] .hiw-card { border-top-color: var(--primary-color); }
[data-theme="dark"] .hiw-card h3,
[data-theme="dark"] .faq-item summary,
[data-theme="dark"] .gh-card h3 a { color: #e7e9ee; }
[data-theme="dark"] .faq-item summary:hover { color: var(--primary-color); }
[data-theme="dark"] .arch-card code { background: #1b2029; border-color: #2a3038; color: #cbd2dc; }
[data-theme="dark"] .btn-contact-action { background: #171a21; border-color: #2a3038; color: #e7e9ee; }
[data-theme="dark"] .btn-contact-action.copied { border-color: #4ade80; color: #4ade80; }
[data-theme="dark"] .btn-contact-action.copied i { color: #4ade80; }
[data-theme="dark"] .applied-chips { border-top-color: #262c37; }
[data-theme="dark"] .applied-chip { background: #1b2440; color: #9db4ff; border-color: #26325a; }
[data-theme="dark"] .applied-chip:hover { background: var(--primary-color); color: #0f1115; border-color: var(--primary-color); }
[data-theme="dark"] .cmdk-box { background: #14171d; border-color: #262c37; }
[data-theme="dark"] .cmdk-input { color: #e7e9ee; border-bottom-color: #232833; }
[data-theme="dark"] .cmdk-item { color: #e7e9ee; }
[data-theme="dark"] .cmdk-item.active, [data-theme="dark"] .cmdk-item:hover { background: #1b2440; color: #cdd9ff; }
[data-theme="dark"] .cmdk-footer { border-top-color: #232833; }
[data-theme="dark"] .cmdk-kbd { background: #1b2029; border-color: #2a3038; color: #cbd2dc; }

/* ---------- Reduced motion for round-2 components ---------- */
@media (prefers-reduced-motion: reduce) {
    .arch-card, .gh-card, .hiw-card, .btn-contact-action,
    .shiplog-toggle, .applied-chip, .btn-resume-pdf, .cmdk-hint { transition: none !important; }
    .arch-card:hover, .gh-card:hover, .hiw-card:hover,
    .btn-contact-action:hover, .btn-resume-pdf:hover { transform: none !important; }
}

/* ---------- Print: clean, flat, recruiter-friendly ---------- */
@media print {
    .navbar, .availability-banner, .chat-widget, .chat-toggle,
    .app-filter, .ai-twin-cta, .btn-screens, .cmdk-overlay, .cmdk-hint,
    .lightbox, .skip-link, .shiplog-toggle, .contact-actions,
    .faq-twin-link, .theme-toggle, .social-links { display: none !important; }
    html, body { background: #ffffff !important; }
    section {
        opacity: 1 !important;
        transform: none !important;
        content-visibility: visible !important;
        padding: 28px 0 !important;
        page-break-inside: auto;
    }
    .hero { min-height: 0 !important; padding: 36px 0 !important; }
    .hero-buttons .btn { box-shadow: none !important; }
    .app-card, .arch-card, .gh-card, .hiw-card, .coursework-category,
    .skill-category, .techstack-group, .education-item, .sia-item, .faq-item {
        box-shadow: none !important;
        border: 1px solid #dddddd !important;
        break-inside: avoid;
    }
    .apps-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 1rem !important; }
    .btn-app-store, .btn-website {
        background: none !important;
        color: #000000 !important;
        border: none !important;
        padding: 0 !important;
    }
    .phone-frame { box-shadow: none !important; }
    .footer { background: none !important; color: #000000 !important; }
    .footer a { color: #000000 !important; }
}

/* ---------- Small screens (round 2) ---------- */
@media (max-width: 768px) {
    .cmdk-overlay { padding-top: 8vh; }
    .gh-stats { gap: 1rem; }
    .gh-stat { padding: 0.9rem 1.4rem; min-width: 120px; }
    .shiplog-notes { font-size: 0.88rem; }
    .arch-diagram-wrap {
        -webkit-overflow-scrolling: touch;
    }
}

/* =============================================================
   Round 2b — owner assets: hero headshot, pitch line,
   standout coursework (transcript-verified grades).
   ============================================================= */

/* ---------- Hero headshot ---------- */
.hero-headshot {
    display: block;
    width: 144px;
    height: 144px;
    margin: 0 auto 1.6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #eef2ff;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16);
    animation: fadeInUp 0.8s ease 0.1s;
    animation-fill-mode: backwards;
}

/* ---------- Hero pitch line (owner's own words) ---------- */
.hero-pitch {
    font-size: 1.02rem;
    font-style: italic;
    color: #334155;
    max-width: 620px;
    margin: -0.75rem auto 1.6rem;
    animation: fadeInUp 0.8s ease 0.6s;
    animation-fill-mode: backwards;
}

/* ---------- Standout Coursework ---------- */
.standout-coursework {
    margin-top: 3rem;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
}
.standout-title {
    text-align: center;
    font-size: 1.35rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}
.standout-title i {
    color: var(--primary-color);
    margin-right: 0.45rem;
}
.standout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}
.standout-group h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.7rem;
}
.standout-group h4 i { margin-right: 0.4rem; }
.standout-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.standout-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #eef1f5;
}
.standout-list li:last-child { border-bottom: none; }
.standout-course {
    font-size: 0.95rem;
    color: #1e293b;
}
.grade-chip {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
}
.grade-a {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.grade-am {
    background: #eef2ff;
    color: var(--primary-color);
    border: 1px solid #e0e7ff;
}
.standout-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--secondary-color);
    margin: 1.4rem 0 0;
}

/* ---------- Dark mode (round 2b) ---------- */
[data-theme="dark"] .hero-headshot {
    border-color: #262c37;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .hero-pitch { color: #cbd2dc; }
[data-theme="dark"] .standout-coursework {
    background: #171a21 !important;
    border-color: #262c37;
}
[data-theme="dark"] .standout-title { color: #e7e9ee; }
[data-theme="dark"] .standout-course { color: #cbd2dc; }
[data-theme="dark"] .standout-list li { border-bottom-color: #232833; }
[data-theme="dark"] .grade-a { background: #12271a; color: #4ade80; border-color: #1d4028; }
[data-theme="dark"] .grade-am { background: #1b2440; color: #9db4ff; border-color: #26325a; }
[data-theme="dark"] .standout-note { color: #9aa4b2; }

/* ---------- Reduced motion (round 2b) ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-headshot, .hero-pitch { animation: none !important; }
}

/* ---------- Print (round 2b) ---------- */
@media print {
    .hero-headshot { box-shadow: none !important; border-color: #dddddd !important; }
    .standout-coursework {
        box-shadow: none !important;
        border: 1px solid #dddddd !important;
    }
    .standout-group { break-inside: avoid; }
}

/* ---------- Small screens (round 2b) ---------- */
@media (max-width: 768px) {
    .hero-headshot { width: 118px; height: 118px; }
    .hero-pitch { font-size: 0.96rem; }
    .standout-coursework { padding: 1.4rem; }
    .standout-course { font-size: 0.9rem; }
}

/* ---------- Chat widget theme layer (round 3, additive) ----------
   js/chat.js styles the widget through --chat-* variables with light
   defaults; this block only supplies the dark values. */
:root[data-theme="dark"] {
    --chat-surface: #14171d;
    --chat-messages-bg: #0f1115;
    --chat-border: #232833;
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    --chat-header-bg: #1c2230;
    --chat-bubble-bot-bg: #1c212b;
    --chat-bubble-bot-text: #e7e9ee;
    --chat-bubble-user-bg: #2f56b8;
    --chat-link: #8fb2ff;
    --chat-code-bg: rgba(255, 255, 255, 0.1);
    --chat-chip-bg: #1c212b;
    --chat-chip-text: #cbd2dc;
    --chat-chip-border: #2a2f3a;
    --chat-input-bg: #0f1115;
    --chat-input-text: #e7e9ee;
    --chat-muted: #9aa4b2;
}
