@font-face {
    font-family: w95;
    src: url("https://saltssaumure.github.io/w9x-discord-theme/font/w95fa.woff2");
}

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

* {
    -webkit-tap-highlight-color: transparent;
}

/* ═══ DARK THEME ═══ */
[data-theme="dark"] {
    --bg: #0c0b09;
    --bg2: #141310;
    --bg3: #1e1c18;
    --fg: #f0ece3;
    --fg2: #9a9284;
    --fg3: #5a5448;
    --accent: #e8742a;
    --accent2: #f59248;
    --accent3: #8a3d0f;
    --accent4: #e8a060;
    --accent5: #c85a10;
    --accent6: #e8c9b0;
    --accent7: #e8742a;
    --grid: rgba(232, 116, 42, 0.06);
    --border: rgba(232, 116, 42, 0.14);
    --border2: rgba(232, 116, 42, 0.3);
    --nav-bg: rgba(12, 11, 9, 0.88);
    --ph-bg: #1e1c18;
    --ph-line: rgba(232, 116, 42, 0.14);
}

/* ═══ LIGHT THEME ═══ */
[data-theme="light"] {
    --bg: #faf8f4;
    --bg2: #f0ece4;
    --bg3: #e4ddd0;
    --fg: #1a1612;
    --fg2: #5a5044;
    --fg3: #9a9080;
    --accent: #c85a10;
    --accent2: #e8742a;
    --accent3: #e8a060;
    --grid: rgba(200, 90, 16, 0.06);
    --border: rgba(200, 90, 16, 0.15);
    --border2: rgba(200, 90, 16, 0.3);
    --nav-bg: rgba(250, 248, 244, 0.92);
    --ph-bg: #e8e0d0;
    --ph-line: rgba(200, 90, 16, 0.18);
}

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

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #00000000;
}

::-webkit-scrollbar-thumb {
    background: var(--accent3);
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: w95, cursive, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s, color 0.4s;
}

/* Custom cursor — only on devices with a real pointer (mouse/trackpad) */
@media (pointer: fine) {
    body { cursor: none; }
}

/* Hide the cursor elements entirely on touch devices */
@media (pointer: coarse) {
    .cursor, .cursor-ring { display: none; }
}

/* CURSOR */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: background 0.3s;
}

.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(232, 116, 42, 0.45);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, opacity 0.2s;
}

body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

/* GRID */
.grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%,
            black 30%,
            transparent 100%);
        animation: grid-bg-looping-mechanism 10s linear infinite;
}

@keyframes grid-bg-looping-mechanism {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 80px 80px, -80px -80px;
    }

}

.scanline {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.025) 3px,
            rgba(0, 0, 0, 0.025) 4px);
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 60px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s, border-color 0.4s;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 36px;
    width: auto;
    display: block;
}

.nav-logo svg {
    height: 36px;
    width: auto;
    display: block;
}

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

.nav-center a {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg2);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-center a::before {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-center a:hover,
.nav-center a.active {
    color: var(--accent);
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* THEME TOGGLE */
.theme-toggle {
    width: 48px;
    height: 26px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 13px;
    cursor: none;
    position: relative;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), background 0.3s;
}

[data-theme="light"] .theme-toggle::after {
    transform: translateX(22px);
}

.t-icon {
    position: absolute;
    font-size: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    line-height: 1;
}

.t-icon.moon {
    left: 5px;
}

.t-icon.sun {
    right: 4px;
}

.nav-cta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--accent);
    border: none;
    padding: 9px 20px;
    cursor: none;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    display: inline-block;
}

.nav-cta:hover {
    background: var(--accent2);
    transform: translateY(-1px);
}

/* PAGES */
.page {
    display: none;
    min-height: 100vh;
    padding-top: 72px;
    position: relative;
    z-index: 2;
}

.page.active {
    display: block;
}

#home {
    display: none;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 0 60px;
    position: relative;
}

#home.active {
    display: flex;
}

/* ═══ HOME ═══ */
.home-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding-top: 40px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto;
    column-gap: 60px;
    align-items: center;
}

.home-content {
    grid-column: 1;
    display: flex;
    flex-direction: column;
}

.home-tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeUp 0.6s 0.3s forwards;
}

.home-tag::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--accent);
}

.home-headline {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: clamp(64px, 8vw, 100px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    overflow: hidden;
}

.home-headline .line {
    display: block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-headline .line:nth-child(1) {
    animation-delay: 0.5s;
}

.home-headline .line:nth-child(2) {
    animation-delay: 0.65s;
    color: var(--fg3);
    font-style: italic;
}

.home-headline .line:nth-child(3) {
    animation-delay: 0.8s;
}

.home-headline em {
    color: var(--accent);
    font-style: normal;
}

.home-sub {
    max-width: 480px;
    font-size: 15px;
    color: var(--fg2);
    line-height: 1.75;
    margin-bottom: 56px;
    opacity: 0;
    animation: fadeUp 0.6s 1s forwards;
}

.home-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    opacity: 0;
    animation: fadeUp 0.6s 1.1s forwards;
}

.btn-primary {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--accent);
    padding: 14px 32px;
    text-decoration: none;
    border: none;
    cursor: none;
    transition: background 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: var(--accent2);
    transform: translateY(-2px);
}

.btn-secondary {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--fg2);
    background: transparent;
    padding: 14px 32px;
    text-decoration: none;
    border: 1px solid var(--border2);
    cursor: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

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

.home-stats {
    display: flex;
    flex-direction: row;
    gap: 40px;
    margin-top: 48px;
    opacity: 0;
    animation: fadeUp 0.6s 1.2s forwards;
}

.stat {
    text-align: left;
}

.stat-num {
    font-family: "IBM Plex Mono", monospace;
    font-size: 36px;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg3);
    margin-top: 4px;
}

.home-scroll {
    position: absolute;
    bottom: 40px;
    left: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg3);
    opacity: 0;
    animation: fadeUp 0.6s 1.4s forwards;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.home-marquee {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    overflow: hidden;
    border-top: 1px solid var(--border);
    background: var(--bg2);
    display: flex;
    align-items: center;
}

.marquee-track {
    display: flex;
    animation: marqueeScroll 22s linear infinite;
    white-space: nowrap;
}

.marquee-item {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg3);
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.marquee-item::after {
    content: "◆";
    color: var(--accent);
    font-size: 8px;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ═══ ABOUT ═══ */
#about {
    display: none;
}

#about.active {
    display: block;
}

.about-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 60px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 80px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.page-num {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-top: 10px;
    animation: fadeUp 0.8s;
}

.page-title {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: clamp(48px, 6vw, 80px);
    line-height: 1;
    flex: 1;

    animation: fadeUp 0.8s 0.05s both;
}

.page-title em {
    color: var(--fg3);
    font-style: italic;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-bottom: 80px;
}

.about-bio p {
    font-size: 16px;
    line-height: 1.85;
    color: var(--fg2);
    margin-bottom: 20px;
}

.about-bio p strong {
    color: var(--fg);
    font-weight: 600;
}

.info-block {
    margin-bottom: 40px;
}

.info-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.info-value {
    font-size: 15px;
    color: var(--fg);
    line-height: 1.6;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 48px 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fg3);
}

.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-bar-meta {
    display: flex;
    justify-content: space-between;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--fg2);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.skill-bar-track {
    height: 2px;
    background: var(--bg3);
    position: relative;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent3), var(--accent));
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-bar-fill.animate {
    transform: scaleX(1);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-top: 48px;
}

.tool-tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg2);
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.tool-tag:hover {
    background: var(--bg3);
    color: var(--accent);
    border-color: var(--border2);
}

/* ═══ PROJECTS ═══ */
#projects {
    display: none;
}

#projects.active {
    display: block;
}

.projects-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 60px;
}

.projects-filter {
    display: flex;
    gap: 4px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg3);
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 18px;
    cursor: none;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(232, 116, 42, 0.05);
}

/* LIST HEADER */
.projects-list-header {
    display: grid;
    grid-template-columns: 128px 1fr 140px 100px 40px;
    gap: 0;
    padding: 0 24px 12px;
    border-bottom: 1px solid var(--border);
}

.list-col-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg3);
}

/* LIST ITEMS */
.projects-list {
    display: flex;
    flex-direction: column;
}

.projects-list a {
    text-decoration: none;
}

.project-row {
    display: grid;
    grid-template-columns: 128px 1fr 140px 100px 40px;
    gap: 0;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    cursor: none;
    position: relative;
    overflow: hidden;
    transition: background 0.25s, border-color 0.25s;
}

.project-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-row:hover {
    background: var(--bg2);
    border-color: var(--border2);
}

.project-row:hover::before {
    transform: scaleY(1);
}

/* Thumbnail in list */
.row-thumb {
    width: 112px;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    background: var(--ph-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--ph-line) 1px, transparent 1px), linear-gradient(90deg, var(--ph-line) 1px, transparent 1px);
    background-size: 10px 10px;
}

.row-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.row-thumb-ph {
    position: relative;
    z-index: 2;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 7px;
    letter-spacing: 0.1em;
    color: var(--fg3);
    text-align: center;
    line-height: 1.3;
}

.row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 20px;
}

.row-idx {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--fg3);
    letter-spacing: 0.1em;
}

.row-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 19px;
    color: var(--fg);
    line-height: 1.2;
    transition: color 0.2s;
}

.project-row:hover .row-name {
    color: var(--accent);
}

.row-desc {
    font-size: 12px;
    color: var(--fg3);
    line-height: 1.5;
    margin-top: 2px;
}

.row-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.proj-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 7px;
}

.row-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--fg3);
    letter-spacing: 0.05em;
}

.row-arrow {
    font-size: 16px;
    color: var(--fg3);
    text-align: right;
    transition: color 0.2s, transform 0.2s;
}

.project-row:hover .row-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.project-row[data-cat="design"]:hover .row-arrow {
    color: var(--accent);
    transform: rotate(-45deg);
}

/* Mobile: collapse some columns */
@media(max-width:680px) {
    .projects-list-header {
        display: none;
    }

    .project-row {
        grid-template-columns: 80px 1fr 40px;
        grid-template-rows: auto auto;
        gap: 0;
    }

    .row-main {
        padding: 0 12px;
        grid-column: 2;
    }

    .row-thumb {
        width: 80px;
    }

    .row-tags {
        grid-column: 2;
        padding: 0 12px 0;
        display: none;
    }

    .row-year {
        display: none;
    }

    .row-arrow {
        grid-column: 3;
        grid-row: 1;
    }
}

/* ═══ PROJECT MODAL ═══ */
.proj-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
    transition: background 0.35s, backdrop-filter 0.35s;
}

.proj-modal-overlay.open {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    pointer-events: all;
}

.proj-modal {
    background: rgba(30, 30, 32, 0.82);
    backdrop-filter: blur(48px) saturate(180%);
    -webkit-backdrop-filter: blur(48px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow:
        0 0 0 0.5px rgba(0,0,0,0.6),
        0 32px 80px rgba(0,0,0,0.7),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    max-width: 820px;
    width: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

[data-theme="light"] .proj-modal {
    background: rgba(236, 236, 238, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow:
        0 0 0 0.5px rgba(0,0,0,0.15),
        0 32px 80px rgba(0,0,0,0.25),
        0 8px 24px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.proj-modal-overlay.open .proj-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* macOS title bar */
.modal-titlebar {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px 12px 0 0;
    gap: 0;
    user-select: none;
    cursor: grab;
}

[data-theme="light"] .modal-titlebar {
    background: rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-traffic-lights {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tl-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: default;
    position: relative;
    transition: filter 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tl-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
}

.tl-close  { background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.25); }
.tl-minimize { background: #febc2e; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }
.tl-maximize { background: #28c840; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2); }

.modal-traffic-lights:not(:hover) .tl-btn {
    background: rgba(150, 150, 150, 0.4) !important;
    box-shadow: none !important;
}

.tl-close:hover  { background: #ff5f57; filter: brightness(1.1); cursor: default; }
.tl-minimize:hover { background: #febc2e; filter: brightness(1.1); }
.tl-maximize:hover { background: #28c840; filter: brightness(1.1); }

/* Close × icon on hover */
.tl-close:hover::after {
    content: '×';
    font-size: 10px;
    font-weight: 700;
    color: rgba(0,0,0,0.5);
    opacity: 1;
    line-height: 1;
}

.modal-titlebar-label {
    flex: 1;
    text-align: center;
    font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 12px;
}

[data-theme="light"] .modal-titlebar-label {
    color: rgba(0, 0, 0, 0.5);
}

.modal-titlebar-spacer {
    width: 56px;
    flex-shrink: 0;
}

.proj-modal-img {
    width: 100%;
    aspect-ratio: 256/181;
    height: auto;
    background: var(--ph-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proj-modal-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--ph-line) 1px, transparent 1px), linear-gradient(90deg, var(--ph-line) 1px, transparent 1px);
    background-size: 28px 28px;
}

.proj-modal-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 44%, var(--ph-line) 44%, var(--ph-line) 56%, transparent 56%);
    background-size: 56px 56px;
}

.proj-modal-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: block;
}

.proj-modal-ph {
    position: relative;
    z-index: 3;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg3);
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 8px 16px;
}

.proj-modal-body {
    padding: 24px 28px 28px;
}

.proj-modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.proj-modal-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
}

.proj-modal-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--fg3);
    letter-spacing: 0.1em;
}

.proj-modal-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(22px, 3vw, 32px);
    color: var(--fg);
    line-height: 1.15;
    margin-bottom: 10px;
}

.proj-modal-desc {
    font-size: 14px;
    color: var(--fg2);
    line-height: 1.75;
}

/* Remove old close button — replaced by traffic lights */
.proj-modal-close { display: none; }

/* Mobile: collapse some columns */
@media(max-width:680px) {
    .projects-list-header {
        display: none;
    }

    .project-row {
        grid-template-columns: 80px 1fr 40px;
        grid-template-rows: auto auto;
        gap: 0;
    }

    .row-main {
        padding: 0 12px;
        grid-column: 2;
    }

    .row-thumb {
        width: 80px;
    }

    .row-tags {
        grid-column: 2;
        padding: 0 12px 0;
        display: none;
    }

    .row-year {
        display: none;
    }

    .row-arrow {
        grid-column: 3;
        grid-row: 1;
    }
}

/* ═══ SERVICES ═══ */
#services {
    display: none;
}

#services.active {
    display: block;
}

.services-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 60px;
}

.services-intro {
    max-width: 600px;
    margin-bottom: 72px;
    font-size: 18px;
    color: var(--fg2);
    line-height: 1.75;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-bottom: 80px;
}

.service-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 56px 48px;
    position: relative;
    overflow: hidden;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-card::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 100% 0%,
            rgba(232, 116, 42, 0.1),
            transparent 70%);
}

.service-card:hover {
    background: var(--bg3);
    border-color: var(--border2);
    transform: translateY(-4px);
}

.service-num {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 24px;
}

.service-icon {
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1;
}

.service-name {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: 32px;
    color: var(--fg);
    margin-bottom: 16px;
    line-height: 1.15;
}

.service-desc {
    font-size: 15px;
    color: var(--fg2);
    line-height: 1.75;
    margin-bottom: 28px;
}

.service-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-list li {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--fg3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-list li::before {
    content: "→";
    color: var(--accent);
}

.service-price {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    color: var(--fg3);
    letter-spacing: 0.1em;
}

.service-price strong {
    display: block;
    font-size: 22px;
    color: var(--accent);
    font-weight: 400;
    margin-top: 4px;
}

.cta-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.cta-heading {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: 40px;
    margin-bottom: 12px;
}

.cta-sub {
    font-size: 15px;
    color: var(--fg2);
}

.cta-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* PROFILE PICTURE */
.home-profile {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeUp 0.8s 0.9s forwards;
}

.profile-frame {
    position: relative;
    width: 260px;
    height: 300px;
    flex-shrink: 0;
}

.profile-frame::before {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid var(--border2);
    z-index: 0;
    animation: framePulse 4s ease-in-out infinite;
}

.profile-frame::after {
    content: "";
    position: absolute;
    bottom: -14px;
    right: -14px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
    z-index: -1;
    background: var(--bg2);
}

@keyframes framePulse {

    0%,
    100% {
        border-color: var(--border2);
    }

    50% {
        border-color: var(--accent);
        box-shadow: 0 0 20px rgba(232, 116, 42, 0.12);
    }
}

.profile-img-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: var(--ph-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-img-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--ph-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--ph-line) 1px, transparent 1px);
    background-size: 24px 24px;
}

.profile-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    display: block;
}

.profile-ph-label {
    position: relative;
    z-index: 3;
    text-align: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg3);
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 8px 14px;
}

.profile-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 4;
}

.profile-corner.tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.profile-corner.tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.profile-corner.bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.profile-corner.br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

.profile-caption {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg3);
}

/* KEYFRAMES */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ HAMBURGER BUTTON ═══ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border2);
    cursor: none;
    padding: 8px;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

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

.hamburger span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--fg2);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.3s,
                background 0.2s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--accent);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--accent);
}

/* ═══ MOBILE MENU PANEL ═══ */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0 24px;
    flex-direction: column;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s;
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-menu a {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg2);
    text-decoration: none;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s, background 0.2s;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a::before {
    content: "—";
    font-size: 10px;
    color: var(--fg3);
    transition: color 0.2s;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--accent);
    background: rgba(232, 116, 42, 0.04);
}

.mobile-menu a:hover::before,
.mobile-menu a.active::before {
    color: var(--accent);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    z-index: 98;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}

.mobile-overlay.open {
    pointer-events: all;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 960px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .home-inner {
        grid-template-columns: 1fr 220px;
        column-gap: 40px;
    }

    .profile-frame {
        width: 190px;
        height: 240px;
    }
}

/* Mobile */
@media (max-width: 680px) {
    nav {
        padding: 0 16px;
        height: 60px;
    }

    .nav-logo svg {
        height: 28px;
    }

    .nav-center {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    .mobile-overlay {
        display: block;
    }

    #home {
        padding: 0 20px;
        padding-top: 60px;
        justify-content: flex-start;
    }

    .home-inner {
        display: flex;
        flex-direction: column;
        padding-top: 24px;
        grid-template-columns: unset;
    }

    .home-content {
        order: 2;
    }

    .home-profile {
        order: 1;
        grid-column: unset;
        margin-bottom: 32px;
        justify-content: flex-start;
    }

    .profile-frame {
        width: 160px;
        height: 200px;
    }

    .home-stats {
        flex-direction: row;
        gap: 24px;
        margin-top: 32px;
    }

    .stat-num {
        font-size: 28px;
    }

    .about-wrapper,
    .projects-wrapper,
    .services-wrapper {
        padding: 48px 20px;
    }

    .home-scroll {
        display: none;
    }

    .nav-cta {
        display: none;
    }

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

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

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

    .cta-section {
        flex-direction: column;
        padding: 32px 24px;
    }

    .home-headline {
        font-size: clamp(44px, 12vw, 80px);
    }
}

@media (max-width: 420px) {
    .home-headline {
        font-size: clamp(36px, 11vw, 60px);
    }

    .stat-num {
        font-size: 24px;
    }
}

/* ═══ TOUCH DEVICE CURSOR FIX ═══
   Restore pointer/default cursor on all interactive elements for mobile.
   cursor: none on touch devices blocks tap events on iOS/Android. */
@media (pointer: coarse) {
    a, button, [onclick], .filter-btn, .tool-tag,
    .project-row, .service-card, .btn-primary, .btn-secondary,
    .theme-toggle, .hamburger, .tl-btn, .nav-logo,
    .mobile-menu a, .proj-modal-close {
        cursor: pointer;
    }
}
