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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 179, 255, 0.2);
}
a, button {
    -webkit-tap-highlight-color: rgba(0, 179, 255, 0.2);
    touch-action: manipulation;
}

:root {
    --bg: #050508;
    --bg-2: #0a0a12;
    --bg-3: #12121c;
    --card: #0d0d15;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.18);
    --text: #ffffff;
    --text-dim: #8a8a9a;
    --text-muted: #555566;
    --accent: #00b3ff;
    --accent-glow: rgba(0, 179, 255, 0.5);
    --accent-soft: rgba(0, 179, 255, 0.08);
    --success: #00ff88;
    --warning: #ffb800;

    --light-bg: #f5f1e8;
    --light-bg-2: #ede8d8;
    --light-line: rgba(0,0,0,0.08);
    --light-line-strong: rgba(0,0,0,0.15);
    --light-text: #0f0f17;
    --light-text-dim: #4a4a5a;
    --light-text-muted: #8a8a9a;
    --light-card: #fffdf5;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.05 0 0 0 0 0.1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

section.section-light {
    position: relative;
    z-index: 2;
}
section.section-light::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}
section.section-light > .container {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 2;
}

.hud {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(10, 10, 18, 0.96);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 8px 8px 8px 20px;
    font-family: 'JetBrains Mono', monospace;
    transition: padding 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                min-width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 480px;
    height: 44px;
    display: flex;
    align-items: center;
}
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .hud {
        background: rgba(10, 10, 18, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}
.hud[data-mode="compact"] {
    min-width: 0;
    padding: 6px 8px;
}

.hud-state {
    display: flex;
    align-items: center;
    gap: 18px;
    opacity: 1;
    transition: opacity 0.3s ease;
    width: 100%;
}
.hud-state.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    inset: 0;
    padding: 8px 8px 8px 20px;
}
.hud-state--compact {
    gap: 4px;
    justify-content: center;
}

.hud-logo {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hud-logo::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-glow); }
    50% { opacity: 0.6; box-shadow: 0 0 14px var(--accent-glow); }
}
.hud-logo span { color: var(--accent); }
.hud-divider {
    width: 1px;
    height: 14px;
    background: var(--line-strong);
}
.hud-links {
    display: flex;
    gap: 16px;
    list-style: none;
}
.hud-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.3px;
}
.hud-links a:hover {
    color: var(--text);
}
.hud-cta {
    background: var(--accent);
    color: var(--bg);
    padding: 7px 14px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    text-transform: uppercase;
}
.hud-cta:hover {
    background: var(--text);
    box-shadow: 0 0 20px var(--accent-glow);
}

.hud-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-dim);
    background: transparent;
    transition: all 0.25s ease;
    position: relative;
}
.hud-icon-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}
.hud-icon-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 12px rgba(0, 179, 255, 0.2);
}
.hud-icon-btn .ico {
    font-size: 14px;
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}
.hud-icon-btn--cta {
    background: var(--accent);
    color: var(--bg) !important;
}
.hud-icon-btn--cta:hover {
    background: #4dcaff;
    color: var(--bg) !important;
    box-shadow: 0 0 16px var(--accent-glow);
}
.hud-icon-btn--cta.active {
    background: var(--accent) !important;
    color: var(--bg) !important;
    box-shadow: 0 0 16px var(--accent-glow);
}
.hud-icon-btn--cta.active:hover {
    background: #4dcaff !important;
}

.hud::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--accent);
    border-radius: 100px;
    transform: scaleX(var(--scroll-progress, 0));
    transform-origin: left;
    transition: transform 0.1s linear;
    box-shadow: 0 0 6px var(--accent-glow);
    opacity: 0.7;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 179, 255, 0.18), transparent 60%);
    z-index: 0;
    animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeUp 0.8s 0.1s forwards;
}
.hero-meta .pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5);
    animation: greenPulse 2s infinite;
}
@keyframes greenPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}
.hero-meta .sep {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}

.hero h1 {
    font-size: clamp(56px, 12vw, 160px);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -5px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeUp 0.9s 0.3s forwards;
}
.hero h1 .accent {
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

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

.hero-body {
    max-width: 720px;
    margin-top: 24px;
    opacity: 0;
    animation: fadeUp 0.9s 0.6s forwards;
}
.hero-text p {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-dim);
    margin-bottom: 20px;
    max-width: 640px;
}
.hero-text p strong {
    color: var(--text);
    font-weight: 600;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow);
    background: #4dcaff;
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}


section {
    padding: 120px 0;
    position: relative;
}

section.section-light {
    background: var(--light-bg);
    color: var(--light-text);
}
section.section-light .section-title {
    color: var(--light-text);
}
section.section-light .section-intro {
    color: var(--light-text-dim);
}
section.section-light .chapter {
    border-top-color: var(--light-line);
}
section.section-light .chapter:last-child {
    border-bottom-color: var(--light-line);
}
section.section-light .chapter-period {
    color: var(--light-text);
}
section.section-light .chapter-content h3 {
    color: var(--light-text);
}
section.section-light .chapter-content p {
    color: var(--light-text-dim);
}
section.section-light .explored-item {
    background: var(--light-card);
    border-color: var(--light-line);
}
section.section-light .explored-content {
    color: var(--light-text);
}
section.section-light .explored-content .dim {
    color: var(--light-text-dim);
}
section.section-light .project {
    background: var(--light-card);
    border-color: var(--light-line);
}
section.section-light .project:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 60px rgba(0, 179, 255, 0.18);
}
section.section-light .project-visual {
    background: linear-gradient(135deg, var(--light-bg-2), var(--light-bg));
}
section.section-light .project-visual::before {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}
section.section-light .project-visual-placeholder {
    color: var(--light-text-muted);
}
section.section-light .project-number {
    color: var(--light-text-dim);
}
section.section-light .project-title {
    color: var(--light-text);
}
section.section-light .project-description {
    color: var(--light-text-dim);
}
section.section-light .project-link-disabled {
    color: var(--light-text-muted);
    border-color: var(--light-text-muted);
}
.section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.section-tag::before {
    content: "▸";
    opacity: 0.6;
}
.section-title {
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 900;
    letter-spacing: -2.5px;
    line-height: 1;
    margin-bottom: 28px;
    max-width: 900px;
}
.section-title .accent {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}
.section-intro {
    font-size: 18px;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 70px;
}

.chapters {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.chapter {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    padding: 44px 0;
    border-top: 1px solid var(--line);
}
.chapter:last-child {
    border-bottom: 1px solid var(--line);
}
.chapter-meta {
    font-family: 'JetBrains Mono', monospace;
}
.chapter-number {
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.chapter-period {
    font-size: 16px;
    color: var(--text);
    font-weight: 600;
}
.chapter-content h3 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 14px;
    line-height: 1.1;
}
.chapter-content p {
    font-size: 16px;
    color: var(--text-dim);
    line-height: 1.75;
    max-width: 640px;
}

.explored-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.explored-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 24px 22px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.explored-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}
.explored-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.explored-item:hover::before {
    opacity: 1;
}
.explored-domain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
.explored-content {
    font-size: 15px;
    color: var(--text);
    line-height: 1.55;
}
.explored-content .dim {
    color: var(--text-dim);
    font-size: 13.5px;
}

.projects {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.project {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    transition: all 0.4s;
}
.project:nth-child(even) {
    grid-template-columns: 1fr 1.2fr;
}
.project:nth-child(even) .project-visual {
    order: 2;
}
.project:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 179, 255, 0.12);
}
.project-visual {
    background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.project-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 179, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 179, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}
.project-visual-placeholder {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.project-visual img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    object-position: top;
    display: block;
    position: relative;
    z-index: 1;
}
.project-visual:has(img)::before {
    display: none;
}
.project-content {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.project-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
}
.project-number {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
}
.project-status {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}
.status-online {
    background: rgba(0, 255, 136, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.3);
}
.status-progress {
    background: rgba(255, 184, 0, 0.12);
    color: var(--warning);
    border: 1px solid rgba(255, 184, 0, 0.3);
}
.project-title {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.05;
    margin-bottom: 18px;
}
.project-description {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.75;
    margin-bottom: 24px;
}
.project-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 0;
    border-bottom: 1px solid var(--accent);
    transition: gap 0.3s;
}
.project-link:hover {
    gap: 14px;
}
.project-link-disabled {
    color: var(--text-muted);
    border-color: var(--text-muted);
    cursor: default;
}
.project-link-disabled:hover {
    gap: 8px;
}

.contact {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    padding: 140px 0;
    position: relative;
    overflow: hidden;
}
.contact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 179, 255, 0.18), transparent 60%);
    animation: breathe 10s ease-in-out infinite;
}
.contact-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.contact h2 {
    font-size: clamp(40px, 7vw, 88px);
    font-weight: 900;
    letter-spacing: -2.5px;
    line-height: 1;
    margin-bottom: 24px;
}
.contact h2 .accent {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}
.contact p {
    font-size: 18px;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 540px;
    margin: 0 auto 44px;
}
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 100px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.3px;
}
.contact-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-3px);
}
.contact-link-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 700;
}
.contact-link-primary:hover {
    background: #4dcaff;
    border-color: #4dcaff;
    color: var(--bg);
    box-shadow: 0 8px 30px var(--accent-glow);
}

footer {
    background: var(--bg-2);
    padding: 28px 0;
    border-top: 1px solid var(--line);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.email-text {
    font-style: italic;
    opacity: 0.6;
    transition: opacity 0.3s, font-style 0.2s;
}
.email-protected.revealed .email-text {
    font-style: normal;
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    box-shadow: 0 8px 30px var(--accent-glow);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.retro-mode {
    --bg: #0a0420;
    --bg-2: #14082e;
    --bg-3: #1d0d3d;
    --card: #160829;
    --text: #fff4d6;
    --text-dim: #c9b899;
    --text-muted: #8a7a6a;
    --accent: #ff00aa;
    --accent-glow: rgba(255, 0, 170, 0.55);
    --accent-soft: rgba(255, 0, 170, 0.12);
    --success: #00ff66;
    --warning: #ffcc00;
    transition: background 0.6s ease;
}
body.retro-mode .section-light {
    --light-bg: #ffd54a;
    --light-bg-2: #ffc214;
    --light-line: rgba(0,0,0,0.25);
    --light-text: #1a0438;
    --light-text-dim: #4a1a6e;
    --light-text-muted: #6d3c8c;
    --light-card: #ffeb8f;
}

body.retro-mode .hero h1,
body.retro-mode .section-title,
body.retro-mode .contact h2,
body.retro-mode .project-title,
body.retro-mode .chapter-content h3 {
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
}
body.retro-mode .hero h1 {
    font-size: clamp(28px, 5vw, 64px);
    text-shadow: 4px 4px 0 var(--accent);
}
body.retro-mode .section-title {
    font-size: clamp(22px, 3.5vw, 38px);
    text-shadow: 3px 3px 0 var(--accent);
}
body.retro-mode .contact h2 {
    font-size: clamp(22px, 3.5vw, 42px);
    text-shadow: 3px 3px 0 var(--accent);
}
body.retro-mode .project-title {
    font-size: 22px;
}
body.retro-mode .chapter-content h3 {
    font-size: 18px;
}
body.retro-mode .btn,
body.retro-mode .hud-cta {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 11px !important;
    letter-spacing: 0 !important;
    border-radius: 0 !important;
}
body.retro-mode .hud,
body.retro-mode .hud-icon-btn,
body.retro-mode .contact-link,
body.retro-mode .stat-bar,
body.retro-mode .stat-bar-fill,
body.retro-mode .info-block,
body.retro-mode .explored-item,
body.retro-mode .project,
body.retro-mode .footer-icon,
body.retro-mode .toast,
body.retro-mode .hidden-indicator {
    border-radius: 0 !important;
}
body.retro-mode .hud {
    border: 2px solid var(--accent) !important;
    box-shadow: 4px 4px 0 var(--accent) !important;
}
body.retro-mode .project {
    border: 2px solid var(--accent) !important;
    box-shadow: 6px 6px 0 var(--accent);
}
body.retro-mode .explored-item {
    border: 2px solid var(--accent) !important;
}
body.retro-mode .btn-primary {
    background: var(--accent) !important;
    color: var(--text) !important;
    border: 2px solid var(--text) !important;
    box-shadow: 4px 4px 0 var(--text) !important;
}
body.retro-mode .btn-secondary {
    border: 2px solid var(--text) !important;
    box-shadow: 4px 4px 0 var(--text) !important;
    background: transparent !important;
}
body.retro-mode .hud-cta {
    background: var(--accent) !important;
    color: var(--text) !important;
    padding: 8px 14px !important;
}

body.retro-mode::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.15) 0px,
        rgba(0,0,0,0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9990;
    opacity: 0.6;
}

body.retro-mode .hero::before {
    background: radial-gradient(circle, rgba(255, 0, 170, 0.25), transparent 60%);
}

body.retro-mode .hidden-indicator {
    opacity: 1;
    background: var(--accent);
    color: var(--text);
    font-family: 'Press Start 2P', monospace;
    border-radius: 0 !important;
    border: 2px solid var(--text);
    box-shadow: 3px 3px 0 var(--text);
}

body.inverted-mode {
    filter: none;
}

.hidden-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-transform: uppercase;
    box-shadow: 0 8px 30px var(--accent-glow);
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.footer-copy {
    flex: 1;
}
.footer-socials {
    display: flex;
    gap: 6px;
}
.footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.25s ease;
}
.footer-icon:hover {
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


@media (hover: none) {
    .project:hover {
        transform: none;
        box-shadow: 0 4px 16px rgba(0, 179, 255, 0.06);
    }
    .explored-item:hover {
        transform: none;
    }
    .footer-icon:hover {
        transform: none;
        color: var(--text-dim);
        background: transparent;
    }
    .btn-primary:hover {
        transform: none;
        box-shadow: none;
        background: var(--accent);
    }
    .btn-secondary:hover {
        transform: none;
        border-color: var(--line-strong);
        color: var(--text);
    }
    .contact-link:hover {
        transform: none;
        border-color: var(--line);
        background: var(--card);
    }
    .contact-link-primary:hover {
        background: var(--accent);
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .hero::before,
    .contact::before {
        animation-duration: 12s;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero::before,
    .contact::before {
        animation: none;
    }
    .hud-logo::before,
    .pulse-dot {
        animation: none;
    }
}

@media (max-width: 640px) {
    .btn,
    .contact-link,
    .hud-cta,
    .footer-icon {
        min-height: 44px;
    }
    .hud-icon-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 960px) {
    .container { padding: 0 28px; }
    section { padding: 90px 0; }

    .hud {
        padding: 7px !important;
        gap: 5px !important;
        min-width: 0 !important;
        height: 56px !important;
        border-radius: 100px;
    }
    .hud .hud-state[data-state="full"] {
        display: none !important;
    }
    .hud .hud-state[data-state="compact"] {
        display: flex !important;
        opacity: 1 !important;
        position: static !important;
        inset: auto !important;
        padding: 0 !important;
    }
    .hud-state--compact {
        gap: 5px !important;
        justify-content: center;
    }
    .hud-icon-btn {
        min-width: 42px;
        min-height: 42px;
        width: 42px;
        height: 42px;
    }
    .hud-icon-btn .ico { font-size: 15px; }
    .hud-divider { display: none; }

    .hero { padding: 90px 0 50px; }
    .hero h1 { font-size: clamp(48px, 9vw, 88px); letter-spacing: -2px; }
    .hero-body { max-width: 100%; }
    .hero-text p { font-size: 17px; max-width: 100%; }
    .hero-meta { font-size: 11px; gap: 10px; flex-wrap: wrap; }

    .section-title { font-size: clamp(36px, 6vw, 56px); }
    .section-intro { font-size: 17px; margin-bottom: 50px; }

    .chapter { grid-template-columns: 1fr; gap: 14px; padding: 30px 0; }
    .chapter-content h3 { font-size: 28px; }

    .explored-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

    .project, .project:nth-child(even) { grid-template-columns: 1fr; }
    .project:nth-child(even) .project-visual { order: 0; }
    .project-visual { min-height: 280px; }
    .project-content { padding: 36px 32px; }
    .project-title { font-size: 30px; }

    .contact { padding: 100px 0; }

    .footer-inner { padding: 0 28px; }
}

@media (max-width: 640px) {
    .container { padding: 0 20px; }
    section { padding: 70px 0; }

    .hero { padding: 90px 0 50px; min-height: auto; }
    .hero::before {
        width: 400px;
        height: 400px;
        top: 20%;
    }
    .hero h1 {
        font-size: clamp(40px, 10vw, 64px);
        letter-spacing: -1.5px;
        line-height: 0.95;
        margin-bottom: 28px;
    }
    .hero-meta {
        font-size: 10px;
        letter-spacing: 1px;
        gap: 8px;
        margin-bottom: 22px;
    }
    .hero-meta .pulse-dot { width: 6px; height: 6px; }
    .hero-text p { font-size: 16px; line-height: 1.7; margin-bottom: 16px; }
    .hero-actions { margin-top: 28px; gap: 10px; }

    .btn {
        padding: 12px 20px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .hud {
        top: 14px;
        padding: 6px !important;
        gap: 4px !important;
        min-width: 0 !important;
        max-width: calc(100% - 24px);
        height: 52px !important;
        border-radius: 100px;
    }
    .hud .hud-state[data-state="full"] {
        display: none !important;
    }
    .hud .hud-state[data-state="compact"] {
        display: flex !important;
        opacity: 1 !important;
        position: static !important;
        inset: auto !important;
        padding: 0 !important;
    }
    .hud-state--compact {
        gap: 4px !important;
        justify-content: center;
    }
    .hud-icon-btn {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
    }
    .hud-icon-btn .ico { font-size: 14px; }
    .hud-divider { display: none; }

    .section-tag { font-size: 10px; letter-spacing: 1.5px; }
    .section-title {
        font-size: clamp(30px, 8vw, 44px);
        letter-spacing: -1.5px;
        margin-bottom: 20px;
    }
    .section-intro {
        font-size: 15.5px;
        line-height: 1.65;
        margin-bottom: 40px;
    }

    .chapter { padding: 24px 0; gap: 10px; }
    .chapter-number { font-size: 11px; letter-spacing: 1.5px; }
    .chapter-period { font-size: 14px; }
    .chapter-content h3 { font-size: 24px; margin-bottom: 10px; }
    .chapter-content p { font-size: 15px; line-height: 1.65; }

    .explored-grid { grid-template-columns: 1fr; gap: 12px; }
    .explored-item { padding: 20px 22px; }
    .explored-domain { font-size: 10px; letter-spacing: 1.2px; }
    .explored-content { font-size: 14px; }

    .project-visual { min-height: 200px; }
    .project-content { padding: 28px 24px; }
    .project-meta { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
    .project-number { font-size: 10px; }
    .project-status { font-size: 9px; padding: 3px 8px; }
    .project-title { font-size: 24px; margin-bottom: 14px; }
    .project-description { font-size: 14.5px; line-height: 1.7; margin-bottom: 20px; }
    .project-link { font-size: 11px; }

    .contact { padding: 80px 0; }
    .contact::before { width: 500px; height: 500px; }
    .contact h2 {
        font-size: clamp(36px, 9vw, 56px);
        letter-spacing: -1.5px;
        margin-bottom: 20px;
    }
    .contact p { font-size: 15.5px; line-height: 1.65; margin-bottom: 36px; }
    .contact-link {
        padding: 13px 22px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    footer { padding: 22px 0; }
    .footer-inner {
        flex-direction: column;
        gap: 14px;
        text-align: center;
        padding: 0 20px;
    }
    .footer-copy { font-size: 10px; letter-spacing: 0.8px; }
    .footer-icon { width: 32px; height: 32px; }

    .toast { font-size: 11px; padding: 10px 18px; }
    .hidden-indicator { font-size: 10px; padding: 8px 14px; bottom: 16px; right: 16px; }

    body.retro-mode .hero h1 { font-size: 24px !important; }
    body.retro-mode .section-title { font-size: 18px !important; }
    body.retro-mode .contact h2 { font-size: 22px !important; }
    body.retro-mode .project-title { font-size: 16px !important; }
    body.retro-mode .chapter-content h3 { font-size: 14px !important; }
    body.retro-mode .btn,
    body.retro-mode .hud-cta { font-size: 9px !important; padding: 10px 14px !important; }
}

@media (max-width: 380px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 36px; }
    .section-title { font-size: 28px; }
    .contact h2 { font-size: 32px; }
    .project-content { padding: 24px 20px; }
    .project-title { font-size: 22px; }
    .hud-links { gap: 10px; }
    .hud-links a { font-size: 10.5px; }
}
