/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --text-2: #a1a1a6;
    --secondary-text: #86868b;
    --accent-color: #2997ff;
    --button-blue: #0071e3;
    --card-bg: #161618;
    --line: rgba(255, 255, 255, 0.1);
    --radius-lg: 28px;
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1120px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

section {
    scroll-margin-top: 52px;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes blurIn {
    from { opacity: 0; filter: blur(20px); transform: scale(1.1); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes drift {
    from { transform: translate3d(-3%, -2%, 0) scale(1); }
    to { transform: translate3d(3%, 3%, 0) scale(1.08); }
}

@keyframes cue {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}

.reveal {
    opacity: 0;
}

.reveal.active.fade-up {
    animation: fadeInUp 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal.active.scale-in {
    animation: scaleIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal.active.blur-in {
    animation: blurIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ==========================================================================
   Typography
   ========================================================================== */
h1 {
    font-size: clamp(52px, 11vw, 104px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

h2 {
    font-size: clamp(32px, 5.4vw, 56px);
    font-weight: 600;
    line-height: 1.07;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

h3 {
    font-size: clamp(21px, 2.4vw, 28px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

p {
    font-size: clamp(17px, 1.9vw, 19px);
    color: var(--text-2);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.012em;
    margin-bottom: 20px;
}

.section-sub {
    font-size: clamp(19px, 2.4vw, 24px);
    line-height: 1.3;
    max-width: 640px;
    margin-bottom: 48px;
}

.micro-label {
    font-size: 13px;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 15px;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: clamp(64px, 10vw, 128px) 0;
}

.section-tight {
    padding-top: 0;
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.022em;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease;
}

.btn-primary {
    background: var(--button-blue);
    color: #fff;
}

.btn-primary:hover {
    background: #0077ed;
    transform: scale(1.03);
}

.link-arrow {
    display: inline-flex;
    gap: 5px;
    color: var(--accent-color);
    font-size: 17px;
    letter-spacing: -0.022em;
    text-decoration: none;
}

.link-arrow::after {
    content: "›";
    transition: transform 0.25s ease;
}

.link-arrow:hover {
    text-decoration: underline;
}

.link-arrow:hover::after {
    transform: translateX(3px);
}

/* ==========================================================================
   Navigation (frosted, Apple-style)
   ========================================================================== */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 52px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.site-nav.scrolled {
    background: rgba(22, 22, 23, 0.72);
    border-bottom-color: var(--line);
}

.nav-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    text-decoration: none;
}

.nav-mark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: rgba(245, 245, 247, 0.8);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #fff;
}

.nav-links .nav-cta {
    background: var(--button-blue);
    color: #fff;
    padding: 6px 14px;
    border-radius: 980px;
    font-weight: 500;
}

.nav-links .nav-cta:hover {
    background: #0077ed;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    padding: 92px 0 72px;
}

.hero-glow {
    position: absolute;
    inset: -10% -10% auto;
    height: 85%;
    z-index: -1;
    background:
        radial-gradient(40% 50% at 28% 42%, rgba(41, 151, 255, 0.38), transparent 70%),
        radial-gradient(34% 46% at 72% 30%, rgba(175, 82, 222, 0.30), transparent 70%),
        radial-gradient(30% 40% at 55% 72%, rgba(48, 209, 200, 0.20), transparent 70%);
    will-change: transform;
    animation: drift 18s ease-in-out infinite alternate;
}

.eyebrow {
    font-size: clamp(17px, 2.4vw, 21px);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--accent-color);
    margin-bottom: 14px;
}

.hero h1 {
    background: linear-gradient(180deg, #ffffff 30%, #8e8e93);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    max-width: 640px;
    margin: 8px auto 36px;
    font-size: clamp(19px, 2.6vw, 24px);
    line-height: 1.35;
}

.hero-cta {
    display: flex;
    gap: 22px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.scroll-cue {
    position: absolute;
    bottom: 28px;
    left: 50%;
    width: 26px;
    height: 42px;
    margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
}

.scroll-cue span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 3px;
    height: 8px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.6);
    animation: cue 1.8s ease-in-out infinite;
}

/* ==========================================================================
   Profile & intro
   ========================================================================== */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 44px;
    text-align: center;
}

.profile-img {
    width: min(300px, 70vw);
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(20%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 40px 100px rgba(41, 151, 255, 0.18);
    transition: filter 0.5s ease;
}

.profile-img:hover {
    filter: grayscale(0%);
}

.intro {
    max-width: 720px;
}

/* ==========================================================================
   Specs
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 32px;
    margin-top: 8px;
}

.stat-item {
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.stat-value {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 17px;
    color: var(--secondary-text);
}

/* ==========================================================================
   Spotlight (cursor-following glow on bento cards)
   ========================================================================== */
.spot {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.spot::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.09), transparent 45%);
    transition: opacity 0.4s ease;
}

.spot > * {
    position: relative;
    z-index: 1;
}

@media (hover: hover) {
    .spot:hover {
        transform: translateY(-3px);
    }

    .spot:hover::before {
        opacity: 1;
    }
}

/* ==========================================================================
   Apps & projects bento
   ========================================================================== */
.bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(280px, auto);
    gap: 16px;
}

.tile {
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 3.4vw, 40px);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    color: inherit;
    text-decoration: none;
}

.tile p {
    font-size: 17px;
    margin-bottom: 0;
}

.icon {
    display: block;
    width: 32px;
    height: 32px;
}

.tile-icon {
    margin-bottom: auto;
    padding-bottom: 24px;
}

.tile-frame .tile-icon { color: #ffb340; }

.tile-frame {
    background: radial-gradient(120% 90% at 100% 0%, rgba(255, 159, 10, 0.22), transparent 60%), var(--card-bg);
}

/* Featured: Soi! uses its own brand palette */
.tile-soi {
    grid-column: span 2;
    justify-content: flex-end;
    background: linear-gradient(160deg, #ffd58a 0%, #ff8a6e 55%, #ff6f61 100%);
    border-color: transparent;
    color: #3c1e46;
}

.tile-soi::before {
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.28), transparent 45%);
}

.tile-soi h3 {
    font-size: clamp(40px, 6vw, 64px);
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin-bottom: 14px;
}

.tile-soi p {
    max-width: 30em;
    font-size: clamp(17px, 2vw, 20px);
    color: rgba(60, 30, 70, 0.82);
}

.tile-app-icon {
    width: 88px;
    height: 88px;
    border-radius: 22%;
    box-shadow: 0 16px 36px rgba(60, 30, 70, 0.3);
}

.soi-art {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 220px;
    padding: 28px 0;
}

.soi-art img {
    width: clamp(110px, 24%, 200px);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 24px 50px rgba(60, 30, 70, 0.35);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.soi-art img:nth-child(1) { transform: rotate(-6deg) translateY(10px); }
.soi-art img:nth-child(2) { transform: translateY(-14px); }
.soi-art img:nth-child(3) { transform: rotate(6deg) translateY(10px); }

@media (hover: hover) {
    .tile-soi:hover .soi-art img:nth-child(1) { transform: rotate(-9deg) translate(-8px, 6px); }
    .tile-soi:hover .soi-art img:nth-child(2) { transform: translateY(-22px) scale(1.03); }
    .tile-soi:hover .soi-art img:nth-child(3) { transform: rotate(9deg) translate(8px, 6px); }
}

.tile-soi .pill-live {
    color: #14612f;
}

.tile-soi .tags span {
    background: rgba(60, 30, 70, 0.12);
    color: #3c1e46;
}

.tile-link {
    margin-top: 24px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.tile-link::after {
    content: " ›";
}

.tile-soi:hover .tile-link {
    text-decoration: underline;
}

.tile-soi:focus-visible {
    outline-color: #3c1e46;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.pill-live { color: #30d158; }
.pill-wip { color: #ffb340; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tags span {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 980px;
}

/* ==========================================================================
   Philosophy bento
   ========================================================================== */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: dense;
    gap: 16px;
    margin-top: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 3vw, 36px);
}

.card-wide {
    grid-column: span 2;
}

.card-full {
    grid-column: span 3;
}

.lifecycle {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    counter-reset: step;
}

.lifecycle li {
    counter-increment: step;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 980px;
    background: rgba(41, 151, 255, 0.1);
    border: 1px solid rgba(41, 151, 255, 0.3);
    color: #8cc8ff;
    font-size: 14px;
    font-weight: 500;
}

.lifecycle li::before {
    content: counter(step);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    opacity: 0.7;
}

.card-icon {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.card p {
    font-size: 17px;
    margin-bottom: 0;
}

.lang-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    color: #d1d1d6;
    font-size: 16px;
}

/* ==========================================================================
   Personal / get to know me
   ========================================================================== */
.personal-intro {
    text-align: center;
}

.personal-intro p {
    max-width: 600px;
    margin: 0 auto 36px;
}

.personal-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid var(--line);
    padding: 15px 28px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-main);
    letter-spacing: -0.022em;
    cursor: pointer;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.personal-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.02);
}

.personal-toggle .plus-icon {
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.3s ease;
}

.personal-toggle[aria-expanded="true"] .plus-icon {
    transform: rotate(45deg);
}

.personal-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.personal-panel.open {
    opacity: 1;
}

.pp-inner {
    padding-top: 56px;
}

.personal-panel.open .pp-item {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

.personal-intro {
    scroll-margin-top: 70px;
}

.facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.fact {
    padding: 24px 26px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--line);
}

.fact-value {
    display: block;
    font-size: clamp(30px, 4.4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.fact-label {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--secondary-text);
}

/* Floating close button, visible while scrolling through the open section */
.personal-fab {
    position: fixed;
    top: 66px;
    left: 50%;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 980px;
    border: 1px solid var(--line);
    background: rgba(28, 28, 30, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.personal-fab.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
}

.personal-fab:hover {
    background: rgba(58, 58, 60, 0.92);
}

.lifestyle {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: clamp(32px, 6vw, 64px);
    text-align: center;
}

.lifestyle-copy {
    color: #b0b0b5;
    margin: 20px auto;
    max-width: 600px;
}

.lifestyle-block {
    margin: 30px 0;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.lifestyle-block .chips {
    margin-top: 0;
}

.chip {
    background: #2a2a2d;
    color: white;
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
}

.arcade {
    margin-top: 64px;
}

/* Games (Apple Arcade style) */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.game-card {
    height: 320px;
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    cursor: default;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.game-elden { background: linear-gradient(135deg, #1a1a1a, #6e5c3e); }
.game-hearthstone { background: linear-gradient(135deg, #2c1a0e, #d4a04d); }
.game-expedition { background: linear-gradient(135deg, #0e1a2c, #c93b3b); }
.game-starwars { background: linear-gradient(135deg, #000000, #1e3a8a); }

.game-content {
    position: relative;
    z-index: 2;
}

.game-genre {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.game-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 5px;
}

.game-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
    opacity: 0.8;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.8));
    z-index: 1;
}

/* ==========================================================================
   Photography (full-bleed, edge-faded)
   ========================================================================== */
.scrolling-gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px max(20px, calc((100vw - var(--max-width)) / 2 + 20px)) 40px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-wrap {
    position: relative;
}

.gallery-wrap::before,
.gallery-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(24px, 8vw, 120px);
    z-index: 2;
    pointer-events: none;
}

.gallery-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-color), transparent);
}

.gallery-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg-color), transparent);
}

.scrolling-gallery::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 auto;
    width: clamp(220px, 28vw, 300px);
    aspect-ratio: 3 / 4;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* ==========================================================================
   Footer / contact
   ========================================================================== */
.site-footer {
    text-align: center;
    padding: clamp(72px, 10vw, 140px) 0 48px;
    border-top: 1px solid var(--line);
}

.site-footer h2 {
    max-width: 14em;
    margin: 0 auto 32px;
}

.footer-cta {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.footer-mail {
    margin-top: 28px;
    font-size: 15px;
    color: var(--secondary-text);
}

.legal {
    margin-top: 56px;
    margin-bottom: 0;
    font-size: 12px;
    color: var(--secondary-text);
}

/* ==========================================================================
   Gamer layer: HUD labels, XP bar, achievements, loadout, arcade mode
   ========================================================================== */
.hud-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #30d158;
}

.hud-tag::before {
    content: ">";
    opacity: 0.7;
}

.hud-tag::after {
    content: "";
    width: 7px;
    height: 12px;
    background: currentColor;
    opacity: 0.85;
    animation: blink 1.1s steps(1) infinite;
}

.hud-tag--dim {
    color: var(--secondary-text);
}

.personal-intro .hud-tag,
.site-footer .hud-tag {
    justify-content: center;
}

@keyframes blink {
    0%, 55% { opacity: 0.85; }
    56%, 100% { opacity: 0; }
}

.stat-tag {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--secondary-text);
    margin-bottom: 8px;
}

.icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* XP bar */
.xp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    pointer-events: none;
}

.xp-bar span {
    display: block;
    height: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #2997ff, #af52de 55%, #30d158);
    box-shadow: 0 0 12px rgba(41, 151, 255, 0.6);
}

/* Achievements: counter, panel, toast */
.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.ach-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 980px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 245, 247, 0.85);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.ach-counter:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ach-counter.pulse {
    animation: pulse 0.9s ease-out;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); color: #30d158; }
    100% { box-shadow: 0 0 0 14px rgba(48, 209, 88, 0); }
}

.ach-panel {
    position: absolute;
    top: 60px;
    right: max(20px, calc((100vw - var(--max-width)) / 2 + 20px));
    width: min(360px, calc(100vw - 40px));
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(22, 22, 24, 0.96);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.ach-panel[hidden] {
    display: none;
}

.ach-panel .hud-tag {
    margin-bottom: 12px;
}

.ach-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ach-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #6e6e73;
}

.ach-item .icon-sm {
    margin-top: 3px;
}

.ach-item strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ach-item span {
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.ach-item.is-done {
    color: var(--text-color);
}

.ach-item.is-done .icon-sm {
    color: #30d158;
}

.ach-item.is-done span {
    color: var(--text-2);
}

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    gap: 14px;
    align-items: center;
    width: min(340px, calc(100vw - 40px));
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(48, 209, 88, 0.35);
    background: rgba(22, 22, 24, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    color: #30d158;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast .icon-sm {
    width: 26px;
    height: 26px;
}

.toast p {
    margin: 0;
    letter-spacing: 0;
    line-height: 1.3;
}

.toast-kicker {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10.5px !important;
    font-weight: 700;
    letter-spacing: 0.14em !important;
    text-transform: uppercase;
    color: #30d158 !important;
}

.toast-title {
    font-size: 16px !important;
    font-weight: 600;
    color: var(--text-color) !important;
}

.toast-desc {
    font-size: 13px !important;
    color: var(--text-2) !important;
}

/* Frame tile: viewfinder graphic */
.tile-frame .tile-icon {
    margin-bottom: 0;
    padding-bottom: 0;
}

.frame-art {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 220px;
    padding: 24px 0;
}

.viewfinder {
    position: relative;
    width: min(100%, 190px);
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(255, 255, 255, 0.03);
    background-image:
        linear-gradient(90deg, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.16) calc(33.33% - 0.5px) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.16) calc(66.66% - 0.5px) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
        linear-gradient(0deg, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.16) calc(33.33% - 0.5px) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.16) calc(66.66% - 0.5px) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px));
}

.vf-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid #ffb340;
}

.vf-tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.vf-tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.vf-bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.vf-br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.vf-dot {
    position: absolute;
    left: 66.66%;
    top: 33.33%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #ffb340;
    box-shadow: 0 0 0 6px rgba(255, 179, 64, 0.2);
    animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(255, 179, 64, 0.22); }
    50% { box-shadow: 0 0 0 11px rgba(255, 179, 64, 0.06); }
}

.vf-hint {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb340;
    background: rgba(255, 179, 64, 0.1);
    border: 1px solid rgba(255, 179, 64, 0.3);
    padding: 6px 12px;
    border-radius: 980px;
    text-align: center;
}

/* Loadout */
.loadout {
    margin-top: 56px;
}

.loadout-card {
    padding: clamp(24px, 3.4vw, 40px);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
}

.slot-groups {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.slot-group {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 20px;
    align-items: start;
}

.slot-label {
    margin: 0;
    padding-top: 8px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.slot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.slot--on {
    color: var(--text-color);
    background: rgba(48, 209, 88, 0.08);
    border: 1px solid rgba(48, 209, 88, 0.32);
}

.slot--on::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 8px #30d158;
}

/* Zibao tile (uses the app's own paper palette) */
.tile-zibao {
    grid-column: span 3;
    background: #faf2de;
    border-color: transparent;
    color: #2e2114;
}

.tile-zibao::before {
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(215, 54, 43, 0.12), transparent 45%);
}

.tile-zibao .glyph {
    position: absolute;
    right: clamp(8px, 3vw, 40px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
    font-size: clamp(110px, 17vw, 220px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #d7362b;
    opacity: 0.14;
    pointer-events: none;
    user-select: none;
}

.tile-zibao p {
    max-width: 30em;
    color: #6b5233;
}

.tile-zibao h3 {
    font-size: clamp(32px, 4.4vw, 48px);
    letter-spacing: -0.03em;
}

.tile-zibao .pill-soon {
    color: #bd3026;
}

.tile-zibao .tags span {
    background: rgba(46, 33, 20, 0.08);
    color: #6b5233;
}

.tile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: auto;
    padding-bottom: 28px;
}

.tile-app-icon--sm {
    width: 72px;
    height: 72px;
    box-shadow: 0 12px 28px rgba(46, 33, 20, 0.28);
}

.tones {
    display: flex;
    gap: 7px;
}

.tones span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c);
}

.pill-soon {
    color: #64d2ff;
}

/* Arcade mode (Konami code) */
html.arcade-mode {
    --accent-color: #30d158;
    --button-blue: #1e8e3e;
}

html.arcade-mode .hero-glow {
    filter: hue-rotate(120deg) saturate(1.4);
}

html.arcade-mode body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 250;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

.hint-touch {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .hint-kb {
        display: none;
    }

    .hint-touch {
        display: inline;
    }
}

.legal--hint {
    margin-top: 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
    .bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .tile-soi,
    .tile-zibao {
        grid-column: auto;
        grid-row: auto;
    }

    .tile-icon {
        padding-bottom: 40px;
    }

    .tile-zibao .glyph {
        top: 18px;
        right: 18px;
        transform: none;
        font-size: 96px;
        opacity: 0.12;
    }

    .tile-soi {
        min-height: 460px;
    }

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

    .card-full {
        grid-column: span 2;
    }

    .slot-group {
        grid-template-columns: 1fr;
    }

    .slot-label {
        padding-top: 0;
    }
}

@media (max-width: 600px) {
    .nav-links li:not(:last-child) {
        display: none;
    }


    .nav-right {
        gap: 12px;
    }

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

    .toast-region {
        top: 64px;
        bottom: auto;
        left: 16px;
        right: 16px;
    }

    .toast {
        width: 100%;
        transform: translateY(-12px) scale(0.97);
    }

    .stats-grid,
    .philosophy-grid {
        grid-template-columns: 1fr;
    }

    .card-wide,
    .card-full {
        grid-column: auto;
    }

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

    .fact {
        display: flex;
        align-items: baseline;
        gap: 14px;
        padding: 18px 22px;
    }

    .fact-label {
        margin-top: 0;
    }

    .game-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 14px;
        padding-bottom: 12px;
        scrollbar-width: none;
    }

    .game-grid::-webkit-scrollbar {
        display: none;
    }

    .game-card {
        flex: 0 0 78%;
        scroll-snap-align: center;
    }

    .br-desktop {
        display: none;
    }

    .game-card {
        height: 280px;
    }
}

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

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

    .hero-glow,
    .scroll-cue span,
    .hud-tag::after,
    .vf-dot,
    .ach-counter.pulse {
        animation: none !important;
    }

    .toast,
    .xp-bar span,
    .personal-fab {
        transition: none !important;
    }

    .pp-item {
        animation: none !important;
    }

    .spot,
    .spot::before,
    .btn,
    .personal-panel,
    .personal-toggle,
    .personal-toggle .plus-icon,
    .game-card,
    .profile-img,
    .soi-art img,
    .gallery-item img {
        transition: none !important;
    }
}

@media (max-width: 359px) {
    .nav-name {
        display: none;
    }
}
