/* The "How to print" page (print.html). Clicker Wonderland's type, spacing,
   radii, buttons and shadows, recoloured Chop Red through src/tokens.css,
   which print.html links first. Light only. Plain document: one reading
   column, no script. */

@font-face {
    font-family: 'Bitter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../../vendor/fonts/Bitter-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Overpass';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../../vendor/fonts/Overpass-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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    background-color: var(--bg-1);
    background-image:
        radial-gradient(at 0% 0%, rgba(170, 90, 110, 0.10) 0px, transparent 55%),
        radial-gradient(at 100% 0%, rgba(170, 90, 110, 0.08) 0px, transparent 55%),
        radial-gradient(at 50% 100%, rgba(170, 90, 110, 0.06) 0px, transparent 55%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ---- Focus, skip link, screen-reader text (as the app) ---- */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-inset);
}

.skip-link {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3010;
    transform: translateY(-140%);
    padding: 0.7rem 1.2rem;
    background: var(--c-white);
    color: var(--accent-text);
    border: 3px solid var(--focus-ring);
    border-radius: 0 0 var(--radius-card) 0;
    font: 700 var(--fs-base) var(--font-display);
    text-decoration: none;
    transition: transform var(--dur-150) ease;
}
.skip-link:focus {
    transform: translateY(0);
}

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

/* ---- Header: the lockup and the way back to the app ---- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.6rem clamp(1rem, 4vw, 2rem);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-card);
    box-shadow: 0 6px 24px var(--shadow-soft);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-height: 44px;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-control);
}
.brand-top {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-display);
    font-size: var(--fs-mark);
    font-weight: var(--fw-display);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
}
.brand-mark {
    flex: none;
    width: 28px;
    height: 28px;
}
.brand-word {
    background: var(--grad-wordmark);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent-text);
}
.brand-line {
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--accent-text);
}
.brand-line strong {
    font-weight: var(--fw-display);
}

/* ---- Buttons: pills, 44 px high (LOOK.md "Buttons") ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-chip);
    font-family: var(--font-ui);
    font-size: var(--fs-base);
    font-weight: var(--fw-strong);
    line-height: var(--lh-tight);
    text-decoration: none;
    transition: background var(--dur-150) ease, transform var(--dur-150) ease, box-shadow var(--dur-150) ease;
}
.btn-primary {
    background: var(--grad-primary);
    color: var(--c-white);
    box-shadow: 0 4px 12px var(--shadow-pink);
}
.btn-primary:hover {
    background: var(--grad-primary-hover);
    transform: translateY(-1px);
}
.btn:active {
    transform: scale(0.97);
}

/* ---- The reading column ---- */
.page {
    width: min(100% - 2rem, 44rem);
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 2.75rem) 0 clamp(2rem, 6vw, 3.5rem);
}
.page:focus {
    outline: none;
}

.intro h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 6vw, 2.4rem);
    font-weight: var(--fw-display);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-title);
    color: var(--text-primary);
}
.lede {
    max-width: 68ch;
    margin-top: 0.75rem;
    font-size: var(--fs-lg);
    color: var(--text-secondary);
}

/* "On this page": pill links, wrapping */
.toc {
    margin-top: 1.25rem;
}
.toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
}
.toc a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.95rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-chip);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-strong);
    line-height: var(--lh-tight);
    text-decoration: none;
    transition: background var(--dur-150) ease, border-color var(--dur-150) ease;
}
.toc a:hover {
    background: #fbe9e6;
    border-color: var(--border-card-open);
}

/* ---- Sections ---- */
.block,
.cta {
    margin-top: 2.25rem;
    padding-top: 1.1rem;
    border-top: 2px solid var(--border-color);
    scroll-margin-top: 1rem;
}
.block > * + *,
.cta > * + * {
    margin-top: 0.8rem;
}
.block > h2,
.cta > h2 {
    margin-top: 0;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: var(--fw-display);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-title);
    color: var(--text-primary);
}
.block h3 {
    margin-top: 1.6rem;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: var(--fw-strong);
    line-height: var(--lh-tight);
    color: var(--text-primary);
}

p,
li {
    max-width: 68ch;
}
strong {
    font-weight: var(--fw-strong);
}
a {
    color: var(--accent-text);
    text-underline-offset: 0.18em;
}
a:hover {
    color: var(--text-primary);
}
.small {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

/* Lists */
.plain-list,
.part-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-left: 1.2rem;
}
.part-list {
    gap: 0.6rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    list-style: none;
    counter-reset: step;
}
.steps li {
    position: relative;
    min-height: 2rem;
    padding-left: 2.75rem;
    counter-increment: step;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    top: -0.1rem;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-chip);
    background: var(--grad-primary);
    color: var(--c-white);
    font-family: var(--font-display);
    font-weight: var(--fw-display);
    line-height: 1;
    box-shadow: 0 4px 12px var(--shadow-pink);
}

/* A short note, set apart */
.note {
    padding: 0.7rem 0.9rem;
    background: #fff6f3;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--radius-inset);
}

/* ---- Figures ---- */
.figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 0.9rem 0.75rem;
    background: var(--c-white);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-card);
}
.figure img {
    display: block;
    width: 100%;
    max-width: 21rem;
    height: auto;
}
.figure-tall img {
    max-width: 11rem;
}
.figure figcaption {
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
    color: var(--text-secondary);
    text-align: center;
}

.parts-layout {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.parts-text > * + * {
    margin-top: 0.8rem;
}
@media (min-width: 640px) {
    .parts-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .figure-tall {
        flex: 0 0 13rem;
    }
    .parts-text {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ---- The settings table: scrolls inside its own box ---- */
.table-scroll {
    position: relative;
    overflow-x: auto;
    background: var(--c-white);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-card);
    -webkit-overflow-scrolling: touch;
}
.settings {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    line-height: var(--lh-tight);
}
.settings th,
.settings td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-soft);
}
.settings thead th,
.settings thead td {
    background: #fbe9e6;
    border-bottom: 1px solid var(--border-card);
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    font-weight: var(--fw-strong);
}
.settings tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 7.5rem;
    background: var(--card-bg);
    font-weight: var(--fw-strong);
    border-right: 1px solid var(--border-soft);
}
.settings tbody tr:last-child th,
.settings tbody tr:last-child td {
    border-bottom: 0;
}

/* ---- Last call to action ---- */
.cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-footer {
    padding: 1.25rem 1rem 2rem;
    border-top: 1px solid var(--border-soft);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}
.site-footer p {
    max-width: none;
}

/* ---- Small screens: the same page, a little tighter ---- */
@media (max-width: 480px) {
    .block h2,
    .cta h2 {
        font-size: 1.3rem;
    }
    .figure {
        padding: 0.75rem 0.6rem 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .skip-link,
    .btn,
    .toc a {
        transition: none;
    }
    .btn:active {
        transform: none;
    }
}

/* If the page is printed: the page itself, without the chrome */
@media print {
    body {
        background: var(--c-white);
    }
    .site-header .btn,
    .toc,
    .cta,
    .skip-link {
        display: none;
    }
    .table-scroll {
        overflow: visible;
    }
    .settings {
        min-width: 0;
    }
}
