:root {
    --bg: #050811;
    --surface: rgba(15, 19, 45, 0.75);
    --surface-strong: rgba(28, 34, 74, 0.8);
    --card: rgba(255, 255, 255, 0.08);
    --accent: #8b5cf6;
    --accent-2: #14b8a6;
    --accent-3: #f472b6;
    --text: #f5f7ff;
    --muted: rgba(255, 255, 255, 0.66);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 60px rgba(8, 10, 30, 0.45);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --max-width: 1100px;
    --nav-height: 72px;
    font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 20%, #1f223f, transparent 60%),
        radial-gradient(circle at 80% 0%, rgba(139, 92, 246, 0.25), transparent 55%),
        linear-gradient(160deg, #050811 0%, #090b1a 50%, #03040d 100%);
    color: var(--text);
    font-size: 16px;
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--accent-2);
}

p {
    margin: 0 0 1.4rem;
}

h1,
h2,
h3 {
    font-family: 'Roboto', 'Zen Kaku Gothic New', sans-serif;
    margin: 0 0 1rem;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 3.6rem);
}

h2 {
    font-size: clamp(2.1rem, 4vw, 2.6rem);
}

h3 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section {
    width: min(100%, var(--max-width));
    margin: 0 auto;
    padding: 80px 24px;
}

.section-heading {
    max-width: 680px;
    margin-bottom: 48px;
}

.section-kicker {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    color: rgba(255, 255, 255, 0.64);
    margin-bottom: 16px;
}

.global-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, var(--max-width));
    margin: 0 auto;
    padding: 0 24px;
    backdrop-filter: blur(18px);
    background: rgba(9, 12, 27, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logo {
    font-weight: 700;
    letter-spacing: 0.08em;
}


.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.lang-toggle {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 24px;
    font-size: 0.95rem;
    margin-left: 32px;
}

.nav-links a {
    position: relative;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.74);
    transition: color 0.2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.is-active::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: inherit;
    padding: 8px;
    cursor: pointer;
}

.nav-toggle-line {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero {
    position: relative;
    padding: 140px 24px 120px;
    width: min(100%, var(--max-width));
    margin: 0 auto;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.15), transparent 55%),
        radial-gradient(circle at 90% 0%, rgba(248, 113, 113, 0.18), transparent 50%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(7, 10, 22, 0.65));
    z-index: -2;
    border-radius: var(--radius-lg);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    z-index: -1;
    border-radius: var(--radius-lg);
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
    align-items: center;
}

.hero-eyebrow {
    letter-spacing: 0.3em;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 24px;
}

.hero-lead {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
    cursor: pointer;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0a0d21;
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.35);
}

.btn.primary:hover,
.btn.primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 45px rgba(20, 184, 166, 0.45);
}

.btn.ghost {
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.btn.ghost:hover,
.btn.ghost:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.btn.github {
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #f5f7ff;
    background: rgba(255, 255, 255, 0.04);
    gap: 10px;
    box-shadow: 0 10px 28px rgba(8, 10, 30, 0.4);
}

.btn.github::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.39 7.86 10.9.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.87-1.54-3.87-1.54-.53-1.34-1.3-1.7-1.3-1.7-1.06-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.04 1.78 2.74 1.27 3.41.97.11-.76.41-1.27.74-1.56-2.55-.29-5.23-1.27-5.23-5.65 0-1.25.45-2.27 1.19-3.07-.12-.29-.52-1.45.11-3.02 0 0 .97-.31 3.18 1.17a11.03 11.03 0 0 1 5.79 0c2.21-1.48 3.18-1.17 3.18-1.17.63 1.57.23 2.73.11 3.02.74.8 1.19 1.82 1.19 3.07 0 4.39-2.69 5.36-5.25 5.64.42.36.8 1.08.8 2.18 0 1.57-.02 2.83-.02 3.22 0 .31.21.68.8.56A10.51 10.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"/></svg>') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 .5C5.65.5.5 5.65.5 12c0 5.09 3.29 9.39 7.86 10.9.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.87-1.54-3.87-1.54-.53-1.34-1.3-1.7-1.3-1.7-1.06-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.04 1.78 2.74 1.27 3.41.97.11-.76.41-1.27.74-1.56-2.55-.29-5.23-1.27-5.23-5.65 0-1.25.45-2.27 1.19-3.07-.12-.29-.52-1.45.11-3.02 0 0 .97-.31 3.18 1.17a11.03 11.03 0 0 1 5.79 0c2.21-1.48 3.18-1.17 3.18-1.17.63 1.57.23 2.73.11 3.02.74.8 1.19 1.82 1.19 3.07 0 4.39-2.69 5.36-5.25 5.64.42.36.8 1.08.8 2.18 0 1.57-.02 2.83-.02 3.22 0 .31.21.68.8.56A10.51 10.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"/></svg>') center / contain no-repeat;
    background-color: currentColor;
}

.btn.github:hover,
.btn.github:focus-visible {
    border-color: rgba(255, 255, 255, 0.85);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(20, 184, 166, 0.35);
}

.hero-contribute {
    max-width: 560px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 32px;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.hero-meta div {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(6px);
}

.hero-meta dt {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
}

.hero-meta dd {
    margin: 0;
    font-weight: 600;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    padding: 24px 0;
}

.hero-card-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 28px;
    position: relative;
    z-index: 2;
    justify-items: center;
    align-items: center;
}

.orb {
    position: absolute;
    filter: blur(0);
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: 0.7;
    animation: pulse 10s infinite alternate ease-in-out;
    z-index: 1;
    pointer-events: none;
}

.orb-one {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.9), transparent 65%);
    top: 12%;
    right: 14%;
}

.orb-two {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 50% 50%, rgba(20, 184, 166, 0.9), transparent 65%);
    bottom: 6%;
    left: 12%;
    animation-duration: 12s;
}

.floating-card {
    position: relative;
    padding: 20px 22px;
    background: rgba(11, 14, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 40px rgba(8, 10, 30, 0.35);
    width: min(240px, 100%);
    backdrop-filter: blur(12px);
    animation: float 6s ease-in-out infinite alternate;
    z-index: 2;
}

.floating-card h3 {
    margin-bottom: 0.6rem;
}

.floating-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.card-dungeon {
    justify-self: start;
    margin-top: -12px;
}

.card-minigame {
    justify-self: end;
    margin-top: 18px;
    animation-duration: 7s;
}

.card-skill {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 280px;
    animation-duration: 8s;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature-card {
    background: linear-gradient(145deg, rgba(22, 26, 51, 0.8), rgba(18, 22, 44, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border 0.25s ease;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.6);
}

.flow-section {
    position: relative;
}

.flow-timeline {
    position: relative;
    margin: 0;
    padding-left: 24px;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.timeline-card {
    background: rgba(14, 18, 40, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow);
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    border: 4px solid rgba(9, 12, 27, 0.9);
    position: absolute;
    left: -32px;
    margin-top: 12px;
}

.persona-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.persona-card {
    background: linear-gradient(160deg, rgba(20, 24, 52, 0.8), rgba(14, 18, 42, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow);
}

.persona-card ul {
    list-style: disc;
    padding-left: 18px;
    color: rgba(255, 255, 255, 0.76);
}

.minigame-section {
    text-align: center;
}

.carousel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin: 0 auto;
    max-width: 760px;
}

.carousel-window {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: rgba(13, 16, 34, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow);
}

.carousel-card {
    padding: 40px 48px;
    text-align: left;
}

.carousel-title {
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.carousel-tagline {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.carousel-points li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 12px;
}

.carousel-points li::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}

.carousel-control {
    min-width: 52px;
    height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.carousel-control:hover,
.carousel-control:focus-visible {
    background: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.7);
}

.carousel-control.prev::before {
    content: "←";
    font-size: 1rem;
}

.carousel-control.next::after {
    content: "→";
    font-size: 1rem;
}

.carousel-indicators {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.carousel-dot.is-active {
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.2);
}

.manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.manual-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: transform 0.25s ease, border 0.25s ease, background 0.25s ease;
    outline: none;
}

.manual-card:hover,
.manual-card:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(20, 184, 166, 0.6);
    background: rgba(20, 184, 166, 0.15);
}

.manual-action {
    margin-top: 32px;
    text-align: center;
}

.cta-section {
    padding: 100px 24px;
}

.cta-inner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(20, 184, 166, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    padding: 64px 48px;
    text-align: center;
    box-shadow: var(--shadow);
}

.cta-inner p {
    max-width: 640px;
    margin: 0 auto 32px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer {
    padding: 32px 24px 60px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0a0d21;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(139, 92, 246, 0.4);
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes float {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 0.65;
    }
    to {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-meta {
        justify-items: center;
    }

    .hero-visual {
        min-height: 360px;
        margin: 0 auto;
        width: min(460px, 100%);
    }

    .hero-card-stack {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
        gap: 20px;
    }

    .card-dungeon,
    .card-minigame,
    .card-skill {
        margin-top: 0;
        justify-self: center;
    }

    .card-skill {
        max-width: 260px;
    }
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .nav-links {
        position: absolute;
        top: var(--nav-height);
        right: 24px;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        background: rgba(9, 12, 27, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow);
        display: none;
        margin-left: 0;
    }

    .nav-links.is-open {
        display: flex;
    }

    .hero-visual {
        min-height: auto;
        width: 100%;
        padding: 12px 0 24px;
    }

    .hero-card-stack {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .floating-card {
        width: min(320px, 100%);
        margin: 0 auto;
    }

    .card-skill {
        max-width: none;
    }

    .orb {
        opacity: 0.45;
        filter: blur(12px);
    }
}

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

    .hero {
        padding: 120px 20px 100px;
    }

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

    .carousel-control {
        display: none;
    }

    .carousel-card {
        padding: 32px 28px;
    }

    .nav-links {
        right: 16px;
    }
}

@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;
    }

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