/* ==========================================================
   Nikhil Thorat — portfolio
   Night is the default theme; [data-theme="light"] swaps the tokens.
   ========================================================== */
:root {
    /* surfaces */
    --bg:             #05070a;
    --panel:          #0a0d12;
    --panel-2:        #0e1219;
    --panel-hero:     #04060a;
    --panel-about:    #080a0e;
    --panel-work:     #07090d;
    --panel-contact:  #06080c;
    --surface:        rgba(255, 255, 255, 0.025);
    --surface-hover:  rgba(255, 255, 255, 0.045);
    --surface-soft:   rgba(255, 255, 255, 0.04);

    /* lines */
    --line:           rgba(255, 255, 255, 0.10);
    --line-soft:      rgba(255, 255, 255, 0.06);
    --track-bg:       rgba(255, 255, 255, 0.18);
    --tl-line:        rgba(255, 255, 255, 0.14);

    /* type */
    --text:           #f2f4f7;
    --text-strong:    #ffffff;
    --muted:          #9aa5b1;
    --faint:          #626c78;
    --text-nav:       rgba(255, 255, 255, 0.78);
    --on-accent:      #ffffff;

    /* accent */
    --accent:         #2f9fe0;
    --accent-dk:      #1d78b0;
    --accent-glow:    rgba(47, 159, 224, 0.22);
    --accent-wash:    rgba(47, 159, 224, 0.06);
    --halo:           rgba(47, 159, 224, 0.20);

    /* chrome */
    --topbar-bg:      rgba(5, 7, 10, 0.82);
    --topbar-bg-m:    rgba(5, 7, 10, 0.90);
    --nav-panel-bg:   rgba(6, 8, 12, 0.97);
    --intro-bg:       #05070a;
    --intro-bar-bg:   rgba(255, 255, 255, 0.14);

    /* hero photo treatment */
    --hero-photo:     contrast(1.04) brightness(0.92);
    --veil-a:         rgba(3, 5, 8, 0.86);
    --veil-b:         rgba(3, 5, 8, 0.55);
    --veil-c:         rgba(3, 5, 8, 0.12);
    --veil-d:         rgba(3, 5, 8, 0.30);
    --veil-radial:    rgba(0, 0, 0, 0.60);
    --portrait-filter: grayscale(1) contrast(1.06) brightness(0.94);

    --ease:           cubic-bezier(0.22, 1, 0.36, 1);
    --shell:          1180px;
}

/* ---------- DAY ---------- */
:root[data-theme="light"] {
    --bg:             #f3f6fa;
    --panel:          #ffffff;
    --panel-2:        #eaeff6;
    --panel-hero:     #04060a;      /* the hero stays photographic */
    --panel-about:    #f8fafc;
    --panel-work:     #ffffff;
    --panel-contact:  #f3f6fa;
    --surface:        rgba(15, 23, 42, 0.028);
    --surface-hover:  rgba(15, 23, 42, 0.06);
    --surface-soft:   rgba(15, 23, 42, 0.04);

    --line:           rgba(15, 23, 42, 0.14);
    --line-soft:      rgba(15, 23, 42, 0.09);
    --track-bg:       rgba(15, 23, 42, 0.18);
    --tl-line:        rgba(15, 23, 42, 0.16);

    --text:           #111821;
    --text-strong:    #05080d;
    --muted:          #4b5868;
    --faint:          #778495;
    --text-nav:       #313d4c;
    --on-accent:      #ffffff;

    --accent:         #1273b0;
    --accent-dk:      #0c5a8c;
    --accent-glow:    rgba(18, 115, 176, 0.20);
    --accent-wash:    rgba(18, 115, 176, 0.07);
    --halo:           rgba(18, 115, 176, 0.18);

    --topbar-bg:      rgba(255, 255, 255, 0.88);
    --topbar-bg-m:    rgba(255, 255, 255, 0.94);
    --nav-panel-bg:   rgba(255, 255, 255, 0.98);
    --intro-bg:       #f3f6fa;
    --intro-bar-bg:   rgba(15, 23, 42, 0.14);

    /* daylight in the room: lift the photo, thin the veil */
    --hero-photo:     contrast(1.02) brightness(1.04);
    --veil-a:         rgba(3, 5, 8, 0.74);
    --veil-b:         rgba(3, 5, 8, 0.44);
    --veil-c:         rgba(3, 5, 8, 0.08);
    --veil-d:         rgba(3, 5, 8, 0.22);
    --veil-radial:    rgba(0, 0, 0, 0.42);
    --portrait-filter: grayscale(0.9) contrast(1.02) brightness(1.03);
}

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

/* scrollbar-gutter keeps the scrollbar's space reserved, so locking scroll
   during the intro does not shift the layout sideways when it releases */
/* overflow-x belongs on <html>: setting it on <body> makes the body itself a
   scroll container (the other axis computes to auto), which breaks scroll
   locking and programmatic scrolling. */
html {
    scroll-behavior: smooth; scroll-padding-top: 70px;
    scrollbar-gutter: stable; overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
/* long words (emails, URLs) must never push a narrow layout wider */
p, li, h1, h2, h3, h4, a { overflow-wrap: break-word; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4, .mark, .hero-name { font-family: 'Montserrat', sans-serif; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 28px; }

/* Each section is a "screen" like the reference boards */
.panel { position: relative; background: var(--panel); }
.panel + .panel { border-top: 1px solid var(--line-soft); }

/* Only while switching themes — keeps page load free of colour transitions */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color 0.45s var(--ease), border-color 0.45s var(--ease),
                color 0.45s var(--ease), fill 0.45s var(--ease) !important;
}

/* ==========================================================
   OPENING ANIMATION
   ========================================================== */
.intro {
    position: fixed; inset: 0; z-index: 2000;
    display: grid; place-items: center;
    background:
        radial-gradient(60% 50% at 50% 45%, var(--accent-glow), transparent 70%),
        var(--intro-bg);
    /* Safety net: the overlay clears itself even if the script never runs */
    animation: introAutoClear 0.8s var(--ease) 3.6s forwards;
}
.intro.done { animation: none; opacity: 0; visibility: hidden; transition: opacity 0.75s var(--ease), visibility 0.75s; }
@keyframes introAutoClear { to { opacity: 0; visibility: hidden; } }

.intro-inner { text-align: center; padding: 0 24px; }

.intro-mark {
    font-family: 'Montserrat', sans-serif; font-weight: 800; color: var(--text-strong);
    font-size: clamp(2.8rem, 9vw, 4.6rem); letter-spacing: -0.03em; line-height: 1;
    opacity: 0; animation: introMark 0.9s var(--ease) 0.1s forwards;
}
.intro-mark span {
    display: inline-block; color: var(--accent);
    opacity: 0; animation: introDot 0.5s var(--ease) 0.75s forwards;
}
@keyframes introMark { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes introDot  { from { opacity: 0; transform: translateY(-10px) scale(0.4); } to { opacity: 1; transform: none; } }

.intro-tag {
    margin-top: 10px; font-size: 0.68rem; letter-spacing: 0.34em; text-transform: uppercase;
    color: var(--faint);
    opacity: 0; animation: introFade 0.7s var(--ease) 0.55s forwards;
}
@keyframes introFade { to { opacity: 1; } }

.intro-bar {
    width: 140px; height: 1px; margin: 26px auto 0;
    background: var(--intro-bar-bg); overflow: hidden;
}
.intro-bar i {
    display: block; width: 100%; height: 100%; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    animation: introBar 1.25s var(--ease) 0.35s forwards;
}
@keyframes introBar { to { transform: scaleX(1); } }

/* Hold the page still, and hold the hero's entrance, until the intro clears.
   The lock lives on <html>, not <body>: locking the body makes <html> the
   scroller and clips the body's content, which blanks the page when a visit
   starts at an anchor or a restored scroll position. The class is added by
   script, so a page without JS is never locked. */
html.intro-lock { overflow: hidden; }
body:not(.ready) .hero-name .thin,
body:not(.ready) .hero-name .fat,
body:not(.ready) .hero-role,
body:not(.ready) .hero-actions,
body:not(.ready) .hero-foot { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
    .intro { display: none; }
    html.intro-lock { overflow: auto; }
}

/* ==========================================================
   TOP BAR
   ========================================================== */
.topbar {
    position: fixed; inset: 0 0 auto 0; z-index: 900;
    padding: 18px 0;
    transition: background 0.35s var(--ease), padding 0.35s var(--ease), border-color 0.35s var(--ease);
    border-bottom: 1px solid transparent;
}
.topbar.scrolled {
    padding: 11px 0;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }

/* Unscrolled the bar floats over the hero photo, so its items stay light in
   both themes; once it gains a background they follow the theme. */
.nav { display: flex; gap: 30px; }
.nav-link {
    font-size: 0.82rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.78);
    position: relative; padding-bottom: 3px; transition: color 0.25s var(--ease);
}
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--accent); }
.topbar.scrolled .nav-link { color: var(--text-nav); }
.topbar.scrolled .nav-link:hover { color: var(--text-strong); }
.topbar.scrolled .nav-link.active { color: var(--accent); }

.topbar-phone {
    font-size: 0.78rem; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.72);
    display: inline-flex; align-items: center; gap: 9px; transition: color 0.25s var(--ease);
}
.topbar-phone:hover { color: var(--accent); }
.topbar-phone i { font-size: 0.9rem; }
.topbar.scrolled .topbar-phone { color: var(--text-nav); }
.topbar.scrolled .topbar-phone:hover { color: var(--accent); }

.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: 6px;
}
.hamburger span {
    width: 24px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), background 0.3s var(--ease);
}
.topbar.scrolled .hamburger span { background: var(--text); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================
   DAY / NIGHT TOGGLE
   A signal crossing a neural layer: nodes sit on a wire and the active
   one carries the bit — 0 while the site sleeps, 1 once it wakes.
   ========================================================== */
.theme-toggle {
    position: relative; flex: none;
    width: 62px; height: 28px; padding: 0; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(160deg, #0d1a28 0%, #070d16 100%);
    overflow: hidden; -webkit-tap-highlight-color: transparent;
    transition: background 0.6s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.theme-toggle:hover { box-shadow: 0 0 0 3px var(--accent-glow); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:root[data-theme="light"] .theme-toggle {
    background: linear-gradient(160deg, #e8f1f9 0%, #d3e6f6 100%);
    border-color: rgba(15, 23, 42, 0.16);
}

/* the wire the signal travels along */
.tt-net { position: absolute; inset: 0; }
.tt-net::before {
    content: ''; position: absolute; left: 9px; right: 9px; top: 50%;
    height: 1px; background: rgba(255, 255, 255, 0.22);
    transition: background 0.5s var(--ease);
}
:root[data-theme="light"] .tt-net::before { background: rgba(15, 23, 42, 0.20); }

/* nodes on the wire, firing in sequence */
.tt-net i {
    position: absolute; top: 50%; width: 4px; height: 4px; border-radius: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.38);
    transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
    animation: ttFire 2.8s ease-in-out infinite;
}
.tt-net i:nth-child(1) { left: 12px; animation-delay: 0s; }
.tt-net i:nth-child(2) { left: 24px; animation-delay: 0.35s; }
.tt-net i:nth-child(3) { left: 36px; animation-delay: 0.7s; }
.tt-net i:nth-child(4) { left: 48px; animation-delay: 1.05s; }
@keyframes ttFire {
    0%, 70%, 100% { opacity: 0.4; }
    12%           { opacity: 1; box-shadow: 0 0 6px currentColor; }
}
:root[data-theme="light"] .tt-net i { background: rgba(15, 23, 42, 0.30); }

/* the active node carries the bit */
.tt-node {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #dfe8f2; color: #0b1622;
    box-shadow: 0 0 10px rgba(200, 220, 245, 0.45);
    transform: translateX(34px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.5, 1),
                background 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.5s var(--ease);
}
:root[data-theme="light"] .tt-node {
    transform: translateX(0);
    background: linear-gradient(150deg, #48b4ee 0%, #1273b0 100%);
    color: #fff;
    box-shadow: 0 0 12px rgba(18, 115, 176, 0.55), 0 0 0 4px rgba(18, 115, 176, 0.16);
}

/* 0 flips to 1 as the signal fires */
.tt-bit {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    font-size: 11px; font-weight: 700; line-height: 1;
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}
.tt-bit.on  { opacity: 0; transform: rotateX(90deg); }
.tt-bit.off { opacity: 1; transform: none; }
:root[data-theme="light"] .tt-bit.on  { opacity: 1; transform: none; }
:root[data-theme="light"] .tt-bit.off { opacity: 0; transform: rotateX(-90deg); }

/* ==========================================================
   HERO
   ========================================================== */
.hero {
    /* svh tracks the visible area on mobile, where the browser chrome
       collapses and 100vh overflows the screen */
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden; background: var(--panel-hero);
}

/* Cinematic backdrop. Drop a photo at assets/hero.jpg and it layers in
   automatically; without it the generated gradient scene shows through. */
.hero-bg {
    position: absolute; inset: 0;
    background-color: #06080c;
    background-image:
        radial-gradient(120% 80% at 78% 34%, rgba(47, 159, 224, 0.20) 0%, transparent 55%),
        radial-gradient(60% 45% at 88% 22%, rgba(120, 200, 255, 0.16) 0%, transparent 60%),
        radial-gradient(90% 70% at 12% 88%, rgba(20, 40, 60, 0.85) 0%, transparent 60%),
        linear-gradient(160deg, #0b1017 0%, #05070a 45%, #02030a 100%);
    animation: driftBg 26s ease-in-out infinite alternate;
}
.hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background-image: url('assets/hero.jpg');
    background-size: cover; background-position: center center;
    opacity: 1; filter: var(--hero-photo);
    transition: filter 0.6s var(--ease);
}
@keyframes driftBg { to { transform: scale(1.06) translate3d(-1.5%, -1%, 0); } }

.hero-veil {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, var(--veil-a) 0%, var(--veil-b) 34%, var(--veil-c) 62%, var(--veil-d) 100%),
        radial-gradient(130% 100% at 50% 50%, transparent 45%, var(--veil-radial) 100%);
    transition: background 0.6s var(--ease);
}

.hero-inner { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; }
.hero-copy { max-width: 640px; padding-top: 40px; }

.hero-name {
    line-height: 0.92; text-transform: uppercase; color: #fff;
    display: flex; flex-direction: column;
}
.hero-name .thin {
    font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 300; letter-spacing: 0.06em;
    opacity: 0; animation: riseIn 0.9s var(--ease) 0.15s forwards;
}
.hero-name .fat {
    font-size: clamp(3.4rem, 11vw, 7rem); font-weight: 800; letter-spacing: -0.015em;
    opacity: 0; animation: riseIn 0.9s var(--ease) 0.3s forwards;
}

.hero-role {
    margin-top: 14px; font-size: clamp(0.78rem, 1.6vw, 1rem); font-weight: 300;
    letter-spacing: 0.42em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85);
    opacity: 0; animation: riseIn 0.9s var(--ease) 0.45s forwards;
}

.hero-actions {
    margin-top: 38px; display: flex; gap: 16px; flex-wrap: wrap;
    opacity: 0; animation: riseIn 0.9s var(--ease) 0.6s forwards;
}

@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 34px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 0.85rem; letter-spacing: 0.09em; color: var(--text);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.pill:hover { background: var(--text); color: var(--panel); border-color: var(--text); transform: translateY(-2px); }
.pill.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.solid:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }

/* pills over the hero photo stay light whatever the theme */
.hero .pill { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.hero .pill:hover { background: #fff; color: #06080c; border-color: #fff; }

.hero-foot {
    position: relative; z-index: 2;
    display: flex; align-items: flex-end; justify-content: space-between;
    padding-bottom: 34px;
    opacity: 0; animation: riseIn 0.9s var(--ease) 0.75s forwards;
}

.socials { display: flex; gap: 22px; }
.socials a {
    font-size: 1.05rem; color: rgba(255, 255, 255, 0.82);
    transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}
.socials a:hover { color: var(--accent); transform: translateY(-3px); }
.socials.sm a { font-size: 0.95rem; color: var(--muted); }
.socials.sm a:hover { color: var(--accent); }

/* small bracket mark, bottom-right of the hero */
.corner-mark {
    position: relative; width: 22px; height: 22px; display: block; opacity: 0.7;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.corner-mark:hover { opacity: 1; transform: scale(1.12); }
.corner-mark span { position: absolute; width: 8px; height: 8px; border: 1px solid #fff; }
.corner-mark span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.corner-mark span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.corner-mark span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.corner-mark span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ==========================================================
   SHARED TITLES
   ========================================================== */
.ul-title {
    display: inline-block; font-weight: 700; text-transform: uppercase;
    font-size: 1.35rem; letter-spacing: 0.03em; color: var(--text);
    padding-bottom: 8px; margin-bottom: 22px;
    border-bottom: 2px solid var(--accent);
}
.ul-title.sm { font-size: 0.92rem; letter-spacing: 0.12em; margin: 42px 0 20px; }
.col > .ul-title.sm:first-child { margin-top: 0; }

.section-lead { color: var(--muted); max-width: 620px; margin-bottom: 42px; font-weight: 300; }

/* ==========================================================
   ABOUT
   ========================================================== */
.about {
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden; padding: 120px 0 70px;
    background: var(--panel-about);
}
/* Circular portrait medallion. The source photo is a circular crop on a
   white square, so the 50% radius clips the white corners away. */
.portrait {
    position: relative; justify-self: end; align-self: center;
    width: clamp(240px, 30vw, 400px); aspect-ratio: 1; margin: 0;
}
.portrait img {
    position: relative; z-index: 2;
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
    filter: var(--portrait-filter);
    transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}
.portrait:hover img { filter: none; transform: scale(1.02); }
/* soft blue halo + hairline ring behind the photo */
.portrait-ring {
    position: absolute; inset: -18px; border-radius: 50%; z-index: 1;
    border: 1px solid var(--line);
    background: radial-gradient(circle at 50% 40%, var(--halo), transparent 68%);
    animation: haloPulse 7s ease-in-out infinite;
}
@keyframes haloPulse { 50% { transform: scale(1.045); opacity: 0.75; } }

.about-inner {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 60px; align-items: center;
}
.about-copy { max-width: 540px; }
.about-copy .ul-title { display: block; width: fit-content; margin-bottom: 14px; }
.about-mail { display: block; color: var(--accent); font-size: 0.9rem; margin-bottom: 30px; }
.about-mail:hover { text-decoration: underline; }
.about-copy p { color: var(--muted); font-weight: 300; margin-bottom: 18px; }

.about-stats {
    margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 30px; border-top: 1px solid var(--line-soft); padding-top: 28px;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
    font-family: 'Montserrat', sans-serif; font-size: 1.9rem; font-weight: 700;
    color: var(--text-strong); line-height: 1.1;
}
.stat-label { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

.about-address {
    position: relative; z-index: 2; text-align: center; margin-top: 60px;
    font-size: 0.78rem; letter-spacing: 0.14em; color: var(--muted);
    display: flex; align-items: center; justify-content: center; gap: 14px;
}
.about-address .rule { width: 34px; height: 1px; background: var(--accent); display: inline-block; }

/* ==========================================================
   RESUME
   ========================================================== */
.resume { padding: 110px 0 100px; background: var(--panel-2); }
.resume-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 54px; }

/* skill sliders */
.sliders li {
    display: grid; grid-template-columns: 30px 1fr 96px; align-items: center;
    gap: 12px; margin-bottom: 16px;
}
.sliders.plain li { grid-template-columns: 1fr 110px; }
.badge {
    width: 30px; height: 26px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 4px;
    font-size: 0.62rem; font-weight: 600; color: var(--muted);
    font-family: 'Montserrat', sans-serif;
}
.s-name { font-size: 0.82rem; color: var(--muted); }
.track {
    position: relative; height: 1px; background: var(--track-bg); display: block;
}
.track i {
    position: absolute; top: 50%; left: 0; width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
    transform: translate(-50%, -50%); transition: left 1.1s var(--ease);
}

.line-list { font-size: 0.84rem; color: var(--muted); font-weight: 300; margin-bottom: 6px; }

/* timeline */
.timeline { position: relative; padding-left: 4px; }
.tl-item { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 18px; padding-bottom: 30px; }
.tl-item::before {
    content: ''; position: absolute; left: 23px; top: 46px; bottom: 0; width: 1px;
    background: var(--tl-line);
}
.tl-item:last-child::before { display: none; }
.tl-year {
    width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
    display: grid; place-items: center; text-align: center;
    font-size: 0.56rem; font-weight: 600; line-height: 1.25; color: var(--on-accent);
    font-family: 'Montserrat', sans-serif;
}
.tl-body h4 { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em; }
.tl-role { display: block; font-size: 0.8rem; color: var(--accent); margin-bottom: 8px; }
.tl-body ul li {
    position: relative; padding-left: 14px; font-size: 0.8rem; color: var(--muted);
    font-weight: 300; line-height: 1.6; margin-bottom: 6px;
}
.tl-body ul li::before {
    content: ''; position: absolute; left: 0; top: 10px;
    width: 5px; height: 1px; background: var(--accent);
}

.edu { margin-bottom: 18px; }
.edu h4 { font-size: 0.84rem; font-weight: 600; }
.edu p { font-size: 0.78rem; color: var(--faint); }

.awards li { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.awards i { color: var(--accent); margin-right: 9px; font-size: 0.76rem; }

.hobbies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 10px; margin-top: 6px; }
.hobby {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em;
}
.hobby span {
    width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-soft); border: 1px solid var(--line);
    color: var(--text); font-size: 1rem;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}
.hobby:hover span { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-4px); }

/* Driving is clickable, so it carries a small play badge */
.hobby-link { cursor: pointer; }
.hobby-link span { position: relative; }
.hobby-link span::after {
    content: ''; position: absolute; right: -2px; bottom: -2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--panel-2);
    transition: transform 0.3s var(--ease);
}
/* the play triangle inside that badge */
.hobby-link span::before {
    content: ''; position: absolute; right: 3px; bottom: 4px; z-index: 2;
    width: 0; height: 0;
    border-left: 5px solid #fff;
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    transition: transform 0.3s var(--ease);
}
.hobby-link:hover span::after { transform: scale(1.12); }
.hobby-link:focus-visible span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================
   CLIP GALLERY (lightbox)
   ========================================================== */
.lightbox { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lb-backdrop {
    position: absolute; inset: 0; background: rgba(3, 6, 11, 0.82);
    backdrop-filter: blur(6px);
    animation: lbFade 0.3s var(--ease);
}
.lb-panel {
    position: relative; z-index: 2; width: min(880px, 100%); max-height: calc(100vh - 48px);
    overflow-y: auto; background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 22px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
    animation: lbRise 0.4s var(--ease);
}
@keyframes lbFade { from { opacity: 0; } }
@keyframes lbRise { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

.lb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.lb-head h3 {
    font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
.lb-close {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); color: var(--text);
    display: grid; place-items: center; font-size: 0.95rem;
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.lb-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: rotate(90deg); }

.lb-stage {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    background: #05070a; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden;
}
.lb-stage iframe, .lb-stage video { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
/* portrait clips (reels) get a taller stage */
.lb-stage.portrait { aspect-ratio: 9 / 16; max-height: 62vh; margin: 0 auto; width: auto; }

.lb-caption { font-size: 0.82rem; color: var(--muted); margin-top: 12px; }

.lb-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.lb-thumb {
    position: relative; width: 116px; aspect-ratio: 16 / 9; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { transform: translateY(-3px); border-color: var(--accent); }
.lb-thumb[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.lb-thumb .lb-fallback {
    display: grid; place-items: center; width: 100%; height: 100%;
    color: var(--muted); font-size: 1.1rem;
}

.lb-more {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
    font-size: 0.82rem; color: var(--accent);
}
.lb-more:hover { text-decoration: underline; }

html.modal-open { overflow: hidden; }

/* ==========================================================
   PORTFOLIO
   ========================================================== */
.portfolio { padding: 110px 0 110px; background: var(--panel-work); }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; }
.work-wide { grid-column: 1 / -1; }
.work {
    background: var(--surface); border: 1px solid var(--line-soft);
    padding: 32px 28px; position: relative; overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.work::before {
    content: ''; position: absolute; left: 0; top: 0; width: 2px; height: 0;
    background: var(--accent); transition: height 0.45s var(--ease);
}
.work:hover { transform: translateY(-6px); border-color: var(--line); background: var(--surface-hover); }
.work:hover::before { height: 100%; }
.work-icon { color: var(--accent); font-size: 1.5rem; margin-bottom: 16px; }
.work h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 12px; letter-spacing: 0.01em; }
.work p { font-size: 0.85rem; color: var(--muted); font-weight: 300; margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
    font-size: 0.68rem; letter-spacing: 0.06em; padding: 4px 11px;
    border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}

/* ==========================================================
   CONTACT + FOOTER
   ========================================================== */
.contact { padding: 110px 0 0; background: var(--panel-contact); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.c-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 24px 22px; border: 1px solid var(--line-soft);
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.c-item:hover { transform: translateY(-5px); border-color: var(--accent); background: var(--accent-wash); }
.c-item i { color: var(--accent); font-size: 1.05rem; margin-bottom: 8px; }
.c-label { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.c-value { font-size: 0.85rem; word-break: break-word; }

.contact-cta { margin-top: 44px; display: flex; gap: 16px; flex-wrap: wrap; }

.footer { margin-top: 90px; border-top: 1px solid var(--line-soft); padding: 26px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.mark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.mark span { color: var(--accent); }
.footer p { font-size: 0.76rem; color: var(--faint); }

/* ==========================================================
   UTILITIES
   ========================================================== */
.scroll-top {
    position: fixed; right: 26px; bottom: 26px; z-index: 800;
    width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
    background: var(--accent); border: 0; color: #fff;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.scroll-top.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { background: var(--accent-dk); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    .hero-name .thin, .hero-name .fat, .hero-role, .hero-actions, .hero-foot { opacity: 1; }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {
    .resume-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .about-inner { gap: 40px; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .topbar { padding: 12px 0; background: var(--topbar-bg-m); backdrop-filter: blur(14px); }
    /* the bar always has a background here, so its items follow the theme */
    .nav-link, .topbar-phone { color: var(--text-nav); }
    .nav-link:hover { color: var(--text-strong); }
    .hamburger span { background: var(--text); }
    .nav {
        position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
        background: var(--nav-panel-bg); border-bottom: 1px solid var(--line-soft);
        max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease);
    }
    .nav.open { max-height: 340px; }
    .nav-link { padding: 14px 28px; font-size: 0.9rem; }
    .topbar-right { gap: 14px; margin-left: auto; }
    .topbar-phone { font-size: 0.72rem; }

    .hero-foot { flex-direction: column; align-items: flex-start; gap: 22px; }
    .corner-mark { align-self: flex-end; }

    .about { padding: 110px 0 60px; }
    .about-inner { grid-template-columns: 1fr; gap: 36px; }
    .portrait { order: -1; justify-self: center; width: clamp(180px, 52vw, 260px); }
    .about-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-role { letter-spacing: 0.26em; }
    .stat-label { letter-spacing: 0.05em; }

    .resume-grid { grid-template-columns: 1fr; gap: 10px; }
    .resume, .portfolio, .contact { padding-top: 80px; }
    .contact-cta .pill { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 560px) {
    .resume, .portfolio, .contact { padding-top: 70px; }
    .portfolio, .resume { padding-bottom: 70px; }
    .work { padding: 26px 22px; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-inner { justify-content: center; text-align: center; }
    .about-address { flex-wrap: wrap; font-size: 0.72rem; letter-spacing: 0.1em; }
    .scroll-top { width: 38px; height: 38px; right: 14px; bottom: 14px; }
    .theme-toggle { width: 52px; height: 25px; }
    .tt-node { width: 17px; height: 17px; transform: translateX(29px); }
    :root[data-theme="light"] .tt-node { transform: translateX(0); }
    .tt-net i:nth-child(4) { display: none; }
    .tt-net i:nth-child(1) { left: 11px; }
    .tt-net i:nth-child(2) { left: 21px; }
    .tt-net i:nth-child(3) { left: 31px; }
}

@media (max-width: 420px) {
    .shell { padding: 0 20px; }
    .hero-role { letter-spacing: 0.2em; }
    .hero-actions { gap: 12px; }
    .hero-actions .pill { padding: 11px 26px; }
    .socials { gap: 18px; }
    .about-stats { grid-template-columns: 1fr; }
    .hobbies { grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
    .hobby span { width: 42px; height: 42px; font-size: 0.9rem; }
    .sliders li { grid-template-columns: 28px 1fr 72px; gap: 9px; }
    .sliders.plain li { grid-template-columns: 1fr 84px; }
    .tl-item { grid-template-columns: 40px 1fr; gap: 14px; }
    .tl-year { width: 40px; height: 40px; font-size: 0.5rem; }
    .tl-item::before { left: 20px; top: 42px; }
    .intro-bar { width: 110px; }
    .topbar-phone { display: none; }
}

/* Short screens — phones in landscape, small laptops. Let the full-height
   panels collapse to their content instead of forcing a scroll. */
@media (max-height: 560px) and (min-width: 480px) {
    .hero, .about { min-height: auto; }
    .hero { padding: 96px 0 26px; }
    .about { padding: 80px 0 50px; }
    .hero-copy { padding-top: 0; }
    .hero-foot { padding-bottom: 0; }
}

/* Very large displays: let the content breathe rather than stranding it */
@media (min-width: 1600px) {
    :root { --shell: 1320px; }
    .hero-copy { max-width: 760px; }
}
