/* ===========================================
   JEM TERAOKA — PORTFOLIO
   Premium Motion-Driven Design System
   =========================================== */

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; color: inherit; font: inherit; }
img { display: block; max-width: 100%; }

/* ─── Design Tokens ─── */
:root {
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-alt: #101017;
    --surface: #15151e;
    --surface-hover: #1c1c28;
    --text: #f0eff4;
    --text-secondary: #9896a3;
    --text-muted: #5c5a66;
    --accent: #7c6cf6;
    --accent-hover: #9488ff;
    --accent-soft: rgba(124, 108, 246, 0.08);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --shadow-card: 0 24px 64px rgba(0, 0, 0, 0.4);
    --cursor-border: rgba(180, 160, 255, 0.3);
    --cursor-bg: rgba(120, 90, 255, 0.05);
    --img-bg: transparent;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg: #f8f7fc;
    --bg-alt: #f0eff6;
    --surface: #ffffff;
    --surface-hover: #f4f3fa;
    --text: #1a1824;
    --text-secondary: #5c5a66;
    --text-muted: #9896a3;
    --accent: #5046e5;
    --accent-hover: #6358f0;
    --accent-soft: rgba(80, 70, 229, 0.06);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-card: 0 24px 64px rgba(0, 0, 0, 0.1);
    --cursor-border: rgba(80, 60, 180, 0.3);
    --cursor-bg: rgba(80, 60, 180, 0.05);
    --img-bg: #eeedf5;
}

/* ─── Base ─── */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    cursor: none;
    transition: background 0.5s, color 0.4s;
}

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

.section {
    padding: 8rem 2rem;
    position: relative;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Glyph Canvas ─── */
.glyph-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ─── Custom Cursor ─── */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--cursor-border);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    opacity: 0;
    transition: width 0.4s var(--ease-out-expo),
                height 0.4s var(--ease-out-expo),
                background 0.3s,
                border-color 0.3s,
                opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cursor-ring.cursor-hover {
    width: 48px;
    height: 48px;
    background: var(--cursor-bg);
    border-color: var(--cursor-border);
}

.cursor-ring.cursor-case {
    width: 80px;
    height: 80px;
    background: var(--accent-soft);
    border-color: var(--accent);
}

.cursor-text {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-ring.cursor-case .cursor-text {
    opacity: 1;
}

/* ─── Navigation ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 2.5rem;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: padding 0.4s, background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
    padding: 0.7rem 2.5rem;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent);
}

.nav-logo { justify-self: start; }
.nav-links { justify-self: center; }
.nav-actions, .nav-right { justify-self: end; }

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: none;
    will-change: transform;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    transition: color 0.3s;
    cursor: none;
    will-change: transform;
}

.nav-link:hover { color: var(--text); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-toggle, .theme-toggle {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    transition: color 0.3s, border-color 0.3s, background 0.3s;
    cursor: none;
    will-change: transform;
}

.lang-toggle {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.theme-toggle:hover { color: var(--text); }

.theme-toggle {
    display: flex;
    align-items: center;
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 4px;
    cursor: none;
    will-change: transform;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.4s var(--ease-out-expo), opacity 0.3s;
}

.menu-toggle.active span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle.active span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* ─── Mobile Menu ─── */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out-expo);
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    transition: color 0.3s;
}

.mobile-link:hover { color: var(--accent); }

.mobile-controls {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ═══════════ HERO ═══════════ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.three-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
}

.hero-eyebrow {
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text);
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.hero-name {
    margin-bottom: 0;
}

.line-mask {
    overflow: hidden;
    line-height: 0.92;
    padding: 0 0.3em;
}

.hero-line {
    font-family: var(--font-display);
    font-size: clamp(5rem, 14vw, 12rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 0.92;
}

.hero-line.flip-text {
    line-height: 0.92;
    align-items: flex-end;
}

.hero-line .flip-char {
    padding-right: 0.01em;
}

.hero-line .flip-char > span:nth-child(2) {
    top: 0.92em;
}

/* Split-flap invert: back-face flips style (fill <-> outline) */
.hero-line:not(.outline) .flip-char > span:nth-child(2) {
    color: transparent;
    -webkit-text-stroke: 2px var(--text);
}
.hero-line.outline .flip-char > span:nth-child(2) {
    color: var(--text);
    -webkit-text-stroke: 0;
}

.hero-line.outline {
    -webkit-text-stroke: 2px var(--text);
    color: transparent;
}

[data-theme="light"] .hero-line.outline {
    -webkit-text-stroke: 2px var(--text);
}


.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--accent);
    animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(400%); }
    100% { transform: translateY(400%); }
}

/* ═══════════ ABOUT (Mac Window) ═══════════ */
#about {
    position: relative;
    z-index: 2;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
}

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

.about-card.mac-window {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 0;
    will-change: transform;
    transition: background 0.5s, border-color 0.4s;
    overflow: hidden;
}

[data-theme="light"] .about-card.mac-window {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Mac Titlebar */
.mac-titlebar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .mac-titlebar {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.mac-dots {
    display: flex;
    gap: 7px;
    min-width: 60px;
}

.mac-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: filter 0.3s;
}

.dot-close { background: #ff5f57; }
.dot-minimize { background: #febc2e; }
.dot-maximize { background: #28c840; }

.mac-window:hover .mac-dots span { filter: brightness(1.15); }

.mac-filename {
    flex: 1;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.mac-dots-spacer {
    min-width: 60px;
}

/* Mac Body */
.mac-body {
    padding: clamp(2rem, 4vw, 3.5rem);
}

.about-intro {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.timeline-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
    margin-top: 0.3rem;
}

/* CV Layout */
.cv-section {
    margin-bottom: 2.5rem;
}

.cv-section:last-child { margin-bottom: 0; }

.cv-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* CV Row (base) */
.cv-row {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

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

.cv-company {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cv-company img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--surface-hover);
    flex-shrink: 0;
}

.cv-role {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.cv-period {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Experience Accordion */
.cv-accordion {
    border-bottom: 1px solid var(--border);
}

.cv-accordion:last-child { border-bottom: none; }

.cv-accordion-header {
    display: flex;
    align-items: center;
    padding: 1rem 0.75rem;
    margin: 0 -0.75rem;
    gap: 1rem;
    cursor: none;
    user-select: none;
    border-radius: 10px;
    position: relative;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-accordion-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 3px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-accordion-header:hover {
    background: var(--accent-soft);
    padding-left: 1.25rem;
}

.cv-accordion-header:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.cv-accordion.open .cv-accordion-header::before {
    transform: translateY(-50%) scaleY(1);
}

.cv-accordion.open .cv-accordion-header {
    padding-left: 1.25rem;
}

.cv-chevron {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: auto;
}

.cv-accordion.open .cv-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.cv-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.65s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s ease;
    padding: 0 0 0 calc(24px + 0.75rem);
    opacity: 0;
}

.cv-accordion.open .cv-accordion-body {
    max-height: 600px;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
    opacity: 1;
}

.cv-accordion-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
    word-spacing: 0.05em;
    margin: 0;
}

/* Skill Tags */
.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cv-tags span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: none;
    transition: color 0.3s;
}

.cv-tags span:hover { color: var(--text); }

.cv-skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.skill-block {
    margin-bottom: 2rem;
}

.skill-block:last-child { margin-bottom: 0; }

.skill-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.skill-block ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    font-weight: 300;
}

/* ═══════════ SPLIT-FLAP (Airport Board) ═══════════ */
.flip-text {
    display: inline-flex;
    vertical-align: baseline;
    line-height: 1;
}
.flip-char {
    display: inline-block;
    overflow: hidden;
    position: relative;
    height: 1em;
    vertical-align: top;
}
.flip-char > span {
    display: block;
    transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
    transition-delay: calc(var(--i) * 0.028s);
}
.flip-char > span:nth-child(2) {
    position: absolute;
    left: 0;
    top: 100%;
}
.flip-text:not(.flip-text--per-char):hover .flip-char > span { transform: translateY(-100%); }
.flip-text--per-char .flip-char.is-flipped > span { transform: translateY(-100%); }
.flip-text--linear .flip-char > span { transition-delay: 0s !important; }
.flip-space {
    display: inline-block;
    width: 0.28em;
    flex-shrink: 0;
}

/* ═══════════ CASES — BENTO GRID ═══════════ */
.section-cases {
    padding: 8rem 0 6rem;
}

.cases-header {
    max-width: 1300px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.bento-size-a { grid-column: span 8; aspect-ratio: 16 / 9; }
.bento-size-b { grid-column: span 4; }
.bento-size-c { grid-column: span 5; }
.bento-size-d { grid-column: span 7; aspect-ratio: 16 / 9; }
.bento-size-half { grid-column: span 6; aspect-ratio: 4 / 3; }
.bento-size-topaz { grid-column: span 5; aspect-ratio: auto; height: 420px; }
.bento-size-steam { grid-column: span 7; aspect-ratio: auto; height: 420px; }

.bento-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: none;
    transition: border-color 0.4s,
                box-shadow 0.6s var(--ease-out-expo),
                transform 0.6s var(--ease-out-expo);
}

.bento-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
    transform: translateY(-3px);
}

.bento-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--img-bg);
}

[data-theme="light"] .bento-media { background: #eeedf5; }
[data-theme="light"] .bento-media img { mix-blend-mode: multiply; }

.bento-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1.02);
    transition: transform 1s var(--ease-out-expo);
    will-change: transform;
}

.bento-card:hover .bento-media img {
    transform: scale(1.08) translateX(-10px);
}

.bento-meta {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.25rem 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
    background: linear-gradient(to top,
        rgba(10, 10, 15, 0.85) 0%,
        rgba(10, 10, 15, 0.45) 55%,
        rgba(10, 10, 15, 0) 100%);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out-expo),
                transform 0.7s var(--ease-out-expo);
    pointer-events: none;
}

.bento-card:hover .bento-meta {
    opacity: 1;
    transform: translateY(0);
}

.bento-tag {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.72);
}

.bento-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: #fff;
}

/* Featured work section heading — same scale + color as hero bio title */
.section-cases .section-heading {
    font-size: clamp(1.2rem, 2.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text);
    line-height: 1;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* ═══════════ BENTO CARD — LIGHT VARIANT (black type, always visible) ═══════════ */
.bento-card--light .bento-meta {
    opacity: 1;
    transform: none;
    background: linear-gradient(to top,
        rgba(248, 250, 252, 0.97) 0%,
        rgba(248, 250, 252, 0.82) 55%,
        rgba(248, 250, 252, 0) 100%);
    padding: 2.5rem 2rem 2rem;
    gap: 0.75rem;
}
.bento-card--light .bento-tag {
    color: rgba(10, 10, 15, 0.68);
    font-weight: 600;
}
.bento-card--light .bento-title {
    color: #0a0a0f;
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.025em;
}
.bento-card--light .bento-desc {
    color: rgba(10, 10, 15, 0.75);
    font-size: clamp(0.95rem, 1.1vw, 1.125rem);
    font-weight: 500;
    line-height: 1.45;
    max-width: 32rem;
}

/* ═══════════ MORE WORK GRID ═══════════ */
.section-work .section-heading {
    padding: 0;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.work-card {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.6s var(--ease-out-expo),
                box-shadow 0.6s var(--ease-out-expo),
                border-color 0.3s;
    cursor: none;
}

.work-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-hover);
}

.work-img {
    height: 240px;
    overflow: hidden;
    background: var(--img-bg);
    position: relative;
}

[data-theme="light"] .work-img::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: none;
}

.work-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out-expo);
}

.work-card:hover .work-img img {
    transform: scale(1.05);
}

.work-info {
    padding: 1.25rem 1.5rem 1.5rem;
}

.work-tag {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.work-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
}

.work-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ═══════════ PROCESS ═══════════ */
.section-process .section-heading {
    padding: 0;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.process-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: border-color 0.4s, transform 0.6s var(--ease-out-expo);
}

.process-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.process-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
    display: block;
    margin-bottom: 1.5rem;
}

.process-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.process-card p {
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ═══════════ CONTACT ═══════════ */
.section-contact {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.contact-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.contact-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 4rem;
    white-space: nowrap;
}

.contact-links {
    display: flex;
    flex-direction: column;
}

.contact-link {
    display: flex;
    align-items: center;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.5s var(--ease-out-expo);
    cursor: none;
    will-change: transform;
}

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

.contact-link:hover {
    padding-left: 1.5rem;
}

.contact-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    min-width: 100px;
}

.contact-value {
    font-size: 1rem;
    font-weight: 400;
    flex: 1;
}

.contact-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.4s var(--ease-out-expo), color 0.3s;
}

.contact-link:hover .contact-arrow {
    transform: translateX(8px);
    color: var(--accent);
}

/* ═══════════ BACK TO TOP ═══════════ */
.back-to-top {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 0.9, 0.34, 1), background 0.25s, border-color 0.25s;
}
.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    background: color-mix(in srgb, var(--text) 8%, var(--bg) 85%);
    border-color: color-mix(in srgb, var(--text) 40%, transparent);
    transform: translateY(-2px);
}
.back-to-top svg {
    transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.34, 1);
}
.back-to-top:hover svg { transform: translateY(-2px); }

@media (max-width: 768px) {
    .back-to-top { bottom: 1.25rem; right: 1.25rem; width: 44px; height: 44px; }
}

/* ═══════════ FOOTER ═══════════ */
.footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-top {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s;
    cursor: none;
    will-change: transform;
}

.footer-top:hover { color: var(--text); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .menu-toggle { display: flex; }

    .bento-grid { grid-template-columns: repeat(6, 1fr); }
    .bento-size-a, .bento-size-d { grid-column: span 6; }
    .bento-size-b, .bento-size-c { grid-column: span 6; }
    .bento-size-steam { grid-column: span 4; height: 320px; }
    .bento-size-topaz { grid-column: span 2; height: 320px; }

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

@media (max-width: 768px) {
    .section { padding: 5rem 1.5rem; }

    .hero { min-height: 100svh; padding: 5rem 1.5rem 3rem; }
    .hero-line { font-size: clamp(3.5rem, 18vw, 6rem); }

    .cv-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    .cv-accordion-header {
        flex-wrap: wrap;
        gap: 0.2rem 1rem;
    }
    .cv-accordion-header .cv-company { min-width: auto; }
    .cv-accordion-body { padding-left: 0 !important; }
    .cv-company { min-width: auto; }

    .section-cases { padding: 5rem 0 3rem; }
    .cases-header { padding: 0 1.5rem; margin-bottom: 2rem; }
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 1.5rem;
    }
    .bento-size-a, .bento-size-b, .bento-size-c, .bento-size-d {
        grid-column: 1 / -1;
    }
    .bento-size-steam, .bento-size-topaz {
        grid-column: 1 / -1;
        height: 280px;
    }
    .bento-meta {
        opacity: 1;
        transform: translateY(0);
        padding: 1.75rem 1.5rem 1.25rem;
    }

    .section-work { padding: 5rem 1.5rem; }
    .work-grid { grid-template-columns: 1fr; }
    .work-img { height: 200px; }

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

    .section-contact { padding: 4rem 1.5rem; }
    .contact-heading { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 3rem; white-space: normal; }
    .contact-label { min-width: 80px; font-size: 0.65rem; }
    .contact-value { font-size: 0.9rem; }

    .nav { padding: 1rem 1.5rem; }
    .nav.scrolled { padding: 0.7rem 1.5rem; }

    .footer { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-line { font-size: clamp(3rem, 20vw, 5rem); }
    .bento-grid { padding: 0 1rem; gap: 1rem; }
}

@media (pointer: coarse) {
    * { cursor: auto !important; }
    .cursor-dot, .cursor-ring, .glyph-canvas { display: none !important; }
}

/* ═══════════════════════════════════════════
   WIP Modal — Dino Runner
   ═══════════════════════════════════════════ */

.wip-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.wip-modal.is-open {
    display: flex;
    animation: wipFadeIn 0.35s var(--ease-out-expo);
}

.wip-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme="light"] .wip-backdrop {
    background: rgba(255, 255, 255, 0.55);
}

.wip-window {
    position: relative;
    width: min(760px, 100%);
    max-height: 92vh;
    overflow: hidden;
    transform-origin: center;
    animation: wipScaleIn 0.45s var(--ease-spring);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}

.wip-window .mac-titlebar {
    cursor: default;
}

.wip-window .mac-dots button.dot-close {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: filter 0.3s, transform 0.18s var(--ease-out-quart);
}

.wip-window .mac-dots button.dot-close:hover {
    filter: brightness(1.2);
    transform: scale(1.1);
}

.wip-body {
    padding: clamp(1.25rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.wip-copy {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
}

.wip-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 700 / 200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

[data-theme="light"] .wip-stage {
    background: #fafafa;
}

.wip-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    outline: none;
}

.wip-score {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 2;
    display: flex;
    gap: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    pointer-events: none;
    user-select: none;
}

.wip-score em {
    font-style: normal;
    color: var(--text-secondary);
}

.wip-cur {
    color: var(--text);
    font-weight: 600;
}

.wip-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.25s ease;
    pointer-events: none;
}

[data-theme="light"] .wip-overlay {
    background: rgba(255, 255, 255, 0.55);
}

.wip-overlay.is-hidden {
    opacity: 0;
}

.wip-overlay-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    line-height: 1.5;
    padding: 0 1rem;
}

.wip-overlay kbd {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--surface-hover);
    border: 1px solid var(--border-hover);
    border-radius: 5px;
    color: var(--text);
    letter-spacing: 0.05em;
}

.wip-overlay-sub {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.wip-hint {
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@keyframes wipFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Lock body scroll when modal open */
body.wip-locked {
    overflow: hidden;
}

@media (max-width: 600px) {
    .wip-modal { padding: 0.75rem; }
    .wip-body { padding: 1rem; gap: 0.85rem; }
    .wip-copy { font-size: 0.82rem; }
    .wip-score { font-size: 0.7rem; top: 8px; right: 10px; }
    .wip-overlay-title { font-size: 0.85rem; }
    .wip-hint { font-size: 0.62rem; }
}
