/* ═══════════════════════════════════════════════════════════════
   Panthawit "Boo" Chumthong — QA Portfolio
   Apple-style single-page résumé. White-default + dark toggle.
   One family (Anuphan), monochrome surface, color as functional signal.
═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
    /* Type */
    --font-sans: 'Anuphan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Menlo', 'Monaco', monospace;

    /* Motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --dur: 0.32s;

    /* Geometry */
    --container: 1200px;
    --container-narrow: 760px;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --pill: 980px;

    /* Z-index scale */
    --z-glow: 1;
    --z-base: 2;
    --z-nav: 100;
    --z-modal: 1000;
    --z-viewer: 2000;

    /* Light theme (default) */
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --surface: #f5f5f7;
    --surface-2: #ffffff;
    --surface-hover: #ececef;
    --ink: #1d1d1f;
    --ink-2: #6e6e73;
    --ink-3: #86868b;
    --hairline: #d2d2d7;
    --hairline-strong: #b9b9c0;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --on-accent: #ffffff;

    /* Functional signal hues (contact buttons on hover) */
    --sig-email: #0071e3;
    --sig-phone: #0a84c4;
    --sig-linkedin: #0a66c2;
    --sig-github: #1d1d1f;
    --sig-resume: #0a7d3e;

    /* The single reserved flare (GAY-DAR card) */
    --special-gradient: linear-gradient(125deg, #ff5a5a, #ff8a1e);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.22);
    --glow-tint: rgba(0, 113, 227, 0.10);
}

[data-theme="dark"] {
    --bg: #08070d;
    --bg-alt: transparent;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-2: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.10);
    --ink: #f4f3f8;
    --ink-2: #b9b7c6;
    --ink-3: #8a8799;
    --hairline: rgba(255, 255, 255, 0.12);
    --hairline-strong: rgba(255, 255, 255, 0.26);
    --accent: #ff8a3c;
    --accent-hover: #ffa05c;
    --on-accent: #1a0e06;

    /* Neon palette (vibrant multicolor type) */
    --neon-1: #ff8a3c;
    --neon-2: #ff5dbe;
    --neon-3: #ffd23f;
    --neon-4: #ff5a5a;
    --neon-5: #8c93ff;
    --neon-6: #34dceb;

    --sig-email: #5b8cff;
    --sig-phone: #34dceb;
    --sig-linkedin: #6c9bff;
    --sig-github: #f4f3f8;
    --sig-resume: #34d27a;

    --special-gradient: linear-gradient(125deg, #ff5a5a, #ff8a1e);

    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 16px 44px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.75);
    --glow-tint: rgba(255, 138, 60, 0.18);
}

/* ─── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 9999;
    padding: 10px 18px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 10px;
    font-weight: 600;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ─── Typography scale ───────────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.022em;
    text-wrap: balance;
    color: var(--ink);
}

.section-title {
    font-size: clamp(1.85rem, 4vw, 2.85rem);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.section-sub {
    margin-top: 0.85rem;
    color: var(--ink-2);
    font-size: clamp(1.02rem, 1.4vw, 1.18rem);
    font-weight: 400;
    line-height: 1.5;
    max-width: 56ch;
    text-wrap: pretty;
}

/* ─── Layout primitives ──────────────────────────────────────── */
main { position: relative; z-index: var(--z-base); }

.section {
    padding-block: clamp(2.25rem, 5vw, 4rem);
}
/* Offset anchored sections so the fixed nav never covers their heading */
:where(section[id], main[id]) { scroll-margin-top: 72px; }
.skills-section,
.certifications-section {
    background: var(--bg-alt);
}

.section-inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
.section-inner--narrow { max-width: var(--container-narrow); }

.section-head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.section-head--center { text-align: center; }
.section-head--center .section-sub { margin-inline: auto; }

/* ─── Nav ────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-nav);
    height: 56px;
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    border-bottom: 1px solid transparent;
    transition: background 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft), backdrop-filter 0.3s;
}
.nav.is-scrolled {
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: var(--hairline);
}
.nav-inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.nav-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    transition: transform 0.4s var(--ease);
}
.nav-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nav-brand:hover .nav-mark { transform: rotate(-8deg) scale(1.05); }
.nav-word { font-size: 1.05rem; }

.nav-links { display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1.75rem); }
.nav-link {
    position: relative;
    color: var(--ink-2);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0.15rem;
    transition: color 0.2s var(--ease-soft);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.28s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--ink);
    border: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--surface-hover); transform: scale(1.06); }
.theme-toggle:active { transform: scale(0.94); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.4rem;
    border-radius: var(--pill);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    color: var(--ink);
    background: var(--surface);
    transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s;
    white-space: nowrap;
}
.btn svg { flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 10px 26px var(--glow-tint); }

.btn-ghost {
    background: transparent;
    border-color: var(--hairline-strong);
    color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* Contact buttons: monochrome at rest, hue on hover */
.btn-email, .btn-phone, .btn-linkedin, .btn-github, .btn-resume {
    background: var(--surface-2);
    border-color: var(--hairline);
    color: var(--ink);
}
[data-theme="dark"] .btn-email,
[data-theme="dark"] .btn-phone,
[data-theme="dark"] .btn-linkedin,
[data-theme="dark"] .btn-github { background: var(--surface); }

.btn-email:hover  { color: var(--sig-email);    border-color: var(--sig-email);    box-shadow: 0 8px 22px color-mix(in srgb, var(--sig-email) 22%, transparent); }
.btn-phone:hover  { color: var(--sig-phone);    border-color: var(--sig-phone);    box-shadow: 0 8px 22px color-mix(in srgb, var(--sig-phone) 22%, transparent); }
.btn-linkedin:hover { color: var(--sig-linkedin); border-color: var(--sig-linkedin); box-shadow: 0 8px 22px color-mix(in srgb, var(--sig-linkedin) 22%, transparent); }
.btn-github:hover { color: var(--sig-github);   border-color: var(--sig-github);   box-shadow: var(--shadow-sm); }

/* Résumé is the primary contact action: carries its color at rest */
.btn-resume {
    background: var(--sig-resume);
    color: #fff;
    border-color: transparent;
}
.btn-resume:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--sig-resume) 30%, transparent); }

.btn-secondary { background: var(--surface); border-color: var(--hairline); color: var(--ink-2); }
.btn-secondary:hover { color: var(--ink); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-close { background: transparent; border-color: var(--hairline); color: var(--ink-2); }
.btn-close:hover { color: #ff453a; border-color: #ff453a; transform: none; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: clamp(440px, 66vh, 680px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    padding: calc(56px + clamp(1.5rem, 5vh, 3rem)) 0 clamp(2rem, 5vh, 3.5rem);
    overflow: hidden;
}
.hero-inner {
    max-width: 760px;
    width: 100%;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-ticker {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.hero-avatar { margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.avatar-img {
    width: clamp(88px, 11vw, 124px);
    height: clamp(88px, 11vw, 124px);
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--hairline);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.avatar-img:hover { transform: scale(1.04) translateY(-3px); box-shadow: var(--shadow-lg); }

.hero-eyebrow {
    color: var(--ink-2);
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    font-weight: 500;
    margin-bottom: clamp(0.6rem, 1.5vw, 1rem);
}
.hero-title {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
}
.hero-nick { color: var(--ink-2); font-weight: 600; }
.hero-desc {
    margin-top: clamp(0.75rem, 1.5vw, 1.1rem);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 48ch;
    text-wrap: pretty;
}
.hero-hook {
    display: block;
    font-size: clamp(1.15rem, 1.9vw, 1.45rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.hero-sub {
    display: block;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    font-weight: 400;
    color: var(--ink-2);
    line-height: 1.55;
}
.hero-cta .btn { padding-inline: 1.7rem; font-size: 1.02rem; }

/* ─── Projects ───────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: clamp(0.85rem, 1.6vw, 1.25rem);
}
.project-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: clamp(1.1rem, 2vw, 1.5rem);
    min-height: 168px;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.25s;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--hairline-strong);
}
.p-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: auto;
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    transition: transform 0.4s var(--ease);
}
.project-card:hover .p-icon { transform: translateY(-2px) rotate(-4deg); }
.file-label {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}
.file-sub { color: var(--ink-2); font-size: 0.85rem; }

/* The single flare: GAY-DAR side project */
.card-special .p-icon {
    background: var(--special-gradient);
    color: #fff;
    border-color: transparent;
}
.card-special:hover { border-color: color-mix(in srgb, #ff7a3c 55%, var(--hairline)); }

/* ─── Skills ─────────────────────────────────────────────────── */
/* ─── Skills Ticker ────────────────────────────────────────── */
.skills-ticker {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-block: 0.25rem;
}
.ticker-row {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker-scroll 24s linear infinite;
}
.ticker-row--reverse .ticker-track { animation-direction: reverse; animation-duration: 20s; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.ticker-half {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ticker-sep {
    padding: 0 1rem;
    color: var(--ink-3);
    font-weight: 300;
    user-select: none;
    flex-shrink: 0;
}
.skill-chip {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--pill);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 500;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
.skill-chip:hover {
    transform: translateY(-2px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-sm);
}

/* Dark mode: bare neon text, no border */
[data-theme="dark"] .skill-chip {
    background: transparent;
    border-color: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.4rem 0.5rem;
}
[data-theme="dark"] .ticker-sep { color: rgba(255,255,255,0.18); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+1)  { color: var(--neon-1); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+3)  { color: var(--neon-2); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+5)  { color: var(--neon-3); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+7)  { color: var(--neon-4); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+9)  { color: var(--neon-5); }
[data-theme="dark"] .ticker-half .skill-chip:nth-child(12n+11) { color: var(--neon-6); }

/* ─── Experience ─────────────────────────────────────────────── */
.experience-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3.5rem);
}

.timeline { position: relative; }
.timeline-item {
    display: grid;
    grid-template-columns: clamp(74px, 16vw, 104px) 1fr;
    column-gap: clamp(1rem, 3vw, 1.75rem);
}
.tl-date {
    text-align: right;
    color: var(--ink-2);
    font-weight: 500;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    padding-top: 0.15rem;
    white-space: nowrap;
}
.tl-content {
    position: relative;
    padding-left: clamp(1.25rem, 3vw, 1.85rem);
    padding-bottom: clamp(1.6rem, 4vw, 2.25rem);
    border-left: 1px solid var(--hairline);
}
.timeline-item:last-child .tl-content { border-left-color: transparent; padding-bottom: 0; }
.tl-content::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0.45rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 0 0 4px var(--bg);
}
.tl-content h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.015em; }
.tl-content p { color: var(--ink-2); font-size: 0.96rem; margin-top: 0.15rem; }

.side-panel { display: flex; flex-direction: column; gap: 1rem; }
.side-block {
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
}
[data-theme="dark"] .side-block { background: var(--surface); }
.side-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.85rem;
}
.lang-item { display: flex; justify-content: space-between; align-items: baseline; padding: 0.3rem 0; }
.lang-item + .lang-item { border-top: 1px solid var(--hairline); }
.lang-name { font-weight: 500; }
.lang-level { color: var(--ink-2); font-size: 0.9rem; }
.side-list { display: flex; flex-direction: column; gap: 0.55rem; }
.side-list li { position: relative; padding-left: 1.3rem; color: var(--ink-2); }
.side-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.62em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.side-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.side-tag {
    padding: 0.35rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--pill);
    font-size: 0.85rem;
    color: var(--ink-2);
}
[data-theme="dark"] .side-tag { background: var(--surface-2); }

/* ─── Certifications ─────────────────────────────────────────── */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: clamp(0.9rem, 1.8vw, 1.35rem);
}
.cert-card {
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--surface-2);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
[data-theme="dark"] .cert-card { background: var(--surface); }
.cert-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--hairline-strong);
}
.cert-image-container {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface);
}
.cert-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.cert-card:hover .cert-image-container img { transform: scale(1.05); }
.cert-overlay {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--hairline);
}
.cert-overlay span { font-size: 0.92rem; font-weight: 500; color: var(--ink); }

/* ─── Contact ────────────────────────────────────────────────── */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.contact-links .btn { padding: 0.8rem 1.5rem; font-size: 1rem; }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: var(--z-base);
    border-top: 1px solid var(--hairline);
    padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.footer .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}
.footer-mark { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.footer-note { color: var(--ink-3); font-size: 0.9rem; }

/* ─── Cursor glow (ambient, pointer:fine only) ───────────────── */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-glow);
    background: radial-gradient(circle, var(--glow-tint) 0%, transparent 62%);
    opacity: 0;
    transition: opacity 0.6s var(--ease-soft);
    will-change: transform;
}
.cursor-glow.is-on { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   MODAL: README reader
═══════════════════════════════════════════════════════════════ */
.readme-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 4vw, 3rem);
    background: color-mix(in srgb, var(--bg) 35%, rgba(0,0,0,0.55));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-soft), visibility 0.3s;
}
.readme-overlay.active { opacity: 1; visibility: visible; }

.modal-panel {
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.35s var(--ease);
}
.readme-overlay.active .modal-panel { transform: translateY(0) scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem 0.85rem 1.5rem;
    border-bottom: 1px solid var(--hairline);
    background: var(--surface-2);
}
#modal-title { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.modal-controls { display: flex; gap: 0.5rem; align-items: center; }

.readme-content {
    overflow-y: auto;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    line-height: 1.7;
    color: var(--ink-2);
}
.loading-text { color: var(--ink-3); text-align: center; padding: 2rem 0; }

/* Markdown */
.readme-content h1, .readme-content h2, .readme-content h3,
.readme-content h4 { color: var(--ink); line-height: 1.25; }
.readme-content h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 1rem; letter-spacing: -0.025em; }
.readme-content h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 2rem 0 0.85rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--hairline); }
.readme-content h3 { font-size: 1.18rem; margin: 1.5rem 0 0.6rem; }
.readme-content p { margin-bottom: 1rem; }
.readme-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.readme-content a:hover { border-bottom-color: var(--accent); }
.readme-content ul, .readme-content ol { margin: 0 0 1rem 1.4rem; }
.readme-content ul { list-style: disc; }
.readme-content ol { list-style: decimal; }
.readme-content li { margin-bottom: 0.4rem; }
.readme-content strong { color: var(--ink); font-weight: 600; }
.readme-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface);
    border: 1px solid var(--hairline);
    padding: 0.12em 0.4em;
    border-radius: 6px;
    color: var(--ink);
}
.readme-content pre {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}
.readme-content pre code { background: none; border: none; padding: 0; font-size: 0.85rem; }
.readme-content blockquote {
    border-left: 3px solid var(--hairline-strong);
    padding-left: 1rem;
    margin: 0 0 1rem;
    color: var(--ink-3);
}
.readme-content img {
    border-radius: 12px;
    border: 1px solid var(--hairline);
    margin: 0.5rem 0 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.readme-content img:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.readme-content hr { border: none; border-top: 1px solid var(--hairline); margin: 1.75rem 0; }
.readme-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2rem;
    font-size: 0.92rem;
}
.readme-content th, .readme-content td {
    border: 1px solid var(--hairline);
    padding: 0.55rem 0.8rem;
    text-align: left;
}
.readme-content th { background: var(--surface); color: var(--ink); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   MODAL: Certificate image viewer
═══════════════════════════════════════════════════════════════ */
.image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-viewer);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 5vw, 3rem);
    background: rgba(0, 0, 0, 0.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-soft), visibility 0.3s;
}
.image-viewer-overlay.active { opacity: 1; visibility: visible; }
.viewer-container {
    position: relative;
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transform: scale(0.96);
    transition: transform 0.35s var(--ease);
}
.image-viewer-overlay.active .viewer-container { transform: scale(1); }
#viewerImage {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.viewer-caption { color: #f5f5f7; font-size: 0.95rem; text-align: center; }
.viewer-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s var(--ease);
}
.viewer-close:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.08); }

/* ═══════════════════════════════════════════════════════════════
   HERO FOCUS AREAS (neon multicolor in dark)
═══════════════════════════════════════════════════════════════ */
.hero-focus {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.4rem;
    margin-top: clamp(1.25rem, 3vw, 1.9rem);
}
.hero-focus li {
    font-weight: 700;
    font-size: clamp(0.78rem, 1.3vw, 0.98rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ═══════════════════════════════════════════════════════════════
   DARK NEON THEME — grainy aurora gradient + neon accents
═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] body {
    background-color: var(--bg);
    background-image:
        radial-gradient(50% 58% at 12% 8%, rgba(255, 122, 60, 0.22), transparent 60%),
        radial-gradient(48% 56% at 88% 14%, rgba(232, 80, 200, 0.18), transparent 60%),
        radial-gradient(60% 68% at 82% 86%, rgba(60, 96, 235, 0.22), transparent 62%),
        radial-gradient(55% 64% at 16% 92%, rgba(140, 60, 185, 0.20), transparent 60%),
        radial-gradient(140% 120% at 50% 38%, transparent 38%, rgba(6, 5, 12, 0.65) 100%);
    background-repeat: no-repeat;
}
/* Film grain overlay */
[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.16;
    mix-blend-mode: overlay;
}

/* Neon section titles with soft glow */
[data-theme="dark"] .section-title { text-shadow: 0 0 28px color-mix(in srgb, currentColor 30%, transparent); }
[data-theme="dark"] #work .section-title       { color: var(--neon-1); }
[data-theme="dark"] #skills .section-title     { color: var(--neon-2); }
[data-theme="dark"] #experience .section-title { color: var(--neon-3); }
[data-theme="dark"] #certs .section-title      { color: var(--neon-5); }
[data-theme="dark"] #contact .section-title    { color: var(--neon-6); }

/* Hero neon accents */
[data-theme="dark"] .hero-eyebrow { color: var(--neon-6); }
[data-theme="dark"] .hero-nick    { color: var(--neon-2); }
[data-theme="dark"] .hero-hook    { color: #f4f3f8; }
[data-theme="dark"] .nav-mark { background: transparent; }
[data-theme="dark"] .footer-mark  { color: var(--neon-1); }
[data-theme="dark"] .btn-resume   { background: var(--sig-resume); color: #fff; border-color: transparent; }

[data-theme="dark"] .hero-focus li:nth-child(1) { color: var(--neon-1); }
[data-theme="dark"] .hero-focus li:nth-child(2) { color: var(--neon-2); }
[data-theme="dark"] .hero-focus li:nth-child(3) { color: var(--neon-3); }
[data-theme="dark"] .hero-focus li:nth-child(4) { color: var(--neon-5); }
[data-theme="dark"] .hero-focus li:nth-child(5) { color: var(--neon-6); }

/* Glassy cards floating on the gradient */
[data-theme="dark"] .project-card,
[data-theme="dark"] .cert-card,
[data-theme="dark"] .side-block {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
[data-theme="dark"] .project-card:hover {
    border-color: color-mix(in srgb, var(--neon-1) 45%, var(--hairline-strong));
    box-shadow: var(--shadow-md), 0 0 26px color-mix(in srgb, var(--neon-1) 16%, transparent);
}
[data-theme="dark"] .cert-card:hover {
    border-color: color-mix(in srgb, var(--neon-5) 45%, var(--hairline-strong));
    box-shadow: var(--shadow-md), 0 0 26px color-mix(in srgb, var(--neon-5) 16%, transparent);
}
[data-theme="dark"] .skill-chip:hover {
    opacity: 0.7;
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .experience-grid {
        grid-template-columns: minmax(0, 1fr) clamp(260px, 28vw, 320px);
        align-items: start;
        gap: clamp(2.5rem, 5vw, 4rem);
    }
}

@media (max-width: 700px) {
    .nav-links { display: none; }
    .nav { height: 52px; }
    .hero { padding-top: calc(52px + 2rem); }
    .hero-cta { width: 100%; }
    .hero-cta .btn { flex: 1 1 auto; }
    .contact-links { flex-direction: column; }
    .contact-links .btn { width: 100%; }
    .viewer-close { top: auto; bottom: -3.4rem; right: 50%; transform: translateX(50%); }
    .image-viewer-overlay.active .viewer-container { transform: scale(1); }
}

@media (max-width: 380px) {
    .projects-grid { grid-template-columns: 1fr 1fr; }
    .cert-grid { grid-template-columns: 1fr 1fr; }
    .timeline-item { grid-template-columns: 64px 1fr; column-gap: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .cursor-glow { display: none; }
    .btn:hover, .project-card:hover, .cert-card:hover, .skill-chip:hover,
    .avatar-img:hover, .nav-brand:hover .nav-mark { transform: none; }
    .cert-card:hover .cert-image-container img,
    .project-card:hover .p-icon { transform: none; }
}
