:root {
    --bg: #F8F9FB;
    --bg-elevated: #FFFFFF;
    --bg-subtle: #F1F3F7;
    --text: #14161C;
    --text-muted: #5C6270;
    --text-faint: #8A8F9C;
    --border: #E4E7EE;
    --border-strong: #D0D5DE;
    --accent: #4F46E5;
    --accent-soft: #EEF0FF;
    --mint: #3FA88F;
    --mint-soft: #E4F4EF;
    --score-good: #2FA36B;
    --score-warn: #C48A16;
    --score-alert: #C74A0F;
    --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.04), 0 1px 3px rgba(20, 22, 28, 0.06);
    --shadow-md: 0 2px 8px rgba(20, 22, 28, 0.06), 0 6px 16px rgba(20, 22, 28, 0.05);
    --radius-l: 16px;
    --radius-m: 12px;
    --radius-s: 8px;
    --grid-line: rgba(79, 70, 229, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0E1016;
        --bg-elevated: #191C25;
        --bg-subtle: #14171F;
        --text: #F1F2F5;
        --text-muted: #A2A7B4;
        --text-faint: #7A7F8C;
        --border: #262A35;
        --border-strong: #3B404E;
        --accent: #818CF8;
        --accent-soft: #1E2140;
        --mint: #6BC7B0;
        --mint-soft: #14332A;
        --score-good: #63D19A;
        --score-warn: #E3B95E;
        --score-alert: #E88A6A;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
        --grid-line: rgba(129, 140, 248, 0.07);
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 120ms ease;
}

a:hover {
    border-bottom-color: currentColor;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3, h4 {
    color: var(--text);
    line-height: 1.35;
    margin: 0 0 0.6em;
    letter-spacing: -0.01em;
}

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

ul, ol {
    padding-left: 1.25em;
    margin: 0 0 1em;
}

li { margin-bottom: 0.35em; }

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.9em;
    background: var(--bg-subtle);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* Layout */

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
    border: none;
    font-size: 1rem;
}

.brand__icon {
    width: 32px;
    height: 32px;
    border-radius: 22.37%;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    display: block;
}

.brand__name {
    letter-spacing: 0.02em;
}

.brand__code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-left: 6px;
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.92rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-s);
    border: none;
}

.nav a:hover {
    color: var(--text);
    background: var(--bg-subtle);
}

.nav__lang {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-muted);
}

.nav__lang.is-current {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: transparent;
}

main {
    padding: 40px 0 80px;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0 48px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer__links a {
    color: var(--text-muted);
}

.site-footer__meta {
    color: var(--text-faint);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

/* Hero */

.hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero__icon {
    width: 128px;
    height: 128px;
    border-radius: 22.37%;
    box-shadow: var(--shadow-md);
    margin: 0 auto 24px;
    display: block;
    background: #FFFFFF;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero__title {
    font-size: 2.2rem;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.hero__lead {
    font-size: 1.08rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 24px;
}

.hero__cta {
    margin-top: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--text);
    color: var(--bg);
    padding: 12px 20px;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 0.98rem;
    border: none;
    box-shadow: var(--shadow-sm);
}

.badge:hover {
    border: none;
    opacity: 0.9;
}

.badge--muted {
    background: var(--bg-subtle);
    color: var(--text-muted);
    box-shadow: none;
    cursor: default;
}

.badge__icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    line-height: 1;
}

/* Section */

section {
    margin: 48px 0;
}

.section__eyebrow {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
    display: block;
}

/* Cards */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 14px;
}

.card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 1.06rem;
    font-weight: 700;
}

.card__title-icon {
    font-size: 1.3em;
    line-height: 1;
    flex-shrink: 0;
}

.card__body {
    color: var(--text-muted);
    margin: 0;
}

.card__body:last-child { margin-bottom: 0; }

/* Feature grid */

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .features {
        grid-template-columns: 1fr 1fr;
    }
    .features .card--wide {
        grid-column: 1 / -1;
    }
}

/* Score table */

.score-table {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.score-table__label {
    color: var(--text);
}

.score-table__weight {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    color: var(--accent);
    font-weight: 600;
}

.score-table__note {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: var(--text-faint);
    margin-top: 6px;
}

/* Callout */

.callout {
    background: var(--mint-soft);
    border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent);
    border-radius: var(--radius-l);
    padding: 20px 22px;
    color: var(--text);
}

.callout__title {
    font-weight: 700;
    color: var(--mint);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout p { margin: 0.4em 0; }
.callout p:last-child { margin-bottom: 0; }

/* Policy / support layout */

.doc h2 {
    margin-top: 40px;
    padding-top: 6px;
    scroll-margin-top: 80px;
}

.doc h2:first-of-type { margin-top: 24px; }

.doc__meta {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.82rem;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

.faq details {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 4px 18px;
    margin-bottom: 10px;
}

.faq details[open] {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.faq summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 600;
    list-style: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "＋";
    color: var(--text-faint);
    font-size: 1.1em;
    line-height: 1;
    transition: transform 200ms ease;
}

.faq details[open] summary::after {
    content: "－";
}

.faq__body {
    color: var(--text-muted);
    padding: 0 0 14px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
}

.faq__body p { margin: 0.4em 0; }

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* Print */

@media print {
    body { background: none; color: black; }
    .site-header, .site-footer, .hero__cta { display: none; }
    a { color: black; text-decoration: underline; }
    main { padding: 0; }
}
