:root {
    color-scheme: light;
    --background: #f7f6f3;
    --background-warm: #fbfaf7;
    --card: #ffffff;
    --card-soft: #fffdf8;
    --text: #111827;
    --text-soft: #374151;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --border: rgba(17, 24, 39, .07);
    --border-strong: rgba(17, 24, 39, .12);
    --primary: #0f766e;
    --primary-dark: #0b5f58;
    --primary-soft: #e7f4f1;
    --danger: #d9482b;
    --danger-soft: #fff0eb;
    --success: #4f9b6e;
    --success-soft: #edf8f1;
    --warning: #b7791f;
    --warning-soft: #fff7df;
    --gold: #c49a45;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .05), 0 14px 34px rgba(0, 0, 0, .08);
    --spacing: 24px;
    --section-gap: 24px;
    --card-padding: 24px;
    --dashboard-card-height: 148px;
    --dashboard-panel-min-height: 220px;
    --motion-fast: 160ms ease;
    --motion: 220ms ease;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100%;
    padding-bottom: 48px;
    font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, .08), transparent 32rem),
        linear-gradient(180deg, var(--background-warm), var(--background));
    color: var(--text);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.site-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 18px;
    min-height: 40px;
    padding: 8px 18px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
    white-space: nowrap;
    overflow-x: auto;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-center {
    justify-content: center;
}

.footer-right {
    justify-content: flex-end;
}

.site-footer a {
    color: var(--primary-dark);
    font-weight: 850;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a, button, input, textarea {
    transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast), color var(--motion-fast), transform var(--motion-fast), opacity var(--motion-fast);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(15, 118, 110, .25);
    outline-offset: 3px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 850;
    letter-spacing: 0;
    font-size: 17px;
}

.brand::before {
    content: "日";
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .24);
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-weight: 800;
}

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

.nav a,
.link-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.nav a:hover,
.link-button:hover {
    color: var(--text);
    background: rgba(17, 24, 39, .045);
    transform: translateY(-1px);
}

.nav a.active,
.nav-primary,
.nav-primary.active {
    color: var(--primary-dark) !important;
    background: var(--primary-soft);
    border-color: rgba(15, 118, 110, .12);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .06);
}

.theme-toggle {
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.theme-toggle[aria-pressed="true"] {
    background: var(--text);
    border-color: var(--text);
    color: white;
}

.page {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 44px 0 72px;
}

.hero {
    min-height: calc(100vh - 140px);
    display: grid;
    align-items: center;
    padding-bottom: 8vh;
}

.hero h1,
.dashboard-head h1,
.panel h1,
.auth-panel h1,
.quiz h1,
.result h1 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(34px, 5.4vw, 68px);
    line-height: .98;
    letter-spacing: 0;
    font-weight: 850;
}

.quiz h1 {
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Inter, sans-serif;
    font-size: clamp(46px, 8vw, 86px);
    line-height: 1.08;
    font-weight: 800;
}

.hero-copy {
    max-width: 650px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 21px);
    line-height: 1.65;
}

.eyebrow,
.mode-label {
    margin: 0 0 12px;
    color: var(--danger);
    font-weight: 850;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .08em;
}

.mode-label {
    width: min(760px, 100%);
    margin: 34px auto -10px;
}

.quiz-question {
    text-align: center;
    margin-inline: auto;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: balance;
}

.quiz-question.translation-question {
    max-width: 680px;
    font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(28px, 4.4vw, 48px);
    line-height: 1.16;
    font-weight: 850;
}

.quiz-question.japanese-question {
    max-width: 760px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

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

.button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
}

.button.primary,
.small-button {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.button.primary:hover,
.small-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 118, 110, .18);
}

.button.secondary {
    background: rgba(255, 255, 255, .82);
    color: var(--text);
}

.button.secondary:hover {
    background: white;
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.button:active,
.small-button:active {
    transform: scale(.98);
}

.button:disabled,
.small-button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.small-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
}

.small-button.danger {
    background: var(--danger-soft);
    border-color: rgba(217, 72, 43, .22);
    color: var(--danger);
}

.small-button.danger:hover {
    background: #ffe5dc;
    border-color: rgba(217, 72, 43, .32);
    color: #ad321d;
    box-shadow: 0 10px 22px rgba(217, 72, 43, .12);
}

.landing-page {
    display: grid;
    gap: 46px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(460px, 1.05fr);
    gap: 42px;
    align-items: center;
    min-height: calc(100vh - 168px);
    padding: 28px 0;
}

.landing-hero .eyebrow {
    color: var(--danger);
}

.landing-hero h1 {
    max-width: 560px;
    margin: 0;
    font-size: clamp(42px, 5.2vw, 66px);
    line-height: 1.05;
    font-weight: 900;
}

.landing-hero .hero-copy {
    max-width: 500px;
    margin: 20px 0 0;
    color: var(--text-soft);
    font-size: 19px;
    line-height: 1.75;
}

.landing-actions {
    margin-top: 26px;
}

.landing-actions .button {
    min-width: 184px;
}

.landing-feature-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 520px;
    margin-top: 34px;
}

.landing-feature-row span {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: var(--text);
    text-align: center;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.landing-feature-row i,
.landing-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-style: normal;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08);
}

.landing-hero-visual {
    position: relative;
    min-height: 560px;
}

.landing-quiz-preview {
    position: absolute;
    left: 0;
    top: 66px;
    z-index: 2;
    width: min(390px, 72%);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05), 0 20px 48px rgba(0, 0, 0, .09);
}

.landing-quiz-preview .quiz-status-bar {
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
}

.landing-quiz-preview .quiz-status-main {
    gap: 7px;
    min-width: 0;
}

.landing-quiz-preview .quiz-status-main span,
.landing-quiz-preview .quiz-status-main strong,
.landing-quiz-preview .quiz-limit-count {
    min-height: 28px;
    font-size: 12px;
}

.landing-quiz-preview .quiz-status-main span {
    padding: 0 9px;
}

.landing-quiz-preview .quiz-limit-status {
    grid-template-columns: minmax(60px, 130px) auto;
    gap: 8px;
    min-width: 0;
}

.landing-quiz-preview .quiz-limit-track {
    height: 7px;
}

.landing-quiz-preview .quiz-limit-count {
    min-width: 52px;
    padding: 0 8px;
}

.preview-topline,
.progress-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.preview-topline strong,
.progress-preview-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
}

.preview-topline span,
.preview-topline i {
    color: var(--muted);
    font-style: normal;
    font-weight: 850;
}

.mini-progress {
    height: 5px;
    margin: 14px 0 20px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(17, 24, 39, .08);
}

.mini-progress span {
    display: block;
    width: 32%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.preview-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
}

.preview-chip.purple {
    background: #efe9ff;
    color: #6d4fc2;
}

.preview-prompt {
    margin: 14px 0 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 750;
}

.landing-quiz-preview h2,
.demo-quiz h3 {
    margin: 0 0 18px;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Inter, sans-serif;
    color: var(--text);
    font-size: 46px;
    line-height: 1.08;
}

.landing-answer-list {
    display: grid;
    gap: 10px;
}

.landing-answer-list button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: default;
}

.landing-answer-list button span {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
}

.landing-answer-list button.selected {
    border-color: var(--primary);
    background: #f2fbf8;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
}

.landing-answer-list button.selected span {
    border-color: var(--primary);
    background: radial-gradient(circle, var(--primary) 42%, transparent 45%);
}

.landing-toast {
    position: absolute;
    left: 0;
    right: -52px;
    bottom: -58px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-soft);
    box-shadow: var(--shadow);
    font-weight: 750;
}

.landing-toast span,
.demo-result span,
.landing-bottom-cta li span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(15, 118, 110, .14);
    color: var(--primary);
    font-weight: 900;
}

.landing-mascot {
    display: block;
    max-width: 100%;
    aspect-ratio: 500 / 800;
    height: auto;
    object-fit: contain;
}

.page-mascot {
    position: absolute;
    z-index: 1;
    display: block;
    max-width: none;
    aspect-ratio: 500 / 800;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.mascot-scene {
    position: relative;
    isolation: isolate;
    overflow: visible;
}

.hero-mascot {
    position: absolute;
    left: min(250px, 46%);
    top: -8px;
    z-index: 1;
    width: min(468px, 86%);
}

.landing-section {
    display: grid;
    gap: 22px;
}

.landing-section h2 {
    margin: 0;
    text-align: center;
    color: var(--text);
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.18;
    font-weight: 900;
}

.why-grid,
.how-grid,
.demo-grid {
    display: grid;
    gap: 18px;
}

.why-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.how-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .93);
    box-shadow: var(--shadow);
    transition: transform var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast);
}

.landing-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
}

.why-card {
    min-height: 252px;
    padding: 24px;
}

.why-card h3,
.how-card h3 {
    margin: 18px 0 10px;
    color: var(--text);
    font-size: 19px;
    line-height: 1.22;
    font-weight: 900;
}

.why-card p,
.how-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.65;
}

.exam-card {
    display: grid;
    grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
    gap: 26px;
    align-items: start;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .075), transparent 42%),
        rgba(255, 255, 255, .93);
}

.exam-card h2 {
    margin: 14px 0 0;
    text-align: left;
}

.exam-copy {
    display: grid;
    gap: 12px;
}

.exam-copy p {
    margin: 0;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.7;
}

.how-card {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 258px;
    padding: 20px;
}

.how-card:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -18px;
    z-index: 2;
    color: rgba(15, 118, 110, .34);
    font-size: 30px;
    font-weight: 900;
    transform: translateY(-50%);
}

.step-head {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
}

.step-head > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 18px;
    font-weight: 900;
}

.step-head h3 {
    margin-top: 0;
}

.how-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center bottom;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.demo-quiz {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, .7fr);
    gap: 22px;
    padding: 28px;
}

.demo-quiz > .preview-chip,
.demo-quiz > .preview-prompt,
.demo-quiz > h3,
.demo-quiz > .landing-answer-list {
    grid-column: 1;
}

.landing-answer-list.compact {
    gap: 8px;
}

.demo-result {
    grid-column: 2;
    grid-row: 1 / span 4;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 10px;
    padding: 22px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #ffffff, var(--success-soft));
}

.demo-result strong {
    color: var(--text);
    font-size: 19px;
}

.demo-result p {
    margin: 0;
    color: var(--text-soft);
    font-weight: 750;
}

.demo-result .small-button {
    justify-self: end;
    width: 46px;
    min-height: 42px;
    margin-top: 18px;
}

.demo-progress {
    padding: 28px;
}

.progress-preview-head span {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 850;
}

.progress-preview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.progress-preview-stats div {
    display: grid;
    gap: 4px;
}

.progress-preview-stats span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.progress-preview-stats strong {
    color: var(--text);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 900;
}

.mini-chart {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: end;
    gap: 10px;
    height: 138px;
    margin-top: 28px;
    padding: 18px 18px 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(231, 244, 241, .25), rgba(231, 244, 241, .75));
}

.mini-chart span {
    height: var(--h);
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, var(--primary), rgba(15, 118, 110, .22));
}

.landing-bottom-cta {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(260px, 1fr) minmax(260px, .9fr);
    gap: 28px;
    align-items: center;
    padding: 22px 34px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: var(--radius);
    background: linear-gradient(90deg, rgba(231, 244, 241, .78), rgba(255, 255, 255, .92));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.bottom-mascot-wrap {
    display: flex;
    align-items: end;
    gap: 18px;
}

.bottom-mascot {
    width: 128px;
    margin-bottom: -24px;
}

.speech-bubble {
    max-width: 190px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text);
    font-weight: 900;
    box-shadow: var(--shadow);
}

.landing-bottom-cta ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-bottom-cta li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-weight: 750;
}

.landing-bottom-cta li span {
    width: 22px;
    height: 22px;
    font-size: 13px;
}

.bottom-cta-actions {
    display: grid;
    gap: 12px;
    justify-items: stretch;
}

.bottom-cta-actions .button {
    min-height: 54px;
}

.bottom-cta-actions p {
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.auth-panel,
.panel,
.quiz,
.result,
.split article,
.card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-panel,
.panel,
.quiz,
.result {
    max-width: 760px;
    margin: 34px auto;
    padding: 34px;
}

.form {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 750;
    font-size: 14px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 4px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.form-checkbox input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    accent-color: var(--primary);
    cursor: pointer;
    box-shadow: none;
}

.form-checkbox span {
    display: block;
}

.form-checkbox a {
    color: var(--primary-dark);
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.form-checkbox a:hover {
    color: var(--primary);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    padding: 0 15px;
    font: inherit;
    color: var(--text);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .02);
}

input {
    min-height: 48px;
}

textarea {
    padding-block: 13px;
    resize: vertical;
}

input:hover,
textarea:hover,
input:focus,
textarea:focus {
    border-color: rgba(15, 118, 110, .3);
}

.muted {
    color: var(--muted);
}
