/* ===================== Tokens ===================== */
:root {
    --font-sans: "Work Sans", system-ui, sans-serif;
    --font-display: "JetBrains Mono", ui-monospace, monospace;

    --background: oklch(98.7% .002 247);
    --foreground: oklch(24.3% .024 249);
    --primary: oklch(62.3% .188 260);
    --primary-hover: oklch(57% .19 260);
    --primary-foreground: oklch(100% 0 0);
    --secondary: oklch(94% .009 253);
    --muted: oklch(96% .005 250);
    --muted-foreground: oklch(51% .022 250);
    --accent: oklch(94% .023 253);
    --border: oklch(90% .009 250);
    --paper: oklch(100% 0 0);
    --blue-surface: oklch(95% .025 255);
    --mint-surface: oklch(94% .03 163);
    --mint-ink: oklch(39% .07 165);
    --terminal: oklch(24% .013 250);
    --terminal-text: oklch(89% .009 250);
    --success: oklch(80% .13 153);
    --hero-grid: oklch(89% .012 250 / .43);
    --soft-shadow: 0 15px 40px oklch(30% .02 250 / .08);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --background: oklch(17.5% .014 255);
    --foreground: oklch(93% .008 250);
    --primary: oklch(68% .17 260);
    --primary-hover: oklch(73% .15 260);
    --primary-foreground: oklch(100% 0 0);
    --secondary: oklch(24% .018 255);
    --muted: oklch(25% .016 255);
    --muted-foreground: oklch(70% .02 250);
    --accent: oklch(27% .03 258);
    --border: oklch(30% .018 255);
    --paper: oklch(21% .016 255);
    --blue-surface: oklch(23% .04 260);
    --mint-surface: oklch(25% .035 165);
    --mint-ink: oklch(83% .1 163);
    --terminal: oklch(13% .01 250);
    --terminal-text: oklch(89% .009 250);
    --success: oklch(80% .13 153);
    --hero-grid: oklch(32% .02 255 / .45);
    --soft-shadow: 0 15px 40px oklch(5% .01 250 / .45);

    color-scheme: dark;
}

/* Fallback when JS is off: follow the system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --background: oklch(17.5% .014 255);
        --foreground: oklch(93% .008 250);
        --primary: oklch(68% .17 260);
        --primary-hover: oklch(73% .15 260);
        --secondary: oklch(24% .018 255);
        --muted: oklch(25% .016 255);
        --muted-foreground: oklch(70% .02 250);
        --accent: oklch(27% .03 258);
        --border: oklch(30% .018 255);
        --paper: oklch(21% .016 255);
        --blue-surface: oklch(23% .04 260);
        --mint-surface: oklch(25% .035 165);
        --mint-ink: oklch(83% .1 163);
        --terminal: oklch(13% .01 250);
        --hero-grid: oklch(32% .02 255 / .45);
        --soft-shadow: 0 15px 40px oklch(5% .01 250 / .45);
        color-scheme: dark;
    }
}

/* ===================== Base ===================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 760px) {
    html {
        scroll-padding-top: 72px;
    }
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s, color .25s;
}

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

img,
svg {
    display: block;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

h1,
h2,
h3 {
    font-weight: inherit;
    font-size: inherit;
}

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

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-width {
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 32px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
}

.skip-link:focus {
    top: 16px;
}

/* ===================== Buttons ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding-inline: 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .2s, color .2s, border-color .2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: var(--background);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--accent);
}

.btn-sm {
    height: 36px;
    padding-inline: 16px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ===================== Header ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 88px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklch, var(--background) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
}

.logo {
    display: inline-flex;
    color: var(--foreground);
    transition: color .2s, transform .3s;
}

.logo svg {
    width: auto;
    height: 38px;
    fill: currentColor;
}

.logo:hover {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 36px;
    font-size: 14px;
    color: var(--muted-foreground);
}

.main-nav a {
    position: relative;
    padding: 10px 0;
    transition: color .2s;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--primary);
}

.main-nav a.is-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: calc(50% - 2px);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

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

.nav-contact {
    height: 40px;
    background: transparent;
}

.theme-toggle,
.menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: background-color .2s, color .2s;
}

.theme-toggle:hover,
.menu-toggle:hover {
    background: var(--accent);
    color: var(--foreground);
}

.theme-toggle .icon,
.menu-toggle .icon {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

.menu-toggle,
.mobile-contact {
    display: none;
}

/* ===================== Hero ===================== */
.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background-image:
        linear-gradient(var(--hero-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
    background-size: 64px 64px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 44px;
    min-height: 595px;
    padding-top: 60px;
    padding-bottom: 70px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--muted-foreground);
}

.availability {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    font-size: 11px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 var(--primary);
    animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
    0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--primary) 55%, transparent); }
    70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

.hero h1 {
    font: 600 58px/1.18 var(--font-display);
    margin-bottom: 17px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-role {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-size: 18px;
}

.hero-role > span {
    color: var(--primary);
}

.hero-copy {
    max-width: 450px;
    color: var(--muted-foreground);
    font-size: 16px;
    line-height: 1.85;
}

.hero-copy strong {
    color: var(--foreground);
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-social {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-top: 28px;
    color: var(--muted-foreground);
}

.hero-social a {
    transition: color .2s;
}

.hero-social a:hover {
    color: var(--primary);
}

.hero-social .icon {
    width: 18px;
    height: 18px;
}

.hero-social .divider {
    width: 1px;
    height: 15px;
    background: var(--border);
}

.hero-social p {
    font-size: 11px;
}

.portrait-scene {
    position: relative;
    width: 370px;
    max-width: 100%;
    margin-left: auto;
    padding: 22px 18px 30px;
}

.portrait-frame {
    aspect-ratio: .95;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--secondary);
    box-shadow: var(--soft-shadow);
    transform: rotate(3deg);
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.portrait-scene:hover .portrait-frame {
    transform: rotate(0deg);
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(-3deg) scale(1.08);
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.portrait-scene:hover .portrait-frame img {
    transform: rotate(0deg) scale(1.04);
}

.code-label {
    position: absolute;
    top: 0;
    left: -24px;
    z-index: 1;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--paper);
    box-shadow: var(--soft-shadow);
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--muted-foreground);
}

.code-label span {
    color: var(--primary);
}

.portrait-caption {
    position: absolute;
    bottom: 0;
    right: -3px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 22px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--paper);
    box-shadow: var(--soft-shadow);
}

.portrait-caption > .icon {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.portrait-caption strong {
    display: block;
    font-size: 12px;
    font-weight: 500;
}

.portrait-caption span {
    display: block;
    margin-top: 4px;
    font: 10px var(--font-display);
    color: var(--muted-foreground);
}

/* ===================== Stack strip ===================== */
.stack-strip {
    border-bottom: 1px solid var(--border);
    background: var(--paper);
}

.stack-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 88px;
}

.stack-label {
    font: 10px var(--font-display);
    color: var(--muted-foreground);
    white-space: nowrap;
}

.stack-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.stack-item .icon {
    width: 17px;
    height: 17px;
    color: var(--muted-foreground);
}

.java-symbol {
    color: var(--primary);
    font-size: 23px;
    line-height: 1;
}

/* ===================== Sections ===================== */
.section {
    padding-top: 76px;
    padding-bottom: 76px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.section-heading h2 {
    margin-top: 10px;
    font: 500 30px/1.4 var(--font-display);
}

.section-heading h2 span {
    color: var(--primary);
}

.section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 5px;
    font-size: 12px;
    color: var(--muted-foreground);
    transition: color .2s, gap .2s;
}

.section-link:hover {
    color: var(--primary);
    gap: 11px;
}

/* ===================== Project cards ===================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--paper);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--soft-shadow);
}

.project-card[hidden] {
    display: none;
}

.project-visual {
    display: flex;
    flex-direction: column;
    height: 220px;
    padding: 19px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: 8px var(--font-display);
    opacity: .75;
}

.preview-top > span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.preview-top .icon {
    width: 12px;
    height: 12px;
}

.tiny-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* EvT */
.visual-events {
    background: var(--blue-surface);
    color: var(--primary);
}

.event-logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 80px/1 var(--font-display);
}

.event-logo > span:first-child {
    color: var(--foreground);
}

.event-asterisk {
    margin-left: 10px;
    font-size: 42px;
    font-weight: 400;
    transition: transform .6s;
}

.project-card:hover .event-asterisk {
    transform: rotate(90deg);
}

.architecture {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.architecture > span {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--paper);
    font: 8px var(--font-display);
    color: var(--foreground);
}

.architecture .icon {
    width: 11px;
    height: 11px;
}

/* ExpenseGate */
.visual-expenses {
    background: var(--mint-surface);
    color: var(--mint-ink);
}

.expense-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px;
}

.expense-title > span {
    font-size: 24px;
    line-height: 1.3;
}

.expense-title strong {
    font-weight: 600;
}

.expense-title > .icon {
    width: 68px;
    height: 68px;
    stroke-width: 1;
}

.api-line {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 10px;
    border-radius: 4px;
    background: var(--paper);
    font: 9px var(--font-display);
}

.api-line > span:first-child {
    font-weight: 700;
}

.api-ok {
    margin-left: auto;
    font-size: 8px;
}

/* Tests & QA */
.visual-tests {
    background: var(--terminal);
    color: var(--terminal-text);
}

.test-terminal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    font: 10px var(--font-display);
}

.test-terminal > span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-terminal .icon {
    width: 12px;
    height: 12px;
    color: var(--success);
}

.terminal-muted {
    opacity: .5;
}

.test-terminal strong {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid color-mix(in oklch, var(--terminal-text) 15%, transparent);
    color: var(--success);
    font-weight: 400;
}

/* Monify (featured) */
.project-featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.project-featured .project-visual {
    height: auto;
    min-height: 320px;
    border-bottom: 0;
    border-right: 1px solid var(--border);
}

.project-featured h3 {
    justify-content: flex-start;
}

.project-featured .project-content p {
    min-height: 0;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 3px 7px;
    border-radius: 3px;
    background: var(--mint-surface);
    color: var(--mint-ink);
    text-transform: none;
}

.project-status .status-dot {
    width: 5px;
    height: 5px;
    background: currentColor;
}

.project-highlights {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    list-style: none;
    font-size: 12px;
    line-height: 1.6;
}

.project-highlights li {
    display: flex;
    gap: 8px;
}

.project-highlights .icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    color: var(--primary);
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.visual-monify {
    background: var(--mint-surface);
    color: var(--mint-ink);
}

.visual-monify .preview-top {
    margin-bottom: 16px;
}

.browser {
    display: flex;
    flex-direction: column;
    margin-block: auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: var(--soft-shadow);
    transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}

.project-featured:hover .browser {
    transform: translateY(-3px) scale(1.01);
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding-inline: 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.browser-bar i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
}

.browser-bar span {
    margin-left: 8px;
    font: 9px var(--font-display);
    color: var(--muted-foreground);
}

.browser img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top left;
}

/* Other projects */
.visual-other {
    align-items: center;
    background: var(--secondary);
    color: var(--foreground);
}

.visual-other .preview-top {
    align-self: stretch;
}

.other-project-icon.icon {
    width: 70px;
    height: 70px;
    margin: 25px 0 15px;
    stroke-width: 1;
    color: var(--primary);
    transition: transform .3s;
}

.project-card:hover .other-project-icon {
    transform: scale(1.06);
}

.other-project-name {
    font: 500 19px var(--font-display);
}

.other-project-name span {
    color: var(--primary);
    animation: blink 1.1s steps(1) infinite;
}

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

.project-content {
    padding: 23px;
}

.project-category {
    font: 9px var(--font-display);
    color: var(--muted-foreground);
    text-transform: uppercase;
}

.project-content h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
    font: 500 17px var(--font-display);
}

.project-content h3 .icon {
    width: 17px;
    height: 17px;
    color: var(--muted-foreground);
    transition: color .2s, transform .2s;
}

.project-card:hover h3 .icon {
    color: var(--primary);
    transform: translate(2px, -2px);
}

.project-content p {
    min-height: 71px;
    margin-top: 13px;
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 1.8;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 19px;
    list-style: none;
}

.project-tags li {
    padding: 5px 6px;
    border-radius: 3px;
    background: var(--muted);
    font: 9px var(--font-display);
    color: var(--muted-foreground);
}

/* ===================== Projects filter ===================== */
.all-projects {
    padding-top: 76px;
}

.section-intro {
    max-width: 560px;
    margin-top: 12px;
    color: var(--muted-foreground);
    font-size: 15px;
    line-height: 1.8;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.filter-bar button {
    height: 36px;
    padding-inline: 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color .2s, color .2s;
}

.filter-bar button:hover {
    background: var(--accent);
}

.filter-bar button span {
    font: 10px var(--font-display);
    color: var(--muted-foreground);
}

.filter-bar button[aria-pressed="true"] {
    background: var(--primary);
    color: var(--primary-foreground);
}

.filter-bar button[aria-pressed="true"] span {
    color: inherit;
    opacity: .8;
}

/* ===================== About ===================== */
.about-section {
    border-block: 1px solid var(--border);
    background: var(--paper);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 70px;
}

.about-intro {
    align-self: start;
    position: sticky;
    top: 120px;
}

.about-intro > p {
    margin-bottom: 18px;
    color: var(--muted-foreground);
    font-size: 15px;
    line-height: 1.9;
}

.stats {
    list-style: none;
    margin-top: 30px;
}

.stats li {
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.stats li:first-child {
    border-top: 1px solid var(--border);
}

.stats strong {
    font: 600 32px/1 var(--font-display);
    color: var(--primary);
}

.stats span {
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 1.65;
}

.block-title {
    margin-bottom: 20px;
    font: 500 18px var(--font-display);
}

.about-timeline .education-list {
    margin-bottom: 28px;
}

.experience-item {
    margin-bottom: 28px;
    padding: 5px 0 5px 20px;
    border-left: 2px solid var(--primary);
}

.experience-item:last-of-type {
    margin-bottom: 40px;
}

.experience-item h3 {
    font-size: 16px;
    font-weight: 500;
}

.experience-item > span {
    display: block;
    margin-top: 7px;
    font: 10px var(--font-display);
    color: var(--primary);
}

.experience-item ul {
    margin-top: 10px;
    padding-left: 18px;
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 1.8;
}

.experience-item li + li {
    margin-top: 4px;
}

.experience-item li::marker {
    color: var(--primary);
}

.education-list {
    list-style: none;
}

.education-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.education-list li:first-child {
    border-top: 1px solid var(--border);
}

.education-list strong {
    display: block;
    font-size: 15px;
    font-weight: 500;
}

.education-list span {
    display: block;
    margin-top: 5px;
    font: 10px var(--font-display);
    color: var(--muted-foreground);
}

/* ===================== Skills ===================== */
.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.skill-list li {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--paper);
    font: 12px var(--font-display);
    transition: border-color .2s, color .2s;
}

.skill-list li:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.skill-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 40px;
}

.skill-group h3 {
    margin-bottom: 12px;
    font: 10px var(--font-display);
    color: var(--muted-foreground);
    text-transform: uppercase;
}

.info-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.info-grid .block-title {
    margin-bottom: 8px;
}

.plain-list {
    list-style: none;
}

.plain-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.plain-list span {
    font: 11px var(--font-display);
    color: var(--muted-foreground);
}

/* ===================== Contact ===================== */
.contact-section {
    border-block: 1px solid var(--border);
    background: var(--blue-surface);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 60px;
}

.contact-main h2 {
    margin-top: 10px;
    font: 500 34px/1.3 var(--font-display);
}

.contact-main h2 span {
    color: var(--primary);
}

.contact-main > p {
    max-width: 460px;
    margin-top: 14px;
    color: var(--muted-foreground);
    font-size: 15px;
    line-height: 1.8;
}

.email-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 24px;
}

.contact-email {
    display: block;
    font: 500 23px var(--font-display);
    color: var(--primary);
    overflow-wrap: anywhere;
}

.contact-email:hover {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.copy-btn {
    position: relative;
}

.copy-btn .icon-check,
.copy-btn.copied .icon-copy {
    display: none;
}

.copy-btn.copied .icon-check {
    display: block;
    color: var(--success);
}

.copy-btn::after {
    content: attr(data-feedback);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 4px);
    padding: 5px 8px;
    border-radius: 4px;
    background: var(--foreground);
    color: var(--background);
    font: 10px var(--font-display);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.copy-btn.copied::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===================== Footer ===================== */
.site-footer {
    display: flex;
    align-items: center;
    gap: 25px;
    min-height: 100px;
}

.site-footer .logo svg {
    height: 28px;
}

.site-footer p,
.footer-note {
    color: var(--muted-foreground);
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 16px;
    margin-left: auto;
    color: var(--muted-foreground);
}

.footer-links a {
    transition: color .2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links .icon {
    width: 18px;
    height: 18px;
}

.footer-note {
    padding-left: 23px;
    border-left: 1px solid var(--border);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
    transition: color .2s;
}

.social-link .icon {
    width: 22px;
    height: 22px;
}

.social-link > .icon:last-child {
    width: 20px;
    margin-left: auto;
    transition: transform .2s;
}

.social-link:hover {
    color: var(--primary);
}

.social-link:hover > .icon:last-child {
    transform: translate(3px, -3px);
}

.social-link strong {
    display: block;
    font-size: 16px;
    font-weight: 500;
}

.social-link span {
    display: block;
    margin-top: 6px;
    color: var(--muted-foreground);
    font-size: 12px;
}

/* ===================== Motion ===================== */
.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s ease-out, transform .6s ease-out;
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-content {
        animation: appear .6s ease-out both;
    }

    .portrait-scene {
        animation: appear .8s ease-out both;
    }
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== Responsive ===================== */
@media (min-width: 1500px) {
    .hero-inner {
        min-height: 630px;
    }
}

@media (max-width: 1000px) {
    .hero h1 { font-size: 46px; }
    .portrait-scene { width: 315px; }
    .hero-inner { gap: 25px; }
    .stack-items { gap: 18px; }
    .stack-inner { gap: 17px; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .project-content { padding: 19px; }
    .about-grid { gap: 40px; }
    .skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-note { display: none; }
}

@media (max-width: 760px) {
    .site-width { padding-inline: 20px; }

    .site-header { height: 72px; }
    .logo svg { height: 32px; }
    .nav-contact { display: none; }
    .menu-toggle { display: inline-flex; }

    .main-nav {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        z-index: 10;
        display: none;
        flex-direction: column;
        gap: 4px;
        padding: 16px 20px 20px;
        border-bottom: 1px solid var(--border);
        background: var(--background);
        font-size: 15px;
    }

    .main-nav.is-open { display: flex; }
    .mobile-contact { display: block; }
    .main-nav a.is-active::after { left: -10px; top: calc(50% - 2px); }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: 0;
        padding-top: 36px;
        padding-bottom: 36px;
    }

    .hero h1 { font-size: 42px; }
    .hero-role { font-size: 15px; }
    .hero-copy { max-width: 100%; font-size: 15px; }
    .hero-buttons { gap: 9px; }
    .hero-buttons .btn { padding-inline: 14px; font-size: 12px; }
    .hero-social { margin-top: 23px; flex-wrap: wrap; }

    .portrait-scene { width: 260px; margin: 12px auto 0; }
    .portrait-frame { aspect-ratio: 1.05; }
    .code-label { left: -7px; font-size: 9px; }
    .portrait-caption { right: -10px; padding: 10px 12px; }
    .portrait-caption strong { font-size: 10px; }
    .portrait-caption span { font-size: 8px; }

    .stack-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding-block: 24px;
    }

    .stack-items { gap: 16px 22px; }
    .stack-item { font-size: 12px; }

    .section { padding-block: 45px; }
    .section-heading { align-items: flex-start; margin-bottom: 25px; }
    .section-heading h2 { font-size: 23px; }
    .section-heading > .section-link { flex-shrink: 0; padding-top: 29px; font-size: 11px; }

    .project-grid { grid-template-columns: 1fr; gap: 20px; }
    .project-visual { height: 210px; }
    .project-visual.visual-other { display: none; }
    .project-featured { grid-column: auto; grid-template-columns: 1fr; }
    .project-featured .project-visual { min-height: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .browser { margin-top: 16px; }
    .project-content h3 { font-size: 17px; }
    .project-content p { min-height: 0; }
    .architecture > span { padding: 8px 10px; font-size: 9px; }
    .expense-title > span { font-size: 26px; }
    .test-terminal { gap: 12px; font-size: 12px; }

    .all-projects { padding-top: 45px; }
    .section-intro { font-size: 14px; }

    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-intro { position: static; }
    .stats li { grid-template-columns: 84px 1fr; gap: 12px; padding: 16px 0; }
    .stats strong { font-size: 26px; }

    .skill-groups { grid-template-columns: 1fr; gap: 22px; }
    .info-grid { grid-template-columns: 1fr; gap: 35px; margin-top: 35px; padding-top: 30px; }

    .contact-layout { grid-template-columns: 1fr; gap: 30px; }
    .contact-main h2 { font-size: 26px; }
    .contact-email { font-size: 19px; }

    .site-footer {
        flex-wrap: wrap;
        gap: 12px 15px;
        min-height: 85px;
        padding-block: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }

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