@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;450;500;600;700&family=IBM+Plex+Sans+JP:wght@300;400;500;600;700&family=IBM+Plex+Serif:wght@400;500;600&display=swap');

:root {
    --r: 10px;
    --r-sm: 6px;
    --r-lg: 14px;

    --color-base-rgb: 246, 241, 230;
    --color-base: RGB(var(--color-base-rgb));
    --color-surface-sunken-rgb: 235, 228, 212;
    --color-surface-sunken: RGB(var(--color-surface-sunken-rgb));
    --color-surface-rgb: 253, 250, 243;
    --color-surface: RGB(var(--color-surface-rgb));
    --color-rule-rgb: 224, 217, 200;
    --color-rule: RGB(var(--color-rule-rgb));
    --color-rule-strong-rgb: 206, 198, 178;
    --color-rule-strong: RGB(var(--color-rule-strong-rgb));

    --color-ink-rgb: 27, 26, 23;
    --color-ink: RGB(var(--color-ink-rgb));
    --color-ink-soft-rgb: 58, 56, 51;
    --color-ink-soft: RGB(var(--color-ink-soft-rgb));
    --color-muted-rgb: 107, 103, 95;
    --color-muted: RGB(var(--color-muted-rgb));
    --color-faint-rgb: 154, 148, 138;
    --color-faint: RGB(var(--color-faint-rgb));

    --color-primary-rgb: 154, 100, 24;
    --color-primary: RGB(var(--color-primary-rgb));
    --color-primary-soft-rgb: 249, 232, 214;
    --color-primary-soft: RGB(var(--color-primary-soft-rgb));
    --color-primary-line-rgb: 218, 191, 162;
    --color-primary-line: RGB(var(--color-primary-line-rgb));
    --color-primary-ink-rgb: 119, 76, 16;
    --color-primary-ink: RGB(var(--color-primary-ink-rgb));

    --color-green-rgb: 57, 121, 73;
    --color-green: RGB(var(--color-green-rgb));
    --color-green-soft-rgb: 228, 248, 231;
    --color-green-soft: RGB(var(--color-green-soft-rgb));
    --color-blue-rgb: 51, 98, 140;
    --color-blue: RGB(var(--color-blue-rgb));
    --color-blue-soft-rgb: 225, 236, 246;
    --color-blue-soft: RGB(var(--color-blue-soft-rgb));
    --color-rose-rgb: 166, 74, 88;
    --color-rose: RGB(var(--color-rose-rgb));
    --color-rose-soft-rgb: 250, 225, 228;
    --color-rose-soft: RGB(var(--color-rose-soft-rgb));

    --shadow: 0 8px 24px RGBA(var(--color-ink-rgb), .08);
    --shadow-soft: 0 1px 2px RGBA(var(--color-ink-rgb), .04);
    --ui: 'IBM Plex Sans', system-ui, sans-serif;
    --jp: 'IBM Plex Sans JP', 'IBM Plex Sans', system-ui, sans-serif;
    --serif: 'IBM Plex Serif', ui-serif, serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-base);
    color: var(--color-ink);
    font-family: var(--ui);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Page-wide dotted-grid (SPA .main::before look) ---------- */

main {
    position: relative;
    width: 100%;
    overflow: hidden; /* contain the bg horizontally so it can't trigger page scrollbar */
}

main::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(
        circle,
        RGBA(var(--color-ink-rgb), 0.22) 1.3px,
        transparent 1.7px
    );
    background-size: 24px 24px;
    --dot-fade: clamp(0px, calc((100vw - 700px) * 0.34), 260px);
    --dot-full: calc(var(--dot-fade) * 0.55);
    mask-image: linear-gradient(
        to right,
        black 0,
        black var(--dot-full),
        transparent var(--dot-fade),
        transparent calc(100% - var(--dot-fade)),
        black calc(100% - var(--dot-full)),
        black 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        black 0,
        black var(--dot-full),
        transparent var(--dot-fade),
        transparent calc(100% - var(--dot-fade)),
        black calc(100% - var(--dot-full)),
        black 100%
    );
}

main > * {
    position: relative;
    z-index: 1;
}

/* Pill navbar rules moved to /assets/css/site-topbar.css so the SPA shell
 * (IndexPage.hbs) can share the exact same topbar without duplicating styles. */

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 99px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.btn-secondary {
    border: 1px solid var(--color-rule-strong);
    background: var(--color-surface);
    color: var(--color-ink);
}

.btn-secondary:hover {
    border-color: var(--color-faint);
    background: var(--color-surface-sunken);
    color: var(--color-ink);
}

.btn-primary {
    border: 1px solid var(--color-ink);
    background: var(--color-ink);
    color: var(--color-base);
}

.btn-primary:hover {
    background: var(--color-ink-soft);
    border-color: var(--color-ink-soft);
    color: var(--color-base);
    transform: translateY(-1px);
}

.btn-ghost {
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-ink-soft);
}

.btn-ghost:hover {
    background: RGBA(var(--color-ink-rgb), .05);
    color: var(--color-ink);
}

.btn-lg {
    min-height: 48px;
    padding: 0 22px;
    font-size: 15px;
}

/* ---------- Section + heading shared ---------- */

.landing-hero,
.landing-section,
.legal-page,
main > article:not(.legal-page),
.guide-index {
    max-width: 1160px;
    margin: 0 auto;
}

.landing-section {
    padding: 64px 24px 0;
    scroll-margin-top: 86px;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    color: var(--color-ink);
    font-size: 36px;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.014em;
}

.section-heading p {
    margin: 12px 0 0;
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.7;
}

.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 12px;
    border: 1px solid var(--color-primary-line);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    margin-bottom: 14px;
}

.landing-eyebrow-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--color-ink);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}

.landing-eyebrow-mark {
    width: 20px;
    height: 20px;
}

/* ---------- Hero ---------- */

.landing-hero {
    position: relative;
    padding: 120px 24px 56px;
}

.landing-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(440px, 1fr);
    gap: 48px;
    align-items: center;
}

.landing-hero-copy {
    max-width: 640px;
}

.landing-hero h1 {
    margin: 0;
    color: var(--color-ink);
    font-size: 60px;
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.022em;
    max-width: 620px;
}

.landing-hero-subtitle {
    margin: 18px 0 0;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1.55;
    max-width: 560px;
}

.landing-actions {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.landing-hero-fineprint {
    margin: 16px 0 0;
    color: var(--color-faint);
    font-size: 13px;
    line-height: 1.55;
    max-width: 480px;
}

/* ---------- Hero stage (kanji cloud + floating cards) ---------- */

.landing-hero-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 560px;
    margin-left: auto;
    pointer-events: none;
    user-select: none;
}

.hero-cloud {
    position: absolute;
    /* Keep within the stage bounds so the cloud doesn't bleed into the
       page-wide side-band dotted grid. */
    inset: 4% 6%;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, black 52%, transparent 88%);
    mask-image: radial-gradient(circle at 50% 50%, black 0%, black 52%, transparent 88%);
}

.cloud-glyph {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s, 1));
    font-family: var(--jp);
    color: var(--color-ink);
    font-size: 30px;
    font-weight: 500;
    opacity: 0.13;
    letter-spacing: 0;
    white-space: nowrap;
}

.cloud-glyph-kana {
    color: var(--color-primary-ink);
    opacity: 0.14;
}

/* Sleeping cat sitting on the top edge of the lookup card (SPA today-hero pattern) */
.hero-float-mascot {
    position: absolute;
    top: 0;
    right: 20px;
    width: 110px;
    height: 110px;
    pointer-events: none;
    user-select: none;
    /* pose-sleep on SPA uses translateY(-48%) so the curl sits on the edge */
    transform: translateY(-48%);
    filter: drop-shadow(0 4px 10px RGBA(var(--color-ink-rgb), .10));
    z-index: 5;
}

/* Floating mini cards on the hero stage */

.hero-float-card {
    position: absolute;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow:
        0 14px 32px RGBA(var(--color-ink-rgb), .10),
        0 2px 6px RGBA(var(--color-ink-rgb), .05);
    padding: 14px 16px;
    pointer-events: auto;
    transition: transform 360ms cubic-bezier(.22, 1, .36, 1), box-shadow 320ms ease;
    z-index: 2;
}

.hero-float-card:hover {
    transform: translateY(-3px) rotate(var(--hover-tilt, 0deg));
    box-shadow:
        0 20px 40px RGBA(var(--color-ink-rgb), .14),
        0 2px 6px RGBA(var(--color-ink-rgb), .05);
}

.hero-float-eyebrow {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

/* Card 1: lookup */
.hero-float-lookup {
    top: 6%;
    left: 0%;
    width: 56%;
    transform: rotate(-3deg);
    --hover-tilt: -3deg;
    z-index: 3;
}

.hero-float-sentence {
    font-family: var(--jp);
    font-size: 18px;
    line-height: 2;
    color: var(--color-ink);
    padding-bottom: 4px;
}

.hero-float-sentence .demo-rich-word {
    display: inline-block;
    padding: 0 1px;
    border-radius: var(--r-sm);
}

.hero-float-sentence .demo-rich-word rt {
    color: var(--color-muted);
    font-size: .42em;
    user-select: none;
}

.hero-float-sentence .demo-float-target {
    background: RGBA(var(--color-primary-rgb), .14);
}

.hero-float-popover {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--color-base);
    border: 1px solid var(--color-rule);
    border-radius: var(--r);
    box-shadow: 0 4px 10px RGBA(var(--color-ink-rgb), .05);
}

.hero-float-popover-meaning {
    color: var(--color-ink);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.hero-float-popover-row {
    display: flex;
    gap: 6px;
}

.hero-float-popover-row .demo-srs-button {
    flex: 1;
    text-align: center;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 600;
}

/* Card 2: stroke draw */
.hero-float-draw {
    top: 32%;
    right: -2%;
    width: 42%;
    transform: rotate(4deg);
    --hover-tilt: 4deg;
    z-index: 2;
}

.hero-float-kanji-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface);
    border: 2px solid var(--color-rule);
    border-radius: var(--r);
    overflow: hidden;
    background-image: radial-gradient(
        circle,
        RGBA(var(--color-ink-rgb), 0.08) 1px,
        transparent 1.5px
    );
    background-size: 18px 18px;
    background-position: center;
    transition: border-color 400ms ease;
}

.hero-float-kanji-frame.is-success {
    border-color: RGBA(var(--color-green-rgb), .8);
}

.hero-float-kanji-frame.is-success .demo-kanji-success-overlay {
    animation: demo-success-overlay 1700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-float-kanji-frame::before,
.hero-float-kanji-frame::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.hero-float-kanji-frame::before {
    left: 50%;
    top: 8%;
    bottom: 8%;
    border-left: 1px dashed var(--color-rule-strong);
    opacity: .45;
}

.hero-float-kanji-frame::after {
    top: 50%;
    left: 8%;
    right: 8%;
    border-top: 1px dashed var(--color-rule-strong);
    opacity: .45;
}

.hero-float-kanji-frame > svg.kanji-vg-svg {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
    z-index: 2;
}

.hero-float-kanji-frame > svg.kanji-vg-svg path {
    stroke: var(--color-ink);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.hero-float-kanji-frame > svg.kanji-vg-svg text {
    display: none;
}

.hero-float-stroke-hint {
    margin-top: 10px;
    text-align: center;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 600;
    transition: color 200ms ease;
}

.hero-float-stroke-hint.is-complete {
    color: var(--color-green);
}

/* Card 3: SRS flashcard */
.hero-float-srs {
    bottom: 4%;
    left: 16%;
    width: 50%;
    transform: rotate(-2deg);
    --hover-tilt: -2deg;
    z-index: 3;
    text-align: center;
}

.hero-float-srs-word {
    margin-top: 6px;
    font-family: var(--jp);
    color: var(--color-ink);
    font-size: 30px;
    line-height: 1.3;
    display: inline-block;
}

.hero-float-srs-word ruby rt {
    color: var(--color-muted);
    font-size: .35em;
    font-weight: 400;
    user-select: none;
}

.hero-float-srs-tap {
    margin-top: 10px;
    color: var(--color-faint);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: opacity 240ms ease;
}

.hero-float-srs-tap.is-hidden {
    opacity: 0;
}

.hero-float-srs-reveal {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 360ms cubic-bezier(.22, 1, .36, 1),
                opacity 280ms ease,
                margin-top 320ms ease;
    /* Reserve space inside the clip for the Good button flash glow (4px outside the
       button) so it isn't cropped by overflow: hidden during the reveal-open state. */
    padding: 0 4px 8px;
    margin-left: -4px;
    margin-right: -4px;
}

.hero-float-srs-reveal.is-open {
    max-height: 200px;
    opacity: 1;
    margin-top: 4px;
}

.hero-float-srs-meaning {
    color: var(--color-ink-soft);
    font-size: 12.5px;
    line-height: 1.4;
}

.hero-float-srs-prompt {
    margin-top: 8px;
    color: var(--color-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}

.hero-float-srs-buttons {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

.hero-float-srs-buttons .demo-srs-button {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 600;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-float-srs-buttons .demo-srs-button.is-flashing {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px RGBA(var(--color-green-rgb), .25);
}

/* ---------- Feature section intro bullets ---------- */

.landing-feature-points {
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
    max-width: 1000px;
}

.landing-feature-points li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--color-ink-soft);
    font-size: 15px;
    line-height: 1.55;
}

.landing-feature-points li::before {
    content: "";
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    /* Vertically center bullet on the FIRST LINE of text:
       (line-height - bullet-height) / 2 = (15 * 1.55 - 12) / 2 = 5.6px */
    margin-top: 5.6px;
    border-radius: 999px;
    background:
        radial-gradient(circle, var(--color-primary) 0, var(--color-primary) 26%, transparent 32%) center / 100% 100% no-repeat,
        var(--color-primary-soft);
    border: 1.5px solid var(--color-primary-line);
}

/* ---------- Carousel engine ---------- */

.feature-carousel {
    position: relative;
    padding: 28px 28px 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.feature-carousel-watermark {
    position: absolute;
    top: -32px;
    right: -28px;
    font-family: var(--jp);
    font-size: 220px;
    font-weight: 500;
    line-height: 1;
    color: var(--color-ink);
    opacity: 0.035;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    letter-spacing: -.04em;
}

.feature-carousel > .feature-carousel-track,
.feature-carousel > .feature-carousel-dots {
    position: relative;
    z-index: 1;
}

.feature-carousel-track {
    position: relative;
    display: grid;
}

.feature-carousel-slide {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr);
    gap: 32px;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 360ms ease, transform 360ms ease;
    pointer-events: none;
    min-height: 320px;
}

.feature-carousel-slide.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.feature-carousel-eyebrow {
    color: var(--color-faint);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.feature-carousel-caption h4 {
    margin: 0;
    color: var(--color-ink);
    font-size: 24px;
    font-weight: 550;
    line-height: 1.2;
    letter-spacing: -.008em;
}

.feature-carousel-caption p {
    margin: 10px 0 0;
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.6;
}

.feature-carousel-stage {
    display: grid;
    place-items: center;
    min-height: 300px;
}

/* Tab bar at top of each carousel (replaces dots) */

.feature-carousel-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    margin: -4px -4px 22px;
    background: RGBA(var(--color-ink-rgb), .04);
    border-radius: 99px;
}

.feature-carousel-tab {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 99px;
    color: var(--color-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.feature-carousel-tab:hover {
    color: var(--color-ink);
    background: RGBA(var(--color-surface-rgb), .6);
}

.feature-carousel-tab.is-active {
    background: var(--color-surface);
    border-color: var(--color-rule);
    color: var(--color-ink);
    font-weight: 600;
    box-shadow: 0 1px 2px RGBA(var(--color-ink-rgb), .05);
}

/* Desktop: long labels visible. Mobile: short labels (swapped below). */
.tab-label-short { display: none; }
.tab-label-long  { display: inline; }

.feature-carousel-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: RGBA(var(--color-ink-rgb), .05);
    overflow: hidden;
}

.feature-carousel-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-primary);
}

/* ---------- Demo: story reader card (matches SPA .card.raised + reader-text-viewer) ---------- */

.demo-reader-card {
    width: 100%;
    max-width: 460px;
    padding: 22px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.demo-reader-sentence {
    font-family: var(--jp);
    font-size: 21px;
    line-height: 2.1;
    color: var(--color-ink);
    position: relative;
}

/* .demo-rich-word — a <span> wrapping component rubies, matches SPA .rich-word */
.demo-rich-word {
    display: inline-block;
    border-radius: var(--r-sm);
    color: var(--color-ink);
    transition: background 160ms ease;
}

.demo-rich-word-component {
    /* default ruby behaves correctly — small reading above kanji */
}

.demo-rich-word rt {
    user-select: none;
    color: var(--color-muted);
    font-size: .42em;
    font-weight: 400;
    transition: opacity 220ms ease;
}

.demo-rich-word.hide-furigana rt {
    opacity: 0;
}

.demo-rich-word.is-revealed rt {
    opacity: 1;
}

.demo-rich-word.is-revealed {
    background: RGBA(var(--color-primary-rgb), .10);
}

.demo-rich-word.hide-furigana,
.demo-lookup-target {
    cursor: pointer;
}

/* Animated faux cursor that appears during interactive demo steps */
.demo-cursor {
    position: absolute;
    z-index: 5;
    width: 22px;
    height: 22px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -4px);
    transition: opacity 220ms ease, top 460ms cubic-bezier(.22, 1, .36, 1), left 460ms cubic-bezier(.22, 1, .36, 1);
    filter: drop-shadow(0 2px 4px RGBA(var(--color-ink-rgb), .25));
}

.demo-cursor.is-visible {
    opacity: 1;
}

.demo-cursor.is-clicking {
    transform: translate(-4px, -4px) scale(.85);
    transition: transform 100ms ease, opacity 220ms ease;
}

.demo-cursor svg {
    width: 100%;
    height: 100%;
    display: block;
}

.demo-rich-word.demo-particle,
.demo-period {
    color: var(--color-muted);
}

.demo-reader-hint {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--color-rule);
    color: var(--color-faint);
    font-size: 12px;
}

/* Slide 2: translate */

.demo-translate-row {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.demo-translate-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--color-primary-line);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--color-surface) 0%, RGBA(var(--color-primary-rgb), .04) 100%);
    color: var(--color-primary-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .005em;
    box-shadow: 0 1px 2px RGBA(var(--color-ink-rgb), .04), inset 0 1px 0 RGBA(255, 255, 255, .35);
    transition: background 200ms ease, transform 140ms cubic-bezier(.22, 1, .36, 1), box-shadow 200ms ease, border-color 200ms ease;
    cursor: pointer;
    position: relative;
}

.demo-translate-button:hover,
.demo-translate-button.is-hovered {
    background: linear-gradient(180deg, var(--color-primary-soft) 0%, RGBA(var(--color-primary-rgb), .12) 100%);
    border-color: RGBA(var(--color-primary-rgb), .5);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px RGBA(var(--color-primary-rgb), .14), inset 0 1px 0 RGBA(255, 255, 255, .35);
}

.demo-translate-button.is-pressed {
    background: var(--color-primary-soft);
    transform: scale(0.96);
    box-shadow: 0 1px 1px RGBA(var(--color-ink-rgb), .06), inset 0 1px 2px RGBA(var(--color-primary-rgb), .14);
}

.demo-translate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-base);
    font-size: 11px;
    font-weight: 700;
}

.demo-translation {
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 360ms cubic-bezier(.22, 1, .36, 1),
        opacity 280ms ease 60ms,
        margin-top 360ms cubic-bezier(.22, 1, .36, 1);
}

.demo-translation.is-open {
    max-height: 120px;
    opacity: 1;
    margin-top: 12px;
}

.demo-translation-text {
    color: var(--color-ink-soft);
    font-size: 15px;
    line-height: 1.55;
    padding: 10px 14px;
    border-left: 2px solid var(--color-primary-line);
    background: RGBA(var(--color-primary-rgb), .04);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* Slide 3: word popover — matches SPA .word-popover.card.card-pad */

.demo-reader-card-lookup {
    overflow: visible;
}

.demo-lookup-target.is-targeted {
    background: var(--color-primary-soft);
}

.demo-word-popover {
    position: absolute;
    z-index: 4;
    min-width: 200px;
    max-width: 260px;
    padding: 12px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r);
    box-shadow:
        0 8px 24px RGBA(var(--color-ink-rgb), .10),
        0 1px 3px RGBA(var(--color-ink-rgb), .06);
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 140ms ease, transform 200ms cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
    top: 100%;
    left: 50%;
    margin-top: 8px;
}

.demo-word-popover.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
}

.demo-word-popover-meaning {
    color: var(--color-ink);
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.demo-word-popover-srs {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-rule);
}

.demo-word-popover-srs-prompt {
    color: var(--color-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.demo-word-popover-srs-buttons {
    display: flex;
    gap: 6px;
}

.demo-word-popover-srs-buttons .demo-srs-button {
    flex: 1;
    text-align: center;
    padding: 5px 0;
    font-size: 12px;
}

/* Slide 4: AI selection + bubble */

.demo-reader-sentence-askai {
    position: relative;
}

.demo-selection-target {
    position: relative;
    z-index: 1;
}

.demo-selection-highlight {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background: RGBA(var(--color-primary-rgb), .14);
    border-radius: 4px;
    width: 0;
    height: 1.7em;
    opacity: 0;
    transition: width 460ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease;
}

.demo-selection-highlight.is-active {
    opacity: 1;
}

.demo-ai-bubble {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-rule);
    border-radius: var(--r);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 280ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1);
}

.demo-ai-bubble.is-open {
    opacity: 1;
    transform: translateY(0);
}

.demo-ai-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--color-ink-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.demo-ai-bubble-avatar {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-ink);
    color: var(--color-base);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.demo-ai-bubble-text {
    font-family: var(--ui);
    color: var(--color-ink);
    font-size: 13.5px;
    line-height: 1.55;
}

/* ---------- Demo: kanji components ---------- */

.demo-kanji-components-card {
    width: 100%;
    max-width: 480px;
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.demo-kanji-components-stage {
    position: relative;
    aspect-ratio: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r);
    overflow: hidden;
    background-image: radial-gradient(
        circle,
        RGBA(var(--color-ink-rgb), 0.08) 1px,
        transparent 1.5px
    );
    background-size: 18px 18px;
}

.demo-kanji-components-stage > svg.kanji-vg-svg {
    position: absolute;
    inset: 6%;
    width: 88%;
    height: 88%;
    z-index: 1;
}

.demo-kanji-components-stage > svg.kanji-vg-svg path {
    stroke: var(--color-ink);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.demo-kanji-components-stage > svg.kanji-vg-svg text {
    display: none;
}

.demo-kanji-component {
    position: absolute;
    left: var(--cx);
    top: var(--cy);
    width: var(--cw);
    height: var(--ch);
    transform: translate(-50%, -50%) scale(0.94);
    border-radius: var(--r-sm);
    background: var(--demo-comp-bg, RGBA(var(--color-green-rgb), .12));
    border: 2.5px solid var(--demo-comp-border, RGBA(var(--color-green-rgb), 0.8));
    opacity: 0;
    transition: opacity 280ms ease, transform 240ms cubic-bezier(.22, 1, .36, 1);
    z-index: 2;
}

.demo-kanji-component.is-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
}

.demo-kanji-component[data-component="0"] {
    --demo-comp-bg: RGBA(var(--color-green-rgb), .12);
    --demo-comp-border: RGBA(var(--color-green-rgb), 0.8);
}

.demo-kanji-component[data-component="1"] {
    --demo-comp-bg: RGBA(var(--color-blue-rgb), .12);
    --demo-comp-border: RGBA(var(--color-blue-rgb), 0.8);
}

.demo-kanji-component[data-component="2"] {
    --demo-comp-bg: RGBA(var(--color-rose-rgb), .12);
    --demo-comp-border: RGBA(var(--color-rose-rgb), 0.8);
}

.demo-kanji-component-labels {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-kanji-component-labels li {
    display: grid;
    grid-template-columns: 14px 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    transition: border-color 240ms ease, transform 240ms cubic-bezier(.22, 1, .36, 1), background 240ms ease;
}

.demo-kanji-component-labels li.is-active {
    transform: translateX(2px);
    border-color: var(--demo-comp-border);
    background: var(--demo-comp-soft, var(--color-surface-sunken));
}

.demo-kanji-component-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--demo-comp-border);
}

.demo-kanji-component-labels li[data-component="0"] {
    --demo-comp-border: RGB(var(--color-green-rgb));
    --demo-comp-soft: var(--color-green-soft);
}
.demo-kanji-component-labels li[data-component="1"] {
    --demo-comp-border: RGB(var(--color-blue-rgb));
    --demo-comp-soft: var(--color-blue-soft);
}
.demo-kanji-component-labels li[data-component="2"] {
    --demo-comp-border: RGB(var(--color-rose-rgb));
    --demo-comp-soft: var(--color-rose-soft);
}

.demo-kanji-component-labels strong {
    font-family: var(--jp);
    font-size: 20px;
    font-weight: 500;
    color: var(--color-ink);
    text-align: center;
}

.demo-kanji-component-labels em {
    font-style: normal;
    color: var(--color-ink-soft);
    font-size: 13px;
}

/* ---------- Demo: kanji drawing (slide 2) ---------- */

.demo-kanji-draw-card {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.demo-kanji-stroke-hint {
    align-self: stretch;
    text-align: center;
    padding: 7px 12px;
    border-radius: var(--r-sm);
    background: var(--color-surface-sunken);
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-kanji-stroke-hint.is-good {
    background: var(--color-green-soft);
    border-color: RGBA(var(--color-green-rgb), .25);
    color: var(--color-green);
}

.demo-kanji-stroke-hint.is-bad {
    background: RGBA(var(--color-rose-rgb), .10);
    border-color: RGBA(var(--color-rose-rgb), .30);
    color: var(--color-rose);
    animation: demo-kanji-shake 500ms both;
}

@keyframes demo-kanji-shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-4px); }
    40%  { transform: translateX(4px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.demo-kanji-input {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface);
    border: 2px solid var(--color-rule);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color 400ms ease;
    background-image: radial-gradient(
        circle,
        RGBA(var(--color-ink-rgb), 0.08) 1px,
        transparent 1.5px
    );
    background-size: 22px 22px;
    background-position: center;
}

.demo-kanji-input::before,
.demo-kanji-input::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.demo-kanji-input::before {
    left: 50%;
    top: 8%;
    bottom: 8%;
    border-left: 1px dashed var(--color-rule-strong);
    opacity: .55;
}

.demo-kanji-input::after {
    top: 50%;
    left: 8%;
    right: 8%;
    border-top: 1px dashed var(--color-rule-strong);
    opacity: .55;
}

.demo-kanji-input > svg.kanji-vg-svg {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
    z-index: 2;
}

.demo-kanji-input > svg.kanji-vg-svg path {
    stroke: var(--color-ink);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.demo-kanji-input > svg.kanji-vg-svg path.is-wrong {
    stroke: var(--color-rose);
}

.demo-kanji-input > svg.kanji-vg-svg text {
    display: none;
}

.demo-kanji-input.is-flash-green {
    border-color: var(--color-green);
}

.demo-kanji-input.is-flash-red {
    border-color: var(--color-rose);
    animation: demo-kanji-shake 500ms both;
}

.demo-kanji-success-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
        circle at center,
        RGBA(var(--color-green-rgb), 1) 0%,
        RGBA(var(--color-green-rgb), 1) 70%,
        RGBA(var(--color-green-rgb), 0) 80%
    );
    background-size: 200% 200%;
    background-position: 50% -100%;
    background-repeat: no-repeat;
    filter: blur(20px);
}

.demo-kanji-input.is-success {
    border-color: RGBA(var(--color-green-rgb), .8);
}

.demo-kanji-input.is-success .demo-kanji-success-overlay {
    animation: demo-success-overlay 1700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes demo-success-overlay {
    0%   { background-position: 50% -100%; opacity: 1; }
    100% { background-position: 50% 30%; opacity: 0; }
}

/* ---------- Demo: kanji SRS write prompt (slide 3) ---------- */

.demo-kanji-srs-card {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 22px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
}

.demo-kanji-srs-eyebrow {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.demo-kanji-srs-keyword {
    color: var(--color-ink);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 4px;
}

.demo-kanji-input-srs {
    max-width: 220px;
}

.demo-kanji-srs-buttons {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    width: 100%;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 300ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1);
}

.demo-kanji-srs-buttons.is-open {
    opacity: 1;
    transform: translateY(0);
}

.demo-srs-button {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--color-rule);
    background: var(--color-base);
    color: var(--color-ink-soft);
}

.demo-srs-button-hard { background: RGBA(var(--color-rose-rgb), .08); color: var(--color-rose); border-color: RGBA(var(--color-rose-rgb), .22); }
.demo-srs-button-good { background: var(--color-surface-sunken); color: var(--color-ink-soft); }
.demo-srs-button-easy { background: var(--color-green-soft); color: var(--color-green); border-color: RGBA(var(--color-green-rgb), .25); }

/* ---------- Demo: kanji detail hero (slide 4) ---------- */

.demo-kanji-hero {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 0;
    width: 100%;
    max-width: 540px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.demo-kanji-hero-stroke {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: var(--color-base);
    border-right: 1px solid var(--color-rule);
}

.demo-kanji-svg-frame {
    position: relative;
    width: 100%;
    max-width: 156px;
    aspect-ratio: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-sm);
    background-image: radial-gradient(
        circle,
        RGBA(var(--color-ink-rgb), 0.08) 1px,
        transparent 1.5px
    );
    background-size: 18px 18px;
    background-position: center;
    overflow: hidden;
}

.demo-kanji-svg-frame > svg.kanji-vg-svg {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
}

.demo-kanji-svg-frame > svg.kanji-vg-svg path {
    stroke: var(--color-ink);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.demo-kanji-svg-frame > svg.kanji-vg-svg text {
    display: none;
}

.demo-kanji-hero-meta {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.demo-kanji-hero-keyword {
    color: var(--color-ink);
    font-size: 24px;
    font-weight: 500;
}

.demo-kanji-hero-reading-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-rule);
}

.demo-kanji-hero-reading {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.demo-kanji-hero-reading-label {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.demo-kanji-hero-reading-value {
    color: var(--color-ink);
    font-family: var(--jp);
    font-size: 17px;
}

.demo-kanji-hero-meaning {
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
    padding-top: 12px;
    border-top: 1px solid var(--color-rule);
}

.demo-kanji-hero.is-staggering .demo-kanji-hero-keyword,
.demo-kanji-hero.is-staggering .demo-kanji-hero-reading-row .demo-kanji-hero-reading,
.demo-kanji-hero.is-staggering .demo-kanji-hero-meaning {
    animation: demo-kanji-detail-fade 460ms cubic-bezier(.22, 1, .36, 1) both;
}

.demo-kanji-hero.is-staggering .demo-kanji-hero-keyword { animation-delay: 0ms; }
.demo-kanji-hero.is-staggering .demo-kanji-hero-reading-row .demo-kanji-hero-reading:nth-child(1) { animation-delay: 80ms; }
.demo-kanji-hero.is-staggering .demo-kanji-hero-reading-row .demo-kanji-hero-reading:nth-child(2) { animation-delay: 160ms; }
.demo-kanji-hero.is-staggering .demo-kanji-hero-meaning { animation-delay: 240ms; }

@keyframes demo-kanji-detail-fade {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Intelligent learning section ---------- */

.landing-intelligent-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.landing-intelligent-card {
    padding: 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
}

.landing-intelligent-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-family: var(--jp);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 14px;
}

.landing-intelligent-card h3 {
    margin: 0;
    color: var(--color-ink);
    font-size: 17px;
    font-weight: 550;
}

.landing-intelligent-card p {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.6;
}

.landing-intelligent-card-mascot {
    position: relative;
    overflow: visible;
}

.landing-intelligent-mascot {
    position: absolute;
    top: 0;
    right: 18px;
    width: 110px;
    height: 110px;
    pointer-events: none;
    user-select: none;
    /* Match SPA today-hero-mascot pose-laying: lift to sit on top edge */
    transform: translateY(-60%);
    filter: drop-shadow(0 4px 10px RGBA(var(--color-ink-rgb), .10));
    z-index: 2;
}

/* ---------- Bottom-hero (cuddle cats + manifesto) ---------- */

.landing-bottomhero {
    padding-top: 56px;
}

.landing-bottomhero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: 48px 56px;
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-primary-soft) 240%);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.landing-bottomhero-mascot {
    width: 100%;
    max-width: 280px;
    height: auto;
    justify-self: center;
    filter: drop-shadow(0 10px 24px RGBA(var(--color-ink-rgb), .12));
}

.landing-bottomhero-copy h2 {
    margin: 0;
    color: var(--color-ink);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -.012em;
}

.landing-bottomhero-copy p {
    margin: 14px 0 18px;
    color: var(--color-ink-soft);
    font-size: 15px;
    line-height: 1.7;
    max-width: 56ch;
}

.landing-bottomhero-subtitle {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .005em;
}

/* ---------- Pricing ---------- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.pricing-card {
    position: relative;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-color: var(--color-primary);
    box-shadow: 0 10px 30px RGBA(var(--color-primary-rgb), .14);
}

.pricing-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
}

.pricing-card h3 {
    margin: 0;
    color: var(--color-ink);
    font-size: 18px;
    font-weight: 550;
}

.price {
    margin: 12px 0 4px;
    color: var(--color-ink);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.01em;
}

.pricing-card > p {
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.pricing-card ul {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.pricing-card li {
    position: relative;
    padding: 5px 0 5px 22px;
    color: var(--color-ink-soft);
    font-size: 13.5px;
    line-height: 1.5;
}

.pricing-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 5px;
    color: var(--color-green);
    font-weight: 700;
    font-size: 13px;
}

.pricing-card .btn {
    margin-top: 20px;
    width: 100%;
}

/* ---------- Article / legal / guide content (kept) ---------- */

main > article:not(.legal-page),
.guide-index,
.legal-page {
    margin-top: 38px;
    margin-bottom: 72px;
    padding: 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
}

main > article h1,
.guide-index h1,
.legal-hero h1 {
    margin: 0;
    color: var(--color-ink);
    font-size: 34px;
    font-weight: 500;
    line-height: 1.1;
}

main > article h2,
.guide-index h2 {
    margin: 30px 0 0;
    color: var(--color-ink);
    font-size: 22px;
    font-weight: 550;
}

main > article h3 {
    margin-top: 24px;
    color: var(--color-ink);
    font-size: 16px;
    font-weight: 550;
}

main > article p,
.guide-index p {
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.7;
}

main > article ul,
main > article ol {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--color-muted);
}

main > article li {
    margin: 8px 0;
    line-height: 1.6;
}

main > article a,
.guide-index a {
    color: var(--color-primary);
    font-weight: 550;
}

main > article a:hover,
.guide-index a:hover {
    text-decoration: underline;
}

main table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}

main th,
main td {
    border: 1px solid var(--color-rule);
    padding: 10px 12px;
    text-align: left;
}

main th {
    background: var(--color-surface-sunken);
    color: var(--color-ink-soft);
    font-weight: 600;
}

main code {
    font-family: var(--ui);
    background: var(--color-surface-sunken);
    border-radius: var(--r-sm);
    padding: 2px 5px;
}

main pre {
    overflow-x: auto;
    padding: 16px;
    background: var(--color-surface-sunken);
    border-radius: var(--r);
}

main pre code {
    padding: 0;
    background: transparent;
}

blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-muted);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.article-content h1 {
    font-size: 22px;
}

.article-content h2 {
    font-size: 19px;
}

.article-content h3 {
    font-size: 16px;
}

.guide-index-articles {
    list-style: none;
    padding-left: 0;
}

.guide-index > p {
    max-width: 780px;
}

.guide-chapters {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 34px;
}

.guide-chapter {
    min-width: 0;
}

.guide-index .guide-chapter h2 {
    margin-top: 0;
}

.guide-index-articles li {
    margin: 7px 0;
}

.jp-block {
    margin: 20px 0;
    padding: 20px 24px;
    border: 1px solid var(--color-primary-line);
    border-radius: var(--r);
    background: var(--color-primary-soft);
    font-family: var(--jp);
    font-size: 1.35em;
    line-height: 2.2;
}

.jp-block .jp-content {
    color: var(--color-ink);
}

.jp-block .jp-word {
    display: inline-block;
    border-radius: var(--r-sm);
    padding: 0 1px;
    transition: background 120ms ease;
}

.jp-block .jp-word[data-dict-id] {
    cursor: pointer;
    position: relative;
}

.jp-block .jp-word[data-dict-id]:hover {
    background: RGBA(var(--color-primary-rgb), .16);
}

.jp-block ruby rt {
    color: var(--color-muted);
    font-size: .5em;
    font-weight: 400;
}

.jp-block .jp-line {
    display: block;
    padding: 4px 0;
}

.jp-block .jp-line + .jp-line {
    border-top: 1px dashed RGBA(var(--color-ink-rgb), .12);
    margin-top: 4px;
}

.jp-block .jp-speaker {
    display: inline-block;
    margin-right: 10px;
    color: var(--color-primary);
    font-size: .55em;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.jp-translation-toggle {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border: 1px solid var(--color-primary-line);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
}

.jp-translation {
    margin-top: 8px;
    color: var(--color-muted);
    font-size: 14px;
    font-style: italic;
    line-height: 1.6;
}

.jp-word-nudge {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    z-index: 20;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid var(--color-rule);
    border-radius: var(--r);
    background: var(--color-surface);
    box-shadow: var(--shadow);
    color: var(--color-muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
}

.jp-word-nudge a {
    margin-left: 6px;
    color: var(--color-primary);
    font-weight: 700;
}

.legal-page {
    max-width: 860px;
}

.legal-hero {
    margin-bottom: 24px;
}

.legal-section {
    padding-top: 24px;
    border-top: 1px solid var(--color-rule);
}

.legal-section + .legal-section {
    margin-top: 24px;
}

.legal-updated {
    margin-top: 32px;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.legal-section dl {
    margin: 14px 0 0;
}

.legal-section dl div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding: 12px 0;
    border-top: 1px solid var(--color-rule);
}

.legal-section dt {
    color: var(--color-ink);
    font-weight: 600;
}

.legal-section dd {
    margin: 0;
    color: var(--color-muted);
}

.legal-section h2 {
    margin: 0;
    color: var(--color-ink);
    font-size: 22px;
    font-weight: 550;
}

.legal-section ul {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--color-muted);
}

.legal-section li {
    margin: 8px 0;
    line-height: 1.6;
}

/* ---------- Footer ---------- */

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--color-rule);
    background: var(--color-surface);
    position: relative;
    z-index: 2;
}

.site-footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer-logo {
    color: var(--color-ink);
    font-weight: 650;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

.site-footer a {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
}

.site-footer a:hover {
    color: var(--color-ink);
}

/* ---------- Article practice CTA + paywall modal (kept) ---------- */

.article-practice {
    margin: 48px 0 0;
    padding: 28px 28px 32px;
    border-top: 1px solid var(--color-rule);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    background: var(--color-surface-sunken);
}

.article-practice__heading {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-ink);
    line-height: 1.2;
}

.article-practice__invitation {
    margin: 0 0 18px;
    color: var(--color-muted);
    line-height: 1.55;
    max-width: 60ch;
}

body.practice-modal-open {
    overflow: hidden;
}

.practice-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 14, 6, 0.55);
    animation: practice-modal-backdrop-in 180ms ease;
}

.practice-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 32px 28px 26px;
    background: var(--color-surface);
    color: var(--color-ink);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    animation: practice-modal-in 200ms ease;
}

.practice-modal__heading {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    padding-right: 28px;
}

.practice-modal__body {
    margin: 0 0 22px;
    color: var(--color-muted);
    line-height: 1.55;
}

.practice-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.practice-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background 120ms ease, color 120ms ease;
}

.practice-modal__close:hover {
    background: var(--color-surface-sunken);
    color: var(--color-ink);
}

@keyframes practice-modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes practice-modal-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .landing-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(380px, 0.95fr);
        gap: 32px;
    }

    .landing-hero h1 {
        font-size: 48px;
    }

    .feature-carousel-slide {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 24px;
    }
}

@media (max-width: 920px) {
    /* .site-header / .site-nav / .site-nav-links overrides live in site-topbar.css. */

    .landing-hero {
        padding: 80px 28px 28px;
    }

    .landing-hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .landing-hero-copy {
        text-align: center;
        margin: 0 auto;
    }

    .landing-hero h1 {
        font-size: 38px;
        margin-left: auto;
        margin-right: auto;
    }

    .landing-hero-subtitle {
        font-size: 16px;
        margin-left: auto;
        margin-right: auto;
    }

    .landing-hero-fineprint {
        margin-left: auto;
        margin-right: auto;
    }

    .landing-eyebrow {
        margin-left: auto;
        margin-right: auto;
    }

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

    .landing-hero-stage {
        margin: 0 auto;
        max-width: 460px;
        aspect-ratio: 1 / 0.85;
    }

    .cloud-glyph {
        font-size: 24px;
    }

    .hero-float-card {
        padding: 12px 14px;
    }

    .hero-float-mascot {
        width: 92px;
        height: 92px;
        right: 14px;
        transform: translateY(-52%);
    }

    .hero-float-sentence {
        font-size: 16px;
    }

    .hero-float-srs-word {
        font-size: 26px;
    }

    .landing-intelligent-mascot {
        width: 92px;
        height: 92px;
        right: 12px;
        /* Lift the cat so its body sits ON the top edge of the third card
           (paws/belly on the edge, head/back above). Mirrors the SPA
           today-hero pose-laying offset but slightly less aggressive so the
           cat doesn't overshoot into the AI-teacher card above. */
        transform: translateY(-65%);
    }

    .pricing-grid,
    .landing-intelligent-grid {
        grid-template-columns: 1fr;
    }

    .landing-section {
        padding-left: 18px;
        padding-right: 18px;
        padding-top: 56px;
    }

    .section-heading h2 {
        font-size: 28px;
    }

    .landing-feature-points {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .feature-carousel {
        padding: 22px 18px;
    }

    .feature-carousel-slide {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: 0;
    }

    .feature-carousel-caption {
        order: 0;
    }

    .feature-carousel-stage {
        order: 1;
        min-height: 280px;
    }

    .demo-kanji-components-card {
        grid-template-columns: 1fr;
        gap: 14px;
        justify-items: center;
    }

    .demo-kanji-components-stage {
        max-width: 200px;
        width: 100%;
    }

    .demo-kanji-component-labels {
        width: 100%;
        max-width: 320px;
    }

    .demo-kanji-hero {
        grid-template-columns: 1fr;
    }

    .demo-kanji-hero-stroke {
        border-right: none;
        border-bottom: 1px solid var(--color-rule);
    }

    .feature-carousel-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .feature-carousel-tabs::-webkit-scrollbar { display: none; }

    .feature-carousel-tab {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        padding: 0 8px;
        height: 32px;
        scroll-snap-align: start;
    }

    /* Swap to short labels on mobile */
    .tab-label-long  { display: none; }
    .tab-label-short { display: inline; }

    .landing-bottomhero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 28px;
        text-align: center;
    }

    .landing-bottomhero-mascot {
        max-width: 220px;
    }

    .landing-bottomhero-copy p {
        margin-left: auto;
        margin-right: auto;
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px 18px;
    }

    .site-footer nav {
        justify-content: flex-start;
    }

    main > article:not(.legal-page),
    .guide-index,
    .legal-page {
        margin: 24px 16px 56px;
        padding: 24px 20px;
    }
}

@media (max-width: 520px) {
    /* .site-logo-text / .site-nav-cta / .site-nav-links a overrides live in site-topbar.css. */

    .landing-hero {
        padding: 72px 24px 24px;
    }

    .landing-hero h1 {
        font-size: 32px;
    }

    .landing-actions {
        flex-wrap: nowrap;
    }

    .landing-actions .btn {
        flex: 0 1 auto;
        width: auto;
    }

    .landing-hero-stage {
        aspect-ratio: 1 / 0.95;
        max-width: 100%;
    }

    .cloud-glyph {
        font-size: 20px;
    }

    .hero-float-lookup {
        width: 70%;
        left: -2%;
    }

    .hero-float-draw {
        width: 50%;
        right: -2%;
        top: 28%;
    }

    .hero-float-srs {
        width: 64%;
        left: 8%;
        bottom: -2%;
    }

    .hero-float-sentence {
        font-size: 15px;
    }

    .hero-float-srs-word {
        font-size: 24px;
    }

    .hero-float-mascot {
        width: 80px;
        height: 80px;
        right: 12px;
        transform: translateY(-54%);
    }

    .demo-reader-sentence {
        font-size: 19px;
    }

    .demo-reader-card {
        padding: 18px 18px;
    }

    .feature-carousel-caption h4 {
        font-size: 20px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .feature-carousel-slide,
    .feature-carousel-progress > span,
    .demo-rich-word,
    .demo-rich-word rt,
    .demo-translation,
    .demo-word-popover,
    .demo-ai-bubble,
    .demo-selection-highlight,
    .demo-kanji-input,
    .demo-kanji-input > svg.kanji-vg-svg path,
    .demo-kanji-success-overlay,
    .demo-kanji-component,
    .demo-kanji-component-labels li,
    .demo-kanji-srs-buttons,
    .demo-kanji-hero-keyword,
    .demo-kanji-hero-reading,
    .demo-kanji-hero-meaning,
    .demo-kanji-stroke-hint {
        animation: none !important;
        transition: none !important;
    }
}
