/* PCSX2 — design system + index “synthwave” theme */
:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-accent: #0ea5e9;
    --color-surface: #f8fafc;
    --color-ink: #0f172a;
    --color-muted: #64748b;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 12px 24px -8px rgba(15, 23, 42, 0.08);
    --shadow-elevated: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 32px 64px -16px rgba(15, 23, 42, 0.14);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-display: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
    --font-unconventional: Orbitron, system-ui, sans-serif;
    --synth-cyan: #22d3ee;
    --synth-fuchsia: #e879f9;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

html.reduce-motion .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link */
.skip-link {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #030208;
    background: linear-gradient(135deg, #22d3ee, #e879f9);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-120%);
    transition: transform 0.2s var(--ease-out-expo);
}
.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid #fff;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-brutal-primary:focus-visible,
.btn-brutal-ghost:focus-visible,
.btn-synth-primary:focus-visible,
.btn-synth-ghost:focus-visible {
    outline: 3px solid rgba(34, 211, 238, 0.8);
    outline-offset: 3px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

.section-anchor { scroll-margin-top: 6rem; }

/* Default nav (subpages) */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.28s var(--ease-out-expo);
}
.nav-lang-link[aria-current='page'],
.nav-lang-link-mobile[aria-current='page'] {
    color: #67e8f9;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}
.nav-link.active {
    color: var(--color-ink) !important;
    font-weight: 600;
}

/* Synthwave header — glow nav */
#header.theme-synth .nav-link::after {
    display: none;
}
#header.theme-synth .nav-link {
    border: 1px solid transparent;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(207, 250, 254, 0.55);
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, text-shadow 0.2s;
}
#header.theme-synth .nav-link:hover {
    color: #ecfeff;
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}
#header.theme-synth .nav-link.active {
    color: #fdf4ff !important;
    border-color: rgba(232, 121, 249, 0.5);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(232, 121, 249, 0.12));
    font-weight: 700;
    box-shadow: 0 0 24px rgba(232, 121, 249, 0.2);
}

.back-to-top {
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.back-to-top.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
}

.fixed-download-btn {
    transition: transform 0.28s var(--ease-out-expo), box-shadow 0.28s ease;
}
.fixed-download-btn:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.45);
}

#fixed-download-btn {
    transform: translateY(-50%);
}
#fixed-download-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.card-hover {
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease, border-color 0.25s ease;
}
.theme-synth .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px -12px rgba(34, 211, 238, 0.12), 0 0 0 1px rgba(34, 211, 238, 0.2);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.75s var(--ease-out-expo),
        transform 0.75s var(--ease-out-expo);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero — synthwave landing */
.hero-synth {
    background-color: #070512;
}
.hero-mesh {
    background-color: #09090b;
    background-image:
        radial-gradient(ellipse 100% 80% at 10% 20%, rgba(190, 242, 100, 0.09), transparent 50%),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(217, 70, 239, 0.07), transparent 45%);
}

/* Perspective grid “floor” */
.synth-floor {
    background:
        linear-gradient(180deg, transparent 0%, rgba(34, 211, 238, 0.04) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 58px,
            rgba(34, 211, 238, 0.07) 58px,
            rgba(34, 211, 238, 0.07) 59px
        );
    transform: perspective(420px) rotateX(56deg);
    transform-origin: 50% 100%;
    mask-image: linear-gradient(to top, black 15%, transparent 75%);
    -webkit-mask-image: linear-gradient(to top, black 15%, transparent 75%);
}

.crt-scanlines {
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.09),
        rgba(0, 0, 0, 0.09) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}
.hero-grid-pattern {
    background-image:
        linear-gradient(rgba(250, 250, 250, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(250, 250, 250, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black, transparent 72%);
}
.hero-noise {
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.hero-title {
    font-family: "Outfit", "DM Sans", "Noto Sans SC", "Noto Sans JP", ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(2.25rem, 5vw + 1rem, 4rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.section-heading {
    letter-spacing: -0.03em;
    text-wrap: balance;
}

/* Legacy buttons (subpages) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.625rem;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.625rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

.btn-brutal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 3px solid #0a0a0b;
    background: var(--lime);
    padding: 0.9rem 1.5rem;
    font-family: ui-monospace, "IBM Plex Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0a0a0b;
    box-shadow: 6px 6px 0 0 #0a0a0b;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-brutal-primary:hover {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0 0 #0a0a0b;
}
.btn-brutal-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 3px solid #52525b;
    background: transparent;
    padding: 0.9rem 1.5rem;
    font-family: ui-monospace, "IBM Plex Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fafafa;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn-brutal-ghost:hover {
    border-color: var(--lime);
    background: rgba(190, 242, 100, 0.08);
}

.btn-synth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(168, 85, 247, 0.85));
    padding: 0.9rem 1.5rem;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-synth-primary:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.08);
    box-shadow: 0 0 40px rgba(232, 121, 249, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-synth-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(232, 121, 249, 0.35);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.9rem 1.5rem;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e2e8f0;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s ease;
}
.btn-synth-ghost:hover {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
    transform: translateY(-2px);
}

.mockup-frame {
    border-radius: 0;
    background: #18181b;
    border: 4px solid #fafafa;
    box-shadow: 12px 12px 0 0 var(--lime);
}
.mockup-inner-glow {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float-soft {
    animation: none;
}
html.reduce-motion .animate-float-soft {
    animation: none;
}

.cta-band {
    background: linear-gradient(180deg, #070512 0%, #12081f 50%, #070512 100%);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    border-bottom: 1px solid rgba(232, 121, 249, 0.15);
}
.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 100%, rgba(168, 85, 247, 0.2), transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(34, 211, 238, 0.1), transparent 50%);
    pointer-events: none;
}

.cta-primary-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-primary-btn:hover {
    transform: translate(3px, 3px);
    box-shadow: 4px 4px 0 0 #0a0a0b !important;
}
.cta-ghost-btn {
    transition: background 0.15s, transform 0.15s ease;
}
.cta-ghost-btn:hover {
    transform: translate(2px, 2px);
}

#header.scrolled.theme-synth {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 1px rgba(34, 211, 238, 0.2);
}

.hero-soft {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #ffffff 100%);
}

.feature-icon-wrap {
    display: flex;
    height: 3rem;
    width: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border: 3px solid var(--lime);
    background: #18181b;
    color: var(--lime);
    box-shadow: 4px 4px 0 0 rgba(190, 242, 100, 0.25);
    transition: transform 0.25s var(--ease-spring);
}
.theme-synth .feature-icon-wrap {
    border-radius: 0.75rem;
    border-width: 1px;
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.06);
    color: #67e8f9;
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}
.theme-synth .card-hover:hover .feature-icon-wrap {
    transform: scale(1.06);
    box-shadow: 0 0 28px rgba(232, 121, 249, 0.2);
}

.feature-spotlight {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    border: 3px solid #3f3f46 !important;
    box-shadow: 8px 8px 0 0 rgba(190, 242, 100, 0.2);
}
.theme-synth .feature-spotlight {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(15, 5, 25, 0.6) 100%);
    border: 1px solid rgba(34, 211, 238, 0.25) !important;
    box-shadow: 0 24px 60px -20px rgba(34, 211, 238, 0.08);
}
.feature-spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(190, 242, 100, 0.5), rgba(217, 70, 239, 0.25), transparent 65%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.theme-synth .feature-spotlight::before {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.45), rgba(232, 121, 249, 0.35), transparent 60%);
}

.testimonial-card {
    position: relative;
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}
.theme-synth .testimonial-card {
    border-width: 1px;
}
.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    font-family: var(--font-unconventional);
    font-size: 3rem;
    line-height: 1;
    color: rgba(190, 242, 100, 0.15);
    pointer-events: none;
}
.theme-synth .testimonial-card::before {
    color: rgba(34, 211, 238, 0.12);
}
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -15px rgba(34, 211, 238, 0.1);
}

.stat-pill {
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s ease;
}
.stat-pill:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 rgba(190, 242, 100, 0.2);
}

.trust-badge {
    transition: color 0.2s, transform 0.2s var(--ease-out-expo);
}
.trust-badge:hover {
    color: #d4d4d8;
    transform: translateY(-2px);
}

.guide-card-arrow {
    transition: transform 0.25s var(--ease-out-expo);
}
.group:hover .guide-card-arrow {
    transform: translateX(6px);
}

html.reduce-motion .animate-ping {
    animation: none !important;
}

/* Diagonal section accent */
.skew-strip {
    transform: skewY(-1.5deg);
    transform-origin: top left;
}

/* Inner pages — match index synth shell */
.subpage-section {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.subpage-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 100% 70% at 50% -10%, rgba(168, 85, 247, 0.18), transparent 50%);
}
.subpage-section::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 50% at 80% 60%, rgba(34, 211, 238, 0.08), transparent 55%);
}
.subpage-inner {
    position: relative;
    z-index: 1;
}
.link-synth {
    font-weight: 600;
    color: #22d3ee;
    text-decoration: underline;
    text-decoration-color: rgba(34, 211, 238, 0.35);
    text-underline-offset: 3px;
}
.link-synth:hover {
    color: #f0abfc;
}

.setup-steps > li {
    list-style: none;
}
.setup-steps > li::marker {
    content: none;
}

/* Japanese locale (/jp): CJK-friendly body copy */
html[lang="ja"] body.theme-synth {
    font-family: "Noto Sans JP", "DM Sans", Inter, system-ui, sans-serif;
}
