/* =========================================================
   THEME TOKENS  (dark is the default; light overrides below)
   ========================================================= */
:root {
    --bg: #0b1017;
    --surface: #121a24;
    --surface-2: #0e151d;
    --line: rgba(151, 168, 188, .16);
    --text: #e8edf4;
    --muted: #93a1b5;
    --accent: #3ce0a1;
    --accent-dim: rgba(60, 224, 161, .12);
    --accent-glow: rgba(60, 224, 161, .35);
    --status-border: rgba(60, 224, 161, .35);
    --chrome-bg: rgba(11, 16, 23, .82);

    --page-w: 1440px;
    /* was effectively 1240px */

    --font-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

    --chrome-h: 64px;
}

.layout,
.topbar,
.mnav {
    width: 100%;
    max-width: var(--page-w);
    margin-inline: auto;
}

[data-theme="light"] {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --line: rgba(23, 36, 54, .12);
    --text: #18202b;
    --muted: #5c6a7d;
    --accent: #0aa06e;
    --accent-dim: rgba(10, 160, 110, .12);
    --accent-glow: rgba(10, 160, 110, .3);
    --status-border: rgba(10, 160, 110, .3);
    --chrome-bg: rgba(245, 247, 250, .82);
}

/* =========================================================
   BASE
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

.print-skills {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color .5s ease, color .5s ease;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mono {
    font-family: var(--font-mono);
}

.tiny {
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

::selection {
    background: var(--accent);
    color: #05231a;
}

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

section[id] {
    scroll-margin-top: calc(var(--chrome-h) + 20px);
}

/* =========================================================
   AMBIENT LAYERS — blueprint grid, glow, grain, progress bar
   ========================================================= */
:root {
    --grid-line: rgba(151, 168, 188, .07);
}

[data-theme="light"] {
    --grid-line: rgba(23, 36, 54, .055);
}

.bgfx {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(52rem 34rem at 82% -12%, var(--accent-dim), transparent 62%),
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 38vh, transparent 72vh);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 38vh, transparent 72vh);
}


.noise {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 90;
    background: var(--accent);
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
}

/* =========================================================
   CHROME — terminal top bar + mobile chip nav
   ========================================================= */
.chrome {
    position: sticky;
    top: 0;
    z-index: 80;
    height: var(--chrome-h);
    background: var(--chrome-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar {
    margin: 0 auto;
    height: 100%;
    padding: 0 clamp(20px, 4vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: .8rem;
    letter-spacing: .04em;
    color: var(--muted);
}

.brand .caret {
    color: var(--accent);
    animation: blink 1.1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .ri-sun-line {
    display: none;
}

[data-theme="light"] .ri-moon-line {
    display: none;
}

/* mobile chip nav (hidden on desktop) */
.mnav {
    display: none;
}

/* =========================================================
   LAYOUT — sticky rail + content column
   ========================================================= */
.layout {
    padding: 0 clamp(20px, 4vw, 48px);
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: clamp(36px, 5vw, 72px);
}

.rail {
    position: sticky;
    top: var(--chrome-h);
    align-self: start;
    padding-top: 8px;
}

.rnav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.rnav a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: .55rem .75rem;
    border-radius: 8px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: color .25s ease, background-color .25s ease;
}

.rnav a:hover {
    color: var(--text);
}

.rnav a.active {
    color: var(--text);
    background: var(--accent-dim);
}

.rnav a.active .idx {
    color: var(--accent);
}

.idx {
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--muted);
}

.rail-loc {
    margin-top: 28px;
    padding-left: .75rem;
}

/* =========================================================
   IDENTITY — the opening "clearance card"
   ========================================================= */
.identity {
    padding-top: clamp(20px, 3vh, 36px);
    padding-bottom: clamp(36px, 5vh, 56px);
}

/* text column + portrait */
.id-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.kicker {
    font-size: .7rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    position: relative;
    flex: none;
}

/* only the status bar dot keeps the ping ring; other pulse dots stay static */
.sb-status .pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: .6;
    animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
    to {
        transform: scale(2.1);
        opacity: 0;
    }
}

/* id-main is an inline-size container so the name can scale to ITS width */
.id-main {
    container-type: inline-size;
}

.name {
    font-size: clamp(3rem, 7vw, 7rem); /* fallback for browsers without cqw units */
    font-weight: 700;
    line-height: .95;
    letter-spacing: -.03em;
}

@supports (font-size: 1cqw) {
    .name {
        /* scales with the id-main column width so it fills it, capped at 7rem */
        font-size: clamp(3rem, 15cqw, 7rem);
    }
}

.role {
    margin-top: 14px;
    font-size: clamp(1.02rem, 2vw, 1.3rem);
    font-weight: 500;
    color: var(--muted);
    max-width: 62ch;
}

/* quick contact + availability: single row constrained to id-main width */
.id-status-row {
    display: flex;
    align-items: center;
    gap: 12px 14px;
    flex-wrap: wrap;      /* wraps within id-main width when narrow */
    margin-top: 22px;
}

/* availability pill — the accent moment of the hero */
.sb-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: .65rem 1.1rem .65rem .9rem;
    border-radius: 999px;
    background: var(--accent-dim);
    border: 1px solid var(--status-border);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

/* light mode keeps a 4.5:1 contrast for the bold status text */
[data-theme="light"] .sb-status {
    color: #067a54;
}

.sb-status .pulse {
    width: 10px;
    height: 10px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip,
.sb-contact a {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .02em;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: .5rem .8rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.sb-contact a:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px -10px var(--accent-glow);
}

/* icon-only quick contact in the status bar: square, touch-sized */
.sb-contact a {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 10px;
}

.chip i {
    color: var(--accent);
    font-size: .95em;
}

/* portrait with reticle corners + scanline */
.portrait {
    margin: 0;
    position: relative;
    width: clamp(210px, 24vw, 300px);
    flex: none;
}

.p-frame {
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.p-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.monogram {
    display: none;
    position: absolute;
    inset: 0;
    place-items: center;
    font-family: var(--font-display);
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--muted);
}

.portrait.no-img img {
    display: none;
}

.portrait.no-img .monogram {
    display: grid;
}

.scanline {
    position: absolute;
    left: 0;
    right: 0;
    top: -10%;
    height: 2px;
    opacity: .7;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scan 6.5s linear infinite;
}

@keyframes scan {
    to {
        top: 110%;
    }
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent);
    border-style: solid;
    border-width: 0;
}

.corner.tl {
    top: -7px;
    left: -7px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.corner.tr {
    top: -7px;
    right: -7px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.corner.bl {
    bottom: -7px;
    left: -7px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.corner.br {
    bottom: -7px;
    right: -7px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Desktop & tablet: the portrait stretches to match the id-main column height */
@media (min-width: 721px) {
    .id-grid {
        align-items: stretch;
    }

    .p-frame {
        height: 100%;
        aspect-ratio: auto;
        min-height: 300px;
    }
}

/* =========================================================
   IDENTITY — scale up id-main (screen only) so its content fills the row's full height next to the portrait, killing the empty space between name/role/status and the photo. Print/PDF is untouched (@media print keeps original sizes). */
@media screen and (min-width: 721px) {
    .kicker {
        font-size: .8rem;
        margin-bottom: clamp(24px, 3vh, 30px);
    }

    /* larger display name; still scales with the id-main column width */
    @supports (font-size: 1cqw) {
        .name {
            font-size: clamp(3.4rem, 17cqw, 9rem);
        }
    }

    /* fallback for browsers without container queries */
    @supports not (font-size: 1cqw) {
        .name {
            font-size: clamp(3.4rem, 8vw, 9rem);
        }
    }

    .role {
        margin-top: 20px;
        line-height: 1.5;
        font-weight: 600;
        max-width: 44ch; /* was 62 — tighter block sits closer to the photo */
    }

    .id-status-row {
        margin-top: clamp(30px, 4vh, 40px);
    }

    /* slightly larger availability pill + contact chips to match the bigger type above */
    .sb-status {
        padding: .75rem 1.2rem;
        font-size: .85rem;
    }

    .sb-contact a {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
}

/* =========================================================
   SECTION HEADINGS — index + line-mask title + growing rule
   ========================================================= */
.sec {
    margin-top: clamp(56px, 8vh, 84px);
}

.sec:first-of-type {
    margin-top: 0;
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.sec-head .idx {
    font-size: .75rem;
    color: var(--accent);
}

.sec-head h2 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -.02em;
}

.mask {
    overflow: hidden;
    display: inline-block;
}

.rule {
    flex: 1;
    height: 1px;
    background: var(--line);
    transform-origin: left center;
}

/* reveal system (only active when JS is on) */
.js .rv {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s ease var(--d, 0ms), transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}

.js .rv.in {
    opacity: 1;
    transform: none;
}

.js .mask-in {
    display: inline-block;
    transform: translateY(115%);
    transition: transform .9s cubic-bezier(.2, .7, .1, 1) .1s;
}

.js .rv.in .mask-in {
    transform: none;
}

.js .rule {
    transform: scaleX(0);
    transition: transform 1.1s ease .25s;
}

.js .rv.in .rule {
    transform: scaleX(1);
}

/* =========================================================
   CARDS & PROFILE
   ========================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: clamp(24px, 3vw, 36px);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(151, 168, 188, .32);
}

.lead {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.lead strong {
    font-weight: 700;
    color: var(--text);
}


.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 30px;
}

.stat {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color .25s ease;
}

.stat:hover {
    border-color: var(--accent);
}

.stat .num {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.6vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -.02em;
    transition: color .25s ease;
}

.stat:hover .num {
    color: var(--accent);
}

.stat .lbl {
    display: block;
    margin-top: 6px;
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.interests {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

/* mini header above the interests grid — harmonized with section labels */
.interests-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
}

.interests-head .ih-label {
    font-size: .7rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    flex: none;
}

.int-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.int-ico {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 1.25rem;
}

.int-item h3 {
    font-size: .98rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.int-item p {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.55;
}

/* =========================================================
   TIMELINE — spine draws itself as you scroll
   ========================================================= */
.timeline {
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 10px;
    width: 2px;
    border-radius: 2px;
    height: var(--spine, 4%);
    background: linear-gradient(180deg, var(--accent), rgba(60, 224, 161, .15));
}

.tl-item {
    position: relative;
    padding-left: 38px;
    margin-bottom: 36px;
}

.tl-item:last-child {
    margin-bottom: 0;
}

.node {
    position: absolute;
    left: 4px;
    top: 9px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
}

.node.now {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.tl-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tl-head h3 {
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 600;
    letter-spacing: -.01em;
}

.tag {
    font-size: .6rem;
    letter-spacing: .14em;
    padding: .3rem .6rem;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--accent);
}

.tl-meta {
    margin-top: 8px;
    font-size: .78rem;
    color: var(--muted);
    letter-spacing: .02em;
}

.tl-meta .sep {
    opacity: .55;
    margin: 0 10px;
}

.tl-meta i {
    font-size: .9em;
    vertical-align: -2px;
}

.tl-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tl-list li {
    position: relative;
    padding-left: 18px;
    font-size: .93rem;
    line-height: 1.65;
    color: var(--text);
}

.tl-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 1px;
}

/* =========================================================
   SKILLS — chips, vendors, language dots
   ========================================================= */
.skill-groups {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sk-label {
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.chip {
    cursor: default;
}

.chip:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px -10px var(--accent-glow);
}

.chip.vendor {
    font-weight: 600;
    font-size: .85rem;
    padding: .6rem 1rem;
}

.langs {
    display: flex;
    flex-direction: column;
}

.lang-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: .72rem 0;
    border-bottom: 1px solid var(--line);
}

.lang-row:last-child {
    border-bottom: none;
}

.lang-name {
    font-weight: 600;
    font-size: .95rem;
    flex: 1;
}

.lang-level {
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.dots {
    display: flex;
    gap: 5px;
}

.dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--line);
    transition: background .4s ease, box-shadow .4s ease;
}

.dots i.on {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

/* =========================================================
   EDUCATION & CERTIFICATIONS
   ========================================================= */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.edu-card .dates {
    display: inline-block;
    font-size: .7rem;
    letter-spacing: .1em;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    background: var(--accent-dim);
    padding: .3rem .65rem;
    border-radius: 999px;
    margin-bottom: 14px;
}

.edu-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.edu-card .inst {
    margin-top: 8px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
}

.edu-card .desc {
    margin-top: 10px;
    font-size: .85rem;
    line-height: 1.7;
    color: var(--muted);
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.cert-head h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.count {
    font-size: .68rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: .25rem .6rem;
    border-radius: 999px;
}

.cert-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
    transition: background-color .25s ease;
}

.cert-list li:last-child {
    border-bottom: none;
}

.cert-list li:hover {
    background: var(--accent-dim);
}

.cert-ico {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 3px;
}

.cert-body strong {
    display: block;
    font-size: .92rem;
    font-weight: 600;
}

.cert-body p {
    margin-top: 4px;
    font-size: .8rem;
    line-height: 1.55;
    color: var(--muted);
}

.chip-valid {
    align-self: start;
    margin-top: 3px;
    font-size: .58rem;
    letter-spacing: .12em;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    background: var(--accent-dim);
    padding: .28rem .55rem;
    border-radius: 999px;
}

/* =========================================================
   FOOTER CTA
   ========================================================= */
.foot {
    margin-top: clamp(64px, 10vh, 96px);
    padding-bottom: clamp(32px, 5vh, 48px);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.kicker2 {
    color: var(--accent);
}

.foot-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -.02em;
    margin: .6rem 0 1.3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #05231a;
    font-weight: 700;
    font-size: .95rem;
    padding: .85rem 1.35rem;
    border-radius: 10px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -10px var(--accent-glow);
}

/* side-by-side CTA row (wraps on narrow screens) */
.foot-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* outline variant of .btn for secondary actions */
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
}

/* =========================================================
   MOBILE — tablets & phones
   ========================================================= */
@media (max-width: 1023px) {
    :root {
        --chrome-h: 118px;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .rail {
        display: none;
    }

    /* chrome: auto height so topbar + chip nav stack cleanly */
    .chrome {
        height: auto;
        padding-top: env(safe-area-inset-top);
    }

    .topbar {
        height: 56px;
        padding: 0 16px;
    }

    .mnav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 2px 16px 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .mnav::-webkit-scrollbar {
        display: none;
    }

    .mnav a {
        font-family: var(--font-mono);
        font-size: .68rem;
        letter-spacing: .07em;
        text-transform: uppercase;
        white-space: nowrap;
        padding: .45rem .8rem;
        border-radius: 999px;
        flex: none;
        border: 1px solid var(--line);
        color: var(--muted);
    }

    .mnav a.active {
        color: var(--accent);
        border-color: var(--accent);
    }
}

@media (max-width: 720px) {

    /* compact header: small photo left, text right */
    .identity {
        padding-top: 18px;
        padding-bottom: 24px;
    }

    .id-grid {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 16px;
        align-items: stretch; /* portrait stretches to the id-main column's height */
    }

    /* wider portrait (up to square-ish) so the 1:1 photo is barely cropped;
       it stretches vertically to match the id-main column height */
    .portrait {
        order: -1;
        width: clamp(100px, 24vw, 150px);
        flex: none;
    }

    /* same height as id-main: fill the stretched row, image crops via cover */
    .p-frame {
        aspect-ratio: auto;
        height: 100%;
        border-radius: 8px;
    }

    /* reticle corners scaled down for the small frame */
    .corner {
        width: 13px;
        height: 13px;
    }

    .corner.tl,
    .corner.tr {
        top: -5px;
    }

    .corner.bl,
    .corner.br {
        bottom: -5px;
    }

    .corner.tl,
    .corner.bl {
        left: -5px;
    }

    .corner.tr,
    .corner.br {
        right: -5px;
    }

    .kicker {
        font-size: .62rem;
        margin-bottom: 10px;
    }

    .name {
        font-size: clamp(2.1rem, 11vw, 2.7rem);
        letter-spacing: -.02em;
        line-height: 1;
    }

    .role {
        margin-top: 8px;
        font-size: .95rem;
        line-height: 1.4;
    }

    /* availability + contact icons: ALWAYS on one row on mobile.
       The pill takes the leftover width and its text wraps INSIDE the pill
       instead of wrapping the pill onto a second line. */
    .id-status-row {
        margin-top: 16px;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .sb-contact {
        flex: none;
        gap: 6px;
    }

    .sb-status {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
        padding: .5rem .7rem .5rem .65rem;
        font-size: .64rem;
        letter-spacing: .04em;
        line-height: 1.45;
    }

    .sb-status-text {
        min-width: 0;
        hyphens: auto;
        -webkit-hyphens: auto;
        overflow-wrap: anywhere;
        text-wrap: balance;
    }

    .chip {
        font-size: .68rem;
        padding: .42rem .6rem;
        border-radius: 7px;
    }

    /* quick contact: compact 36px squares so the whole row fits on one line
       while leaving room for the wider portrait */
    .sb-contact a {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
        border-radius: 8px;
    }


    section[id] {
        scroll-margin-top: calc(var(--chrome-h) + 14px);
    }

    /* sections & cards */
    .sec {
        margin-top: 38px;
    }

    .sec-head {
        gap: 10px;
        margin-bottom: 20px;
    }

    .sec-head h2 {
        font-size: 1.45rem;
    }

    .card {
        padding: 20px;
        border-radius: 12px;
    }

    /* justified text creates ugly gaps on narrow screens → left align */
    .lead {
        font-size: .95rem;
        text-align: left;
        hyphens: auto;
    }

    .stats {
        gap: 8px;
        margin-top: 20px;
    }

    .stat {
        padding: 12px 14px;
    }

    .interests {
        gap: 16px;
        margin-top: 20px;
    }

    .int-ico {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
        border-radius: 9px;
    }

    /* timeline (spine stays centered on the dots) */
    .timeline::before {
        left: 7px;
    }

    .tl-item {
        padding-left: 30px;
        margin-bottom: 26px;
    }

    .node {
        left: 2px;
    }

    .tl-head h3 {
        font-size: 1.15rem;
    }

    .tl-meta {
        font-size: .72rem;
    }

    .tl-list li {
        font-size: .88rem;
    }

    .sk-label {
        margin-bottom: 10px;
    }

    .chip {
        padding: .45rem .7rem;
    }

    .lang-row {
        padding: .6rem 0;
    }

    .edu-grid,
    .cert-grid {
        gap: 14px;
    }

    .foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        margin-top: 48px;
        padding-bottom: 32px;
    }

    .foot-title {
        font-size: 1.7rem;
    }
}

@media (max-width: 400px) {
    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: .95rem;
    }

    .brand {
        font-size: .68rem;
    }

    .name {
        font-size: 2rem;
    }
}


/* chip nav: hide scrollbar, smooth touch scroll */
.mnav {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mnav::-webkit-scrollbar {
    display: none;
}

/* =========================================================
   REDUCED MOTION — everything settles instantly
   ========================================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }

    .js .rv,
    .js .mask-in,
    .js .rule {
        opacity: 1;
        transform: none;
    }

    .scanline,
    .sb-status .pulse::after {
        display: none;
    }
}

/* =========================================================
   PRINT — clean professional CV (A4)
   ========================================================= */
@page {
    size: A4;
    margin: 13mm 15mm;
}

@media print {
    :root {
        --bg: #fff;
        --surface: #fff;
        --text: #1c1e21;
        --muted: #565d66;
        --line: #c9ced4;
        --accent: #0b6e4f;
        --accent-dim: transparent;
        --accent-glow: transparent;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* everything screen-only — plus photo, skills section, profile interests */
    .chrome,
    .rail,
    .noise,
    .bgfx,
    .progress,
    .scanline,
    .corner,
    .kicker,
    .pulse,
    .stats,
    .foot,
    .caret,
    .portrait,
    #skills {
        display: none !important;
    }

    body {
        font-size: 10pt;
        line-height: 1.45;
        background: #fff;
        color: var(--text);
    }

    .rv {
        opacity: 1 !important;
        transform: none !important;
    }

    .layout {
        display: block;
        max-width: none;
        width: auto;
        padding: 0;
        margin: 0;
    }

    section[id] {
        scroll-margin-top: 0;
    }

    /* ---- header: no photo; availability + contact on ONE line ---- */
    .identity {
        display: block;
        padding: 0 0 8pt;
        margin-bottom: 12pt;
        border-bottom: 1.5pt solid #1c1e21;
    }

    .id-grid {
        display: block;
    }

    .name {
        font-size: 21pt;
        line-height: 1.05;
        letter-spacing: -.01em;
    }

    .role {
        margin-top: 4pt;
        font-size: 10.5pt;
        font-weight: 500;
        color: #3a4048;
        max-width: none;
    }

    .id-status-row {
        margin-top: 7pt;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .sb-status {
        padding: 0;
        border: none;
        background: none;
        font-size: 8.5pt;
        letter-spacing: .06em;
        color: #3a4048;
        gap: 6px;
    }

    .sb-contact a {
        width: auto;
        height: auto;
        padding: 0 8px;
        border: none;
        background: none;
        font-size: 1rem;
        color: #3a4048;
    }

    .sb-contact a+a::before {
        content: "·";
        margin-right: 8px;
        color: #9aa1a8;
    }

    /* ---- section heads with small icon ---- */
    .sec {
        margin-top: 13pt;
    }

    .sec-head {
        display: flex;
        align-items: center;
        gap: 6pt;
        margin-bottom: 7pt;
        break-after: avoid;
    }

    .sec-head .idx {
        display: none;
    }

    .sec-head h2 {
        font-size: 11.5pt;
        text-transform: uppercase;
        letter-spacing: .09em;
        color: #1c1e21;
    }

    .rule {
        background: #b6bcc3;
        height: 1px;
    }

    /* ---- profile (with skills content inside) ---- */
    .card {
        border: none;
        background: none;
        padding: 0;
        box-shadow: none;
        transform: none;
    }

    .lead {
        font-size: 9.5pt;
        line-height: 1.5;
        text-align: left;
        hyphens: auto;
        max-width: none;
        margin-bottom: 6pt;
    }

    .print-skills {
        display: block;
    }

    .ps-line {
        font-size: 9.5pt;
        color: #3a4048;
        line-height: 1.45;
        margin: 0 0 2.5pt;
    }

    .ps-label {
        font-weight: 700;
        color: #1c1e21;
    }

    /* ---- experience: role · company / period / place on ONE line, no CURRENT ---- */
    .timeline::before,
    .node {
        display: none;
    }

    .tl-item {
        padding-left: 0;
        margin-bottom: 9pt;
        break-inside: avoid;
    }

    .tl-head {
        display: inline;
    }

    .tl-head h3 {
        display: inline;
        font-size: 11pt;
        letter-spacing: 0;
    }

    /* size untouched */
    .tag {
        display: none;
    }

    /* "CURRENT" removed */
    .tl-meta {
        display: inline;
        margin-top: 0;
        font-family: var(--font-body);
        font-size: 9pt;
        color: #4a5158;
        letter-spacing: 0;
    }

    /* size untouched */
    .tl-meta::before {
        content: " · ";
        color: #9aa1a8;
    }

    .tl-list li {
        position: relative;
        padding-left: 11pt;
        font-size: 9.5pt;
        line-height: 1.4;
        margin-bottom: 2pt;
    }

    .tl-list li::before {
        content: "–";
        position: absolute;
        left: 0;
        top: 0;
        width: auto;
        height: auto;
        background: none;
        border-radius: 0;
        color: #7a828a;
    }

    /* ---- education: diploma + year on one line, smaller school text ---- */
    .edu-grid {
        display: block;
    }

    .edu-card {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 6pt;
        margin-bottom: 8pt;
        break-inside: avoid;
    }

    .dates {
        order: 2;
        background: none;
        border: none;
        padding: 0;
        border-radius: 0;
        font-size: 9pt;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: #4a5158;
    }

    .edu-card h3 {
        order: 1;
        font-size: 10.5pt;
        letter-spacing: 0;
    }

    .inst {
        order: 3;
        width: 100%;
        font-size: 8.5pt;
        font-weight: 600;
        color: #2a2f34;
        margin-top: 2pt;
    }

    .desc {
        order: 4;
        width: 100%;
        font-size: 9pt;
        color: #565d66;
        margin-top: 1pt;
        line-height: 1.45;
    }

    /* ---- certifications: flat list, no vendor heads/descriptions, + remark ---- */
    .cert-grid {
        display: block;
        columns: 2;
        column-gap: 18pt;
    }

    .cert-card {
        margin-bottom: 6pt;
        padding: 0;
        border: none;
        background: none;
    }

    .cert-head,
    .count,
    .chip-valid,
    .cert-ico,
    .cert-body p {
        display: none;
    }

    .cert-list li {
        position: relative;
        padding-left: 10pt;
        margin-bottom: 3pt;
        border: none;
        background: none;
        font-size: 9.5pt;
        break-inside: avoid;
    }

    .cert-list li::before {
        content: "–";
        position: absolute;
        left: 0;
        top: 0;
        color: #7a828a;
    }

    .cert-body strong {
        font-size: 9.5pt;
        font-weight: 600;
    }

    /* ---- personal interests (profile card) ---- */
    .int-item {
        gap: 0;
        align-items: baseline;
    }

    .int-ico {
        display: none;
    }

    .int-item h3 {
        font-size: 9.5pt;
        font-weight: 700;
        margin-right: 4px;
    }

    .int-item p {
        font-size: 9pt;
        color: #565d66;
    }

    /* page-break hygiene */
    .sec-head,
    .tl-item,
    .edu-card,
    .cert-card,
    .ps-line {
        break-inside: avoid;
    }
}


/* =========================================================
   PROFILE SUMMARY BULLETS
   ========================================================= */
.lead-bullets {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lead-bullets li {
    position: relative;
    padding-left: 18px;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.lead-bullets li:last-child {
    margin-bottom: 0;
}

.lead-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 1px;
}


/* =========================================================
   INTEREST LINK STYLE
   ========================================================= */
.int-item h3 a {
    color: var(--text);
    text-decoration: none;
}

.int-item h3 a:hover {
    color: var(--accent);
}



/* =========================================================
   PRINT OVERRIDES
   ========================================================= */
@media print {
    .lead-bullets {
        margin-bottom: 6pt;
    }

    .lead-bullets li {
        font-size: 9.5pt;
        line-height: 1.4;
        margin-bottom: 2pt;
        padding-left: 11pt;
        position: relative;
        color: #3a4048;
    }

    .lead-bullets li::before {
        content: "–";
        position: absolute;
        left: 0;
        top: 0;
        width: auto;
        height: auto;
        background: none;
        border-radius: 0;
        color: #7a828a;
    }
}

/* =========================================================
   SMARTPHONE DISPLAY FIX — keep at the VERY END of file
   ========================================================= */
@media (max-width: 720px) {

    html,
    body {
        overflow-x: hidden !important;
    }

    /* 1. Identity column must be allowed to shrink and wrap */
    .identity,
    .id-grid,
    .id-main,
    .portrait {
        min-width: 0;
    }

    .role {
        max-width: none;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* 2. Skill chips must wrap safely */
    .chip {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        min-width: 0;
        max-width: 100%;
    }

    .hint {
        color: var(--accent);
        margin-left: 4px;
    }

    /* 3. Profile lead: never justify on phones (ugly gaps) */
    .lead {
        text-align: left !important;
        overflow-wrap: anywhere;
    }

    /* 4. Stats: 2 columns instead of 4 */
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* 5. Timeline meta + skill chips wrap safely */
    .tl-meta,
    .chip {
        overflow-wrap: anywhere;
    }

    @media (max-width: 560px) {

        /* interests stack vertically on narrow phones */
        .interests {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 420px) {
        .cert-grid {
            grid-template-columns: 1fr;
        }

        .name {
            font-size: 1.9rem;
        }
    }
}


/* =========================================================
   CREDLY PROFILE — logo mark + link card, smaller renewal note
   ========================================================= */
.credly-box {
    margin-top: 28px;
}

.credly-link {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid var(--accent);
    background: linear-gradient(120deg, var(--surface) 0%, var(--surface-2) 55%, var(--accent-dim) 100%);
    border-radius: 14px;
    box-shadow: 0 10px 30px -18px var(--accent-glow);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* light sweep that runs across the card on hover */
.credly-link::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .3), transparent);
    opacity: 0;
    pointer-events: none;
}

.credly-link:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 18px 36px -14px var(--accent-glow), 0 0 0 3px var(--accent-dim);
}

.credly-link:hover::after {
    animation: credly-sweep .9s ease-out;
}

@keyframes credly-sweep {
    from {
        left: -70%;
        opacity: .85;
    }

    to {
        left: 130%;
        opacity: 0;
    }
}

/* badge-style logo mark: solid accent disc with a soft ring */
.credly-logo {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #05231a;
    font-size: 1.3rem;
    box-shadow: 0 0 0 4px var(--accent-dim), 0 6px 14px -8px var(--accent-glow);
}

/* small mono pill above the CTA text */
.credly-badge {
    display: inline-block;
    font-size: .58rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--status-border);
    padding: .22rem .6rem;
    border-radius: 999px;
    margin-bottom: 7px;
}

.credly-copy {
    flex: 1;
    min-width: 0;
}

.credly-copy strong {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.credly-url {
    display: block;
    margin-top: 3px;
    font-size: .72rem;
    letter-spacing: .02em;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.credly-ext {
    flex: none;
    color: var(--accent);
    transition: transform .25s ease;
}

.credly-link:hover .credly-ext {
    transform: translate(3px, -3px);
}

.cert-note {
    margin-top: 10px;
    font-size: .72rem;
    color: var(--muted);
    font-style: italic;
}

@media print {
    .credly-box {
        margin-top: 10pt;
    }

    .credly-link {
        display: block;
        border: none;
        background: none;
        padding: 0;
        gap: 0;
    }

    .credly-logo,
    .credly-ext,
    .credly-badge {
        display: none;
    }

    .credly-copy strong {
        font-size: 9pt;
        color: #2f3640;
    }

    .credly-url {
        font-size: 8.5pt;
        margin-top: 1pt;
        color: #000;
    }

    .cert-note {
        margin-top: 4pt;
        font-size: 7.5pt;
        color: #565d66;
    }
}



/* Back-to-top button styles live at the very end of this file (mobile FAB). */
.vcard-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.vcard-btn i,
.vcard-btn svg {
    width: 1em;
    height: 1em;
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Justify paragraph text (short labels and notes stay left-aligned) */
.lead,
.cert-body p,
.int-item p,
.lead-bullets li {
    text-align: justify !important;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* =========================================================
   EDUCATION CARDS — horizontal swipe row on mobile only
   (the desktop 2-column grid is left untouched)
   ========================================================= */
@media (max-width: 720px) {
    .edu-grid {
        display: flex;
        overflow-x: auto;
        gap: 14px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .edu-grid::-webkit-scrollbar {
        display: none;
    }

    /* card ≈ full width, but the second card clearly peeks in
       so the swipe affordance is obvious at a glance */
    .edu-card {
        flex: 0 0 min(420px, calc(100% - 64px));
        scroll-snap-align: start;
    }
}

/* =========================================================
   MOBILE BACK-TO-TOP — floating button (mobile only, smooth scroll)
   Kept at the VERY END of the CSS file on purpose.
   ========================================================= */
.back-to-top {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .35);
    cursor: pointer;
    z-index: 95;
    font-size: 1.15rem;
    opacity: 0;
    transform: translateY(10px) scale(.92);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1), border-color .25s ease,
        box-shadow .25s ease;
}

.back-to-top.show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 30px -10px var(--accent-glow);
}

@media (max-width: 768px) {
    .back-to-top {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
    }
}

/* =========================================================
   404 ERROR PAGE — branded "not found" card
   ========================================================= */
.error-404 {
    margin-top: clamp(48px, 10vh, 96px);
}

.err-card {
    text-align: center;
    padding: clamp(32px, 6vw, 56px) clamp(24px, 4vw, 48px);
}

.err-card .kicker {
    justify-content: center;
}

.err-code {
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    margin: 10px 0 18px;
}

.err-code .err-slash {
    color: var(--accent);
}

.err-msg {
    color: var(--muted);
    max-width: 46ch;
    margin-inline: auto;
    line-height: 1.7;
}

.err-actions {
    justify-content: center;
}

