/* Toon Tone sale page.
   Standalone stylesheet: the page shares the game's tokens (paper, ink,
   Outfit) but none of its chrome or advertising surfaces.
   Colour is the subject, so the eight ring colours from the logo do the
   structural work (one per section) and the only elevated surface is the
   hero demo. Lists and rules instead of cards. */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/outfit/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/outfit/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    color-scheme: light;
    --paper: #fbfaf6;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: rgba(15, 23, 42, 0.64);
    --rule: #e5e7eb;
    --rule-strong: #cbd5e1;
    --accent: #4f46e5;
    --btn-bg: #0f172a;
    --btn-bg-hover: #1e293b;
    --btn-ink: #ffffff;
    --thumb: #ffffff;
    --shadow: 0 30px 60px -36px rgba(15, 23, 42, 0.45);
    --pink: #ec4899;
    --red: #ef4444;
    --amber: #f59e0b;
    --green: #22c55e;
    --teal: #14b8a6;
    --blue: #3b82f6;
    --indigo: #6366f1;
    --violet: #a855f7;
    --strip: linear-gradient(90deg, #ec4899, #ef4444, #f59e0b, #22c55e, #14b8a6, #3b82f6, #6366f1, #a855f7);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #0b1020;
    --surface: #161d2e;
    --ink: #f9fafb;
    --muted: rgba(255, 255, 255, 0.64);
    --rule: rgba(148, 163, 184, 0.22);
    --rule-strong: rgba(148, 163, 184, 0.4);
    --accent: #a5b4fc;
    --btn-bg: #f9fafb;
    --btn-bg-hover: #e2e8f0;
    --btn-ink: #0b1020;
    --thumb: #f9fafb;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.75);
    --green: #4ade80;
}

* { box-sizing: border-box; }

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

body {
    min-width: 320px;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* The logo ring, unrolled: a 4px strip across the top edge of the page. */
body::before {
    content: '';
    display: block;
    height: 4px;
    background: var(--strip);
}

a { color: inherit; }

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

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

.sale-header,
main,
.sale-footer {
    width: min(1040px, calc(100% - 2.5rem));
    margin-left: auto;
    margin-right: auto;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
}

.sale-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.sale-brand img { display: block; }

.sale-nav {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
}

.sale-back {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.sale-back:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.sale-lang {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem 0.15rem 0.75rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    background: var(--surface);
}

.sale-lang select {
    max-width: 9.5rem;
    padding: 0.3rem 0.2rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.sale-lang select:focus-visible { outline-offset: 6px; }

main { padding: clamp(1.5rem, 5vw, 3.5rem) 0 0; }

/* ── Hero ───────────────────────────────────────────────────────────── */

.sale-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.sale-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5.3vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.03;
    text-wrap: balance;
}

.sale-lede {
    max-width: 56ch;
    margin: 1.35rem 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    line-height: 1.6;
}

.sale-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.5rem;
    margin-top: 1.9rem;
}

.sale-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-size: 0.98rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.sale-btn:hover { background: var(--btn-bg-hover); }

.sale-link {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 0.22em;
}

.sale-link:hover { text-decoration-color: currentColor; }

.sale-contact {
    margin: 1.1rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.sale-contact a {
    color: var(--ink);
    font-weight: 600;
    text-underline-offset: 0.2em;
}

.sale-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 1.6rem;
    margin: 2rem 0 0;
    padding: 1.4rem 0 0;
    border-top: 1px solid var(--rule);
    list-style: none;
    font-size: 0.93rem;
    line-height: 1.45;
}

.sale-facts li {
    position: relative;
    padding-left: 1.2rem;
}

.sale-facts li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--mark);
}

:lang(zh) .sale-hero h1,
:lang(zh) .sale-section-head h2,
:lang(zh) .sale-closing h2 {
    letter-spacing: 0;
}

:lang(zh) .sale-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); line-height: 1.18; }
:lang(zh) .sale-closing h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); line-height: 1.2; }
:lang(zh) .sale-section-head h2 { line-height: 1.25; }

/* ── Hero demo: one round ───────────────────────────────────────────── */

.sale-demo {
    padding: 1.4rem 1.4rem 1.25rem;
    border: 1px solid var(--rule);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.sale-demo-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.sale-demo-hint {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.sale-swatches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.1rem;
}

.sale-chip {
    display: block;
    aspect-ratio: 5 / 4;
    border-radius: 16px;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    transition: background-color 0.18s ease;
}

.sale-swatch-label {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sale-sliders {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.sale-sliders label {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.sale-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    margin: 0;
    border-radius: 999px;
    background: var(--track);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    cursor: pointer;
}

.sale-range--hue {
    --track: linear-gradient(90deg, hsl(0 90% 55%), hsl(60 90% 50%), hsl(120 80% 42%), hsl(180 85% 42%), hsl(240 85% 60%), hsl(300 85% 55%), hsl(360 90% 55%));
}

.sale-range--sat {
    --track: linear-gradient(90deg, hsl(var(--hue) 0% 55%), hsl(var(--hue) 100% 50%));
}

.sale-range--bri {
    --track: linear-gradient(90deg, #000, hsl(var(--hue) 100% 50%));
}

.sale-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--thumb);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sale-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--thumb);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sale-range::-moz-range-track { background: transparent; }

.sale-readout {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.sale-readout strong {
    color: var(--ink);
    font-size: 1.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}

[data-sale-match="true"] .sale-readout strong { color: var(--green); }

.sale-demo-caption {
    margin: 0.7rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ── Sections ───────────────────────────────────────────────────────── */

.sale-section {
    margin-top: clamp(3.5rem, 7vw, 5rem);
    padding-top: clamp(1.75rem, 3.5vw, 2.25rem);
    border-top: 1px solid var(--rule);
}

.sale-section-head { max-width: 62ch; }

.sale-section-head h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    text-wrap: balance;
}

.sale-bar {
    flex: none;
    width: 0.5em;
    height: 1.05em;
    border-radius: 999px;
    background: var(--bar);
}

.sale-section-head p {
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.sale-inventory {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 2.5rem;
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
}

.sale-inventory li {
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}

.sale-inventory h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.sale-inventory p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.sale-round {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 2.5rem;
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: round;
}

.sale-round li {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    column-gap: 0.9rem;
    align-items: start;
    counter-increment: round;
}

.sale-round li::before {
    content: counter(round);
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--mark);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.sale-round strong {
    padding-top: 0.45rem;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
}

.sale-round p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.sale-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 2.5rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.sale-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

.sale-checklist svg {
    flex: none;
    margin-top: 0.2rem;
    color: var(--mark);
}

.sale-handover {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 2rem;
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: stage;
}

.sale-handover li {
    padding-top: 1rem;
    border-top: 2px solid var(--mark);
    counter-increment: stage;
}

.sale-handover li::before {
    content: counter(stage);
    display: block;
    margin-bottom: 0.4rem;
    color: var(--mark);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.sale-handover strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
}

.sale-handover p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.sale-honest {
    display: grid;
    gap: 1.4rem;
    max-width: 66ch;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.sale-honest strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
}

.sale-honest p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.97rem;
    line-height: 1.55;
}

/* ── Closing ────────────────────────────────────────────────────────── */

.sale-closing {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 2rem 3rem;
    align-items: center;
    margin-top: clamp(3.5rem, 7vw, 5rem);
    padding-top: clamp(2rem, 4vw, 2.75rem);
    border-top: 1px solid var(--rule);
}

.sale-closing h2 {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.05;
    text-wrap: balance;
}

.sale-closing p {
    max-width: 52ch;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.sale-closing-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.9rem;
    justify-self: end;
    text-align: right;
}

.sale-closing-mail {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-underline-offset: 0.2em;
}

.sale-closing-mail:hover { color: var(--ink); }

/* ── Footer ─────────────────────────────────────────────────────────── */

.sale-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    margin-top: clamp(3rem, 7vw, 5rem);
    padding: 1.6rem 0 2.5rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.88rem;
}

.sale-footer a { text-decoration: none; }

.sale-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .sale-hero { grid-template-columns: 1fr; }
    .sale-demo { max-width: 540px; }
    .sale-inventory,
    .sale-handover { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sale-closing { grid-template-columns: 1fr; }
    .sale-closing-action {
        align-items: flex-start;
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .sale-header,
    main,
    .sale-footer { width: min(1040px, calc(100% - 2rem)); }
    .sale-back { display: none; }
    .sale-hero h1 { font-size: clamp(2.1rem, 9.5vw, 2.7rem); }
    .sale-actions { gap: 0.8rem; }
    .sale-btn { width: 100%; }
    .sale-facts,
    .sale-inventory,
    .sale-round,
    .sale-checklist,
    .sale-handover { grid-template-columns: 1fr; }
    .sale-sliders label { grid-template-columns: 5rem minmax(0, 1fr); }
    .sale-demo { padding: 1.1rem 1.1rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .sale-chip { transition: none; }
}
