@font-face {
    font-family: 'Helvetica';
    src: local('Helvetica Bold'), local('Helvetica-Bold'), local('Helvetica');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica';
    src: local('Helvetica Bold Oblique'), local('Helvetica-BoldOblique'), local('Helvetica Oblique');
    font-weight: 700;
    font-style: italic;
}

@keyframes fade-in-slide-down {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }

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


/* --- Dark Mode Widget Override --- */
body.dark {
    --widget-bg: var(--accent);
}

/* --- Eye Tracking Widget Styles --- */
.floating-eyes-widget {
    position: fixed;
    bottom: 2rem;
    left: calc(100vw - 2rem - 100px);
    z-index: 9999;

    background-color: var(--widget-bg, #0062AD);

    width: 100px;
    height: 100px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    opacity: 1;
    transition: background-color 0.3s ease, opacity 0.4s ease-in-out, left 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.floating-eyes-widget.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Speech bubble — fixed so it shows immediately independent of widget slide */
.widget-bubble {
    position: fixed;
    background: #000;
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10000;
}

.widget-bubble.show {
    opacity: 1;
}

.widget-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
}

/* Tail points right → bubble is to the LEFT of widget */
.widget-bubble.tail-right::after {
    right: -8px;
    border-left-color: #000;
    border-right-width: 0;
}

/* Tail points left → bubble is to the RIGHT of widget */
.widget-bubble.tail-left::after {
    left: -8px;
    border-right-color: #000;
    border-left-width: 0;
}


/* --- Fullscreen Eyes Background --- */
.fullscreen-eyes-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg);
    transition: background-color 0.3s ease, opacity 0.4s ease-in-out;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.fullscreen-eyes-bg.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Fullscreen Back/Close Toggle --- */
.eyes-close-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;

    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;

    background-color: var(--close-btn-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.4s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

.eyes-close-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.eyes-close-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.eyes-wrapper {
    display: flex;
    flex-direction: row;
    gap: 4px;
    /* Scaled gap */
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.fullscreen-eyes-bg .eyes-wrapper {
    transform: scale(4);
}

.eye {
    /* Larger eyes, filling the box */
    width: 40px;
    height: 40px;
    background-color: var(--cream-background, #fbf0dc);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.pupil {
    /* Proportionally larger pupils */
    width: 16px;
    height: 16px;
    background-color: #000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

/* ------------------------------------- */


/* =========================================
   Floating Window (cursor-follow, X axis only)
   ========================================= */
.floating-window {
    position: absolute;
    top: 14rem;          /* below nav + comfortable margin */
    left: 50%;
    margin-left: -310px; /* center 620px width element without percentage transform */
    transform: translate3d(0, 0, 0);
    width: 620px;
    height: 372px;       /* 16:9 ratio ready for video */

        /* Glassmorphism matching nav */
    background-image: linear-gradient(144.46deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    backdrop-filter: blur(21px);
    -webkit-backdrop-filter: blur(21px);
    border-radius: 16px;
    border: 1px solid #151515;

    transform-origin: center center;
    opacity: 0;          /* hidden until JS triggers animation */
    z-index: 500;
    will-change: transform;
}

@keyframes crtOn {
    0% {
        transform: translate3d(0, 0, 0) scaleX(0.01) scaleY(0.01);
        border-radius: 50%;
        opacity: 1;
    }
    28% {
        transform: translate3d(0, 0, 0) scaleX(1) scaleY(0.018);
        border-radius: 4px;
        opacity: 1;
    }
    70% {
        transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
        border-radius: 16px;
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
        border-radius: 16px;
        opacity: 1;
    }
}

.floating-window.crt-on {
    animation: crtOn 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

body.dark .floating-window {
    background-image: linear-gradient(144.46deg, rgba(30, 41, 59, 0.6) 0%, rgba(30, 41, 59, 0.2) 100%);
    border: 1px solid var(--border);
}

/* =========================================
   Video buffer spinner (full-screen, solid bg)
   ========================================= */
#video-buffer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #DFFAAA;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#video-buffer.hidden {
    opacity: 0;
    pointer-events: none;
}

body.dark #video-buffer {
    background: #141414;
}

/* Animoji buffer loader */
.buffer-animoji {
    width: 72px;
    height: 72px;
    object-fit: contain;
    animation: animojiPulse 3s ease-in-out infinite;
}

@keyframes animojiPulse {
    0%   { transform: rotate(0deg)   scale(1);    }
    50%  { transform: rotate(180deg) scale(1.12); }
    100% { transform: rotate(360deg) scale(1);    }
}

/* On mobile: stay centered, no cursor follow */
@media (max-width: 640px) {
    .floating-window {
        width: calc(100% - 3rem);
        height: auto;
        aspect-ratio: 16 / 9;
        transform: translateX(-50%) !important;
    }
}

/* =========================================
   Window Title split-flap reveal
   ========================================= */
.window-title {
    position: absolute;
    top: calc(14rem + 372px + 3rem);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: var(--nav-max-width);
    text-align: center;
    white-space: nowrap;
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 3rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.02rem;
    color: #111111;
    opacity: 0;
    z-index: 500;
    transition: letter-spacing 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.window-title.visible {
    opacity: 1;
}

body.dark .window-title {
    color: #ffffff;
}

.window-title.spread {
    letter-spacing: 0.12em;
    overflow: visible;
    white-space: nowrap;
    width: 100vw;
    max-width: none;
}

/* =========================================
   Hero Bio (below DESIGN ENGINEER title)
   ========================================= */
.hero-bio {
    position: absolute;
    top: calc(14rem + 372px + 3rem + 5rem);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 780px;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1.75;
    color: var(--text-secondary);
    z-index: 500;
    transition: color 0.3s ease;
}

body.dark .hero-bio {
    color: var(--text-secondary);
}

/* =========================================
   Location Badge
   ========================================= */
.location-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-family: var(--font-sans);
    z-index: 50;
    cursor: default;
}

.location-primary {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    transition: color 0.3s ease;
}

.location-secondary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.2;
    transition: color 0.3s ease;
}

/* =========================================
   Japanese Flag Hover Overlay
   ========================================= */
.japan-flag-overlay {
    position: absolute;
    inset: -0.6rem -0.75rem;
    pointer-events: none;
    z-index: 10;
    visibility: hidden;
    transition: visibility 0s 1.2s; /* stay visible long enough for fade-out to finish */
}

.location-badge:hover .japan-flag-overlay {
    visibility: visible;
    transition: visibility 0s 0s; /* show immediately on hover */
}

/* Glass layer background, blur, and border all animate together */
.japan-flag-glass {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid transparent;
    transition: background-color 1.1s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 1.1s cubic-bezier(0.25, 1, 0.5, 1),
                backdrop-filter 1.1s cubic-bezier(0.25, 1, 0.5, 1),
                -webkit-backdrop-filter 1.1s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 2;
    overflow: hidden;
}

/* Cursor-following glow spotlight mirroring nav glow */
.japan-flag-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(
        circle 70px at var(--glow-x, -200px) var(--glow-y, -200px),
        rgba(255, 255, 255, 0.24),
        transparent 90%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.location-badge:hover .japan-flag-glass::after {
    opacity: 1;
}

body.dark .japan-flag-glass {
    background-color: rgba(20, 30, 48, 0);
}

.location-badge:hover .japan-flag-glass {
    background-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(21px);
    -webkit-backdrop-filter: blur(21px);
    border-color: #151515;
}

body.dark .location-badge:hover .japan-flag-glass {
    background-color: rgba(20, 30, 48, 0.72);
    border-color: var(--border);
}

/* =========================================
   Split-flap digit animation
   ========================================= */
.flip-char {
    display: inline-block;
}

@keyframes splitFlap {
    0%   { transform: rotateX(0deg);    opacity: 1;   }
    40%  { transform: rotateX(-90deg);  opacity: 0.2; }
    60%  { transform: rotateX(90deg);   opacity: 0.2; }
    100% { transform: rotateX(0deg);    opacity: 1;   }
}

.flip-char.flipping {
    animation: splitFlap 0.12s ease-in-out;
    transform-origin: center center;
}

/* Red dot sits in front of the glass */
.japan-flag-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24%;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: #BC002D;
    filter: blur(3px);
    opacity: 0;
    transition: opacity 1.1s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 3;
}

.location-badge:hover .japan-flag-circle {
    opacity: 1;
}

/* =========================================
   Japan Time Display
   ========================================= */
.japan-time {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    font-family: var(--font-sans);
    z-index: 50;
}

.japan-time-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.japan-time-label::after {
    content: '';
    width: 0.7em;
    height: 0.7em;
    border-radius: 50%;
    background-color: #39FF14;
    flex-shrink: 0;
}

.japan-time-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 0.3s ease;
}

/* =========================================
   Work Section
   ========================================= */
.work-section {
    width: 100%;
    padding-top: 5rem;
    padding-bottom: 6rem;
}

.work-header {
    padding: 0 1.5rem 1.5rem;
}

.work-label {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    width: 100%;
    background-color: var(--border);
}

.work-card {
    position: relative;
    aspect-ratio: 16 / 5.85;
    background-color: var(--card-bg);
    overflow: hidden;
    cursor: pointer;
    /* Hidden until scrolled into view */
    opacity: 0;
    transform: translateY(48px);
    transition:
        opacity 0.65s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: calc(var(--i, 0) * 120ms);
}

.work-section.in-view .work-card {
    opacity: 1;
    transform: translateY(0);
}

/* Cover image (project cards with photo) */
.work-card-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.work-card--has-cover:hover .work-card-cover {
    transform: scale(1.04);
}

/* Gradient overlay so text is legible over the photo */
.work-card--has-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.work-card--has-cover .work-card-body {
    z-index: 2;
}

.work-card--has-cover .work-card-num,
.work-card--has-cover .work-card-tag {
    color: rgba(255, 255, 255, 0.65);
}

.work-card--has-cover .work-card-title {
    color: #ffffff;
}

.work-card--has-cover .work-card-arrow {
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
}

/* Subtle hover tint */
.work-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.work-card:hover::after {
    background: rgba(0, 0, 0, 0.05);
}

body.dark .work-card:hover::after {
    background: rgba(255, 255, 255, 0.05);
}

/* Cover cards don't need the plain hover tint */
.work-card--has-cover::after {
    display: none;
}

.work-card-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    gap: 0.35rem;
}

.work-card-num {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.work-card-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.work-card-tag {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
    transition: color 0.3s ease;
}

/* Arrow icon top right, fades in on hover */
.work-card-arrow {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 18px !important;
    color: var(--text-secondary);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity 0.25s ease, transform 0.25s ease, color 0.3s ease;
}

.work-card:hover .work-card-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

/* Make <a> work-cards look identical to <div> ones */
a.work-card {
    display: block;
    text-decoration: none;
}

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

/* =========================================
   Hobbies Section
   ========================================= */
.hobbies-section {
    width: 100%;
    padding-top: 5rem;
    padding-bottom: 6rem;
}

.hobbies-header {
    padding: 0 1.5rem 1.5rem;
}

.hobbies-label {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.hobbies-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    width: 100%;
    background-color: var(--border);
}

.hobby-card {
    position: relative;
    aspect-ratio: 16 / 5.85;
    background-color: var(--card-bg);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(48px);
    transition:
        opacity 0.65s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: calc(var(--i, 0) * 120ms);
}

.hobbies-section.in-view .hobby-card {
    opacity: 1;
    transform: translateY(0);
}

.hobby-card-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hobby-card--has-cover:hover .hobby-card-cover {
    transform: scale(1.04);
}

.hobby-card--has-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.hobby-card--has-cover .hobby-card-body {
    z-index: 2;
}

.hobby-card--has-cover .hobby-card-num,
.hobby-card--has-cover .hobby-card-tag {
    color: rgba(255, 255, 255, 0.65);
}

.hobby-card--has-cover .hobby-card-title {
    color: #ffffff;
}

.hobby-card--has-cover .hobby-card-arrow {
    z-index: 2;
    color: rgba(255, 255, 255, 0.7);
}

.hobby-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.hobby-card:hover::after {
    background: rgba(0, 0, 0, 0.05);
}

body.dark .hobby-card:hover::after {
    background: rgba(255, 255, 255, 0.05);
}

.hobby-card--has-cover::after {
    display: none;
}

.hobby-card-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    gap: 0.35rem;
}

.hobby-card-num {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.hobby-card-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hobby-card-tag {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hobby-card-arrow {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 18px !important;
    color: var(--text-secondary);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity 0.25s ease, transform 0.25s ease, color 0.3s ease;
}

.hobby-card:hover .hobby-card-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

a.hobby-card {
    display: block;
    text-decoration: none;
}

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

/* =========================================
   Contact CTA
   ========================================= */
.contact-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1.5rem 6rem;
    gap: 1.5rem;
}

.contact-cta-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.cta-question {
    font-style: italic;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.cta-qmark {
    font-style: normal;
    color: var(--text-primary);
}

.cta-oblique {
    font-style: oblique;
}

.cta-highlight {
    background: linear-gradient(135deg, #166534 0%, #15803d 50%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-cta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border-radius: 999px;
    border: 1.5px solid var(--text-primary, #111);
    background: transparent;
    color: var(--text-primary, #111);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, gap 0.22s ease;
}

.contact-cta-pill:hover {
    background: var(--text-primary, #111);
    color: var(--bg, #fff);
    transform: translateY(-2px);
    gap: 0.9rem;
}

body.dark .contact-cta-pill {
    border-color: #fff;
    color: #fff;
}

body.dark .contact-cta-pill:hover {
    background: #fff;
    color: #111;
}

.contact-cta-pill .material-icons-round {
    font-size: 18px;
    transition: transform 0.22s ease;
}

.contact-cta-pill:hover .material-icons-round {
    transform: translateX(3px);
}

/* =========================================
   App Store Modal
   ========================================= */
.as-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.as-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.as-panel {
    width: 100%;
    max-width: 860px;
    background: #1c1c1e;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.as-overlay.visible .as-panel {
    transform: translateX(0);
}

.as-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.as-panel-title {
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.as-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.as-close-btn:hover { background: rgba(255,255,255,0.2); }

.as-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.as-section-title {
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.as-list { display: flex; flex-direction: column; }

.as-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.as-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 0.75rem;
    cursor: pointer;
    border-right: 1px solid rgba(255,255,255,0.07);
    transition: background 0.18s;
}

.as-item:last-child { border-right: none; }
.as-item:hover { background: rgba(255,255,255,0.04); }

.as-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.as-item-info { flex: 1; min-width: 0; }

.as-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-item-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.as-item-iap {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    margin-top: 0.4rem;
}

.as-item-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #2997ff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.as-item-btn:hover { background: rgba(41,151,255,0.18); }

/* =========================================
   App Detail Modal
   ========================================= */
.asd-overlay {
    position: fixed;
    inset: 0;
    background: #1c1c1e;
    z-index: 3100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.asd-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.asd-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.asd-topbar {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.asd-back-btn {
    background: none;
    border: none;
    color: #2997ff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.asd-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    max-width: 900px;
}

.asd-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1.5rem;
}

.asd-icon {
    width: 110px;
    height: 110px;
    border-radius: 22px;
    object-fit: cover;
    flex-shrink: 0;
}

.asd-name {
    font-family: 'Helvetica', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.asd-tagline {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 1rem;
}

.asd-price-btn {
    background: #2997ff;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1.4rem;
    border-radius: 20px;
    cursor: pointer;
}

.asd-stats {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1.75rem;
}

.asd-stat {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.asd-stat:last-child { border-right: none; }

.asd-stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.3rem;
}

.asd-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}

.asd-stat-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    margin-top: 0.15rem;
}

.asd-screenshots {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1.75rem;
    scrollbar-width: none;
}

.asd-screenshots::-webkit-scrollbar { display: none; }

.asd-screenshot {
    height: 240px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
}

.asd-platform {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 1rem;
}

.asd-description {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.65);
    max-width: 660px;
    margin-bottom: 2rem;
}

.asd-dev-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.25rem;
}

.asd-dev-link {
    font-size: 0.88rem;
    color: #2997ff;
    cursor: pointer;
}

/* =========================================
   Mobile Responsive – Hero Flow
   ========================================= */
@media (max-width: 640px) {
    .japan-time {
        top: 2.75rem;
    }

    /* Convert hero to normal flow on mobile */
    .main-container {
        padding-top: 13rem;
        gap: 1.5rem;
        align-items: stretch;
    }

    .floating-window {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        margin: 0;
    }


    /* CRT animation without the translateX(-50%) offset */
    .floating-window.crt-on {
        animation: crtOnMobile 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    }

    .window-title {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        white-space: normal;
        font-size: 2rem;
        width: 100%;
        max-width: 100%;
        text-align: center;
        margin-top: 0;
    }

    .hero-bio {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100%;
        max-width: 100%;
        font-size: 1rem;
        padding: 0;
        text-align: center;
        margin-top: 0;
    }

    /* App Store modal: bottom sheet on mobile */
    .as-overlay {
        align-items: flex-end;
        justify-content: stretch;
    }

    .as-panel {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .as-overlay.visible .as-panel {
        transform: translateY(0);
    }

    /* App store items: single column on mobile */
    .as-row {
        grid-template-columns: 1fr;
    }

    /* Scale down fullscreen monster eyes */
    .fullscreen-eyes-bg .eyes-wrapper {
        transform: scale(2.2);
    }

    /* Floating eyes widget: smaller on mobile */
    .floating-eyes-widget {
        width: 60px;
        height: 60px;
        bottom: 1.25rem;
        left: calc(100vw - 1.25rem - 60px);
    }

    .floating-eyes-widget .eye {
        width: 22px;
        height: 22px;
    }

    .floating-eyes-widget .pupil {
        width: 9px;
        height: 9px;
    }

    .floating-eyes-widget .eyes-wrapper {
        gap: 3px;
    }

    /* Contact CTA: tighter padding */
    .contact-cta-wrap {
        padding: 3rem 1rem 4rem;
    }

    /* Card body padding */
    .work-card-body,
    .hobby-card-body {
        padding: 1.25rem;
    }
}

@keyframes crtOnMobile {
    0%   { transform: scaleX(0.01) scaleY(0.01); border-radius: 50%; opacity: 1; }
    28%  { transform: scaleX(1) scaleY(0.018); border-radius: 4px; opacity: 1; }
    70%  { transform: scaleX(1) scaleY(1); border-radius: 16px; opacity: 1; }
    100% { transform: scaleX(1) scaleY(1); border-radius: 16px; opacity: 1; }
}