/* ===============================================
   PORTFOLIO — Editorial Premium edition
   =============================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* text selection: dark block, bright text — always readable on every theme */
::selection { background: #1c1f2a; color: #ffffff; text-shadow: none; }
::-moz-selection { background: #1c1f2a; color: #ffffff; text-shadow: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: 'Fira Code', monospace; }
section { scroll-margin-top: 80px; }

#bg-canvas { position: fixed; inset: 0; z-index: -1; width: 100vw; height: 100vh; }

#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--accent);
    z-index: 1200; pointer-events: none;
}

/* ---------- loader ---------- */
#loader {
    position: fixed; inset: 0; background: var(--bg); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader { animation: loaderFailsafe 0.5s ease 5s forwards; }
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }
.loader-terminal {
    width: min(440px, 90vw); background: var(--bg-2);
    border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow);
}
.loader-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.loader-bar span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.loader-bar .r { background: #f87171; } .loader-bar .y { background: #fbbf24; } .loader-bar .g { background: #34d399; }
.loader-bar .t { font-family: 'Fira Code', monospace; font-size: 0.7rem; color: var(--muted); margin-left: 8px; }
.loader-body { padding: 16px 18px 22px; font-family: 'Fira Code', monospace; font-size: 0.8rem; min-height: 110px; color: var(--muted); }
.loader-body .ln { margin-bottom: 6px; opacity: 0; animation: lineIn 0.3s ease forwards; }
.loader-body .ok { color: var(--accent); }
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loader-skip { position: absolute; bottom: 28px; font-family: 'Fira Code', monospace; font-size: 0.7rem; color: var(--muted); opacity: 0.7; }

/* ---------- minimal editorial navbar ---------- */
#navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
#navbar.scrolled {
    background: var(--nav-bg);
    border-bottom-color: var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 72px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo { font-family: 'Fira Code', monospace; font-weight: 600; font-size: 1rem; color: var(--text); white-space: nowrap; }
.nav-logo .acc { color: var(--accent); }
.nav-menu { display: flex; align-items: center; gap: 26px; }
.nav-menu a {
    font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted); position: relative; padding: 4px 0;
    transition: color 0.2s ease;
}
.nav-menu a::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--accent); transition: width 0.25s ease;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--text); }
.nav-menu a:hover::after, .nav-menu a.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-wrap { position: relative; }
#theme-btn {
    width: 36px; height: 36px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--border); background: transparent;
    color: var(--text); transition: border-color 0.2s ease, transform 0.2s ease;
}
#theme-btn:hover { border-color: var(--border-strong); transform: rotate(15deg); }
#theme-menu {
    position: absolute; top: calc(100% + 14px); right: 0; width: 190px;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
    padding: 6px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.2s ease;
}
#theme-menu.open { opacity: 1; visibility: visible; transform: none; }
.theme-opt {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border: none; background: transparent; color: var(--text);
    font-size: 0.85rem; border-radius: 8px; text-align: left; transition: background 0.15s ease;
}
.theme-opt:hover { background: var(--card-hover); }
.theme-opt.active { background: var(--chip-bg); color: var(--accent); }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); flex-shrink: 0; }

#hamburger {
    display: none; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
#hamburger span { width: 16px; height: 1.5px; background: var(--text); transition: transform 0.3s ease, opacity 0.3s ease; }
#hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

#mobile-nav {
    position: fixed; inset: 0; z-index: 1090;
    background: var(--bg);
    padding: 110px 32px 40px;
    transform: translateY(-100%); transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1);
    overflow-y: auto;
}
#mobile-nav.open { transform: none; }
#mobile-nav a {
    display: block; padding: 14px 0;
    font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em;
    color: var(--text); border-bottom: 1px solid var(--border);
    transition: color 0.2s ease, padding-left 0.2s ease;
}
#mobile-nav a:hover, #mobile-nav a:active { color: var(--accent); padding-left: 10px; }
.mobile-themes { display: flex; gap: 12px; margin-top: 28px; }
.mobile-themes button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); }
.mobile-themes button.active { border-color: var(--accent); transform: scale(1.12); }

/* ---------- layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
section .container { padding-top: clamp(90px, 12vh, 150px); padding-bottom: 10px; }

/* editorial section header */
.ed-head { position: relative; margin-bottom: clamp(40px, 6vh, 64px); padding-top: 26px; border-top: 1px solid var(--border); }
.ed-num {
    position: absolute; right: 0; top: 6px;
    font-family: 'Fira Code', monospace; font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 600; line-height: 1; color: transparent;
    -webkit-text-stroke: 1px rgba(var(--accent-rgb), 0.35);
    pointer-events: none; user-select: none;
}
.ed-kicker {
    font-family: 'Fira Code', monospace; font-size: 0.74rem; letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 10px;
}
.ed-title {
    font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 700;
    letter-spacing: -0.03em; line-height: 1.04; text-transform: uppercase;
}
.ed-sub { color: var(--muted); margin-top: 14px; max-width: 560px; font-size: 0.95rem; }

/* line-mask title reveal */
.line { display: block; overflow: hidden; }
.line > span { display: block; transform: translateY(115%); transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible .line > span { transform: none; }
.reveal.visible .line:nth-child(2) > span { transition-delay: 0.08s; }

/* generic reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- HERO ---------- */
#home { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; position: relative; }
#home .container { padding-top: 100px; width: 100%; }
.hero-top {
    display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px;
    font-family: 'Fira Code', monospace; font-size: 0.78rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: clamp(28px, 5vh, 56px);
}
.hero-top .acc { color: var(--accent); }
.hero-name {
    font-size: clamp(2.6rem, 9.5vw, 7.2rem);
    font-weight: 700; line-height: 0.98; letter-spacing: -0.04em;
    text-transform: uppercase; margin-bottom: clamp(28px, 4vh, 44px);
}
.hero-name .thin { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero-name .accent { color: var(--accent); }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.hero-role {
    font-family: 'Fira Code', monospace; font-size: clamp(0.9rem, 2vw, 1.05rem); color: var(--muted);
}
.hero-role .prompt { color: var(--accent); }
#typing-text { color: var(--text); }
.type-caret { display: inline-block; width: 9px; height: 1.1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { max-width: 440px; color: var(--muted); font-size: 0.95rem; }
.hero-links { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.u-link {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
    color: var(--text); padding-bottom: 5px; position: relative;
}
.u-link::after { content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--border-strong); transition: background 0.2s ease, transform 0.3s ease; transform-origin: left; }
.u-link:hover { color: var(--accent); }
.u-link:hover::after { background: var(--accent); transform: scaleX(1.06); }
.u-link svg { transition: transform 0.25s ease; }
.u-link:hover svg { transform: translate(3px, -3px); }

/* hero marquee strip */
.marquee {
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    overflow: hidden; padding: 16px 0; margin-top: clamp(40px, 7vh, 80px);
}
.marquee-track { display: flex; align-items: center; width: max-content; animation: mq 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
.mq-item {
    font-size: clamp(0.95rem, 2.2vw, 1.25rem); font-weight: 600; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.mq-sep { color: var(--accent); margin: 0 26px; font-size: 0.9em; }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.about-photo { position: sticky; top: 110px; max-width: 300px; }
/* offset back-frame — matches the photo size exactly (4:5), not the whole column */
.about-photo::before {
    content: ''; position: absolute;
    top: 16px; left: 16px;
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--border-strong);
    z-index: -1;
    transition: transform 0.4s ease;
}
.about-photo:hover::before { transform: translate(-5px, -5px); }
/* badge overlapping the top-left corner */
.photo-badge {
    position: absolute; top: -12px; left: -12px; z-index: 3;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: 'Fira Code', monospace; font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    background: var(--bg-2); color: var(--accent);
    border: 1px solid var(--border-strong);
    padding: 7px 12px;
}
.photo-badge .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e;
    animation: badgePulse 1.8s ease-in-out infinite;
}
@keyframes badgePulse { 50% { opacity: 0.35; } }
/* meta facts under the photo */
.photo-meta { margin-top: 18px; }
.photo-meta li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
    font-size: 0.8rem;
}
.photo-meta li span { font-family: 'Fira Code', monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.photo-meta li b { color: var(--text); font-weight: 600; text-align: right; }
.about-photo picture {
    position: relative; display: block; overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 14px 44px rgba(var(--accent-rgb), 0.14);
    transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}
.about-photo:hover picture {
    border-color: var(--border-strong);
    box-shadow: 0 20px 60px rgba(var(--accent-rgb), 0.3);
    transform: translateY(-4px);
}
.about-photo img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top;
    display: block;
    filter: saturate(0.95) contrast(1.05);
}
/* theme-colored duotone tint — always in color, follows the active theme */
.about-photo picture::before {
    content: ''; position: absolute; inset: 0;
    background: rgb(var(--accent-rgb));
    mix-blend-mode: color;
    opacity: 0.42;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
/* soft accent gradient for depth */
.about-photo picture::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(165deg, rgba(var(--accent-rgb), 0.3), transparent 45%, transparent 68%, rgba(var(--accent-rgb), 0.24));
    pointer-events: none;
    transition: opacity 0.5s ease;
}
/* hover: tint fades away, original colors at 100% */
.about-photo:hover picture::before,
.about-photo:hover picture::after { opacity: 0; }
.about-photo figcaption {
    font-family: 'Fira Code', monospace; font-size: 0.72rem; color: var(--muted);
    margin-top: 12px; display: flex; justify-content: space-between;
}
.about-lede {
    font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 600; line-height: 1.3;
    letter-spacing: -0.02em; margin-bottom: 28px;
}
.about-lede em { font-style: normal; color: var(--accent); }
.about-body p { color: var(--muted); margin-bottom: 16px; font-size: 1rem; max-width: 60ch; }
.about-body strong { color: var(--text); font-weight: 600; }

.stat-strip {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    margin-top: 40px;
}
.stat-cell { padding: 22px 18px; border-left: 1px solid var(--border); }
.stat-cell:first-child { border-left: none; padding-left: 0; }
.stat-cell b { font-family: 'Fira Code', monospace; font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--accent); display: block; line-height: 1.1; }
.stat-cell small { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* ---------- EXPERIENCE rows ---------- */
.x-row {
    display: grid; grid-template-columns: 180px 1fr 150px; gap: 24px;
    padding: 30px 0; border-bottom: 1px solid var(--border);
    transition: background 0.25s ease, padding-left 0.25s ease;
    position: relative;
}
.x-row::before {
    content: ''; position: absolute; left: -32px; top: 0; bottom: 0; width: 2px;
    background: var(--accent); transform: scaleY(0); transform-origin: top;
    transition: transform 0.3s ease;
}
.x-row:hover::before { transform: scaleY(1); }
.x-row:hover { background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.04), transparent 60%); padding-left: 10px; }
.x-row:first-of-type { border-top: 1px solid var(--border); }
.x-date { font-family: 'Fira Code', monospace; font-size: 0.78rem; color: var(--muted); padding-top: 5px; }
.x-now {
    display: inline-block; margin-top: 8px;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; color: #22c55e;
    border: 1px solid rgba(34,197,94,0.4); background: rgba(34,197,94,0.08);
    padding: 3px 9px; border-radius: 999px;
}
.x-main h3 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; letter-spacing: -0.01em; }
.x-org { font-family: 'Fira Code', monospace; font-size: 0.82rem; color: var(--accent); margin: 2px 0 12px; }
.x-points li { position: relative; padding-left: 18px; color: var(--muted); font-size: 0.92rem; margin-bottom: 6px; max-width: 62ch; }
.x-points li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.x-side { text-align: right; padding-top: 5px; }
.x-loc { font-family: 'Fira Code', monospace; font-size: 0.74rem; color: var(--muted); display: block; margin-bottom: 10px; }
.x-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag {
    font-family: 'Fira Code', monospace; font-size: 0.68rem;
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
    color: var(--muted); background: transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.x-row:hover .tag, .p-row:hover .tag { color: var(--accent); border-color: var(--border-strong); }

/* ---------- PROJECT rows ---------- */
.p-row {
    display: grid; grid-template-columns: 70px 1fr auto; gap: 24px; align-items: start;
    padding: 34px 0; border-bottom: 1px solid var(--border);
    position: relative; transition: padding-left 0.25s ease;
}
.p-row:first-of-type { border-top: 1px solid var(--border); }
.p-row::after {
    content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
    background: var(--accent); transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.p-row:hover::after { width: 100%; }
.p-row:hover { padding-left: 8px; }
.p-num { font-family: 'Fira Code', monospace; font-size: 0.85rem; color: var(--muted); padding-top: 10px; }
.p-row h3 {
    font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
    transition: color 0.2s ease;
}
.p-row:hover h3 { color: var(--accent); }
.p-tech { font-family: 'Fira Code', monospace; font-size: 0.76rem; color: var(--accent); margin: 6px 0 10px; }
.p-desc { color: var(--muted); font-size: 0.92rem; max-width: 66ch; }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.p-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; padding-top: 8px; }
.p-year { font-family: 'Fira Code', monospace; font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
.p-arrow {
    width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 50%;
    display: grid; place-items: center; color: var(--text);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.p-row:hover .p-arrow { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: rotate(45deg); }
.p-feat {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; color: var(--on-accent);
    background: var(--accent); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

/* ---------- DASHBOARDS ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.dash-card {
    position: relative; overflow: hidden; cursor: zoom-in;
    border: 1px solid var(--border);
    transition: border-color 0.3s ease;
}
.dash-card:hover { border-color: var(--border-strong); }
.dash-card img { width: 100%; height: auto; transition: transform 0.6s ease; }
.dash-card:hover img { transform: scale(1.04); }
.dash-card::after {
    content: 'VIEW ⤢'; position: absolute; right: 12px; bottom: 12px;
    font-family: 'Fira Code', monospace; font-size: 0.68rem; letter-spacing: 0.12em;
    color: #fff; background: rgba(0,0,0,0.7); padding: 6px 12px;
    opacity: 0; transition: opacity 0.25s ease;
}
.dash-card:hover::after { opacity: 1; }

#lightbox {
    position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,0.9);
    display: none; align-items: center; justify-content: center; padding: 4vh 4vw; cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 24px 80px rgba(0,0,0,0.7); }
#lightbox .lb-close { position: absolute; top: 18px; right: 26px; font-size: 2rem; color: #fff; background: none; border: none; }

/* ---------- SKILLS ---------- */
.skill-cat {
    font-family: 'Fira Code', monospace; font-size: 0.74rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--muted); margin: 34px 0 18px;
}
.skill-cat:first-of-type { margin-top: 0; }
.skill-wall { display: flex; flex-wrap: wrap; gap: 10px; }
.sk {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 11px 20px; border: 1px solid var(--border); border-radius: 999px;
    font-size: 0.9rem; color: var(--muted); background: transparent;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.sk:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-3px); }
.sk img { width: 20px; height: 20px; object-fit: contain; }

/* ---------- CERTIFICATIONS rows ---------- */
.c-row {
    display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: baseline;
    padding: 22px 0; border-bottom: 1px solid var(--border);
    transition: padding-left 0.25s ease;
}
.c-row:first-of-type { border-top: 1px solid var(--border); }
.c-row:hover { padding-left: 8px; }
.c-row h3 { font-size: 1.05rem; font-weight: 600; }
.c-issuer { font-family: 'Fira Code', monospace; font-size: 0.78rem; color: var(--accent); margin-top: 2px; }
.c-desc { color: var(--muted); font-size: 0.86rem; margin-top: 6px; max-width: 70ch; }
.c-id { font-family: 'Fira Code', monospace; font-size: 0.68rem; color: var(--muted); opacity: 0.75; margin-top: 4px; word-break: break-all; }
.c-date { font-family: 'Fira Code', monospace; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

/* ---------- ACHIEVEMENTS ---------- */
.a-block { padding: 34px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 70px 1fr; gap: 24px; }
.a-block:first-of-type { border-top: 1px solid var(--border); }
.a-num { font-family: 'Fira Code', monospace; font-size: 0.85rem; color: var(--accent); padding-top: 8px; }
.a-block h3 { font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 600; letter-spacing: -0.01em; }
.a-event { font-family: 'Fira Code', monospace; font-size: 0.8rem; color: var(--accent); margin: 4px 0 2px; }
.a-date { font-family: 'Fira Code', monospace; font-size: 0.72rem; color: var(--muted); display: block; margin-bottom: 12px; }
.a-points li { position: relative; padding-left: 18px; color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; max-width: 70ch; }
.a-points li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.a-points strong { color: var(--text); font-weight: 600; }

/* ---------- CONTACT ---------- */
#contact .container { padding-bottom: 30px; }
.contact-big {
    font-size: clamp(2.6rem, 9vw, 6.5rem); font-weight: 700;
    line-height: 1; letter-spacing: -0.04em; text-transform: uppercase;
    margin-bottom: 30px;
}
.contact-big .accent { color: var(--accent); }
.contact-sub { color: var(--muted); max-width: 480px; margin-bottom: 40px; }
.contact-mail {
    display: inline-flex; align-items: center; gap: 16px;
    font-family: 'Fira Code', monospace; font-size: clamp(1rem, 3vw, 1.6rem);
    color: var(--text); border-bottom: 2px solid var(--border-strong);
    padding-bottom: 10px; transition: color 0.25s ease, border-color 0.25s ease;
}
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.contact-mail svg { transition: transform 0.25s ease; }
.contact-mail:hover svg { transform: translate(4px, -4px); }
.contact-links { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 44px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); margin-top: clamp(60px, 10vh, 110px); }
.foot-inner {
    max-width: 1280px; margin: 0 auto; padding: 26px 32px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    color: var(--muted); font-size: 0.8rem;
}
.foot-inner .mono { color: var(--accent); }
#local-time { font-family: 'Fira Code', monospace; color: var(--text); }
#sys-readout { font-family: 'Fira Code', monospace; font-size: 0.68rem; color: var(--accent); opacity: 0.75; }

#to-top {
    position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px;
    border-radius: 50%; border: 1px solid var(--border); background: var(--nav-bg);
    backdrop-filter: blur(10px); color: var(--accent); display: grid; place-items: center;
    z-index: 1050; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease;
}
#to-top.show { opacity: 1; visibility: visible; transform: none; }
#to-top:hover { border-color: var(--border-strong); }

/* ---------- custom cursor ---------- */
@media (pointer: fine) {
    .cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; border-radius: 50%; z-index: 9999; transform: translate(-50%, -50%); }
    .cursor-dot { width: 6px; height: 6px; background: var(--accent); }
    .cursor-ring { width: 32px; height: 32px; border: 1.5px solid rgba(var(--accent-rgb), 0.55); transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease; }
    .cursor-ring.hovering { width: 48px; height: 48px; border-color: var(--accent); }
}
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- daylight readability ---------- */
[data-theme="light"] #navbar.scrolled,
[data-theme="light"] #mobile-nav { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
[data-theme="light"] .x-row:hover { background: linear-gradient(90deg, rgba(255,255,255,0.5), transparent 60%); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
    .reveal { opacity: 1; transform: none; }
    .line > span { transform: none; }
    .marquee-track { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-photo { position: static; max-width: 380px; }
    .x-row { grid-template-columns: 1fr; gap: 8px; padding: 26px 0; }
    .x-side { text-align: left; }
    .x-tags { justify-content: flex-start; }
    .p-row { grid-template-columns: 1fr; gap: 10px; }
    .p-num { padding-top: 0; }
    .p-side { flex-direction: row; align-items: center; text-align: left; padding-top: 4px; }
}
@media (max-width: 920px) {
    .nav-menu { display: none; }
    #hamburger { display: flex; }
}
@media (max-width: 640px) {
    .container { padding: 0 20px; }
    .nav-inner { padding: 0 20px; height: 64px; }
    #mobile-nav { padding: 96px 20px 32px; }
    section .container { padding-top: 76px; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .stat-cell:nth-child(3) { border-left: none; padding-left: 0; }
    .stat-cell { border-top: 1px solid var(--border); }
    .stat-cell:nth-child(1), .stat-cell:nth-child(2) { border-top: none; }
    .a-block { grid-template-columns: 1fr; gap: 6px; }
    .ed-num { display: none; }
    #to-top { right: 14px; bottom: 14px; }
}

/* ---------- hero entrance after loader ---------- */
body:not(.loaded) .hero-name .line > span { transform: translateY(115%); }
body.loaded .hero-name .line:nth-child(1) > span { transition-delay: 0.05s; }
body.loaded .hero-name .line:nth-child(2) > span { transition-delay: 0.15s; }
body:not(.loaded) .hero-top, body:not(.loaded) .hero-foot, body:not(.loaded) .marquee { opacity: 0; }
.hero-top, .hero-foot, .marquee { transition: opacity 0.8s ease 0.3s; }

/* ---------- accessibility & UX details ---------- */
.skip-link {
    position: fixed; top: -60px; left: 16px; z-index: 3000;
    background: var(--accent); color: var(--on-accent);
    padding: 10px 18px; border-radius: 0 0 10px 10px;
    font-size: 0.85rem; font-weight: 600;
    transition: top 0.25s ease;
}
.skip-link:focus { top: 0; }

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

#lang-btn {
    height: 36px; padding: 0 13px;
    border-radius: 999px; border: 1px solid var(--border); background: transparent;
    color: var(--text); font-family: 'Fira Code', monospace; font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.08em;
    transition: border-color 0.2s ease, color 0.2s ease;
}
#lang-btn:hover { border-color: var(--border-strong); color: var(--accent); }

.dash-cap {
    font-family: 'Fira Code', monospace; font-size: 0.66rem; letter-spacing: 0.14em;
    color: var(--muted); padding: 10px 14px;
    border-top: 1px solid var(--border);
}

/* ---------- side dot navigation ---------- */
#dot-nav {
    position: fixed; right: 18px; top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    display: flex; flex-direction: column; gap: 14px;
}
#dot-nav .dot {
    position: relative;
    width: 9px; height: 9px; padding: 0;
    border-radius: 50%;
    border: 1px solid var(--muted);
    background: transparent;
    transition: all 0.25s ease;
}
#dot-nav .dot:hover { border-color: var(--accent); transform: scale(1.35); }
#dot-nav .dot.active {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
    transform: scale(1.25);
}
#dot-nav .dot::after {
    content: attr(data-label);
    position: absolute; right: 22px; top: 50%;
    transform: translateY(-50%) translateX(6px);
    font-family: 'Fira Code', monospace; font-size: 0.64rem;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent); background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 4px 10px; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: all 0.2s ease;
}
#dot-nav .dot:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 920px) { #dot-nav { display: none; } }
