@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #05070b;
    --bg-2: #090d14;
    --surface: rgba(12, 17, 26, .72);
    --surface-strong: rgba(16, 23, 35, .92);
    --surface-soft: rgba(255, 255, 255, .035);
    --text: #f4f7fb;
    --text-2: #bdc8d7;
    --muted: #7e8ba0;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);
    --accent: #4aa3ff;
    --accent-2: #ff5a76;
    --accent-soft: rgba(74, 163, 255, .14);
    --success: #68e5b1;
    --shadow: 0 24px 70px rgba(0, 0, 0, .36);
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, .18);
    --container: 1180px;
    --header-h: 76px;
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --ease-spring: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f7fb;
    --bg-2: #edf2f8;
    --surface: rgba(255, 255, 255, .76);
    --surface-strong: rgba(255, 255, 255, .94);
    --surface-soft: rgba(15, 23, 42, .035);
    --text: #0b1220;
    --text-2: #334155;
    --muted: #617087;
    --line: rgba(15, 23, 42, .10);
    --line-strong: rgba(15, 23, 42, .18);
    --accent: #126fd6;
    --accent-2: #d63d58;
    --accent-soft: rgba(18, 111, 214, .11);
    --shadow: 0 24px 70px rgba(60, 80, 105, .14);
    --shadow-soft: 0 14px 34px rgba(60, 80, 105, .10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30rem),
        radial-gradient(circle at 86% 76%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 34rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 1.1s var(--ease-out), color 1.1s var(--ease-out);
}

body.modal-open {
    overflow: hidden;
}

button, input, a {
    font: inherit;
}

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

button {
    color: inherit;
}

img {
    max-width: 100%;
}

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

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 9999;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    transform: translateY(-150%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: none;
}

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

.ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.theme-transition-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
}

.theme-transition-canvas.is-active {
    opacity: 1;
}

.three-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.container {
    width: min(var(--container), calc(100% - clamp(32px, 7vw, 88px)));
    margin-inline: auto;
    position: relative;
    z-index: 3;
}

.section {
    position: relative;
    min-height: 100svh;
    padding: clamp(100px, 12vw, 168px) 0;
    isolation: isolate;
}

.section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-2) 46%, transparent), transparent);
    z-index: -1;
}

/* Header */
.site-header {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: min(1240px, calc(100% - 28px));
    min-height: 60px;
    padding: 9px 10px 9px 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12), inset 0 1px rgba(255, 255, 255, .05);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    transition: background .9s var(--ease-out), border-color .9s var(--ease-out), box-shadow .9s var(--ease-out);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--accent-2)));
    font: 700 11px/1 var(--font-mono);
    letter-spacing: .08em;
    box-shadow: 0 8px 22px var(--accent-soft);
}

.brand-copy {
    display: grid;
    line-height: 1.1;
    min-width: 0;
}

.brand-copy strong {
    font-size: 11px;
    letter-spacing: .08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.brand-copy small {
    margin-top: 4px;
    font: 500 8px/1.1 var(--font-mono);
    color: var(--muted);
    letter-spacing: .14em;
}

.desktop-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 2vw, 26px);
}

.desktop-nav a {
    position: relative;
    padding: 10px 0;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}

.desktop-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s var(--ease-out);
}

.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--text);
}

.desktop-nav a:hover::after, .desktop-nav a.active::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--accent-soft);
}

.menu-button {
    display: none;
    position: relative;
}

.menu-button span {
    position: absolute;
    width: 16px;
    height: 1px;
    background: currentColor;
}

.menu-button span:first-child {
    transform: translateY(-3px);
}

.menu-button span:last-child {
    transform: translateY(3px);
}

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 300;
    padding: 20px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(26px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: .3s var(--ease-out);
}

.mobile-nav.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.mobile-nav-head span {
    font-weight: 700;
}

.mobile-nav-links {
    display: grid;
    margin-top: 30px;
}

.mobile-nav-links a {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-size: clamp(24px, 7vw, 38px);
    font-weight: 700;
    letter-spacing: -.04em;
}

/* Hero */
.hero {
    display: grid;
    align-items: center;
    min-height: 100svh;
    overflow: hidden;
    padding-top: 120px;
}

.hero-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .25;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 86%);
}

.hero-glow {
    position: absolute;
    width: min(62vw, 800px);
    aspect-ratio: 1;
    right: -16%;
    top: 4%;
    background: radial-gradient(circle, var(--accent-soft), transparent 65%);
    filter: blur(18px);
    pointer-events: none;
}

.hero-content {
    padding-top: 40px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font: 500 10px/1 var(--font-mono);
    letter-spacing: .16em;
    color: var(--text-2);
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 18px color-mix(in srgb, var(--success) 72%, transparent);
}

.hero-role {
    margin: 0 0 16px;
    color: var(--accent);
    font: 500 clamp(11px, 1.2vw, 14px)/1.2 var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero-name {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(58px, 11vw, 154px);
    line-height: .82;
    letter-spacing: -.075em;
    font-weight: 800;
    text-wrap: balance;
}

.hero-tagline {
    max-width: 760px;
    margin: 34px 0 0;
    font-size: clamp(20px, 2.5vw, 34px);
    line-height: 1.14;
    letter-spacing: -.035em;
    color: var(--text-2);
    font-weight: 500;
}

.hero-summary {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(14px, 1.25vw, 17px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.button {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    transition: transform .25s var(--ease-spring), box-shadow .25s ease, border-color .25s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--text);
    color: var(--bg);
    box-shadow: var(--shadow-soft);
}

.button-secondary {
    background: var(--surface);
    color: var(--text);
    backdrop-filter: blur(12px);
}

.hero-meta {
    position: absolute;
    bottom: 26px;
    z-index: 3;
    display: flex;
    gap: 14px;
    align-items: center;
    font: 500 8px/1 var(--font-mono);
    color: var(--muted);
    letter-spacing: .12em;
}

.hero-meta-left {
    left: clamp(18px, 4vw, 56px);
}

.hero-meta-right {
    right: clamp(18px, 4vw, 56px);
}

.hero-meta-right i {
    width: 44px;
    height: 1px;
    background: var(--line-strong);
}

/* Section headings */
.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    gap: 40px;
    align-items: end;
    margin-bottom: clamp(42px, 7vw, 78px);
}

.section-index, .panel-label, .modal-label {
    display: block;
    margin-bottom: 14px;
    color: var(--accent);
    font: 500 9px/1 var(--font-mono);
    letter-spacing: .15em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0;
    max-width: 11ch;
    font-size: clamp(42px, 7vw, 88px);
    line-height: .9;
    letter-spacing: -.06em;
}

.section-heading h2 em {
    color: var(--muted);
    font-style: normal;
    font-weight: 500;
}

.section-heading>p {
    margin: 0;
    color: var(--text-2);
    font-size: clamp(14px, 1.3vw, 18px);
    max-width: 44ch;
    justify-self: end;
}

/* Shared surfaces */
.glass-panel, .project-card, .experience-row, .credential-card, .extra-card, .software-card, .stack-console {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface-soft) 65%, transparent));
    box-shadow: var(--shadow-soft), inset 0 1px rgba(255, 255, 255, .035);
    backdrop-filter: blur(18px) saturate(135%);
    transition: background .9s var(--ease-out), border-color .9s var(--ease-out), box-shadow .35s ease, transform .35s var(--ease-spring);
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    gap: 20px;
}

.profile-panel {
    min-height: 480px;
    border-radius: var(--radius-xl);
    padding: clamp(26px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile-panel h3 {
    margin: 0;
    font-size: clamp(34px, 5vw, 64px);
    line-height: .94;
    letter-spacing: -.055em;
}

.profile-panel>p {
    max-width: 48ch;
    color: var(--text-2);
}

.profile-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 36px;
}

.profile-meta>div {
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.profile-meta span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font: 500 8px/1 var(--font-mono);
    letter-spacing: .12em;
}

.profile-meta strong {
    display: block;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
}

.visual-panel {
    min-height: 480px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    overflow: hidden;
    background: radial-gradient(circle at center, var(--accent-soft), transparent 58%);
}

.orbit-system {
    position: relative;
    width: min(68%, 390px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.orbit {
    position: absolute;
    inset: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
    border-radius: 50%;
    animation: orbitSpin 18s linear infinite;
}

.orbit-b {
    inset: 13%;
    transform: rotateX(62deg);
    animation-duration: 14s;
    animation-direction: reverse;
}

.orbit-c {
    inset: 27%;
    transform: rotateY(68deg);
    animation-duration: 10s;
}

.orbit::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 8%;
    left: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent);
}

.orbit-core {
    width: 32%;
    aspect-ratio: 1;
    border-radius: 30%;
    position: relative;
    display: grid;
    place-items: center;
    transform: rotate(45deg);
    border: 1px solid var(--line-strong);
    background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, transparent));
    box-shadow: 0 0 70px var(--accent-soft);
    animation: coreFloat 5s ease-in-out infinite;
}

.orbit-core span {
    width: 42%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 30px var(--accent);
}

.orbit-core i {
    position: absolute;
    inset: -18%;
    border: 1px dashed var(--line-strong);
    border-radius: 50%;
    animation: orbitSpin 9s linear infinite reverse;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.metric-card {
    min-height: 150px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card strong {
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1;
    letter-spacing: -.05em;
}

.metric-card span {
    color: var(--muted);
    font: 500 8px/1.2 var(--font-mono);
    letter-spacing: .13em;
}

/* Work */
.work-section {
    overflow: hidden;
}

.work-backdrop {
    position: absolute;
    top: 9%;
    left: -2%;
    z-index: -1;
    font-size: clamp(120px, 28vw, 420px);
    line-height: .7;
    font-weight: 800;
    letter-spacing: -.08em;
    color: transparent;
    -webkit-text-stroke: 1px var(--line);
    opacity: .35;
    user-select: none;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    perspective: 1200px;
}

.project-card {
    position: relative;
    min-height: 360px;
    padding: 26px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transform-style: preserve-3d;
}

.project-card:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
    box-shadow: var(--shadow);
}

.project-light {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 18%, transparent), transparent 38%);
    transition: opacity .25s ease;
}

.project-card:hover .project-light {
    opacity: 1;
}

.project-card-top, .project-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.project-card-top {
    font: 500 9px/1 var(--font-mono);
    color: var(--muted);
}

.project-card-body {
    position: relative;
    z-index: 2;
    margin: 70px 0 56px;
    max-width: 90%;
    transform: translateZ(18px);
}

.project-card-body h3 {
    margin: 0 0 16px;
    font-size: clamp(28px, 3.6vw, 48px);
    line-height: .95;
    letter-spacing: -.05em;
}

.project-card-body p {
    margin: 0;
    color: var(--text-2);
    max-width: 50ch;
}

.project-card-bottom {
    margin-top: auto;
}

.project-card-bottom b {
    color: var(--line-strong);
    font-size: 38px;
    line-height: 1;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-row span, .modal-tags span {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-2);
    font: 500 8px/1 var(--font-mono);
    letter-spacing: .04em;
}

/* Experience */
.experience-list {
    display: grid;
    gap: 14px;
}

.experience-row {
    display: grid;
    grid-template-columns: 64px minmax(130px, .42fr) minmax(0, 1fr);
    gap: 26px;
    padding: 26px;
    border-radius: var(--radius-lg);
}

.experience-row:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.experience-number {
    color: var(--accent);
    font: 500 11px/1 var(--font-mono);
    padding-top: 4px;
}

.experience-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--muted);
    font: 500 9px/1.4 var(--font-mono);
}

.experience-content h3 {
    margin: 0;
    font-size: clamp(24px, 3vw, 38px);
    letter-spacing: -.045em;
    line-height: 1;
}

.experience-content h4 {
    margin: 8px 0 22px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.experience-copy {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.experience-copy p {
    margin: 0;
    color: var(--text-2);
}

.inline-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

/* Stack */
.stack-console {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.stack-console-head {
    min-height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font: 500 9px/1 var(--font-mono);
    letter-spacing: .12em;
}

.stack-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 430px;
}

.stack-categories {
    padding: 14px;
    border-right: 1px solid var(--line);
}

.stack-category {
    width: 100%;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-2);
    text-align: left;
    cursor: pointer;
}

.stack-category:hover, .stack-category.active {
    background: var(--accent-soft);
    color: var(--text);
}

.stack-category span, .stack-category em {
    color: var(--muted);
    font: 500 8px/1 var(--font-mono);
    font-style: normal;
}

.stack-category strong {
    font-size: 12px;
}

.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
    padding: clamp(22px, 4vw, 44px);
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.skill-chip:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: var(--accent-soft);
}

.skill-chip img, .software-card img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 5px;
}

.skill-chip span {
    font-size: 12px;
    font-weight: 600;
}

.software-section, .extras-section {
    margin-top: 40px;
}

.subheading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--muted);
    font: 500 9px/1 var(--font-mono);
    letter-spacing: .12em;
}

.subheading i {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.software-card {
    min-height: 86px;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.software-card span {
    font-size: 12px;
    font-weight: 600;
}

/* Credentials */
.credentials-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.credential-list {
    display: grid;
    gap: 12px;
}

.credential-card, .extra-card {
    border-radius: var(--radius-lg);
    padding: 24px;
}

.credential-card:hover, .extra-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.credential-card>span, .extra-card>span {
    color: var(--accent);
    font: 500 8px/1 var(--font-mono);
    letter-spacing: .1em;
}

.credential-card h3, .extra-card h3 {
    margin: 16px 0 6px;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.credential-card h4 {
    margin: 0 0 10px;
    color: var(--text-2);
    font-size: 12px;
}

.credential-card p, .extra-card p {
    margin: 0;
    color: var(--muted);
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Contact */
.contact-section {
    overflow: hidden;
    padding-bottom: 50px;
}

.contact-grid-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 70px 70px;
    opacity: .15;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.contact-aurora {
    position: absolute;
    width: 46vw;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .1;
    z-index: -1;
}

.contact-aurora-a {
    left: -16%;
    top: 16%;
    background: var(--accent);
}

.contact-aurora-b {
    right: -18%;
    bottom: 4%;
    background: var(--accent-2);
}

.contact-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .5fr);
    gap: 40px;
    align-items: end;
}

.contact-kicker {
    margin: 0 0 10px;
    color: var(--accent);
    font: 500 10px/1 var(--font-mono);
    letter-spacing: .12em;
}

.contact-name {
    margin: 0;
    font-size: clamp(48px, 8vw, 110px);
    line-height: .83;
    letter-spacing: -.07em;
}

.contact-summary {
    margin: 0;
    color: var(--text-2);
    max-width: 38ch;
    justify-self: end;
}

.contact-command-center {
    display: grid;
    grid-template-columns: minmax(220px, .38fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 60px;
    align-items: center;
}

.contact-core {
    position: relative;
    width: min(100%, 320px);
    aspect-ratio: 1;
    margin: auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 62%);
}

.contact-core>span {
    width: 88px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: linear-gradient(145deg, var(--surface-strong), var(--accent-soft));
    border: 1px solid var(--line-strong);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .08em;
    box-shadow: 0 0 50px var(--accent-soft);
}

.contact-core-ring {
    position: absolute;
    inset: 10%;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    animation: orbitSpin 18s linear infinite;
}

.contact-core-ring-b {
    inset: 23%;
    border-style: dashed;
    animation-direction: reverse;
    animation-duration: 12s;
}

.contact-links {
    display: grid;
    gap: 10px;
}

.contact-link-card {
    min-height: 76px;
    display: grid;
    grid-template-columns: 42px 44px 1fr 32px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    transition: .25s var(--ease-out);
}

.contact-link-card:hover {
    transform: translateX(-4px);
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface) 82%, var(--accent-soft));
}

.contact-link-index {
    color: var(--muted);
    font: 500 8px/1 var(--font-mono);
}

.contact-link-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

.contact-link-copy {
    display: grid;
    min-width: 0;
}

.contact-link-copy strong {
    font-size: 11px;
    letter-spacing: .08em;
}

.contact-link-copy small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-link-arrow {
    color: var(--accent);
}

.contact-footer {
    margin-top: 54px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font: 500 8px/1.4 var(--font-mono);
    letter-spacing: .1em;
}

.contact-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px var(--success);
}

.contact-status b {
    font-weight: 500;
}

/* Modal */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: .25s ease;
}

.project-modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    width: min(900px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
}

.modal-index {
    color: var(--accent);
    font: 500 9px/1 var(--font-mono);
}

.modal-card h2 {
    margin: 18px 52px 28px 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: .9;
    letter-spacing: -.055em;
}

.modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 34px;
}

.modal-copy {
    display: grid;
    gap: 12px;
    color: var(--text-2);
    margin-bottom: 24px;
}

.modal-copy p {
    margin: 0;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* Motion */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    transition-delay: var(--delay, 0ms);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.cursor {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 5px;
    height: 5px;
    background: white;
}

.cursor-ring {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, .65);
    transition: width .2s ease, height .2s ease;
}

@keyframes orbitSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes coreFloat {
    50% {
        transform: rotate(45deg) translateY(-10px) scale(1.04);
    }
}

@keyframes pulse {
    50% {
        transform: scale(1.45);
        opacity: .55;
    }
}

/* Theme transition smoothing */
:root.theme-shifting *, :root.theme-shifting *::before, :root.theme-shifting *::after {
    transition-property: background-color, color, border-color, box-shadow, fill, stroke !important;
    transition-duration: 1.1s !important;
    transition-timing-function: var(--ease-out) !important;
}

/* Responsive */
@media (max-width: 1100px) {
    :root {
        --header-h: 68px;
    }

    .desktop-nav {
        display: none;
    }

    .menu-button {
        display: grid;
    }

    .site-header {
        grid-template-columns: 1fr auto;
    }

    .header-actions {
        justify-self: end;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .visual-panel {
        min-height: 380px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-heading {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .section-heading>p {
        justify-self: start;
    }

    .stack-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .software-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-command-center {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 820px) {
    .container {
        width: min(100% - 30px, var(--container));
    }

    .section {
        min-height: auto;
        padding: 100px 0;
    }

    .site-header {
        top: 10px;
        width: calc(100% - 20px);
        border-radius: 16px;
    }

    .brand-copy small {
        display: none;
    }

    .hero {
        min-height: 100svh;
        padding-top: 100px;
    }

    .hero-name {
        font-size: clamp(54px, 15vw, 104px);
        max-width: 9ch;
    }

    .hero-meta {
        display: none;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        min-height: 320px;
    }

    .experience-row {
        grid-template-columns: 44px 1fr;
    }

    .experience-meta {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .experience-content {
        grid-column: 2;
    }

    .stack-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .stack-categories {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        scrollbar-width: none;
    }

    .stack-category {
        flex: 0 0 auto;
        width: auto;
        min-height: 40px;
        grid-template-columns: auto auto;
    }

    .stack-category span {
        display: none;
    }

    .stack-category em {
        margin-left: 4px;
    }

    .skill-cloud {
        min-height: 230px;
        padding: 22px;
    }

    .software-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .credentials-columns {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .extras-grid {
        grid-template-columns: 1fr;
    }

    .contact-header {
        grid-template-columns: 1fr;
    }

    .contact-summary {
        justify-self: start;
    }

    .contact-command-center {
        grid-template-columns: 1fr;
    }

    .contact-core {
        width: min(58vw, 260px);
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-grid aside {
        order: -1;
    }

    .cursor {
        display: none;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    .container {
        width: calc(100% - 22px);
    }

    .site-header {
        min-height: 56px;
        padding: 7px 8px 7px 10px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand-copy strong {
        max-width: 150px;
        font-size: 10px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .section {
        padding: 84px 0;
    }

    .hero {
        padding-top: 90px;
    }

    .hero-content {
        padding-top: 28px;
    }

    .hero-kicker {
        margin-bottom: 22px;
    }

    .hero-name {
        font-size: clamp(48px, 17vw, 78px);
    }

    .hero-tagline {
        margin-top: 24px;
        font-size: 20px;
    }

    .hero-summary {
        font-size: 14px;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .section-heading {
        margin-bottom: 34px;
    }

    .section-heading h2 {
        font-size: clamp(40px, 13vw, 62px);
    }

    .profile-panel, .visual-panel, .project-card, .stack-console {
        border-radius: 20px;
    }

    .profile-panel {
        min-height: 420px;
        padding: 22px;
    }

    .profile-meta {
        grid-template-columns: 1fr;
    }

    .visual-panel {
        min-height: 320px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .metric-card {
        min-height: 118px;
        padding: 18px;
    }

    .project-card {
        padding: 20px;
        min-height: 300px;
    }

    .project-card-body {
        margin: 54px 0 42px;
        max-width: 100%;
    }

    .experience-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 20px;
    }

    .experience-number, .experience-meta, .experience-content {
        grid-column: 1;
    }

    .software-grid {
        grid-template-columns: 1fr;
    }

    .credential-card, .extra-card {
        padding: 20px;
    }

    .contact-link-card {
        grid-template-columns: 34px 38px 1fr 20px;
        padding: 9px 10px;
    }

    .contact-link-index {
        display: none;
    }

    .contact-footer {
        flex-direction: column;
    }

    .project-modal {
        padding: 10px;
    }

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

@media (max-width: 380px) {
    .brand-copy strong {
        max-width: 112px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .hero-name {
        font-size: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .ambient-canvas, .theme-transition-canvas, .three-canvas {
        display: none !important;
    }

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


/* ============================================================
   V11 — IMMERSIVE UI LAYER
   Three.js canvases stay presentation-only and never intercept UI.
   ============================================================ */
:root {
    --pointer-x: 50vw;
    --pointer-y: 30vh;
    --page-progress: 0;
    --content-max: 1180px;
    --gutter: clamp(18px, 5vw, 72px);
    --section-gap: clamp(88px, 11vw, 168px);
    --glass-blur: 22px;
    --ease-cinematic: cubic-bezier(.22, .72, .16, 1);
}

body {
    position: relative;
    background-attachment: fixed;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(520px circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--accent) 5%, transparent), transparent 65%),
        linear-gradient(180deg, transparent 0 42%, color-mix(in srgb, var(--bg) 24%, transparent) 78%, transparent);
}

.scroll-progress {
    position: fixed;
    inset: 0 0 auto;
    height: 2px;
    z-index: 1001;
    pointer-events: none;
    background: transparent;
}

.scroll-progress i {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 38%, var(--accent-2)), var(--accent-2));
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent);
    will-change: transform;
}

.pointer-aura {
    position: fixed;
    left: var(--pointer-x);
    top: var(--pointer-y);
    width: 220px;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 7%, transparent), transparent 68%);
    filter: blur(12px);
    opacity: .8;
}

.ambient-canvas {
    z-index: 0;
    opacity: .95;
}

.page-noise {
    z-index: 2;
    opacity: .032;
    mix-blend-mode: soft-light;
}

main {
    position: relative;
    z-index: 4;
}

.section {
    overflow: clip;
    padding-block: var(--section-gap);
}

.section>.container {
    position: relative;
    z-index: 4;
}

.section::after {
    content: "";
    position: absolute;
    inset: 8% max(-18vw, -260px) auto;
    height: 72%;
    pointer-events: none;
    z-index: -1;
    opacity: .55;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 4%, transparent), transparent 68%);
    transform: translate3d(0, 14px, 0) scale(.98);
    transition: opacity .9s var(--ease-cinematic), transform .9s var(--ease-cinematic);
}

.section.section-active::after {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.site-header {
    overflow: hidden;
    isolation: isolate;
    border-color: color-mix(in srgb, var(--line) 82%, transparent);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .055);
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 34%, color-mix(in srgb, var(--accent-2) 4%, transparent));
    opacity: .7;
}

.site-header::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 50%, white), transparent);
    opacity: .7;
}

.site-header.scrolled {
    box-shadow: 0 22px 70px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .06);
}

.hero {
    isolation: isolate;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 30%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero-content {
    z-index: 5;
    max-width: var(--content-max);
}

.hero-name {
    position: relative;
    text-shadow: 0 14px 60px color-mix(in srgb, var(--accent) 7%, transparent);
}

.hero-name::after {
    content: "";
    position: absolute;
    width: min(68%, 520px);
    height: 1px;
    left: 0;
    bottom: -20px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 12%, transparent), transparent);
    transform: scaleX(calc(.3 + var(--page-progress) * .7));
    transform-origin: left center;
    opacity: .55;
}

.hero-grid {
    background-size: clamp(42px, 5vw, 68px) clamp(42px, 5vw, 68px);
    transform: perspective(800px) rotateX(58deg) scale(1.4) translateY(22%);
    transform-origin: center bottom;
    opacity: .16;
}

.section-heading {
    position: relative;
}

.section-heading::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -24px;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent 75%);
}

.section-index {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-index::before {
    content: "";
    width: 18px;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.glass-panel, .project-card, .experience-row, .credential-card, .extra-card, .software-card, .stack-console {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-soft) 74%, transparent));
    backdrop-filter: blur(var(--glass-blur)) saturate(145%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(145%);
}

.glass-panel::before, .project-card::before, .experience-row::before, .credential-card::before, .extra-card::before, .software-card::before, .stack-console::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, .055), transparent 24% 70%, color-mix(in srgb, var(--accent) 5%, transparent));
    opacity: .75;
}

.project-card {
    will-change: transform;
    transition: transform .38s var(--ease-spring), border-color .3s ease, box-shadow .38s ease, background .9s var(--ease-out);
}

.project-card::after {
    content: "";
    position: absolute;
    inset: -35%;
    z-index: 0;
    pointer-events: none;
    background: conic-gradient(from 180deg at 50% 50%, transparent, color-mix(in srgb, var(--accent) 9%, transparent), transparent 28%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 56%);
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity .35s ease;
}

.project-card:hover::after {
    opacity: .75;
    animation: cardAurora 9s linear infinite;
}

.project-card>* {
    position: relative;
    z-index: 2;
}

.experience-row::after {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 2px;
    background: linear-gradient(var(--accent), transparent);
    opacity: .25;
    transition: opacity .25s ease, transform .25s ease;
}

.experience-row:hover::after {
    opacity: .9;
    transform: scaleY(1.12);
}

.stack-console {
    box-shadow: 0 26px 90px rgba(0, 0, 0, .18), inset 0 1px rgba(255, 255, 255, .04);
}

.skill-chip {
    position: relative;
    overflow: hidden;
}

.skill-chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 80%);
    transform: translateX(-120%);
    transition: transform .65s var(--ease-cinematic);
}

.skill-chip:hover::after {
    transform: translateX(120%);
}

.contact-section::before {
    background:
        radial-gradient(circle at 18% 72%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 34%),
        radial-gradient(circle at 82% 30%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 32%);
}

.contact-core {
    filter: drop-shadow(0 30px 65px color-mix(in srgb, var(--accent) 14%, transparent));
}

.contact-link-card {
    overflow: hidden;
    isolation: isolate;
}

.contact-link-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 45%, color-mix(in srgb, var(--accent-2) 4%, transparent));
    transform: translateX(-102%);
    transition: transform .5s var(--ease-cinematic);
}

.contact-link-card:hover::before {
    transform: none;
}

:root[data-theme="light"] .pointer-aura {
    opacity: .45;
}

:root[data-theme="light"] .page-noise {
    opacity: .018;
}

:root[data-theme="light"] .site-header {
    box-shadow: 0 18px 56px rgba(44, 67, 94, .13), inset 0 1px rgba(255, 255, 255, .9);
}

:root[data-theme="light"] .glass-panel,
:root[data-theme="light"] .project-card,
:root[data-theme="light"] .experience-row,
:root[data-theme="light"] .credential-card,
:root[data-theme="light"] .extra-card,
:root[data-theme="light"] .software-card,
:root[data-theme="light"] .stack-console {
    box-shadow: 0 18px 54px rgba(65, 83, 108, .10), inset 0 1px rgba(255, 255, 255, .95);
}

@keyframes cardAurora {
    to {
        transform: rotate(360deg);
    }
}

@keyframes floatPulse {
    50% {
        transform: translate3d(0, -8px, 0) scale(1.015);
    }
}

@media (hover:hover) and (pointer:fine) {
    .metric-card:hover {
        transform: translateY(-5px);
        border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
        box-shadow: var(--shadow-soft);
    }

    .software-card:hover {
        transform: translateY(-4px) scale(1.012);
        border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    }
}

@media (max-width: 1100px) {
    :root {
        --glass-blur: 18px;
        --section-gap: clamp(84px, 10vw, 128px);
    }

    .pointer-aura {
        width: 180px;
    }
}

@media (max-width: 820px) {
    :root {
        --gutter: 15px;
        --section-gap: 86px;
    }

    body::before {
        background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 18%, transparent));
    }

    .pointer-aura {
        display: none;
    }

    .hero-grid {
        transform: perspective(760px) rotateX(62deg) scale(1.65) translateY(26%);
    }

    .project-card {
        transform: none !important;
    }

    .section::after {
        opacity: .65;
    }
}

@media (max-width: 560px) {
    :root {
        --section-gap: 74px;
        --radius-xl: 22px;
        --radius-lg: 18px;
        --glass-blur: 15px;
    }

    .scroll-progress {
        height: 2px;
    }

    .hero-name::after {
        bottom: -12px;
    }

    .section-heading::after {
        bottom: -16px;
    }

    .site-header {
        backdrop-filter: blur(18px) saturate(145%);
    }

    .contact-core {
        width: min(72vw, 235px);
    }

    .contact-link-copy small {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    :root {
        --section-gap: 66px;
    }

    .hero-name {
        font-size: clamp(42px, 15vw, 52px);
    }

    .hero-tagline {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pointer-aura, .scroll-progress {
        display: none !important;
    }

    .project-card::after, .skill-chip::after {
        display: none !important;
    }
}

/* First-frame choreography */
.site-header {
    animation: headerArrival .85s var(--ease-cinematic) both;
}

.hero-kicker, .hero-role, .hero-name, .hero-tagline, .hero-summary, .hero-actions {
    will-change: transform, opacity;
}

@keyframes headerArrival {
    from {
        opacity: 0;
        transform: translate(-50%, -16px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header {
        animation: none !important;
    }
}


/* ==========================================================================
   V12 — Editorial / immersive refinement layer
   ========================================================================== */
:root {
    --font-display: "Syne", var(--font-sans);
    --content-max: 1180px;
    --content-pad: clamp(20px, 4vw, 56px);
    --section-space: clamp(96px, 12vw, 176px);
    --hairline: color-mix(in srgb, var(--text) 10%, transparent);
    --hairline-strong: color-mix(in srgb, var(--text) 18%, transparent);
}

html {
    scroll-padding-top: 96px;
}

body {
    overflow-x: clip;
}

.container {
    width: min(var(--content-max), calc(100% - (var(--content-pad) * 2)));
    margin-inline: auto;
}

.section {
    padding-block: var(--section-space);
}

/* Navigation: exact alignment, quieter hierarchy */
.site-header {
    padding: 14px clamp(14px, 2.2vw, 28px);
}

.nav-shell {
    width: min(1260px, calc(100% - 16px));
    min-height: 66px;
    margin-inline: auto;
    padding: 0 14px 0 12px;
    border-radius: 20px;
}

.brand {
    min-width: 0;
    gap: 12px;
}

.brand-mark {
    flex: 0 0 auto;
}

.brand-copy {
    min-width: 0;
}

#brandName {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.015em;
    text-transform: none;
    white-space: nowrap;
}

#brandTitle {
    max-width: 34ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-nav {
    gap: 4px;
}

.desktop-nav a {
    position: relative;
    padding: 10px 11px;
    border-radius: 10px;
}

.desktop-nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 7px;
    height: 1px;
    transform: scaleX(0);
    transform-origin: right;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: transform .28s var(--ease-out);
}

.desktop-nav a:hover::after, .desktop-nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hero: editorial identity rather than oversized generic heading */
.hero {
    min-height: max(720px, 100svh);
    display: grid;
    align-items: center;
    padding-top: 116px;
    padding-bottom: clamp(72px, 10vw, 120px);
}

.hero-grid {
    width: 100%;
    align-items: center;
    gap: clamp(36px, 6vw, 88px);
}

.hero-copy {
    position: relative;
    max-width: 760px;
    padding-block: clamp(28px, 5vw, 54px);
}

.hero-copy::before {
    content: "PORTFOLIO / 2026";
    display: block;
    margin-bottom: clamp(24px, 4vw, 42px);
    color: var(--muted);
    font: 500 9px/1 var(--font-mono);
    letter-spacing: .18em;
}

.hero-name {
    position: relative;
    display: grid;
    width: max-content;
    max-width: 100%;
    gap: .01em;
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(64px, 9.2vw, 142px);
    line-height: .76;
    letter-spacing: -.072em;
    text-wrap: nowrap;
}

.hero-name__first, .hero-name__last {
    display: block;
    position: relative;
}

.hero-name__first {
    color: var(--text);
}

.hero-name__last {
    margin-left: clamp(18px, 5vw, 70px);
    color: transparent;
    -webkit-text-stroke: 1.5px color-mix(in srgb, var(--text) 78%, transparent);
    background: linear-gradient(100deg, var(--text) 0%, color-mix(in srgb, var(--accent) 88%, var(--text)) 48%, var(--accent-2) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: nameSheen 8s cubic-bezier(.2, .7, .2, 1) infinite alternate;
}

.hero-name::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 2%;
    width: 2px;
    height: 88%;
    border-radius: 999px;
    background: linear-gradient(to bottom, transparent, var(--accent), var(--accent-2), transparent);
    opacity: .75;
    box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 38%, transparent);
}

.hero-name::after {
    content: "";
    position: absolute;
    width: clamp(42px, 6vw, 84px);
    height: 1px;
    right: -clamp(54px, 7vw, 92px);
    bottom: 14%;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.hero-role {
    margin-top: clamp(24px, 4vw, 40px);
    max-width: 46ch;
    color: var(--accent);
    font: 500 10px/1.4 var(--font-mono);
    letter-spacing: .15em;
    text-transform: uppercase;
}

.hero-tagline {
    margin-top: 14px;
    max-width: 32ch;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.6vw, 36px);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -.035em;
}

.hero-summary {
    max-width: 58ch;
    margin-top: 22px;
    color: var(--text-2);
    font-size: clamp(14px, 1.25vw, 17px);
    line-height: 1.75;
}

.hero-actions {
    margin-top: 32px;
    gap: 10px;
}

.hero-actions .btn {
    min-height: 48px;
    border-radius: 14px;
    padding-inline: 18px;
}

.hero-kicker {
    align-items: center;
}

/* Hero WebGL belongs to the composition, never on top of copy */
.hero-visual {
    min-height: clamp(440px, 52vw, 700px);
    isolation: isolate;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 10% 3%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 66%);
    filter: blur(28px);
    z-index: -1;
}

.three-canvas {
    opacity: .92;
    mix-blend-mode: normal;
}

/* Section headings: consistent baseline and readable measure */
.section-heading {
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, .68fr);
    column-gap: clamp(36px, 7vw, 96px);
    row-gap: 22px;
    margin-bottom: clamp(48px, 7vw, 86px);
    padding-bottom: 22px;
    border-bottom: 1px solid var(--hairline);
}

.section-heading h2 {
    max-width: 12ch;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(46px, 6.8vw, 90px);
    line-height: .9;
    letter-spacing: -.055em;
}

.section-heading>p {
    max-width: 42ch;
    justify-self: end;
    font-size: clamp(14px, 1.18vw, 17px);
    line-height: 1.72;
}

.section-index, .panel-label, .modal-label {
    letter-spacing: .18em;
}

/* Precision glass system */
.glass-panel, .project-card, .experience-row, .credential-card, .extra-card, .software-card, .stack-console {
    border-color: var(--hairline);
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-soft) 76%, transparent));
    box-shadow: 0 18px 58px rgba(0, 0, 0, .15), inset 0 1px rgba(255, 255, 255, .045);
}

:root[data-theme="light"] .glass-panel,
:root[data-theme="light"] .project-card,
:root[data-theme="light"] .experience-row,
:root[data-theme="light"] .credential-card,
:root[data-theme="light"] .extra-card,
:root[data-theme="light"] .software-card,
:root[data-theme="light"] .stack-console {
    box-shadow: 0 20px 60px rgba(20, 42, 70, .09), inset 0 1px rgba(255, 255, 255, .82);
}

/* About: asymmetric editorial layout */
.about-grid {
    grid-template-columns: minmax(0, 1.14fr) minmax(320px, .86fr);
    gap: clamp(16px, 2vw, 24px);
    align-items: stretch;
}

.profile-panel, .visual-panel {
    min-height: clamp(460px, 48vw, 610px);
}

.profile-panel {
    padding: clamp(28px, 4vw, 52px);
}

.profile-panel h3 {
    max-width: 10ch;
    font-family: var(--font-display);
    font-weight: 700;
}

.profile-meta {
    gap: 10px;
}

.profile-meta>div {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metrics-grid {
    gap: 10px;
}

.metric-card {
    min-height: 138px;
    border: 1px solid var(--hairline);
}

.metric-card strong {
    font-family: var(--font-display);
    font-weight: 700;
}

/* Projects: more deliberate proportions/alignment */
.project-grid {
    gap: clamp(14px, 2vw, 22px);
}

.project-card {
    min-height: clamp(340px, 34vw, 430px);
    padding: clamp(22px, 3vw, 32px);
}

.project-card-body {
    margin: clamp(62px, 8vw, 90px) 0 52px;
    max-width: 92%;
}

.project-card-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(30px, 3.4vw, 48px);
}

.project-card-bottom {
    align-items: flex-end;
}

.project-card-bottom b {
    font-family: var(--font-display);
    font-weight: 700;
    opacity: .34;
}

/* Experience: aligned temporal rail */
.experience-list {
    gap: 12px;
}

.experience-row {
    position: relative;
    grid-template-columns: 56px minmax(150px, .34fr) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    padding: clamp(24px, 3vw, 34px);
    overflow: hidden;
}

.experience-row::after {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 2px;
    border-radius: 99px;
    background: linear-gradient(var(--accent), var(--accent-2));
    opacity: 0;
    transform: scaleY(.45);
    transition: .35s var(--ease-out);
}

.experience-row:hover::after {
    opacity: .9;
    transform: scaleY(1);
}

.experience-content h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

.experience-copy {
    max-width: 72ch;
}

/* Stack / credentials */
.stack-layout {
    grid-template-columns: clamp(220px, 24vw, 280px) minmax(0, 1fr);
}

.stack-category {
    min-height: 58px;
}

.skill-cloud {
    gap: 9px;
    align-content: center;
}

.skill-chip {
    min-height: 44px;
}

.credentials-columns {
    gap: clamp(16px, 2.2vw, 26px);
}

.credential-card, .extra-card {
    min-height: 150px;
}

.credential-card h3, .extra-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

/* Contact: aligned command center without decorative clutter touching text */
.contact-header {
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, .5fr);
    gap: clamp(36px, 7vw, 90px);
}

.contact-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(54px, 8vw, 112px);
}

.contact-command-center {
    grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr);
    gap: clamp(26px, 5vw, 72px);
}

.contact-links {
    gap: 9px;
}

.contact-link-card {
    min-height: 82px;
    border-color: var(--hairline);
}

.contact-link-copy small {
    margin-top: 4px;
    font-size: 11px;
}

/* Motion language */
@keyframes nameSheen {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.reveal {
    transform: translateY(18px);
}

.is-ready .reveal.visible {
    transform: none;
}

/* Responsive: preserve hierarchy rather than simply shrinking */
@media (max-width:1100px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr);
        gap: 32px;
    }

    .hero-name {
        font-size: clamp(60px, 10.8vw, 112px);
    }

    .hero-name__last {
        margin-left: clamp(14px, 4vw, 44px);
    }

    .section-heading {
        grid-template-columns: 1fr minmax(240px, .6fr);
    }

    .software-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width:860px) {
    :root {
        --content-pad: clamp(18px, 4vw, 32px);
        --section-space: clamp(82px, 13vw, 120px);
    }

    .site-header {
        padding: 10px;
    }

    .nav-shell {
        min-height: 60px;
        border-radius: 17px;
    }

    .hero {
        min-height: auto;
        padding-top: 118px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-copy {
        max-width: none;
        padding-bottom: 0;
    }

    .hero-name {
        width: 100%;
        font-size: clamp(60px, 15vw, 112px);
    }

    .hero-name::after {
        display: none;
    }

    .hero-visual {
        min-height: clamp(340px, 66vw, 520px);
        margin-top: -24px;
    }

    .section-heading {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .section-heading>p {
        justify-self: start;
        max-width: 58ch;
    }

    .about-grid, .credentials-columns, .contact-header, .contact-command-center {
        grid-template-columns: 1fr;
    }

    .profile-panel, .visual-panel {
        min-height: auto;
    }

    .visual-panel {
        min-height: 400px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        min-height: 340px;
    }

    .experience-row {
        grid-template-columns: 48px 1fr;
    }

    .experience-meta {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .experience-content {
        grid-column: 2;
    }

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

    .stack-categories {
        display: flex;
        gap: 8px;
        overflow: auto;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
        scrollbar-width: none;
    }

    .stack-category {
        min-width: 190px;
    }

    .software-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-summary {
        justify-self: start;
    }

    .contact-core {
        width: min(52vw, 250px);
    }
}

@media (max-width:560px) {
    :root {
        --content-pad: 18px;
        --section-space: 82px;
    }

    .container {
        width: calc(100% - 36px);
    }

    #brandTitle {
        display: none;
    }

    #brandName {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero {
        padding-top: 102px;
        padding-bottom: 64px;
    }

    .hero-copy::before {
        margin-bottom: 22px;
    }

    .hero-name {
        font-size: clamp(48px, 15.6vw, 76px);
        line-height: .8;
        letter-spacing: -.06em;
    }

    .hero-name__last {
        margin-left: 12px;
        -webkit-text-stroke-width: 1px;
    }

    .hero-name::before {
        left: -8px;
    }

    .hero-role {
        font-size: 8px;
        letter-spacing: .12em;
    }

    .hero-tagline {
        font-size: clamp(20px, 6.4vw, 28px);
    }

    .hero-summary {
        font-size: 14px;
        line-height: 1.65;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-visual {
        min-height: 320px;
        margin-top: -36px;
    }

    .section-heading {
        margin-bottom: 40px;
        padding-bottom: 18px;
    }

    .section-heading h2 {
        font-size: clamp(40px, 13vw, 62px);
    }

    .profile-panel {
        padding: 24px;
    }

    .profile-meta {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 116px;
        padding: 18px;
    }

    .project-card {
        min-height: 310px;
        padding: 22px;
        border-radius: 22px;
        transform: none !important;
    }

    .project-card-body {
        margin: 56px 0 40px;
    }

    .experience-row {
        grid-template-columns: 1fr;
        padding: 22px;
        gap: 14px;
    }

    .experience-number, .experience-meta, .experience-content {
        grid-column: 1;
    }

    .software-grid {
        grid-template-columns: 1fr;
    }

    .contact-command-center {
        margin-top: 38px;
    }

    .contact-core {
        width: min(68vw, 220px);
    }

    .contact-link-card {
        grid-template-columns: 38px 1fr 20px;
    }

    .contact-link-index {
        display: none;
    }
}

@media (max-width:380px) {
    .container {
        width: calc(100% - 28px);
    }

    .hero-name {
        font-size: 44px;
    }

    .hero-name__last {
        margin-left: 8px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .metric-card {
        min-height: 104px;
        padding: 15px;
    }

    .section-heading h2 {
        font-size: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-name__last {
        animation: none;
        background-position: 50% 50%;
    }
}


/* =========================================================
   V13 — Insights / Calendly / footer / back-to-top / theme FX
   ========================================================= */
.theme-transition-canvas {
    z-index: 4000;
    mix-blend-mode: normal;
    transition: opacity .32s cubic-bezier(.2, .8, .2, 1);
}

html.theme-shifting body, html.theme-shifting .site-header, html.theme-shifting .glass-panel, html.theme-shifting .project-card, html.theme-shifting .experience-item, html.theme-shifting .credential-card, html.theme-shifting .software-card, html.theme-shifting .contact-link-card {
    transition: background-color 1.1s cubic-bezier(.2, .8, .2, 1), color 1.1s cubic-bezier(.2, .8, .2, 1), border-color 1.1s cubic-bezier(.2, .8, .2, 1), box-shadow 1.1s cubic-bezier(.2, .8, .2, 1);
}

html.theme-shifting .site-header {
    backdrop-filter: blur(28px) saturate(1.22);
}

.insights-section {
    position: relative;
    overflow: clip;
    isolation: isolate;
}

.insights-section::before {
    content: \"\";
    position: absolute;
    width: min(54vw, 720px);
    aspect-ratio: 1;
    left: -18vw;
    top: 14%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0, transparent 68%);
    filter: blur(18px);
    pointer-events: none;
}

.insights-orbit {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 50%;
    pointer-events: none;
    opacity: .62;
}

.insights-orbit-a {
    width: 420px;
    height: 420px;
    right: -170px;
    top: 12%;
    animation: insightOrbit 18s linear infinite;
}

.insights-orbit-b {
    width: 260px;
    height: 260px;
    right: -40px;
    top: 27%;
    animation: insightOrbit 13s linear infinite reverse;
}

@keyframes insightOrbit {
    to {
        transform: rotate(360deg);
    }
}

.insights-feature {
    min-height: 470px;
    padding: clamp(28px, 5vw, 64px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .7fr);
    gap: clamp(32px, 7vw, 96px);
    align-items: center;
    overflow: hidden;
    position: relative;
}

.insights-feature::before {
    content: \"\";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 42%), radial-gradient(circle at 78% 34%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 28%);
}

.insights-feature__copy {
    position: relative;
    z-index: 2;
    max-width: 690px;
}

.insights-eyebrow {
    display: block;
    margin-bottom: 20px;
    color: var(--accent);
    font: 600 10px/1.2 var(--font-mono);
    letter-spacing: .18em;
}

.insights-feature h3 {
    margin: 0;
    max-width: 11ch;
    font-family: var(--font-display);
    font-size: clamp(42px, 6.2vw, 82px);
    line-height: .92;
    letter-spacing: -.055em;
}

.insights-feature__copy>p {
    max-width: 60ch;
    margin: 26px 0 0;
    color: var(--text-2);
    font-size: clamp(15px, 1.35vw, 18px);
    line-height: 1.78;
}

.insights-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 28px 0 32px;
}

.insights-tags span {
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--text-2);
    font: 600 9px/1 var(--font-mono);
    letter-spacing: .08em;
}

.insights-cta {
    width: max-content;
}

.insights-visual {
    position: relative;
    min-height: 340px;
    display: grid;
    place-items: center;
    perspective: 1000px;
}

.insights-sphere {
    width: clamp(150px, 20vw, 240px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 28%, color-mix(in srgb, #fff 42%, transparent), transparent 17%), radial-gradient(circle at 58% 58%, color-mix(in srgb, var(--accent) 58%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent) 46%, transparent 72%);
    box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 20%, transparent), inset -20px -30px 60px rgba(0, 0, 0, .24);
    animation: insightFloat 7s ease-in-out infinite;
}

.insights-ring {
    position: absolute;
    width: 72%;
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    border-radius: 50%;
    transform: rotateX(68deg);
}

.insights-ring-a {
    animation: insightSpin 14s linear infinite;
}

.insights-ring-b {
    width: 88%;
    transform: rotateX(68deg) rotateZ(64deg);
    animation: insightSpin 20s linear infinite reverse;
    opacity: .55;
}

.insights-wordmark {
    position: absolute;
    display: grid;
    place-items: center;
    gap: 8px;
    text-align: center;
}

.insights-wordmark span {
    font-family: var(--font-display);
    font-size: clamp(46px, 7vw, 88px);
    font-weight: 800;
    letter-spacing: -.08em;
    color: var(--text);
    text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent);
}

.insights-wordmark small {
    font: 600 8px/1.2 var(--font-mono);
    letter-spacing: .18em;
    color: var(--text-2);
}

@keyframes insightFloat {
    0%, 100% {
        transform: translateY(0) rotate(-3deg)
    }

    50% {
        transform: translateY(-14px) rotate(3deg)
    }
}

@keyframes insightSpin {
    to {
        transform: rotateX(68deg) rotateZ(360deg);
    }
}

.contact-header__side {
    display: grid;
    justify-items: start;
    align-content: end;
    gap: 22px;
}

.contact-header__side .contact-summary {
    margin: 0;
}

.contact-book {
    width: max-content;
    white-space: nowrap;
}

.site-footer {
    position: relative;
    z-index: 4;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
}

.site-footer__inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    text-align: center;
    font: 600 9px/1.5 var(--font-mono);
    letter-spacing: .12em;
}

.site-footer__divider {
    width: 1px;
    height: 12px;
    background: var(--line);
}

.back-to-top {
    position: fixed;
    right: clamp(16px, 2.4vw, 34px);
    bottom: clamp(16px, 2.4vw, 32px);
    z-index: 900;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    gap: 0;
    overflow: hidden;
    cursor: pointer;
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    color: var(--text);
    backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(.92);
    transition: opacity .32s ease, visibility .32s ease, transform .42s cubic-bezier(.2, .8, .2, 1), border-color .25s ease, box-shadow .25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
    box-shadow: 0 18px 50px color-mix(in srgb, var(--accent) 18%, transparent);
    transform: translateY(-4px) scale(1.03);
}

.back-to-top__icon {
    font-size: 22px;
    line-height: 1;
    transition: transform .25s ease;
}

.back-to-top__label {
    font: 700 7px/1 var(--font-mono);
    letter-spacing: .16em;
    color: var(--muted);
}

.back-to-top:hover .back-to-top__icon {
    transform: translateY(-3px);
}

@media (max-width:860px) {
    .insights-feature {
        grid-template-columns: 1fr;
        min-height: auto
    }

    .insights-feature h3 {
        max-width: 13ch
    }

    .insights-visual {
        min-height: 280px
    }

    .contact-header__side {
        justify-items: start
    }
}

@media (max-width:560px) {
    .insights-feature {
        padding: 26px 20px;
        border-radius: 24px
    }

    .insights-feature h3 {
        font-size: clamp(38px, 12vw, 56px)
    }

    .insights-visual {
        min-height: 230px
    }

    .insights-sphere {
        width: 150px
    }

    .insights-tags {
        gap: 7px
    }

    .contact-book {
        width: 100%;
        justify-content: center
    }

    .site-footer__inner {
        min-height: 96px;
        flex-direction: column;
        gap: 8px;
        padding-block: 24px
    }

    .site-footer__divider {
        width: 34px;
        height: 1px
    }

    .back-to-top {
        width: 52px;
        height: 52px;
        border-radius: 16px
    }
}

@media (prefers-reduced-motion:reduce) {
    .insights-orbit, .insights-sphere, .insights-ring {
        animation: none !important
    }

    .back-to-top {
        transition: none
    }
}

/* ===== V14: Live Medium feed + advanced Technical System ===== */
.stack-console {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--surface) 74%, transparent)),
        radial-gradient(circle at 78% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 36%);
}

.stack-console::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: .38;
    background-image:
        linear-gradient(color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 86%);
}

.stack-console-head {
    min-height: 64px;
    gap: 18px;
    padding-inline: clamp(16px, 2.4vw, 28px);
    background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
    backdrop-filter: blur(24px) saturate(140%);
}

.stack-console-title, .stack-console-status {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0
}

.stack-console-status {
    justify-content: flex-end;
    flex-wrap: wrap;
    text-align: right
}

.stack-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #57e389;
    box-shadow: 0 0 0 4px color-mix(in srgb, #57e389 12%, transparent), 0 0 18px color-mix(in srgb, #57e389 70%, transparent);
    animation: stackLive 2.1s ease-in-out infinite
}

.stack-console-divider {
    opacity: .34
}

@keyframes stackLive {
    50% {
        opacity: .42;
        transform: scale(.76)
    }
}

.stack-layout {
    position: relative;
    min-height: 480px
}

.stack-categories {
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 74%, transparent), transparent)
}

.stack-category {
    position: relative;
    overflow: hidden;
    min-height: 62px;
    border: 1px solid transparent;
    transition: background .28s ease, border-color .28s ease, transform .28s cubic-bezier(.2, .8, .2, 1), color .28s ease;
}

.stack-category::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 9px;
    background: linear-gradient(var(--accent), var(--accent-2));
    transform: scaleY(0);
    opacity: 0;
    transition: .28s ease
}

.stack-category:hover {
    transform: translateX(4px)
}

.stack-category.active {
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--surface) 60%, transparent));
    box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 5%, transparent)
}

.stack-category.active::before {
    transform: scaleY(1);
    opacity: 1
}

.skill-cloud {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-content: center;
    gap: 12px;
    padding: clamp(24px, 4vw, 52px);
}

.skill-cloud::before {
    content: "ACTIVE MODULES";
    position: absolute;
    top: 16px;
    right: 22px;
    color: var(--muted);
    font: 600 8px/1 var(--font-mono);
    letter-spacing: .18em;
    opacity: .7
}

.skill-chip {
    position: relative;
    min-width: 0;
    min-height: 68px;
    padding: 0 14px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--line) 92%, transparent);
    background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 72%, transparent), color-mix(in srgb, var(--surface) 56%, transparent));
    box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 12px 30px rgba(0, 0, 0, .08);
    animation: skillModuleIn .55s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--i) * 40ms);
}

.skill-chip:hover, .skill-chip:focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, var(--surface-strong)), color-mix(in srgb, var(--surface) 60%, transparent));
    box-shadow: 0 18px 42px color-mix(in srgb, var(--accent) 10%, transparent), inset 0 1px rgba(255, 255, 255, .06);
    outline: none
}

.skill-chip img, .skill-chip__glyph {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    object-fit: contain;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    border: 1px solid var(--line);
    font: 700 8px/1 var(--font-mono);
    color: var(--accent)
}

.skill-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.01em
}

.skill-chip__state {
    font: 600 7px/1 var(--font-mono);
    letter-spacing: .12em;
    color: #57e389
}

.skill-chip__pulse {
    position: absolute;
    right: 9px;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    opacity: .7
}

@keyframes skillModuleIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98)
    }

    to {
        opacity: 1;
        transform: none
    }
}


/* ==========================================================================\n   Medium Publishing Rail — scalable single-row archive\n   ========================================================================== */
.medium-feed-shell {
    position: relative;
    margin-top: clamp(38px, 6vw, 82px);
    isolation: isolate
}

.medium-feed-shell::before {
    content: "";
    position: absolute;
    inset: -40px -8vw -80px;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(ellipse at 14% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 34%), radial-gradient(ellipse at 78% 60%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 30%);
    filter: blur(18px);
    opacity: .86
}

.medium-feed-head {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--line)
}

.medium-feed-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: min(210px, 35%);
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent)
}

.medium-feed-kicker, .medium-feed-status {
    font: 650 8px/1.3 var(--font-mono);
    letter-spacing: .17em;
    color: var(--muted)
}

.medium-feed-head h3 {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 46px);
    letter-spacing: -.05em;
    line-height: .94
}

.medium-feed-status {
    max-width: 48ch;
    text-align: right;
    color: var(--accent);
    text-wrap: balance
}

.medium-feed {
    position: relative;
    display: flex !important;
    grid-template-columns: none !important;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 2px 24px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 2px;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%)
}

.medium-feed::-webkit-scrollbar {
    display: none
}

.medium-feed[aria-busy="true"] {
    min-height: 360px
}

.medium-card {
    position: relative;
    flex: 0 0 clamp(250px, 25vw, 330px);
    min-width: 0;
    scroll-snap-align: start;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(160deg, color-mix(in srgb, var(--surface-strong) 91%, transparent), color-mix(in srgb, var(--surface) 72%, transparent));
    box-shadow: 0 20px 60px rgba(0, 0, 0, .12), inset 0 1px rgba(255, 255, 255, .045);
    transform: translateZ(0);
    transition: transform .55s cubic-bezier(.16, 1, .3, 1), border-color .35s ease, box-shadow .45s ease, background .45s ease
}

.medium-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from 210deg at 50% 50%, transparent 0 68%, color-mix(in srgb, var(--accent) 34%, transparent) 77%, color-mix(in srgb, var(--accent-2) 24%, transparent) 84%, transparent 92%);
    opacity: 0;
    transition: opacity .4s ease;
    mix-blend-mode: screen
}

.medium-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 16%, rgba(255, 255, 255, .06) 40%, transparent 58%);
    transform: translateX(-120%);
    transition: transform .9s cubic-bezier(.16, 1, .3, 1)
}

.medium-card:hover {
    transform: translateY(-7px) scale(1.012);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    box-shadow: 0 30px 90px color-mix(in srgb, var(--accent) 11%, rgba(0, 0, 0, .18)), 0 0 0 1px color-mix(in srgb, var(--accent) 7%, transparent), inset 0 1px rgba(255, 255, 255, .07)
}

.medium-card:hover::before {
    opacity: .8
}

.medium-card:hover::after {
    transform: translateX(120%)
}

.medium-card__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none
}

.medium-card__media {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: radial-gradient(circle at 30% 24%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 34%), linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), color-mix(in srgb, var(--accent-2) 9%, var(--surface)));
    border-bottom: 1px solid var(--line)
}

.medium-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .46), transparent 62%), radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .1), transparent 28%);
    pointer-events: none
}

.medium-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .9s cubic-bezier(.16, 1, .3, 1), filter .5s ease
}

.medium-card:hover .medium-card__media img {
    transform: scale(1.065);
    filter: saturate(1.1) contrast(1.02)
}

.medium-card__index, .medium-card__read {
    position: absolute;
    z-index: 4;
    top: 12px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(5, 7, 11, .52);
    backdrop-filter: blur(14px);
    color: #fff;
    font: 650 7px/1 var(--font-mono);
    letter-spacing: .12em
}

.medium-card__index {
    left: 12px
}

.medium-card__read {
    right: 12px;
    opacity: 0;
    transform: translateY(-5px);
    transition: .3s ease
}

.medium-card:hover .medium-card__read {
    opacity: 1;
    transform: none
}

.medium-card__badges {
    position: absolute;
    z-index: 5;
    left: 12px;
    bottom: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.medium-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    font: 750 7px/1 var(--font-mono);
    letter-spacing: .12em;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16)
}

.medium-badge--latest {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 84%, #07111f), color-mix(in srgb, var(--accent) 58%, #07111f));
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 34%, transparent)
}

.medium-badge--trending {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 82%, #1d0910), color-mix(in srgb, var(--accent-2) 55%, #1d0910));
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent-2) 32%, transparent)
}

.medium-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 248px
}

.medium-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font: 650 7px/1.3 var(--font-mono);
    letter-spacing: .12em
}

.medium-card h4 {
    margin: 16px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(19px, 1.8vw, 25px);
    line-height: 1.08;
    letter-spacing: -.035em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.medium-card p {
    margin: 0;
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.67;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.medium-card__tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 16px;
    overflow: hidden
}

.medium-card__tags span {
    flex: 0 0 auto;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font: 650 7px/1 var(--font-mono);
    letter-spacing: .07em
}

.medium-card--skeleton {
    flex: 0 0 clamp(250px, 25vw, 330px);
    height: 380px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    overflow: hidden
}

.medium-card--skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .055), transparent);
    animation: mediumSkeleton 1.5s infinite
}

.medium-card--skeleton div {
    height: 180px;
    border-radius: 14px;
    background: var(--surface-soft)
}

.medium-card--skeleton span {
    display: block;
    height: 15px;
    border-radius: 8px;
    background: var(--surface-soft)
}

.medium-card--skeleton span:nth-of-type(2) {
    width: 82%
}

.medium-card--skeleton span:nth-of-type(3) {
    width: 58%
}

@keyframes mediumSkeleton {
    100% {
        transform: translateX(100%)
    }
}

.medium-feed-fallback {
    flex: 1 0 100%;
    padding: 28px;
    border-radius: 22px
}

.medium-feed-fallback span {
    font: 650 8px/1 var(--font-mono);
    letter-spacing: .15em;
    color: var(--accent)
}

.medium-feed-fallback p {
    max-width: 58ch;
    color: var(--text-2);
    line-height: 1.7
}

.medium-rail-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px
}

.medium-rail-hint {
    margin-right: auto;
    color: var(--muted);
    font: 650 7px/1 var(--font-mono);
    letter-spacing: .16em
}

.medium-rail-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    color: var(--text);
    cursor: pointer;
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
    transition: transform .25s ease, border-color .25s ease, background .25s ease
}

.medium-rail-btn:hover, .medium-rail-btn:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
    outline: none
}

:root[data-theme="light"] .medium-card {
    box-shadow: 0 18px 46px rgba(20, 42, 70, .08), inset 0 1px rgba(255, 255, 255, .85)
}

:root[data-theme="light"] .medium-feed {
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%)
}

/* ==========================================================================\n   Advanced UI polish — keeps the existing palette, increases depth\n   ========================================================================== */
.glass-panel, .project-card, .experience-item, .credential-card, .stack-console, .extra-card, .contact-card {
    position: relative;
    isolation: isolate
}

.glass-panel::after, .project-card::after, .experience-item::after, .credential-card::after, .stack-console::after, .extra-card::after, .contact-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, .055), transparent 28%, transparent 70%, color-mix(in srgb, var(--accent) 5%, transparent));
    opacity: .68;
    mix-blend-mode: screen;
    z-index: 0
}

.glass-panel>*, .project-card>*, .experience-item>*, .credential-card>*, .stack-console>*, .extra-card>*, .contact-card>* {
    position: relative;
    z-index: 1
}

.section-heading h2 {
    position: relative;
    text-wrap: balance
}

.section-heading h2::after {
    content: "";
    display: inline-block;
    width: .18em;
    height: .18em;
    margin-left: .18em;
    border-radius: 50%;
    vertical-align: .12em;
    background: var(--accent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 58%, transparent)
}

.btn, .nav-theme, .mobile-menu-btn, .back-to-top {
    position: relative;
    overflow: hidden
}

.btn::after, .nav-theme::after, .mobile-menu-btn::after, .back-to-top::after {
    content: "";
    position: absolute;
    inset: -80% -35%;
    background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .14) 50%, transparent 62%);
    transform: translateX(-60%) rotate(8deg);
    transition: transform .75s cubic-bezier(.16, 1, .3, 1);
    pointer-events: none
}

.btn:hover::after, .nav-theme:hover::after, .mobile-menu-btn:hover::after, .back-to-top:hover::after {
    transform: translateX(60%) rotate(8deg)
}

@media(max-width:1100px) {
    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .medium-card {
        flex-basis: clamp(248px, 38vw, 320px)
    }
}

@media(max-width:860px) {
    .stack-console-head {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding-block: 14px
    }

    .stack-console-status {
        text-align: left;
        justify-content: flex-start
    }

    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: 280px
    }

    .medium-feed-head {
        align-items: flex-start;
        flex-direction: column
    }

    .medium-feed-status {
        text-align: left
    }

    .medium-card {
        flex-basis: min(76vw, 310px)
    }

    .medium-rail-controls {
        margin-top: 4px
    }
}

@media(max-width:560px) {
    .stack-console {
        border-radius: 20px
    }

    .stack-console-head {
        min-height: 78px
    }

    .stack-categories {
        padding: 8px
    }

    .stack-category {
        min-width: 170px;
        min-height: 46px
    }

    .skill-cloud {
        grid-template-columns: 1fr;
        padding: 34px 14px 18px
    }

    .skill-cloud::before {
        top: 12px;
        right: 14px
    }

    .skill-chip {
        min-height: 62px
    }

    .medium-feed-shell {
        margin-top: 44px
    }

    .medium-feed-head h3 {
        font-size: 32px
    }

    .medium-feed {
        gap: 11px;
        padding-bottom: 18px;
        mask-image: none
    }

    .medium-card {
        flex-basis: min(84vw, 292px);
        border-radius: 20px
    }

    .medium-card__body {
        min-height: 218px;
        padding: 16px
    }

    .medium-card h4 {
        font-size: 21px
    }

    .medium-card p {
        -webkit-line-clamp: 2
    }

    .medium-card__read {
        display: none
    }

    .medium-rail-hint {
        font-size: 6px;
        letter-spacing: .12em
    }

    .medium-rail-btn {
        width: 36px;
        height: 36px
    }
}

@media(max-width:380px) {
    .medium-card {
        flex-basis: 86vw
    }

    .medium-card__tags span:nth-child(n+3) {
        display: none
    }

    .medium-feed-head {
        gap: 12px
    }
}

@media(prefers-reduced-motion:reduce) {
    .stack-live-dot, .skill-chip, .medium-card--skeleton::after {
        animation: none !important
    }

    .medium-card, .medium-card__media img, .medium-card::after, .medium-rail-btn {
        transition: none !important
    }

    .medium-card:hover {
        transform: none
    }
}

/* ==========================================================================\n   V16 Responsive Fit & Density Pass\n   Keeps V15 design intact while preventing overflow/cut-off on all screens.\n   ========================================================================== */

/* Global containment safeguards */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

main, section, header, footer, nav, .container, .hero-content, .section-heading,
.about-grid, .project-grid, .experience-list, .stack-console, .stack-layout,
.credentials-columns, .insights-feature, .medium-feed-shell, .contact-container,
.contact-command-center, .contact-links {
    min-width: 0;
    max-width: 100%;
}

img, svg, canvas, video {
    max-width: 100%;
}

button, a, input, textarea, select {
    min-width: 0;
}

.section {
    overflow: clip;
}

.section-heading>*, .hero-content>*, .contact-header>* {
    min-width: 0;
}

.section-copy, .hero-tagline, .hero-summary, .experience-copy, .contact-summary,
.project-card p, .credential-card p, .medium-card p {
    overflow-wrap: anywhere;
}

/* Keep large editorial text inside viewport */
.hero-name {
    max-width: 100%;
    overflow: visible;
}

.hero-name__first, .hero-name__last {
    max-width: 100%;
}

.hero-tagline, .hero-summary {
    max-width: min(100%, 68ch);
}

/* Prevent transformed cards/canvases from widening layout */
.project-card, .glass-panel, .experience-row, .credential-card, .extra-card,
.software-card, .stack-console, .medium-card, .contact-link-card {
    contain: paint;
}

.ambient-canvas, .three-canvas, .theme-transition-canvas {
    max-width: 100vw;
}

/* Technical System: denser desktop/tablet layout without losing visual depth */
.stack-console {
    width: 100%;
    overflow: hidden;
}

.stack-layout {
    width: 100%;
}

.stack-categories {
    min-width: 0;
}

.skill-cloud {
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    padding: clamp(22px, 3.4vw, 46px);
}

.skill-chip {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding-inline: 12px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
}

.skill-chip__name {
    min-width: 0;
}

/* Medium rail: never expands document width; remains one row */
.medium-feed-shell {
    width: 100%;
    overflow: hidden;
}

.medium-feed-head {
    min-width: 0;
}

.medium-feed {
    width: 100%;
    max-width: 100%;
}

.medium-card {
    max-width: calc(100vw - 32px);
}

.medium-card__meta {
    min-width: 0;
}

.medium-card h4, .medium-card p {
    overflow-wrap: anywhere;
}

.medium-card__tags {
    min-width: 0;
}

/* Tablet */
@media (max-width: 1100px) {
    :root {
        --content-pad: clamp(20px, 3vw, 34px);
    }

    .hero-name {
        font-size: clamp(56px, 10.6vw, 108px);
    }

    .project-grid, .credentials-columns {
        gap: clamp(14px, 2.4vw, 22px);
    }

    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 28px 22px 24px;
    }

    .skill-chip {
        min-height: 58px;
    }

    .medium-card {
        flex-basis: clamp(236px, 34vw, 302px);
    }

    .medium-card__body {
        min-height: 224px;
    }
}

/* Tablet / large phone */
@media (max-width: 860px) {
    :root {
        --content-pad: clamp(16px, 3.8vw, 28px);
        --section-space: clamp(76px, 10vw, 112px);
    }

    .container {
        width: min(var(--content-max), calc(100% - (var(--content-pad) * 2)));
    }

    .hero {
        min-height: max(680px, 100svh);
    }

    .hero-content {
        width: 100%;
    }

    .hero-name {
        font-size: clamp(54px, 14vw, 96px);
        line-height: .79;
    }

    .hero-name__last {
        margin-left: clamp(8px, 3vw, 26px);
    }

    .hero-meta {
        display: none;
    }

    .section-heading {
        gap: 18px;
    }

    .section-heading p {
        max-width: 62ch;
    }

    .stack-console-head {
        min-height: auto;
        padding: 14px 16px;
    }

    .stack-console-status {
        width: 100%;
        gap: 6px 8px;
    }

    .stack-layout {
        min-height: 0;
    }

    .stack-categories {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;
    }

    .stack-category {
        flex: 0 0 auto;
        min-width: 145px;
        min-height: 44px;
        padding-inline: 10px;
        scroll-snap-align: start;
    }

    .stack-category strong {
        font-size: 11px;
    }

    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        min-height: 0;
        padding: 28px 14px 16px;
        align-content: start;
    }

    .skill-cloud::before {
        top: 10px;
        right: 14px;
        font-size: 7px;
    }

    .skill-chip {
        min-height: 54px;
        border-radius: 13px;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    .skill-chip img, .skill-chip__glyph {
        width: 24px;
        height: 24px;
        border-radius: 7px;
    }

    .skill-chip__state, .skill-chip__pulse {
        display: none;
    }

    .skill-chip__name {
        font-size: 11px;
    }

    .medium-feed-shell {
        margin-top: clamp(30px, 6vw, 48px);
    }

    .medium-feed-head {
        gap: 10px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .medium-feed-head h3 {
        font-size: clamp(28px, 6vw, 38px);
    }

    .medium-feed-status {
        max-width: 100%;
        font-size: 7px;
    }

    .medium-feed {
        gap: 10px;
        padding: 4px 0 16px;
        scroll-padding-inline: 0;
        mask-image: none;
    }

    .medium-card {
        flex-basis: clamp(220px, 58vw, 280px);
        max-width: 78vw;
        border-radius: 20px;
    }

    .medium-card__body {
        min-height: 188px;
        padding: 14px;
    }

    .medium-card h4 {
        margin: 11px 0 7px;
        font-size: clamp(17px, 3.6vw, 21px);
        -webkit-line-clamp: 2;
    }

    .medium-card p {
        font-size: 11.5px;
        line-height: 1.55;
        -webkit-line-clamp: 2;
    }

    .medium-card__tags {
        padding-top: 10px;
    }

    .medium-card__tags span {
        max-width: 96px;
        padding: 5px 7px;
    }

    .medium-card__meta {
        gap: 8px;
    }

    .medium-card__read {
        display: none;
    }

    .medium-rail-controls {
        gap: 8px;
    }
}

/* Phones */
@media (max-width: 560px) {
    :root {
        --content-pad: 14px;
        --section-space: 72px;
        --radius-xl: 22px;
        --radius-lg: 18px;
    }

    body {
        min-width: 0;
    }

    .container {
        width: calc(100% - 28px);
    }

    .section {
        padding-block: var(--section-space);
    }

    .site-header {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }

    .nav-inner {
        min-width: 0;
    }

    .hero {
        min-height: max(620px, 100svh);
    }

    .hero-content {
        padding-top: calc(var(--header-h) + 40px);
        padding-bottom: 48px;
    }

    .hero-name {
        width: 100%;
        font-size: clamp(42px, 14vw, 66px);
        line-height: .82;
        letter-spacing: -.055em;
    }

    .hero-name__last {
        margin-left: 6px;
    }

    .hero-name::before {
        left: -5px;
        height: 82%;
    }

    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-tagline {
        font-size: clamp(18px, 5.3vw, 24px);
    }

    .hero-summary {
        font-size: 13px;
    }

    .section-heading {
        margin-bottom: 30px;
    }

    .section-heading h2 {
        font-size: clamp(36px, 11vw, 54px);
    }

    .section-heading p {
        font-size: 13px;
        line-height: 1.65;
    }

    .about-grid, .project-grid, .credentials-columns, .contact-command-center {
        gap: 12px;
    }

    .profile-panel, .visual-panel, .project-card, .stack-console,
    .credential-card, .extra-card, .software-card {
        border-radius: 18px;
    }

    /* Skills: compact list rather than tall full-width modules */
    .stack-console-head {
        padding: 12px 12px 10px;
        gap: 8px;
    }

    .stack-console-title, .stack-console-status {
        font-size: 7px;
    }

    .stack-console-divider {
        display: none;
    }

    .stack-categories {
        gap: 6px;
        padding: 7px;
    }

    .stack-category {
        min-width: 118px;
        min-height: 38px;
        padding: 0 9px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        border-radius: 10px;
    }

    .stack-category strong {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stack-category em {
        font-size: 7px;
    }

    .stack-category::before {
        top: 8px;
        bottom: 8px;
    }

    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 25px 9px 10px;
    }

    .skill-cloud::before {
        top: 9px;
        right: 10px;
        font-size: 6px;
        letter-spacing: .12em;
    }

    .skill-chip {
        min-height: 44px;
        padding: 6px 8px;
        border-radius: 11px;
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 7px;
    }

    .skill-chip img, .skill-chip__glyph {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        font-size: 6px;
    }

    .skill-chip__name {
        font-size: 10px;
        font-weight: 650;
    }

    .skill-chip:hover, .skill-chip:focus-visible {
        transform: none;
    }

    /* Medium: compact horizontal cards, visible next-card cue, no oversized panels */
    .medium-feed-shell {
        margin-top: 32px;
    }

    .medium-feed-head {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .medium-feed-kicker, .medium-feed-status {
        font-size: 6px;
        letter-spacing: .12em;
    }

    .medium-feed-head h3 {
        margin-top: 6px;
        font-size: clamp(26px, 9vw, 34px);
    }

    .medium-feed {
        gap: 8px;
        padding: 2px 0 12px;
        scroll-snap-type: x mandatory;
    }

    .medium-card {
        flex-basis: min(72vw, 244px);
        max-width: min(72vw, 244px);
        border-radius: 16px;
        scroll-snap-align: start;
    }

    .medium-card__media {
        aspect-ratio: 16/8.2;
    }

    .medium-card__index {
        top: 8px;
        left: 8px;
        padding: 5px 7px;
    }

    .medium-card__badges {
        left: 8px;
        bottom: 8px;
        gap: 4px;
    }

    .medium-badge {
        min-height: 20px;
        padding-inline: 6px;
        font-size: 6px;
    }

    .medium-card__body {
        min-height: 148px;
        padding: 11px;
    }

    .medium-card__meta {
        font-size: 6px;
    }

    .medium-card h4 {
        margin: 9px 0 6px;
        font-size: 16px;
        line-height: 1.12;
        -webkit-line-clamp: 2;
    }

    .medium-card p {
        display: none;
    }

    .medium-card__tags {
        padding-top: 8px;
        gap: 4px;
    }

    .medium-card__tags span {
        max-width: 74px;
        padding: 4px 6px;
        font-size: 6px;
    }

    .medium-card__tags span:nth-child(n+3) {
        display: none;
    }

    .medium-card--skeleton {
        flex: 0 0 min(72vw, 244px);
        max-width: min(72vw, 244px);
        height: 250px;
        padding: 11px;
    }

    .medium-card--skeleton div {
        height: 110px;
    }

    .medium-rail-hint {
        font-size: 6px;
        letter-spacing: .09em;
    }

    .medium-rail-btn {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .contact-header, .contact-command-center, .contact-footer {
        min-width: 0;
    }

    .contact-name {
        overflow-wrap: anywhere;
    }

    .contact-link-card {
        min-width: 0;
    }

    .site-footer__inner {
        width: calc(100% - 28px);
        text-align: center;
    }

    .back-to-top {
        right: 12px;
        bottom: 12px;
        width: 48px;
        height: 48px;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    :root {
        --content-pad: 11px;
        --section-space: 64px;
    }

    .container {
        width: calc(100% - 22px);
    }

    .site-header {
        width: calc(100% - 16px);
        left: 8px;
        right: 8px;
    }

    .hero-name {
        font-size: clamp(38px, 13.8vw, 50px);
    }

    .hero-name__last {
        margin-left: 3px;
    }

    .section-heading h2 {
        font-size: clamp(33px, 10.8vw, 44px);
    }

    .skill-cloud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding-inline: 7px;
    }

    .skill-chip {
        min-height: 40px;
        padding: 5px 7px;
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .skill-chip img, .skill-chip__glyph {
        width: 18px;
        height: 18px;
    }

    .skill-chip__name {
        font-size: 9px;
    }

    .stack-category {
        min-width: 108px;
    }

    .medium-card {
        flex-basis: min(76vw, 226px);
        max-width: min(76vw, 226px);
    }

    .medium-card__body {
        min-height: 140px;
    }

    .medium-card h4 {
        font-size: 15px;
    }

    .medium-card--skeleton {
        flex-basis: min(76vw, 226px);
        max-width: min(76vw, 226px);
    }

    .medium-rail-hint {
        max-width: 145px;
        white-space: normal;
        line-height: 1.4;
    }
}

/* Wide monitors: prevent content becoming too stretched */
@media (min-width: 1600px) {
    :root {
        --content-max: 1240px;
    }

    .medium-card {
        flex-basis: 310px;
    }

    .skill-cloud {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================================
   V17 — Responsive density / navigation / back-to-top pass
   Keeps V16 visual language intact while eliminating excess
   Software & Tools height and viewport collisions.
   ========================================================= */

/* Global hardening for every viewport width. */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

main,
section,
.site-header,
.mobile-nav,
.container,
.stack-console,
.software-section,
.software-grid,
.software-card {
    min-width: 0;
    max-width: 100%;
}

/* ------------------------- Navigation ------------------------- */
.site-header {
    width: min(1240px, calc(100% - 28px));
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
    gap: clamp(10px, 1.5vw, 18px);
}

.desktop-nav {
    min-width: 0;
    max-width: 100%;
    justify-content: center;
    gap: clamp(0px, .45vw, 6px);
}

.desktop-nav a {
    flex: 0 1 auto;
    padding: 9px clamp(7px, .72vw, 11px);
    font-size: clamp(10px, .72vw, 12px);
    white-space: nowrap;
}

.header-actions {
    flex: 0 0 auto;
}

/* Switch to the mobile navigation before the desktop nav can crowd. */
@media (max-width:1180px) {
    .desktop-nav {
        display: none;
    }

    .menu-button {
        display: grid;
    }

    .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .header-actions {
        justify-self: end;
    }
}

.mobile-nav {
    padding:
        max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-nav-head {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 16px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.mobile-nav-links {
    width: min(680px, 100%);
    margin: clamp(18px, 5vh, 42px) auto 0;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: clamp(54px, 9vh, 78px);
    padding: clamp(12px, 2.6vh, 20px) 2px;
    font-size: clamp(24px, 7vw, 48px);
    line-height: .95;
}

.mobile-nav-links a::after {
    content: "↗";
    flex: 0 0 auto;
    margin-left: 16px;
    color: var(--muted);
    font: 500 .42em/1 var(--font-mono);
    transition: transform .25s var(--ease-out), color .25s ease;
}

.mobile-nav-links a:hover::after,
.mobile-nav-links a:focus-visible::after {
    transform: translate(4px, -4px);
    color: var(--accent);
}

body.nav-open {
    overflow: hidden;
}

body.nav-open .back-to-top {
    pointer-events: none;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ------------------- Software & Tools density ------------------ */
.software-section {
    margin-top: clamp(24px, 4vw, 42px);
}

.software-section .subheading {
    margin-bottom: 12px;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.software-card {
    min-height: 58px;
    padding: 9px 10px;
    gap: 9px;
    border-radius: 13px;
    overflow: hidden;
}

.software-card img {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.software-card span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.2;
}

.software-card:hover {
    transform: translateY(-2px);
}

@media (min-width:1440px) {
    .software-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width:1100px) {
    .software-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .software-card {
        min-height: 56px;
    }
}

@media (max-width:760px) {
    .software-section {
        margin-top: 22px;
    }

    .software-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .software-card {
        min-height: 48px;
        padding: 7px 8px;
        border-radius: 11px;
    }

    .software-card img {
        width: 16px;
        height: 16px;
    }

    .software-card span {
        font-size: 10px;
    }
}

@media (max-width:480px) {
    .software-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .software-card {
        min-height: 44px;
        padding: 6px 7px;
        gap: 7px;
    }

    .software-card span {
        font-size: 9px;
    }
}

/* ----------------------- Back to top --------------------------- */
.back-to-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    border-radius: 15px;
    grid-template-rows: 1fr auto;
    padding: 7px 5px 6px;
    touch-action: manipulation;
}

.back-to-top__icon {
    font-size: 19px;
    align-self: end;
}

.back-to-top__label {
    font-size: 6px;
    letter-spacing: .13em;
}

@media (max-width:820px) {
    .back-to-top {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .back-to-top__icon {
        font-size: 17px;
    }
}

@media (max-width:560px) {
    .site-header {
        top: max(8px, env(safe-area-inset-top));
        width: calc(100% - 16px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        min-height: 54px;
        padding: 6px 7px 6px 9px;
        border-radius: 15px;
    }

    .brand {
        gap: 8px;
        max-width: calc(100vw - 112px);
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    #brandName {
        max-width: min(42vw, 150px);
        font-size: 10px;
    }

    #brandTitle {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .icon-button {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .mobile-nav-links a {
        min-height: 58px;
        font-size: clamp(26px, 10vw, 40px);
    }

    .back-to-top {
        right: max(9px, env(safe-area-inset-right));
        bottom: max(9px, env(safe-area-inset-bottom));
        width: 42px;
        height: 42px;
        padding: 5px 4px;
        border-radius: 12px;
    }

    .back-to-top__icon {
        font-size: 15px;
    }

    .back-to-top__label {
        font-size: 5.5px;
    }
}

@media (max-width:360px) {
    #brandName {
        max-width: 112px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .icon-button {
        width: 32px;
        height: 32px;
    }

    .mobile-nav {
        padding-inline: 14px;
    }

    .mobile-nav-links a {
        min-height: 54px;
    }
}

/* ------------------------ Footer version ----------------------- */
.site-footer__version {
    margin-left: auto;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    font: 600 7px/1 var(--font-mono);
    letter-spacing: .12em;
}

@media (max-width:560px) {
    .site-footer__version {
        margin: 4px auto 0;
    }
}

/* =========================================================
   V18 — Responsive-only refinement
   Scope: back-to-top, hero name fit, Medium card length.
   All other V17 visuals/behavior intentionally unchanged.
   ========================================================= */

/* ---------- 1) Back-to-top: premium compact responsive control ---------- */
.back-to-top {
    --top-size: 54px;
    --top-ring: color-mix(in srgb, var(--accent) 58%, transparent);
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: var(--top-size);
    height: var(--top-size);
    padding: 0;
    display: grid;
    place-items: center;
    grid-template-rows: 1fr;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent) 18%);
    background:
        radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .09), transparent 38%),
        color-mix(in srgb, var(--surface-strong) 92%, transparent);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, .18),
        0 0 0 1px color-mix(in srgb, var(--accent) 7%, transparent),
        inset 0 1px rgba(255, 255, 255, .07);
    backdrop-filter: blur(18px) saturate(1.28);
    -webkit-backdrop-filter: blur(18px) saturate(1.28);
    isolation: isolate;
}

.back-to-top::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    border: 1px solid transparent;
    background: conic-gradient(from 210deg, transparent 0 68%, var(--top-ring) 80%, transparent 92%) border-box;
    -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .72;
    pointer-events: none;
    transition: opacity .28s ease, transform .4s var(--ease-out);
}

.back-to-top__icon {
    position: relative;
    z-index: 2;
    align-self: auto;
    font-size: 20px;
    line-height: 1;
    transform: translateY(0);
}

.back-to-top__label {
    position: absolute;
    left: 50%;
    bottom: 7px;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 5.5px;
    line-height: 1;
    letter-spacing: .14em;
    color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.back-to-top:hover,
.back-to-top:focus-visible {
    transform: translateY(-4px) scale(1.035);
    border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
    box-shadow:
        0 20px 52px color-mix(in srgb, var(--accent) 14%, rgba(0, 0, 0, .18)),
        0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
        inset 0 1px rgba(255, 255, 255, .1);
    outline: none;
}

.back-to-top:hover::before,
.back-to-top:focus-visible::before {
    opacity: 1;
    transform: rotate(18deg);
}

.back-to-top:hover .back-to-top__icon,
.back-to-top:focus-visible .back-to-top__icon {
    transform: translateY(-2px);
}

:root[data-theme="light"] .back-to-top {
    box-shadow: 0 14px 34px rgba(20, 42, 70, .12), inset 0 1px rgba(255, 255, 255, .9);
}

/* ---------- 2) Hero name: never clip on tablet/mobile ---------- */
.hero-copy,
.hero-name,
.hero-name__first,
.hero-name__last {
    min-width: 0;
    max-width: 100%;
}

.hero-name {
    width: fit-content;
    max-width: min(100%, 11.4ch);
    overflow: visible;
    text-wrap: nowrap;
    transform-origin: left center;
}

.hero-name__first,
.hero-name__last {
    width: fit-content;
    white-space: nowrap;
}

/* tablet / compact desktop */
@media (max-width: 1100px) {
    .hero-name {
        font-size: clamp(56px, 9.8vw, 104px);
        letter-spacing: -.066em;
        max-width: 100%;
    }

    .hero-name__last {
        margin-left: clamp(10px, 2.8vw, 30px);
    }
}

/* tablet portrait / large phone */
@media (max-width: 860px) {
    .hero-copy {
        width: 100%;
        max-width: 100%;
    }

    .hero-name {
        width: 100%;
        max-width: 100%;
        font-size: clamp(50px, 12.8vw, 86px);
        line-height: .8;
        letter-spacing: -.058em;
    }

    .hero-name__last {
        margin-left: clamp(6px, 1.8vw, 16px);
    }

    .hero-name::before {
        left: -4px;
    }
}

/* phones */
@media (max-width: 560px) {
    .hero-copy {
        overflow: visible;
    }

    .hero-name {
        width: 100%;
        max-width: calc(100vw - 28px);
        font-size: clamp(40px, 13.15vw, 62px);
        line-height: .82;
        letter-spacing: -.048em;
    }

    .hero-name__first,
    .hero-name__last {
        max-width: 100%;
    }

    .hero-name__last {
        margin-left: 2px;
    }

    .hero-name::before {
        left: -2px;
        width: 1px;
    }
}

/* narrow phones */
@media (max-width: 380px) {
    .hero-name {
        max-width: calc(100vw - 22px);
        font-size: clamp(36px, 12.8vw, 46px);
        letter-spacing: -.042em;
    }

    .hero-name__last {
        margin-left: 0;
    }
}

/* ---------- 3) Latest from Medium: slightly longer cards ---------- */
.medium-card,
.medium-card--skeleton {
    flex-basis: clamp(272px, 27vw, 350px);
}

@media (max-width: 1100px) {

    .medium-card,
    .medium-card--skeleton {
        flex-basis: clamp(254px, 37vw, 326px);
    }
}

@media (max-width: 860px) {

    .medium-card,
    .medium-card--skeleton {
        flex-basis: clamp(244px, 62vw, 300px);
        max-width: 82vw;
    }
}

@media (max-width: 560px) {

    .medium-card,
    .medium-card--skeleton {
        flex-basis: min(78vw, 266px);
        max-width: min(78vw, 266px);
    }

    .medium-card__body {
        min-height: 154px;
    }
}

@media (max-width: 380px) {

    .medium-card,
    .medium-card--skeleton {
        flex-basis: min(80vw, 242px);
        max-width: min(80vw, 242px);
    }
}

/* ---------- responsive top button scaling ---------- */
@media (max-width: 860px) {
    .back-to-top {
        --top-size: 48px;
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .back-to-top__icon {
        font-size: 18px;
    }

    .back-to-top__label {
        bottom: 6px;
        font-size: 5px;
    }
}

@media (max-width: 560px) {
    .back-to-top {
        --top-size: 44px;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        border-radius: 50%;
    }

    .back-to-top__icon {
        font-size: 16px;
    }

    .back-to-top__label {
        bottom: 5px;
        font-size: 4.8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top::before {
        transition: none;
    }
}

/* =========================================================
   V19 — Back-to-top command orb only
   Everything else intentionally inherited unchanged from V18.
   ========================================================= */
.back-to-top {
    --top-size: 64px;
    --top-progress: 0deg;
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 980;
    width: var(--top-size);
    height: var(--top-size);
    padding: 0;
    border: 0;
    border-radius: 22px;
    isolation: isolate;
    display: grid;
    place-items: center;
    overflow: visible;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 18px, 0) scale(.86) rotate(4deg);
    transition:
        opacity .32s ease,
        visibility .32s ease,
        transform .5s cubic-bezier(.16, 1, .3, 1),
        filter .28s ease;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .24));
    -webkit-tap-highlight-color: transparent;
}

/* outer progress halo */
.back-to-top::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -2;
    border-radius: 25px;
    background:
        conic-gradient(from -90deg,
            var(--accent) 0deg,
            var(--accent-2) var(--top-progress),
            color-mix(in srgb, var(--line) 68%, transparent) var(--top-progress),
            color-mix(in srgb, var(--line) 68%, transparent) 360deg);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--accent) 16%, transparent),
        0 0 46px color-mix(in srgb, var(--accent-2) 8%, transparent);
    transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
    pointer-events: none;
}

/* glass body — intentionally overrides the generic sheen pseudo-element */
.back-to-top::after {
    content: "";
    position: absolute;
    inset: 2px;
    z-index: -1;
    border-radius: 19px;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .14), transparent 33%),
        linear-gradient(145deg,
            color-mix(in srgb, var(--surface-strong) 94%, transparent),
            color-mix(in srgb, var(--surface) 82%, transparent));
    border: 1px solid color-mix(in srgb, var(--line) 84%, var(--accent) 16%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .10),
        inset 0 -10px 24px rgba(0, 0, 0, .08);
    backdrop-filter: blur(20px) saturate(1.35);
    -webkit-backdrop-filter: blur(20px) saturate(1.35);
    transform: none;
    transition: border-color .28s ease, background .28s ease;
    pointer-events: none;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
}

.back-to-top__icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-top: -7px;
    border-radius: 50%;
    font: 500 20px/1 var(--font-ui);
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), background .28s ease;
}

.back-to-top__label {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    white-space: nowrap;
    font: 700 6px/1 var(--font-mono);
    letter-spacing: .18em;
    color: var(--muted);
    transition: color .28s ease, transform .35s cubic-bezier(.16, 1, .3, 1);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    transform: translate3d(0, -5px, 0) scale(1.045);
    filter: drop-shadow(0 22px 44px color-mix(in srgb, var(--accent) 20%, rgba(0, 0, 0, .18)));
    outline: none;
}

.back-to-top:hover::before,
.back-to-top:focus-visible::before {
    transform: rotate(10deg) scale(1.035);
    box-shadow:
        0 0 30px color-mix(in srgb, var(--accent) 24%, transparent),
        0 0 58px color-mix(in srgb, var(--accent-2) 13%, transparent);
}

.back-to-top:hover::after,
.back-to-top:focus-visible::after {
    transform: none;
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.back-to-top:hover .back-to-top__icon,
.back-to-top:focus-visible .back-to-top__icon {
    transform: translateY(-3px);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.back-to-top:hover .back-to-top__label,
.back-to-top:focus-visible .back-to-top__label {
    color: var(--text-2);
    transform: translateX(-50%) translateY(-1px);
}

:root[data-theme="light"] .back-to-top {
    filter: drop-shadow(0 16px 28px rgba(28, 55, 88, .16));
}

:root[data-theme="light"] .back-to-top::after {
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .96), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(238, 244, 252, .88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -8px 18px rgba(33, 73, 120, .04);
}

@media (max-width: 1100px) {
    .back-to-top {
        --top-size: 58px;
        right: max(18px, env(safe-area-inset-right));
        bottom: max(18px, env(safe-area-inset-bottom));
        border-radius: 20px;
    }

    .back-to-top::before {
        border-radius: 23px;
    }

    .back-to-top::after {
        border-radius: 17px;
    }

    .back-to-top__icon {
        width: 26px;
        height: 26px;
        font-size: 18px;
        margin-top: -6px;
    }

    .back-to-top__label {
        bottom: 9px;
        font-size: 5.7px;
    }
}

@media (max-width: 560px) {
    .back-to-top {
        --top-size: 52px;
        right: max(12px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        border-radius: 18px;
    }

    .back-to-top::before {
        inset: -2px;
        border-radius: 20px;
    }

    .back-to-top::after {
        inset: 2px;
        border-radius: 15px;
    }

    .back-to-top__icon {
        width: 23px;
        height: 23px;
        font-size: 16px;
        margin-top: -6px;
    }

    .back-to-top__label {
        bottom: 8px;
        font-size: 5px;
        letter-spacing: .15em;
    }
}

@media (max-width: 380px) {
    .back-to-top {
        --top-size: 48px;
        right: max(9px, env(safe-area-inset-right));
        bottom: max(11px, env(safe-area-inset-bottom));
    }

    .back-to-top__icon {
        width: 21px;
        height: 21px;
        font-size: 15px;
    }

    .back-to-top__label {
        bottom: 7px;
        font-size: 4.6px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .back-to-top,
    .back-to-top::before,
    .back-to-top::after,
    .back-to-top__icon,
    .back-to-top__label {
        transition: none !important;
    }
}

/* Shared premium heading treatment */
.about-section,
.work-section,
.experience-section,
.stack-section,
.credentials-section,
.insights-section,
.contact-section {
    --section-title-a: var(--accent);
    --section-title-b: var(--accent-2);
    --section-title-glow: color-mix(in srgb, var(--accent) 18%, transparent);
}

.section-heading h2,
.contact-name {
    position: relative;
    isolation: isolate;
    text-wrap: balance;
    -webkit-font-smoothing: antialiased;
}

/* Keep the first phrase crisp and let the emphasis carry the section colour. */
.section-heading h2 {
    color: color-mix(in srgb, var(--text) 92%, var(--section-title-a) 8%);
    text-shadow:
        0 1px 0 color-mix(in srgb, var(--text) 10%, transparent),
        0 16px 52px var(--section-title-glow);
}

.section-heading h2 em {
    display: inline;
    color: transparent;
    background:
        linear-gradient(112deg,
            var(--section-title-a) 0%,
            color-mix(in srgb, var(--section-title-a) 58%, var(--section-title-b)) 48%,
            var(--section-title-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 650;
    text-shadow: none;
}

/* Tiny editorial accent tied to each section palette. */
.section-heading>div::after {
    content: "";
    display: block;
    width: clamp(46px, 5vw, 72px);
    height: 2px;
    margin-top: clamp(13px, 1.5vw, 18px);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--section-title-a), var(--section-title-b));
    box-shadow: 0 0 18px var(--section-title-glow);
    opacity: .86;
    transform-origin: left center;
}

/* Section-specific colour identities — all remain inside the existing blue/pink family. */
.about-section {
    --section-title-a: #58b7ff;
    --section-title-b: #8f7cff;
    --section-title-glow: color-mix(in srgb, #58b7ff 20%, transparent);
}

.work-section {
    --section-title-a: #4aa3ff;
    --section-title-b: #b06cff;
    --section-title-glow: color-mix(in srgb, #4aa3ff 22%, transparent);
}

.experience-section {
    --section-title-a: #ff6680;
    --section-title-b: #7e8dff;
    --section-title-glow: color-mix(in srgb, #ff6680 19%, transparent);
}

.stack-section {
    --section-title-a: #4cc9c0;
    --section-title-b: #4aa3ff;
    --section-title-glow: color-mix(in srgb, #4cc9c0 18%, transparent);
}

.credentials-section {
    --section-title-a: #8f7cff;
    --section-title-b: #ff6680;
    --section-title-glow: color-mix(in srgb, #8f7cff 18%, transparent);
}

.insights-section {
    --section-title-a: #c66cff;
    --section-title-b: #ff5a76;
    --section-title-glow: color-mix(in srgb, #c66cff 20%, transparent);
}

/* Contact title: stronger statement treatment while retaining the existing palette. */
.contact-section {
    --section-title-a: #4aa3ff;
    --section-title-b: #ff5a76;
    --section-title-glow: color-mix(in srgb, #4aa3ff 22%, transparent);
}

.contact-name {
    max-width: 10ch;
    color: transparent;
    background:
        linear-gradient(110deg,
            var(--section-title-a) 0%,
            color-mix(in srgb, var(--section-title-a) 52%, var(--section-title-b)) 52%,
            var(--section-title-b) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 18px 44px var(--section-title-glow));
}

.contact-heading-block::after {
    content: "";
    display: block;
    width: clamp(62px, 7vw, 104px);
    height: 2px;
    margin-top: clamp(16px, 1.8vw, 22px);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--section-title-a), var(--section-title-b));
    box-shadow: 0 0 22px var(--section-title-glow);
}

/* Light mode: preserve saturation while increasing text separation against pale surfaces. */
:root[data-theme="light"] .section-heading h2 {
    color: color-mix(in srgb, var(--text) 94%, var(--section-title-a) 6%);
    text-shadow: 0 14px 42px color-mix(in srgb, var(--section-title-a) 10%, transparent);
}

:root[data-theme="light"] .section-heading h2 em,
:root[data-theme="light"] .contact-name {
    filter: saturate(.96) contrast(1.04);
}

/* Responsive: keep decoration proportional and avoid wrapping artefacts. */
@media (max-width: 860px) {
    .section-heading>div::after {
        width: 52px;
        margin-top: 12px;
    }

    .contact-name {
        max-width: 11ch;
    }

    .contact-heading-block::after {
        width: 68px;
        margin-top: 14px;
    }
}

@media (max-width: 560px) {
    .section-heading h2 em {
        font-weight: 670;
    }

    .section-heading>div::after {
        width: 44px;
        height: 2px;
        margin-top: 10px;
    }

    .contact-name {
        max-width: 100%;
    }

    .contact-heading-block::after {
        width: 54px;
        margin-top: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .section-heading h2,
    .section-heading h2 em,
    .contact-name {
        text-shadow: none;
        filter: none;
    }
}