/* ==========================================================================
   StrikeTCG – main stylesheet
   Hand-written, no build step. Mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (self-hosted woff2, latin + latin-ext subsets)
   -------------------------------------------------------------------------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/inter-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: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/inter-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Archivo Expanded";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    /* Archivo at width 125 % (expanded), bold, as a static font. Its capitals sit almost centred already
       (ascent 878, cap height 686, descent 210 of 1000); these make it exact: ascent = cap height + descent. */
    ascent-override: 88.7%;
    descent-override: 20.1%;
    line-gap-override: 0%;
    src: url("../fonts/archivo-expanded-700-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: "Archivo Expanded";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    ascent-override: 88.7%;
    descent-override: 20.1%;
    line-gap-override: 0%;
    src: url("../fonts/archivo-expanded-700-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Yellowtail";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/yellowtail-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: "Yellowtail";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/yellowtail-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Colour */
    --ink: #15151A;
    --ink-soft: #3B3B45;          /* secondary text, 7:1+ on light grey */
    --muted: #4A4A55;             /* small print, ≥ 5.5:1 on #D0D0D0 */
    --red: #E1261C;               /* brand red: fills, large text, logo */
    --amber-text: #B34700;        /* orange for small text on light grey (≥ 4.5:1) */
    --red-text: #A91B13;          /* red for small text on light grey (≥ 4.5:1) */
    --red-hover: #C41E15;
    --bg-from: #D0D0D0;
    --bg-to: #EFEFEF;
    --surface: #FFFFFF;
    --surface-soft: #F6F6F7;
    --surface-muted: #F3F3F5;     /* hover background inside white panels */
    --on-ink: #FFFFFF;            /* text on an ink-filled pill or button */
    /* The same colours as channels, for see-through tints: rgb(var(--ink-rgb) / .2). They flip in dark mode. */
    --ink-rgb: 21 21 26;
    --surface-rgb: 255 255 255;
    --line: rgba(21, 21, 26, .12);
    --success: #1E6B3A;
    --error: #A91B13;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, .55);
    --glass-bg-strong: rgba(255, 255, 255, .72);
    --glass-bg-fallback: rgba(246, 246, 247, .96);
    /* Panels inside the (blurred) header can't blur the page behind them,
       so they get a more opaque glass. */
    --glass-bg-panel: rgba(255, 255, 255, .9);
    --glass-border: 1px solid rgba(255, 255, 255, .6);
    --glass-blur: blur(16px) saturate(160%);
    --glass-blur-strong: blur(22px) saturate(180%);

    /* Type */
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-label: "Archivo Expanded", "Inter", system-ui, sans-serif;
    /* Letter-spacing of the label font. Browsers also add it after the LAST letter, so text in a
       pill or a centred box would sit to the left: those get text-indent: var(--label-spacing) as well. */
    --label-spacing: .1em;
    --font-script: "Yellowtail", "Brush Script MT", cursive;
    --font-jp: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;

    --step--1: clamp(.82rem, .79rem + .15vw, .9rem);
    --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
    --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.35rem);
    --step-2: clamp(1.4rem, 1.25rem + .75vw, 1.85rem);
    --step-3: clamp(1.75rem, 1.45rem + 1.5vw, 2.6rem);
    --step-4: clamp(2.2rem, 1.7rem + 2.5vw, 3.6rem);

    /* Space */
    --space-2xs: clamp(.25rem, .23rem + .1vw, .3rem);
    --space-xs: clamp(.5rem, .46rem + .2vw, .6rem);
    --space-s: clamp(.75rem, .7rem + .25vw, .9rem);
    --space-m: clamp(1rem, .9rem + .5vw, 1.35rem);
    --space-l: clamp(1.5rem, 1.3rem + 1vw, 2.2rem);
    --space-xl: clamp(2.25rem, 1.8rem + 2.25vw, 3.75rem);
    --space-2xl: clamp(3.5rem, 2.6rem + 4.5vw, 6.5rem);
    --gutter: clamp(1rem, .6rem + 2vw, 2rem);

    /* Shape & depth */
    --radius-s: 10px;
    --radius-m: 16px;
    --radius-l: 24px;
    --radius-pill: 999px;
    --shadow-soft: 0 1px 2px rgba(21, 21, 26, .05), 0 8px 24px rgba(21, 21, 26, .07);
    --shadow-lift: 0 2px 4px rgba(21, 21, 26, .06), 0 18px 40px rgba(21, 21, 26, .12);

    --container: 1180px;
    --container-narrow: 760px;
    --header-h: 72px;

    --ease: cubic-bezier(.2, .7, .2, 1);
    --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}

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

html {
    /* With body: mobile Chrome only stops the sideways overflow when the root element clips it too. */
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--bg-to);
    background-image: linear-gradient(170deg, var(--bg-from) 0%, var(--bg-to) 55%, var(--bg-to) 100%);
    background-attachment: fixed;
    /* Safety net (with html): nothing may make the page wider than the screen (phones then zoom the whole page out). */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fieldsets are at least as wide as their content by default; let them shrink like a div. */
fieldset {
    min-inline-size: 0;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.01em;
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

ul, ol {
    margin: 0;
    padding: 0;
}

a {
    color: inherit;
    text-underline-offset: .2em;
    text-decoration-thickness: 1px;
}

:lang(ja) {
    font-family: var(--font-jp);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: 6px;
}

::selection {
    background: var(--red);
    color: #fff;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: .75rem 1rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-s);
    text-decoration: none;

    &:focus {
        top: 1rem;
    }
}

.container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.container--narrow {
    width: min(100% - 2 * var(--gutter), var(--container-narrow));
}

/* --------------------------------------------------------------------------
   Glass
   -------------------------------------------------------------------------- */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass,
    .button--glass,
    .lang__menu,
    .cart-drawer__panel,
    .badge,
    .site-header.is-scrolled .site-header__inner {
        background: var(--glass-bg-fallback);
    }

    @media (max-width: 47.99rem) {
        html.js .main-nav {
            background: var(--glass-bg-fallback);
        }
    }
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
.label {
    margin: 0;
    font-family: var(--font-label);
    font-weight: 700;
    font-size: .72rem;
    line-height: 1.4;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.label--red {
    color: var(--red-text);
}

.label--light {
    color: #fff;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    font-weight: 600;
    text-decoration: none;

    &::after {
        content: "→";
        color: var(--red-text);
        transition: transform .2s var(--ease);
    }

    &:hover::after {
        transform: translateX(4px);
    }
}

/* --------------------------------------------------------------------------
   Logo (vector files in public/images/logo, taken from the sticker)
   -------------------------------------------------------------------------- */
.logo {
    display: block;
    width: auto;
    height: 2.25rem;
    transition: height .3s var(--ease);
}

.logo--footer {
    height: 3.25rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
/* Disabled buttons (e.g. Pay now while ordering is switched off). */
.button:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checkout__closed {
    margin-bottom: var(--space-s);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 48px;
    padding: .75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--red);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(225, 38, 28, .28);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);

    &:hover {
        background: var(--red-hover);
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(225, 38, 28, .32);
    }

    &:active {
        transform: translateY(0);
    }
}

.button--small {
    min-height: 44px;
    padding: .55rem 1.1rem;
    font-size: var(--step--1);
}

.button--glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    color: var(--ink);
    box-shadow: var(--shadow-soft);

    &:hover {
        background: var(--glass-bg-strong);
        box-shadow: var(--shadow-lift);
    }
}

.button--ink {
    background: var(--ink);
    box-shadow: var(--shadow-soft);

    &:hover {
        background: #2A2A33;
        box-shadow: var(--shadow-lift);
    }
}

.button--ghost {
    background: transparent;
    color: var(--ink);
    border-color: rgb(var(--ink-rgb) / .3);
    box-shadow: none;

    &:hover {
        background: var(--surface);
        box-shadow: var(--shadow-soft);
    }
}

.button--light {
    background: #fff;
    /* Always white with dark text (it sits on the dark banner), also in dark mode where --ink is light. */
    color: #15151A;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);

    &:hover {
        background: #fff;
    }
}

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s var(--ease);

    &:hover {
        background: rgb(var(--surface-rgb) / .7);
    }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: .6rem var(--gutter) 0;
}

/* Announcement bar above the header (partials/announcement) */
.announcement {
    position: relative;
    padding: .55rem 3rem .55rem var(--gutter);
    background: var(--ink);
    color: #fff;
    font-size: var(--step--1);
    font-weight: 500;
    line-height: 1.4;
    text-align: center;

    &[hidden] {
        display: none;
    }

    a {
        color: inherit;
        text-decoration: underline;
        text-underline-offset: .2em;
    }

    a:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
        box-shadow: none;
    }
}

.announcement--red {
    background: #B91C13; /* the brand red, darker so white text passes the contrast check */
}

.announcement__link {
    margin-left: .35rem;
    font-weight: 700;
}

.announcement__close {
    position: absolute;
    top: 50%;
    right: .5rem;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;

    &:hover {
        background: rgba(255, 255, 255, .18);
    }

    &:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 0;
        box-shadow: none;
    }
}

/* The header always takes up the same space; only the bar inside shrinks.
   (If the page moved when the bar shrinks, the scroll position would change
   and the header would flip back and forth near the top.) */
html.js .site-header {
    height: calc(var(--header-h) + .6rem);
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    max-width: var(--container);
    min-height: var(--header-h);
    margin-inline: auto;
    padding: .5rem .6rem .5rem 1.1rem;
    border-radius: var(--radius-l);
    transition: min-height .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease), backdrop-filter .3s var(--ease);
}

.site-header.is-scrolled {
    .site-header__inner {
        min-height: 58px;
        background: var(--glass-bg-strong);
        -webkit-backdrop-filter: var(--glass-blur-strong);
        backdrop-filter: var(--glass-blur-strong);
        box-shadow: var(--shadow-lift);
    }

    .logo--header {
        height: 1.85rem;
    }
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    margin-right: auto;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.cart-button__count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--red);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}

/* Main navigation – mobile: panel under the header */
.main-nav__list {
    list-style: none;
}

.main-nav__link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s var(--ease), color .2s var(--ease);

    &:hover {
        background: rgb(var(--surface-rgb) / .75);
    }

    &[aria-current="page"] {
        color: var(--red-text);
        font-weight: 600;
    }
}

/* Without JS the mobile menu is simply shown as a row of links. */
html:not(.js) .menu-toggle {
    display: none;
}

html:not(.js) .site-header__inner {
    flex-wrap: wrap;
}

html:not(.js) .main-nav {
    order: 3;
    width: 100%;

    .main-nav__list {
        display: flex;
        flex-wrap: wrap;
    }
}

html.js .main-nav {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    right: 0;
    padding: .6rem;
    border-radius: var(--radius-l);
    background: var(--glass-bg-panel);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    border: var(--glass-border);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;

    &.is-open {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity .2s var(--ease), transform .2s var(--ease);
    }

    .main-nav__link {
        min-height: 52px;
        font-size: var(--step-1);
    }
}

/* Phones and small tablets: the menu panel hangs under the sticky header, so the page cannot scroll it
   into view. It is at most as tall as the visible screen (dvh: without the browser's own bars) and
   scrolls inside itself, also with the Shop menu opened in it. */
@media (max-width: 47.99rem) {
    html.js .main-nav {
        max-height: calc(100vh - var(--header-h) - 2rem);
        max-height: calc(100dvh - var(--header-h) - 2rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

.menu-toggle__bars {
    position: relative;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: background-color .2s;

    &::before,
    &::after {
        content: "";
        position: absolute;
        left: 0;
        width: 20px;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: transform .25s var(--ease);
    }

    &::before { transform: translateY(-6px); }
    &::after { transform: translateY(6px); }
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars {
    background: transparent;

    &::before { transform: rotate(45deg); }
    &::after { transform: rotate(-45deg); }
}

@media (min-width: 48rem) {
    /* Three columns: logo | menu | icons. The outer columns are equally wide,
       so the menu sits exactly in the middle of the bar (equal side padding too). */
    .site-header__inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        padding-inline: 1.1rem;
    }

    .site-header__actions {
        justify-self: end;
    }

    .menu-toggle,
    html.js .menu-toggle {
        display: none;
    }

    html.js .main-nav,
    html:not(.js) .main-nav {
        position: static;
        order: 0;
        width: auto;
        padding: 0;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;

        .main-nav__list {
            display: flex;
            gap: .25rem;
        }

        .main-nav__link {
            min-height: 44px;
            font-size: var(--step-0);
        }
    }

    .site-header__brand {
        margin-right: 0;
        justify-self: start;
    }
}

/* Search bar under the header, with suggestions below the input */
.header-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: .6rem;
    max-width: var(--container);
    margin: .5rem auto 0;
    padding: .4rem 1rem;
    border-radius: var(--radius-l);
    background: var(--glass-bg-panel);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    border: var(--glass-border);
    box-shadow: var(--shadow-lift);

    &[hidden] {
        display: none;
    }

    > svg {
        flex: none;
        color: var(--muted);
    }

    input {
        flex: 1;
        min-width: 0;
        min-height: 48px;
        border: 0;
        background: none;
        color: var(--ink);
        font: inherit;
        font-size: var(--step-1);

        /* The cursor shows the focus; the bar itself is the open search, so no extra ring. */
        &:focus,
        &:focus-visible {
            outline: none;
            box-shadow: none;
        }

        /* Our own results replace the browser's clear button look. */
        &::-webkit-search-cancel-button {
            cursor: pointer;
        }
    }

}

.header-search__results {
    flex-basis: 100%;
    max-height: min(70vh, 34rem);
    max-height: min(70dvh, 34rem);
    overflow-y: auto;
    margin-top: .4rem;
    padding: .6rem 0 .4rem;
    border-top: 1px solid var(--line);

    &[hidden] {
        display: none;
    }
}

/* Suggestions (partials/search-suggestions) */
.suggest__grid {
    display: grid;
    gap: var(--space-s);
}

.suggest__label {
    margin-bottom: .3rem;
    padding-inline: .5rem;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.suggest__list {
    display: grid;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggest__category,
.suggest__product,
.suggest__all {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: var(--radius-s);
    color: var(--ink);
    text-decoration: none;
    transition: background-color .15s var(--ease);

    &:hover,
    &:focus-visible,
    &.is-active {
        background: rgb(var(--ink-rgb) / .06);
        outline: none;
    }

    &:focus-visible {
        box-shadow: var(--focus);
    }
}

.suggest__category {
    justify-content: space-between;
    min-height: 44px;
    padding: .4rem .6rem;
    font-weight: 600;
}

.suggest__count,
.suggest__lang {
    padding: .1rem .5rem;
    border-radius: var(--radius-pill);
    background: rgb(var(--ink-rgb) / .08);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

.suggest__product {
    padding: .4rem .5rem;

    img {
        flex: none;
        width: 56px;
        height: 56px;
        border-radius: 8px;
        object-fit: cover;
        background: var(--surface);
    }
}

.suggest__product-text {
    display: grid;
    flex: 1;
    min-width: 0;
}

.suggest__name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest__meta {
    color: var(--muted);
    font-size: var(--step--1);
}

.suggest__price {
    display: grid;
    justify-items: end;
    font-weight: 700;
    white-space: nowrap;

    small {
        font-size: .75rem;
        font-weight: 500;
        color: var(--muted);
    }

    /* The same states as the badge on the product tile: green in stock, red low (with a dot), grey sold out. */
    .suggest__stock {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        font-weight: 600;

        &::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }
    }

    .suggest__stock--instock {
        color: var(--success);
    }

    .suggest__stock--low {
        color: var(--red-text);
    }

    .suggest__stock--few {
        color: var(--amber-text);

        &::before {
            background: #F28A1E;
        }
    }

    .suggest__stock--soldout {
        color: var(--ink-soft);
    }
}

.suggest__condition {
    display: inline-block;
    margin-left: .4rem;
    padding: 0 .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink-soft);
}

.suggest__all {
    justify-content: center;
    min-height: 44px;
    margin-top: .5rem;
    padding: .4rem .6rem;
    font-weight: 600;
}

.suggest__empty {
    display: grid;
    gap: .4rem;
    padding: .4rem .6rem;
    color: var(--muted);
}

@media (min-width: 48rem) {
    /* Categories on the left, products on the right. */
    .suggest__grid:has(.suggest__group--categories):has(.suggest__group--products) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }
}

/* Shop drop-down ("mega menu", partials/mega-menu): categories with JP / EN | latest sets | search and quick links */
.has-mega {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    > .main-nav__link {
        flex: 1;
    }
}

.main-nav__expand {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: inherit;
    cursor: pointer;

    svg {
        transition: transform .2s var(--ease);
    }

    &[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }

    &:hover {
        background: rgb(var(--surface-rgb) / .75);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

/* Closed unless .is-open (set by main.js). Mobile: shown inside the menu panel. */
.mega {
    display: none;
    width: 100%;

    .has-mega.is-open > & {
        display: block;
    }
}

.mega__inner {
    display: grid;
    gap: var(--space-m);
    padding: .4rem 0 .8rem;
}

.mega__col {
    display: grid;
    align-content: start;
    gap: .5rem;
    min-width: 0;
}

.mega__title {
    margin: 0;
    padding-inline: .5rem;
    color: var(--muted);
    font-family: var(--font-label);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: var(--label-spacing);
    text-transform: uppercase;
}

/* 1. Categories: the name opens both card languages, the pills one of them. */
.mega__cats {
    display: grid;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega__cat {
    display: flex;
    align-items: center;
    gap: .4rem;
    border-radius: var(--radius-s);
    transition: background-color .2s var(--ease);

    &:hover {
        background: var(--surface-muted);
    }
}

.mega__link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    min-height: 48px;
    padding: .3rem .5rem;
    border-radius: var(--radius-s);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;

    img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        flex: none;
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

.mega__langs {
    display: flex;
    gap: .3rem;
    padding-right: .5rem;
}

.mega__lang {
    display: inline-grid;
    place-items: center;
    min-width: 2.3rem;
    height: 1.75rem;
    padding-inline: .45rem;
    border: 1px solid rgb(var(--ink-rgb) / .18);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-label);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-decoration: none;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);

    &:hover {
        background: var(--ink);
        border-color: var(--ink);
        color: #fff;
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

/* JP / EN links in the category rows: a small arrow that nudges sideways shows they lead somewhere. */
.mega__lang--go {
    display: inline-flex;
    gap: .3rem;
    padding-inline: .55rem .5rem;
    text-indent: 0;
}

.mega__go {
    display: inline-block;
    font-family: var(--font-body, inherit);
    font-size: .8rem;
    line-height: 1;
    letter-spacing: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .mega__go {
        animation: mega-arrow-nudge 1.4s ease-in-out infinite;
    }
}

@keyframes mega-arrow-nudge {
    0%, 100% { transform: translateX(-1px); }
    50% { transform: translateX(3px); }
}

/* The same pill as a label (not a link): sets and the language links. */
.mega__lang--tag {
    min-width: 2rem;
    height: 1.45rem;
    border-color: transparent;
    background: var(--ink);
    color: #fff;
    font-size: .58rem;
}

/* 2. Latest sets: cover (logo on white, or the box photo), name, language, code, "New". */
.mega__sets {
    display: grid;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega__set {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 56px;
    padding: .35rem .5rem;
    border-radius: var(--radius-s);
    color: var(--ink);
    text-decoration: none;
    transition: background-color .2s var(--ease);

    &:hover {
        background: var(--surface-muted);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

.mega__set-cover {
    display: grid;
    place-items: center;
    flex: none;
    width: 64px;
    height: 48px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* A set logo: whole, with some room. */
.mega__set-cover--logo img {
    padding: 4px;
    object-fit: contain;
}

.mega__set-text {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.mega__set-name {
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mega__set-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: var(--muted);
    font-size: var(--step--1);
}

.mega__new {
    padding: .1rem .45rem;
    border-radius: var(--radius-pill);
    background: var(--red);
    color: #fff;
    font-family: var(--font-label);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-transform: uppercase;
}

/* 3. Quick: all products per card language, extra links. */
.mega__quick {
    display: grid;
    gap: .1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega__quick-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    padding: .3rem .5rem;
    border-radius: var(--radius-s);
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;

    &:hover {
        background: var(--surface-muted);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

.mega__all-products {
    justify-self: start;
    margin: .2rem .5rem 0;
}

@media (min-width: 48rem) {
    .has-mega {
        flex-wrap: nowrap;
        gap: 0;
    }

    /* "Shop" looks like a button: a light pill around the word and its arrow, so it's clear a menu opens there. */
    .has-mega > .main-nav__link {
        padding-right: .35rem;
    }

    .has-mega {
        border-radius: var(--radius-pill);
        background: rgb(var(--surface-rgb) / .7);
        box-shadow: inset 0 0 0 1px rgb(var(--ink-rgb) / .1);
        transition: background-color .2s var(--ease), box-shadow .2s var(--ease);

        &:hover,
        &.is-open {
            background: var(--surface);
            box-shadow: inset 0 0 0 1px rgb(var(--ink-rgb) / .22);
        }
    }

    .main-nav__expand {
        width: 32px;
        margin-left: -.35rem;
        margin-right: .2rem;
    }

    /* Desktop: a solid white panel under the header bar, as wide as the bar (the page doesn't show through). */
    .mega {
        position: absolute;
        top: calc(100% + .5rem);
        left: 0;
        right: 0;
        width: auto;
        padding: var(--space-m);
        border-radius: var(--radius-l);
        background: var(--surface);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-lift);

        /* Invisible bridge over the gap, so the mouse can move into the panel. */
        &::before {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 100%;
            height: .75rem;
        }
    }

    /* The columns scroll inside the panel when the screen is low (landscape tablet), so nothing ends below the
       screen. On the inner part, not the panel: that keeps the hover bridge. */
    .mega__inner {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .9fr);
        gap: var(--space-l);
        max-height: calc(100vh - var(--header-h) - 4rem);
        max-height: calc(100dvh - var(--header-h) - 4rem);
        padding: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .mega__col + .mega__col {
        padding-left: var(--space-l);
        border-left: 1px solid var(--line);
    }
}

/* No sets with a page yet: two columns. */
@media (min-width: 68.01rem) {
    .mega__inner:not(:has(.mega__col--sets)) {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    }
}

/* Tablets: two columns, the quick column goes under them. */
@media (min-width: 48rem) and (max-width: 68rem) {
    .mega__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mega__col--quick {
        grid-column: 1 / -1;
        padding-left: 0 !important;
        padding-top: var(--space-s);
        border-left: 0 !important;
        border-top: 1px solid var(--line);
    }
}

/* Language switcher */
.lang {
    position: relative;
}

.lang__toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .4rem .8rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-size: var(--step--1);
    cursor: pointer;

    &:hover {
        background: rgb(var(--surface-rgb) / .7);
    }
}

.lang__code {
    font-family: var(--font-label);
    font-size: .7rem;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
}

.lang__menu {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 60;
    min-width: 13rem;
    padding: .4rem;
    list-style: none;
    border-radius: var(--radius-m);
    background: var(--glass-bg-panel);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    box-shadow: var(--shadow-lift);
    display: none;
}

/* JS opens the menu; without JS it opens on hover / keyboard focus. */
.lang.is-open .lang__menu,
html:not(.js) .lang:hover .lang__menu,
html:not(.js) .lang:focus-within .lang__menu {
    display: block;
}

.lang__option {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 44px;
    padding: .5rem .8rem;
    border-radius: var(--radius-s);
    text-decoration: none;

    &:hover,
    &:focus-visible {
        background: rgb(var(--surface-rgb) / .85);
    }

    &[aria-current="true"] {
        font-weight: 600;

        .lang__option-code {
            color: var(--red-text);
        }
    }
}

.lang__option-code {
    width: 2rem;
    font-family: var(--font-label);
    font-size: .68rem;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Hero: sticker logo + artwork, extended into ink scenery along the bottom.
   Works from phones to ultrawide screens: the waves have a fixed tile size,
   the hills only stretch sideways, and the text never overlaps the scenery.
   -------------------------------------------------------------------------- */
.hero {
    --hills-h: clamp(4.5rem, 2.5rem + 6vw, 9rem);
    --waves-h: clamp(3.5rem, 2.5rem + 3vw, 6rem);
    --seigaiha-hero: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' viewBox='0 0 32 16'%3E%3Cdefs%3E%3Cg id='s'%3E%3Ccircle r='16' fill='%23EFEFEF' stroke='%23C6C6CB'/%3E%3Ccircle r='11.5' fill='none' stroke='%23D0D0D4'/%3E%3Ccircle r='7' fill='none' stroke='%23D9D9DD'/%3E%3Ccircle r='2.5' fill='none' stroke='%23DFDFE2'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s' x='16' y='0'/%3E%3Cuse href='%23s' x='0' y='8'/%3E%3Cuse href='%23s' x='32' y='8'/%3E%3Cuse href='%23s' x='16' y='16'/%3E%3Cuse href='%23s' x='0' y='24'/%3E%3Cuse href='%23s' x='32' y='24'/%3E%3C/svg%3E");
    position: relative;
    isolation: isolate;
    /* Room for the scenery below the text: the hill peaks start at ~20% of their height. */
    padding-block: var(--space-l) calc(var(--waves-h) + var(--hills-h) * .85);
    overflow: clip;
}

.hero-scenery {
    position: absolute;
    inset: auto 0 0 0;
    z-index: -1;
    pointer-events: none;
}

.hero-hills {
    display: block;
    width: 100%;
    height: var(--hills-h);
    /* Hills run a little into the waves. */
    margin-bottom: calc(var(--waves-h) * -.4);
}

.hero-waves {
    height: var(--waves-h);
    background: var(--seigaiha-hero) repeat-x left bottom / 40px 20px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 55%);
}

.hero__grid {
    display: grid;
    gap: var(--space-l);
    align-items: center;
}

.hero__title {
    margin: 0;
}

.hero-logo {
    display: block;
    width: clamp(15rem, 9rem + 26vw, 30rem);
    height: auto;
    margin-left: -.35rem;
    overflow: visible;
}

.hero__tagline {
    max-width: 34ch;
    margin-top: var(--space-m);
    font-size: var(--step-1);
    line-height: 1.5;
    color: var(--ink-soft);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-top: var(--space-l);
}

/* The Cardmarket button says just "Cardmarket" on phones (see below). */
.hero__cm-short {
    display: none;
}

/* Phones: both buttons on one row, sharing it; the Cardmarket button only says "Cardmarket" (the full
   "View on Cardmarket" didn't fit next to "Shop now" and dropped to a second row). Still wraps if a
   translation is too long. */
@media (max-width: 30rem) {
    .hero__actions {
        gap: .6rem;

        .button {
            flex: 1 1 auto;
            padding-inline: 1.05rem;
            white-space: nowrap;
        }
    }

    .hero__cm-full {
        display: none;
    }

    .hero__cm-short {
        display: inline;
    }
}

.hero__visual {
    --parallax: 0px;
    position: relative;
    max-width: 30rem;
    width: 100%;
    margin-inline: auto;

    /* A soft halo in the painting's own background colour, so its edges
       melt in on any page background (the page is darker at the top). */
    &::before {
        content: "";
        position: absolute;
        inset: -12% -16%;
        z-index: -1;
        background: radial-gradient(closest-side, var(--bg-to) 55%, transparent 100%);
    }
}

/* The painting with soft, oval edges. */
.hero__art {
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(calc(var(--parallax) * .5));
    /* The oval is centred and reaches exactly to the image edges, so every edge (the top too) fades out completely. */
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 80%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 80%, transparent 100%);
}

/* Painting layers (partials/hero-art). The styles here are the END state: the full
   painting. The intro animation below only plays when motion is allowed. */
.hero-art__snowline {
    transform: translateY(620px); /* snow line below the mountain: all snow visible */
}

.hero-art__volcano,
.hero-art__eruption {
    opacity: 0;
}

.hero-art__fire {
    transform-box: fill-box;
    transform-origin: center;
}

/* Lava strokes are drawn along their path (pathLength="1"). */
.hero-art__lava,
.hero-art__burst {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

/* Smoke clouds grow and rise from their bottom middle. */
.hero-art__smoke {
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

/* Soft red glow behind the painted sun (sun centre ≈ 52% / 23% of the image). */
.hero__glow {
    position: absolute;
    left: 52%;
    top: 23%;
    z-index: -1;
    width: 75%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225, 38, 28, .2) 0%, rgba(225, 38, 28, .07) 40%, transparent 70%);
    transform: translate(-50%, -50%);
}

/* Cranes and mist that extend the painting (same proportions as the image, wider to the left). */
/* Cards in the torii gateway (partials/hero-art): open, fronts up, without motion. */
.hero-card__back {
    opacity: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 126.67%;   /* 760 / 600 of the painting's width */
    height: auto;
    aspect-ratio: 760 / 728;
    pointer-events: none;
    overflow: visible;
}

.hero-overlay__cranes {
    transform: translateY(var(--parallax));
}

/* On narrow screens the painting fills the width; the extra cranes would be cut off. */
@media (max-width: 59.99rem) {
    .hero-overlay__cranes {
        display: none;
    }

    /* Stacked (phones, tablets upright): logo, tagline and buttons centred over the centred painting.
       The logo stays one unit (its kana and red line keep their place), centred as a whole. */
    .hero__text {
        display: grid;
        justify-items: center;
        text-align: center;
    }

    /* Nudged a little left: the logo's left part (kana and red line) is light, "Strike" heavy, so the exact
       centre looks too far right. */
    .hero-logo {
        margin-inline: auto;
        translate: -4% 0;
    }

    .hero__tagline {
        margin-inline: auto;
    }

    .hero__actions {
        justify-content: center;
    }
}

@media (min-width: 60rem) {
    .hero__grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero__visual {
        max-width: min(34rem, 100%);
        margin-right: 0;
        /* The foot of the painting stands in the scenery. */
        margin-bottom: calc((var(--waves-h) * .5 + var(--hills-h) * .55) * -1);
    }
}

/* Large and ultrawide screens: a bigger stage that grows with the screen;
   the scenery always fills the full width. */
@media (min-width: 110rem) {
    .hero-logo {
        width: clamp(34rem, 20rem + 12vw, 46rem);
    }

    .hero__visual {
        max-width: clamp(40rem, 18rem + 19vw, 54rem);
    }

    .hero__tagline {
        font-size: clamp(1.45rem, 1rem + .4vw, 1.8rem);
    }
}

/* --------------------------------------------------------------------------
   Trust bar
   -------------------------------------------------------------------------- */
.trust {
    border-block: 1px solid var(--line);
    background: rgb(var(--surface-rgb) / .45);
}

.trust__list {
    display: grid;
    /* One column on phones: the label font is wide and words like "FABRIEKSVERZEGELD" don't fit half a phone;
       a plain 1fr column grew to that word and pushed the whole page wider than the screen. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-s) var(--space-m);
    padding-block: var(--space-m);
    list-style: none;
}

.trust__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-label);
    font-size: .74rem;
    letter-spacing: var(--label-spacing);
    text-transform: uppercase;
    line-height: 1.35;

    span {
        min-width: 0;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    svg {
        flex: none;
        width: 26px;
        height: 26px;
        color: var(--red);
    }
}

@media (min-width: 36rem) {
    .trust__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 56rem) {
    .trust__list {
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
    }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
    padding-block: var(--space-2xl);
}

.section--tight {
    padding-block: var(--space-l);
}

.section--flush-top {
    padding-top: 0;
}

.section--surface {
    background:
        linear-gradient(rgb(var(--surface-rgb) / .7), rgb(var(--surface-rgb) / .7)),
        var(--seigaiha);
}

.section__header {
    display: grid;
    gap: var(--space-xs);
    max-width: 42rem;
    margin-bottom: var(--space-l);
}

/* Page-builder blocks (homepage, free pages): less air between the blocks than a full .section,
   and least above a block's heading. */
.blocks > .section {
    padding-block: var(--space-m);
}

.blocks > .section--tight {
    padding-block: var(--space-s);
}

/* The last block: the footer's own top margin (--space-xl) is the air below it; the same space above it,
   so it sits centred between the block before it and the footer. */
.blocks > .section:last-child {
    padding-block: var(--space-xl) 0;
}

.section__title {
    font-size: var(--step-3);
}

.section__intro {
    font-size: var(--step-1);
    color: var(--ink-soft);
}

.section__more {
    margin-top: var(--space-l);
    text-align: center;
}

/* Seigaiha background pattern (subtle) */
:root {
    --seigaiha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%2315151A' stroke-opacity='.07'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M6 24a18 18 0 0 1 36 0M12 24a12 12 0 0 1 24 0M18 24a6 6 0 0 1 12 0'/%3E%3Cpath d='M-24 12a24 24 0 0 1 48 0M-18 12a18 18 0 0 1 36 0M-12 12a12 12 0 0 1 24 0M-6 12a6 6 0 0 1 12 0M24 12a24 24 0 0 1 48 0M30 12a18 18 0 0 1 36 0M36 12a12 12 0 0 1 24 0M42 12a6 6 0 0 1 12 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
    gap: var(--space-m);
}

@media (max-width: 39.99rem) {
    /* Shop pages on phones: two columns, so a list shows more than one product at a time. */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    /* Homepage product rows on phones: a row to swipe (with dots) instead of a long stack. */
    .product-grid--rail {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(64vw, 15rem);
        gap: var(--space-s);
        margin: 0 calc(var(--gutter) * -1);
        padding: .4rem var(--gutter) .9rem;
        overflow-x: auto;
        /* Sideways only: with overflow-x set, y became auto too, and a tile moving (scroll reveal, badge ripple) made
           the row scroll a little up and down, catching the finger so the page itself would not scroll. */
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--gutter);
        scrollbar-width: none;

        &::-webkit-scrollbar {
            display: none;
        }

        > * {
            scroll-snap-align: start;
        }
    }
}

.product-card {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);

    &:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-lift);
    }
}

.product-card__media {
    position: relative;
    aspect-ratio: 1;
    background: var(--surface);

    img {
        width: 100%;
        height: 100%;
        /* White space around the photo so it does not touch the card's edges. */
        padding: 6%;
        box-sizing: border-box;
        object-fit: contain;
    }

    /* A single: the card itself, card-shaped with a real card's corners (3 mm on 63 × 88 mm). The thumbnail is the
       card centred on a white square at full height, so cover cropping to 63:88 drops exactly the white sides. */
    /* Absolutely placed: in the flow the card-shaped image counted at its own taller size and stretched the
       square (an aspect-ratio box grows to fit its content). */
    &.product-card__media--card img {
        position: absolute;
        inset: 6% 0;
        width: auto;
        height: 88%;
        margin: 0 auto;
        padding: 0;
        aspect-ratio: 63 / 88;
        object-fit: cover;
        border-radius: 4.8% / 3.4%;
        box-shadow: 0 1px 2px rgb(18 22 40 / .18), 0 4px 12px rgb(18 22 40 / .12);
    }

    /* Frosted glass: see-through white with a blurred background, a faint translucent rim (no solid white
       ring), light inner highlights and a soft shadow all round that keeps the top edge visible. */
    .badge {
        position: absolute;
        top: .8rem;
        left: .8rem;
        background: rgba(255, 255, 255, .5);
        -webkit-backdrop-filter: blur(14px) saturate(1.8);
        backdrop-filter: blur(14px) saturate(1.8);
        border: 1px solid rgba(255, 255, 255, .3);
        box-shadow: 0 2px 6px rgba(20, 20, 30, .12), 0 8px 20px rgba(20, 20, 30, .14), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(255, 255, 255, .15);
    }
}

.product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .25rem;
    padding: var(--space-m);
}

.product-card__title {
    font-size: var(--step-1);
}

.product-card__jp {
    color: var(--muted);
    font-size: var(--step--1);
}

.product-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: auto;
    padding-top: var(--space-s);
}

.product-card__price {
    font-size: var(--step-1);
    font-weight: 700;
}

.product-card__from {
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 400;
}

/* "EN" next to the set code: Japanese is the norm, English is marked. */
/* Code line of a product tile: always ONE line. The size follows the tile's width (the card is a size
   container), from .6rem on narrow tiles up to the normal .72rem; a text that still does not fit ends in "…". */
.product-card__code {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: clamp(.6rem, 4.2cqi, .72rem);
    letter-spacing: .08em;
}

.product-card__code-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* JP / EN pill after the code. A fixed height with the letters centred in it (a grid cell), so rounding at
   this small size can't push them off-centre; text-indent balances the letter-spacing after the last letter. */
.lang-tag {
    display: inline-grid;
    place-items: center;
    flex: none;
    height: 1.8em;
    padding: 0 .6em;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: .78em;
    line-height: 1;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-decoration: none;
}

/* Narrow cards (swipe row, two columns): price and cart button stay on one line (the footer wraps only when a
   price is really too long), less padding, so no empty strip next to the button. */
@container (max-width: 15rem) {
    .product-card__body {
        padding: .85rem 1rem 1rem;
    }

    .product-card__footer {
        padding-top: .6rem;
    }
}

/* Very narrow cards (two columns on a phone, ~165 px): smaller text and badge, less padding, and price and
   cart button back on one line (smaller button). */
@container (max-width: 12rem) {
    .product-card__body {
        padding: .7rem .75rem .8rem;
    }

    .product-card__title {
        font-size: var(--step-0);
        line-height: 1.3;
    }

    .product-card__media .badge {
        --badge-pad-x: .5rem;
        top: .45rem;
        left: .45rem;
        padding: .25rem var(--badge-pad-x);
        font-size: .68rem;
    }

    .product-card__footer {
        flex-direction: row;
        align-items: center;
        gap: .4rem;
        padding-top: .5rem;
    }

    .product-card__price {
        font-size: var(--step-0);
    }

    .product-card__footer .product-card__add {
        align-self: center;
        width: 2.4rem;
        height: 2.4rem;
    }
}

.badge {
    /* Side padding as a variable: the ripple of "Only 1 left" is placed from it, so it stays on the dot. */
    --badge-pad-x: .7rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem var(--badge-pad-x);
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    background: rgb(var(--surface-rgb) / .85);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);

    &::before {
        content: "";
        position: relative;
        top: -1px; /* measured: the dot sat 1 px below the middle of the capitals and digits */
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: currentColor;
    }
}

.badge--instock { color: var(--success); }
.badge--low { color: var(--red-text); }

/* 2–3 left: orange, no animation (only the last piece is red and moving). */
.badge--few {
    color: var(--amber-text);

    &::before {
        background: #F28A1E;
    }
}

/* "Near Mint" on a card tile: a small pill in the text under the picture (nothing covers the card). */
.product-card__sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-width: 0;

    .product-card__jp {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.product-card__condition {
    flex: none;
    margin-left: auto;
    padding: .1rem .55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--ink-soft);
}

/* The same drop and ripple on "Only N left" in the search suggestions (dot 6 px, at the left edge). */
@media (prefers-reduced-motion: no-preference) {
    .suggest__price .suggest__stock--low {
        position: relative;

        &::before {
            animation: badge-drop 2.2s ease-in-out infinite;
        }

        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 3px;
            width: 6px;
            height: 6px;
            margin: -3px 0 0 -3px;
            border: 1.5px solid currentColor;
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
            animation: badge-ripple 2.2s ease-out infinite;
        }
    }
}

/* "Only 1 left": a drop falls on the dot, splashes, and a ring ripples out
   (like a drop in water). Dot and ring share one 2.2 s cycle. */
@media (prefers-reduced-motion: no-preference) {
    .badge--low {
        position: relative;

        &::before {
            animation: badge-drop 2.2s ease-in-out infinite;
        }

        /* The ripple, centred on the dot. */
        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: calc(var(--badge-pad-x) + 3.5px);
            width: 7px;
            height: 7px;
            margin: -4.5px 0 0 -3.5px;
            border: 1.5px solid currentColor;
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
            animation: badge-ripple 2.2s ease-out infinite;
        }
    }
}

@keyframes badge-drop {
    0%, 100% { transform: none; }
    6% { transform: translateY(-3px) scale(.65, 1.25); }   /* falling drop */
    14% { transform: translateY(0) scale(1.3, .7); }        /* splash */
    24% { transform: scale(.9, 1.1); }                      /* bounce back */
    32% { transform: none; }
}

@keyframes badge-ripple {
    0%, 13% { opacity: 0; transform: scale(.6); }
    16% { opacity: .9; }
    60%, 100% { opacity: 0; transform: scale(3.4); }
}
.badge--soldout { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Coming soon banner
   -------------------------------------------------------------------------- */
.soon-banner {
    position: relative;
    display: grid;
    gap: var(--space-m);
    align-items: center;
    padding: var(--space-xl) var(--space-l);
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--ink);
    color: #fff;

    p {
        color: rgba(255, 255, 255, .86);
        max-width: 46ch;
    }

    .button {
        justify-self: start;
    }
}

.soon-banner__title {
    margin-block: .4rem .6rem;
    font-size: var(--step-2);
    color: #fff;
}

.soon-banner__text {
    position: relative;
}

.soon-banner__sun {
    position: absolute;
    right: -70px;
    top: -70px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background:
        repeating-linear-gradient(180deg, transparent 0 34px, var(--ink) 34px 40px),
        var(--red);
    opacity: .9;
}

@media (min-width: 48rem) {
    .soon-banner {
        grid-template-columns: 1fr auto;
        padding-inline: var(--space-xl);
    }

    .soon-banner .button {
        position: relative;
        justify-self: end;
    }

    .soon-banner__sun {
        right: 18%;
        top: -110px;
        opacity: .35;
    }
}

/* --------------------------------------------------------------------------
   Why Japanese
   -------------------------------------------------------------------------- */
/* Shop by category (home) */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.category__link {
    display: grid;
    gap: .15rem;
    height: 100%;
    padding: var(--space-s);
    border-radius: var(--radius-l);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(21, 21, 26, .06);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);

    img {
        width: 100%;
        height: auto;
        margin-bottom: .5rem;
        border-radius: var(--radius-s);
    }

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(21, 21, 26, .1);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

.category__name {
    font-size: var(--step-1);
    font-weight: 700;
}

.category__count {
    color: var(--muted);
    font-size: var(--step--1);
}

/* Phones: a compact 2-column grid, so every category is in view at once (no long stack of tall tiles,
   and no swipe row that hides some). An odd last tile spans both columns as a row: picture left, text right. */
@media (max-width: 39.99rem) {
    .categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .category__link {
        padding: .6rem .6rem .75rem;
        border-radius: var(--radius-m);

        img {
            margin-bottom: .35rem;
        }
    }

    .category__name {
        font-size: var(--step-0);
        line-height: 1.25;
    }

    .category:last-child:nth-child(odd) {
        grid-column: 1 / -1;

        .category__link {
            grid-template-columns: 5.5rem 1fr;
            grid-template-rows: auto auto;
            align-content: center;
            column-gap: .9rem;
        }

        img {
            grid-row: 1 / span 2;
            width: 5.5rem;
            margin-bottom: 0;
        }

        .category__name {
            align-self: end;
        }

        .category__count {
            align-self: start;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .category__link:hover {
        transform: none;
    }
}

/* Shop by language: a shop window per card language. A stage with a sun and three product
   photos (white backgrounds blended away with multiply), then text, chips and a button; the
   button's link covers the whole tile, the "New" badge and the chips sit above it. */
.languages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: var(--space-m);
    margin: 0;
    padding: 0;
    list-style: none;
}

.lang-tile {
    position: relative;
    container-type: inline-size;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);

    &:has(.lang-tile__link:focus-visible) {
        box-shadow: var(--focus);
    }
}

/* Sizes on the stage are in cqi (the tile's width), so the sun in the top-left corner and the
   products below it never overlap, whatever the screen: the sun ends at 13cqi from the top,
   the side products start at 16cqi. (They must not overlap: multiply would tint them.) */
.lang-tile__stage {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 46cqi;
    padding-bottom: 4cqi;
    overflow: hidden;
    /* White, like the photos' own backgrounds: they need no blending, so nothing can flash while scrolling
       (a multiply blend did, in Chrome). clip-path keeps the sun inside the rounded corner (Chrome does not
       clip its masked layer with border-radius). */
    background: var(--surface);
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    clip-path: inset(0 round var(--radius-l) var(--radius-l) 0 0);
    isolation: isolate;
}

/* The rising sun (Japanese, red with ink stripes) or an ink ring (English), cut off by the corner. */
.lang-tile__sun {
    position: absolute;
    top: -9cqi;
    left: -6cqi;
    width: 22cqi;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--red);
    -webkit-mask: linear-gradient(#000 0 58%, transparent 58% 63%, #000 63% 71%, transparent 71% 75%, #000 75% 82%, transparent 82% 85%, #000 85%);
    mask: linear-gradient(#000 0 58%, transparent 58% 63%, #000 63% 71%, transparent 71% 75%, #000 75% 82%, transparent 82% 85%, #000 85%);
    z-index: -1;
}

.lang-tile--en .lang-tile__sun {
    background: none;
    border: 2.2cqi solid var(--ink);
    opacity: .85;
    -webkit-mask: none;
    mask: none;
}

/* Big faint 日本 / EN, top right. */
.lang-tile__mark {
    position: absolute;
    top: 1.5cqi;
    right: 3cqi;
    font-family: var(--font-label);
    font-size: 11cqi;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    opacity: .06;
    z-index: -1;
}

.lang-tile--ja .lang-tile__mark {
    font-family: var(--font-jp);
}

.lang-tile__shot {
    --r: 0deg;
    --x: 0;
    width: 26cqi;
    height: auto;
    margin: 0 -1.3cqi;
    transform: translateX(var(--x)) rotate(var(--r));
    transform-origin: 50% 100%;
    transition: transform .45s var(--ease);

    &:nth-of-type(1) { --r: -8deg; --x: 1cqi; }
    &:nth-of-type(2) { width: 30cqi; z-index: 1; }
    &:nth-of-type(3) { --r: 8deg; --x: -1cqi; }
}

.lang-tile__body {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: var(--space-l) var(--space-l) var(--space-m);
}

.lang-tile__new {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .8rem .25rem .3rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: var(--step--1);
    font-weight: 600;
    text-decoration: none;

    span {
        padding: .1rem .55rem;
        border-radius: 999px;
        background: var(--red);
        color: #fff;
        font-family: var(--font-label);
        font-size: .62rem;
        letter-spacing: var(--label-spacing);
        text-indent: var(--label-spacing);
        text-transform: uppercase;
    }

    &:hover {
        color: var(--red-text);
    }
}

.lang-tile__title {
    font-size: var(--step-2);
}

.lang-tile__text {
    max-width: 40ch;
    color: var(--ink-soft);
}

.lang-tile__kinds {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;

    a {
        display: inline-block;
        padding: .3rem .75rem;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
        color: var(--ink);
        font-size: var(--step--1);
        text-decoration: none;
        transition: border-color .2s, color .2s;

        &:hover {
            border-color: var(--red);
            color: var(--red-text);
        }
    }
}

.lang-tile__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1rem;
    /* At the bottom of the tile, so both tiles' buttons line up whatever the text above. */
    margin-top: auto;
    padding-top: .5rem;
}

.lang-tile__link {
    /* No lift on hover: a transform makes the button the containing block of its ::after, so the
       tile-wide link would shrink to the button, lose the hover, grow back… (a flickering pointer). */
    &:hover,
    &:active {
        transform: none;
    }

    &:focus-visible {
        outline: none;
    }

    svg {
        transition: transform .3s var(--ease);
    }

    /* The whole tile is the link. */
    &::after {
        content: "";
        position: absolute;
        inset: 0;
    }
}

.lang-tile__count {
    color: var(--muted);
    font-size: var(--step--1);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .lang-tile:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lift);

        .lang-tile__shot:nth-of-type(1) { --r: -13deg; --x: -1.5cqi; }
        .lang-tile__shot:nth-of-type(2) { transform: translateY(-6%) scale(1.05); }
        .lang-tile__shot:nth-of-type(3) { --r: 13deg; --x: 1.5cqi; }
        .lang-tile__link svg { transform: translateX(4px); }
    }
}

/* Latest sets: up to four set cards sharing the full width; on phones a row to swipe. Never moves by itself. */
.set-rail__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 18rem);
    gap: var(--space-s);
    margin: 0 calc(var(--gutter) * -1);
    padding: .4rem var(--gutter) 1.2rem;
    overflow-x: auto;
    overflow-y: hidden; /* sideways only (see .product-grid--rail) */
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    list-style: none;

    &::-webkit-scrollbar {
        display: none;
    }
}

/* Dots under a swipe row (Latest sets, product rows) on phones: the active one is a red pill. Shown by main.js only when the row scrolls. */
.rail-dots {
    display: flex;
    justify-content: center;
    gap: .2rem;
    margin-top: -.4rem;

    &[hidden] {
        display: none;
    }
}

/* A 28 px tap area around a small dot. */
.rail-dot {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;

    &::before {
        content: "";
        width: .5rem;
        height: .5rem;
        border-radius: 999px;
        background: rgb(var(--ink-rgb) / .22);
        transition: width .25s var(--ease), background-color .25s var(--ease);
    }

    &[aria-current="true"]::before {
        width: 1.3rem;
        background: var(--red);
    }

    &:focus-visible {
        outline: none;
        border-radius: 999px;
        box-shadow: var(--focus);
    }
}

@media (min-width: 48rem) {
    .set-rail__list {
        grid-auto-columns: minmax(0, 1fr);
        gap: var(--space-m);
        margin: 0;
        padding: .4rem 0 .8rem;
        overflow: visible;
    }
}

.set-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    scroll-snap-align: start;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);

    &:has(.set-card__link:focus-visible) {
        box-shadow: var(--focus);
    }
}

.set-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    /* White like the covers' own background: no blending needed (see .lang-tile__stage). */
    background: var(--surface);
    overflow: hidden;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    clip-path: inset(0 round var(--radius-l) var(--radius-l) 0 0);

    /* Positioned inside the 16:9 frame (below the badges), so a logo of any size fits whole and never stretches the card. */
    img {
        position: absolute;
        inset: 2.4rem 1.4rem 1rem;
        width: calc(100% - 2.8rem);
        height: calc(100% - 3.4rem);
        object-fit: contain;
        transition: transform .4s var(--ease);
    }
}

.set-card__lang,
.set-card__new {
    position: absolute;
    top: .8rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    font-family: var(--font-label);
    font-size: .62rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-transform: uppercase;
    color: #fff;
}

.set-card__lang {
    left: .8rem;
    background: var(--ink);
}

.set-card__new {
    right: .8rem;
    background: var(--red);
}

.set-card__body {
    display: grid;
    gap: .35rem;
    align-content: start;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--line);
}

.set-card__code {
    margin: 0;
    color: var(--muted);
    font-size: var(--step--1);
}

.set-card__name {
    font-size: var(--step-1);
    line-height: 1.25;
}

.set-card__link {
    color: var(--ink);
    text-decoration: none;

    &:focus-visible {
        outline: none;
    }

    /* The whole card is the link. */
    &::after {
        content: "";
        position: absolute;
        inset: 0;
    }
}

.set-card__meta {
    margin: 0;
    color: var(--ink-soft);
    font-size: var(--step--1);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .set-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lift);

        .set-card__media img {
            transform: scale(1.04);
        }
    }
}

.why__grid {
    display: grid;
    gap: var(--space-m);
}

.why__item {
    display: grid;
    gap: .5rem;
    align-content: start;
    padding: var(--space-l);
    border-top: 2px solid var(--ink);
    background: rgb(var(--surface-rgb) / .5);
    border-radius: 0 0 var(--radius-m) var(--radius-m);

    h3 {
        font-size: var(--step-1);
    }

    p {
        color: var(--ink-soft);
    }
}

.why__num {
    font-family: var(--font-label);
    font-size: .75rem;
    letter-spacing: .14em;
    color: var(--red-text);
}

@media (min-width: 40rem) {
    .why__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Number, title and text of the cards in a row line up, also when one title takes two lines. */
    .why__item {
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: .5rem;
    }
}

@media (min-width: 70rem) {
    .why__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Packing steps
   -------------------------------------------------------------------------- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--space-m);
    list-style: none;
}

.step {
    display: grid;
    gap: .6rem;
    align-content: start;

    img {
        width: 100%;
        height: auto;
        aspect-ratio: 5 / 3;
        object-fit: cover;
        border-radius: var(--radius-m);
        box-shadow: var(--shadow-soft);
    }

    h3 {
        display: flex;
        align-items: center;
        gap: .6rem;
        margin-top: .4rem;
        font-size: var(--step-1);
    }

    p {
        color: var(--ink-soft);
    }
}

.step__num {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: .85rem;
}

/* --------------------------------------------------------------------------
   Cardmarket block
   -------------------------------------------------------------------------- */
.cm-block {
    display: grid;
    gap: var(--space-m);
    align-items: center;
    padding: var(--space-l);
    border-radius: var(--radius-l);
    background: var(--glass-bg-strong);

    .button {
        justify-self: start;
    }

    p {
        color: var(--ink-soft);
    }
}

.cm-block__title {
    margin-block: .35rem .4rem;
    font-size: var(--step-2);
}

@media (min-width: 52rem) {
    .cm-block {
        grid-template-columns: auto 1fr auto;
        padding: var(--space-l) var(--space-xl);
    }
}

/* --------------------------------------------------------------------------
   Page hero (inner pages)
   -------------------------------------------------------------------------- */
.page-hero {
    padding-block: var(--space-xl) var(--space-l);

    .container {
        display: grid;
        gap: var(--space-xs);
    }
}

/* Contact and other short pages: less air above the title and between the intro and the content. */
.page-hero--compact {
    padding-block: var(--space-s) var(--space-s);
}

.section--tight-bottom {
    padding-bottom: var(--space-l);
}

/* Shop and category pages: tighter, with the hero painting softly on the right
   (images/hero/art/blurred.webp, made by scripts/build-blurred-art.php).
   The whole painting, aligned with the content, fading out on every side
   like on the home page, so it never shows a hard edge. */
.page-hero--art {
    padding-block: var(--space-s) var(--space-s);

    .container {
        position: relative;
        isolation: isolate;
    }

    .breadcrumbs {
        padding-block: 0;
        margin-bottom: var(--space-xs);
    }

    .page-hero__title {
        font-size: var(--step-3);
    }

    /* Text stays left of the painting. The intro is a narrow column; the title may use all the room up to the painting
       (so "Japanese Pokémon Booster Boxes" fits on one line on a wide screen). */
    .page-hero__title,
    .page-hero__intro {
        max-width: min(100%, 38rem);
    }

    @media (min-width: 60rem) {
        .page-hero__title {
            max-width: calc(100% - clamp(16rem, 24vw, 22rem) - var(--space-m));
            text-wrap: balance;
        }
    }

    @media (min-width: 60rem) {
        .container::after {
            content: "";
            position: absolute;
            z-index: -1;
            top: calc(var(--space-s) * -1);
            right: 0;
            width: clamp(16rem, 24vw, 22rem);
            aspect-ratio: 1500 / 1820;
            background: url("../images/hero/art/blurred.webp") center / contain no-repeat;
            opacity: .55;
            /* Oval fade: sun and mountain visible, edges and the lower part dissolve. */
            -webkit-mask-image: radial-gradient(ellipse 48% 40% at 50% 42%, #000 42%, transparent 100%);
            mask-image: radial-gradient(ellipse 48% 40% at 50% 42%, #000 42%, transparent 100%);
            pointer-events: none;
        }
    }
}

/* The painting of an art hero hangs down over the section below it: that section (cards, product grid, form)
   always lies on top of it. */
.page-hero--art + .section {
    position: relative;
    z-index: 1;
}

.page-hero__title {
    font-size: var(--step-4);
}

.page-hero__intro {
    max-width: 50ch;
    font-size: var(--step-1);
    color: var(--ink-soft);
}

.notice {
    margin-bottom: var(--space-l);
    padding: var(--space-s) var(--space-m);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    background: rgb(var(--surface-rgb) / .7);
}

/* --------------------------------------------------------------------------
   Prose (legal pages)
   -------------------------------------------------------------------------- */
.prose {
    display: grid;
    gap: var(--space-m);
    max-width: 65ch;

    /* Legal texts: numbered headings close to their paragraphs. */
    h2 {
        margin-top: var(--space-s);
        margin-bottom: calc(var(--space-m) * -0.5);
        font-size: var(--step-1);
    }
}

.legal__updated {
    color: var(--muted);
    font-size: var(--step--1);
}

.todo {
    padding: var(--space-m);
    border: 2px dashed var(--red);
    border-radius: var(--radius-m);
    background: rgb(var(--surface-rgb) / .8);
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */
.section--contact {
    padding-block: var(--space-l) var(--space-xl);
}

/* Text and email on the left, the form on the right (stacked on a phone). */
.contact {
    display: grid;
    gap: var(--space-l);
    align-items: start;

    @media (min-width: 56rem) {
        grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
        gap: var(--space-xl);
    }
}

.contact__intro {
    display: grid;
    gap: var(--space-xs);
    align-content: start;
}

.contact__mail {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    margin-top: var(--space-s);
    padding: var(--space-s) var(--space-m);
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);

    &:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lift);
    }

    .label {
        display: block;
        margin-bottom: .1rem;
    }
}

.contact__mail-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(225, 38, 28, .1);
    color: var(--red);
}

.contact__email {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Name and email next to each other when there is room. */
.form__row {
    display: grid;
    gap: var(--space-m);

    @media (min-width: 40rem) {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    padding: var(--space-l);
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.form {
    display: grid;
    gap: var(--space-m);

    .button {
        justify-self: start;
    }
}

.field {
    display: grid;
    gap: .35rem;
    align-content: start;

    label {
        font-weight: 600;
    }

    /* Text fields only: checkboxes and radios keep their own size (.check). */
    input:not([type="checkbox"], [type="radio"]),
    textarea {
        width: 100%;
        min-height: 48px;
        padding: .7rem .9rem;
        border: 1px solid rgb(var(--ink-rgb) / .28);
        border-radius: var(--radius-s);
        background: var(--surface);
        color: var(--ink);
        font: inherit;
        transition: border-color .2s var(--ease), box-shadow .2s var(--ease);

        &:focus-visible {
            border-color: var(--ink);
            box-shadow: 0 0 0 3px rgb(var(--ink-rgb) / .18);
            border-radius: var(--radius-s);
        }

        &[aria-invalid="true"] {
            border-color: var(--error);
        }
    }

    textarea {
        resize: vertical;
    }
}

.field__optional {
    font-weight: 400;
    color: var(--muted);
}

.field__error {
    color: var(--error);
    font-size: var(--step--1);
    font-weight: 500;
}

.field--hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: var(--space-m);
    border-radius: var(--radius-m);

    h2 {
        font-size: var(--step-2);
        margin-bottom: .4rem;
    }
}

.alert--success {
    background: var(--surface);
    border-left: 4px solid var(--success);
    box-shadow: var(--shadow-soft);
}

.alert--error {
    background: #FBEAE9;
    color: var(--error);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    background: var(--surface);
    border-top: 1px solid var(--line);

    ul {
        list-style: none;
        display: grid;
        gap: .1rem;
    }

    a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.site-footer__grid {
    display: grid;
    gap: var(--space-l);
    padding-bottom: var(--space-l);
}

.site-footer__col .label {
    margin-bottom: .4rem;
}

.site-footer__tagline {
    max-width: 28ch;
    margin-top: var(--space-s);
    color: var(--ink-soft);
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: var(--space-m);
    border-top: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--muted);
}

.site-footer__kana {
    letter-spacing: .4em;
    color: var(--red-text);
}

@media (min-width: 48rem) {
    .site-footer__grid {
        grid-template-columns: 1.5fr repeat(3, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Motion: reveal on scroll (only when JS runs and motion is allowed)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    /* Only a short slide up, no fade: a see-through white card looks grey for a moment, and the
       blocks should stay white while you scroll. */
    html.js [data-reveal] {
        transform: translateY(18px);
        transition: transform .7s var(--ease);
    }

    html.js [data-reveal].is-visible {
        transform: none;
    }

    /* Hero logo is "drawn" on load:
       red line grows → ストライク appears → "Strike" is written → TCG → swoosh → dot.
       Without motion (or without animation support) the logo is simply shown. */
    .hero-logo {
        --ink-stroke: .35px;
        --logo-start: 0.5s; /* the painting leads; the logo starts drawing while it finishes */

        .lg-line path {
            stroke-dasharray: 1;
            stroke-dashoffset: 1;
            animation: lg-draw .7s var(--ease) calc(var(--logo-start) + .1s) forwards;
        }

        .lg-kana {
            animation: lg-rise .5s var(--ease) both;
            animation-delay: calc(var(--logo-start) + .3s + var(--i) * .1s);
        }

        /* "Strike" and the swoosh: outline is drawn first, then filled with ink. */
        .lg-strike > g > g,
        .lg-swoosh path {
            stroke: var(--ink);
            stroke-width: var(--ink-stroke);
            stroke-dasharray: 1;
            stroke-dashoffset: 1;
            /* Hidden until its own draw starts: a fully offset dash still left specks at the letters' starts
               (light dots on the dark hero). */
            stroke-opacity: 0;
            fill-opacity: 0;
        }

        .lg-strike > g > g {
            animation:
                lg-draw .9s ease-in-out forwards,
                lg-ink .4s ease-out forwards;
            animation-delay:
                calc(var(--logo-start) + .6s + var(--i) * .12s),
                calc(var(--logo-start) + 1.2s + var(--i) * .12s);
        }

        .lg-tcg {
            animation: lg-rise .5s var(--ease) both;
            animation-delay: calc(var(--logo-start) + 2s + var(--i) * .08s);
        }

        /* The swoosh is not outlined: the red dot runs along it from left to right and the ink
           trails behind it (clip reveal and dot move share one duration and a linear pace). */
        .lg-swoosh path {
            stroke: none;
            stroke-dasharray: none;
            stroke-dashoffset: 0;
            fill-opacity: 1;
            animation: lg-swoosh .8s linear calc(var(--logo-start) + 2.1s) both;
        }

        /* The dots (the running red one and its ring) stay completely hidden until their turn: the zero-length
           animation lg-dot-on switches them on exactly when the run starts. */
        .lg-dot {
            visibility: hidden;
            transform-box: fill-box;
            transform-origin: center;
            animation:
                lg-dot-go .8s linear calc(var(--logo-start) + 2.1s) both,
                lg-dot-on .01s linear calc(var(--logo-start) + 2.1s) forwards;
            /* The clip around the dot is only a few pixels wide: it would cut off the glow. */
            clip-path: none;
        }

        /* The red dot glows while it runs and settles into the plain dot at the end. */
        .lg-dot[style*="--i:0"] {
            animation:
                lg-dot-go .8s linear calc(var(--logo-start) + 2.1s) both,
                lg-dot-glow 1.1s ease-out calc(var(--logo-start) + 2.1s) both,
                lg-dot-on .01s linear calc(var(--logo-start) + 2.1s) forwards;
        }
    }

    .hero__tagline,
    .hero__actions {
        animation: hero-in .6s var(--ease) both;
    }

    .hero__tagline {
        animation-delay: 2.6s;
    }

    .hero__actions {
        animation-delay: 2.9s;
    }

    /* The painting plays first (done at ≈ 3 s); the logo starts drawing at 1 s (--logo-start), done at ≈ 4.2 s. */
    .hero__visual {
        --art-start: 0s;
        animation: hero-in .6s var(--ease) var(--art-start) both;
    }

    /* ---- Hero painting intro (≈ 3 s), alongside the logo drawing ------
       (--art-start, set on .hero__visual). Then: 0.3 s eruption → 0.9 s the black cools to grey rock → 1.0 s snow is drawn
       from the summit down → 1.5 s sunrise (fully up before the clouds) →
       1.95 s clouds slide over the sun → 2.1 s cranes fly in → done at 3.0 s. */
    /* The parts below each start and end invisible; the group only shows them. */
    .hero-art__eruption {
        opacity: 1;
    }

    .hero-art__fire {
        animation: ha-fire .9s ease-out calc(var(--art-start) + .25s) both;
    }

    .hero-art__burst {
        animation: ha-burst .55s cubic-bezier(.2, .7, .3, 1) calc(var(--art-start) + .3s + var(--d)) both;
    }

    .hero-art__lava {
        animation: ha-lava .8s cubic-bezier(.45, 0, .6, 1) calc(var(--art-start) + .38s + var(--d)) both;
    }

    .hero-art__smoke {
        animation: ha-smoke 1.3s cubic-bezier(.2, .6, .35, 1) calc(var(--art-start) + .3s + var(--d)) both;
    }

    .hero-art__spark {
        animation: ha-spark .7s cubic-bezier(.2, .7, .4, 1) calc(var(--art-start) + .35s + var(--d) * .5) both;
    }

    .hero-art__volcano {
        animation: ha-cool .3s ease-in-out calc(var(--art-start) + .9s) both;
    }

    .hero-art__snowline {
        animation: ha-snow .6s cubic-bezier(.45, 0, .3, 1) calc(var(--art-start) + 1s) both;
    }

    .hero-art__sun {
        animation: ha-sunrise .5s cubic-bezier(.2, .7, .25, 1) calc(var(--art-start) + 1.5s) both;
    }

    .hero-art__clouds--left {
        animation: ha-clouds-left .5s cubic-bezier(.3, .6, .2, 1) calc(var(--art-start) + 1.95s) both;
    }

    .hero-art__clouds--right {
        animation: ha-clouds-right .5s cubic-bezier(.3, .6, .2, 1) calc(var(--art-start) + 2s) both;
    }

    .hero-art__birds {
        animation: ha-birds .9s cubic-bezier(.25, .6, .3, 1) calc(var(--art-start) + 2.1s) both;
    }

    .hero-overlay__cranes {
        animation: ha-cranes-in .8s cubic-bezier(.25, .6, .3, 1) calc(var(--art-start) + 2.2s) both;
    }

    /* The cards (≈ 2.55 → 4.8 s): a stack rises in the torii gateway, fans open like a hand of cards,
       each card flips to its front, then a holo glint runs over the middle one. */
    .hero-art__cards {
        animation: hc-rise .5s cubic-bezier(.2, .7, .3, 1) calc(var(--art-start) + 2.55s) both;
    }

    .hero-card {
        animation: hc-fan .65s cubic-bezier(.3, 1.35, .5, 1) calc(var(--art-start) + 3s + var(--d)) both;
    }

    .hero-card__flip {
        transform-box: fill-box;
        transform-origin: center;
        animation: hc-flip .42s ease-in-out calc(var(--art-start) + 3.35s + var(--d)) both;
    }

    .hero-card__back {
        animation: hc-back .42s linear calc(var(--art-start) + 3.35s + var(--d)) both;
    }

    .hero-card__front {
        animation: hc-front .42s linear calc(var(--art-start) + 3.35s + var(--d)) both;
    }

    .hero-card__shine {
        animation: hc-shine .9s ease-in-out calc(var(--art-start) + 4s) both;
    }

    .hero__glow {
        animation:
            glow-in .5s ease-out calc(var(--art-start) + 1.55s) both,
            glow-breathe 7s ease-in-out calc(var(--art-start) + 2.1s) infinite alternate;
    }

    .hero-overlay__mist,
    .hero-landscape__mist {
        animation: mist-drift 18s ease-in-out infinite alternate;
    }

    .hero-landscape__mist {
        animation-duration: 24s;
    }

    .crane {
        animation: crane-glide 9s ease-in-out infinite alternate;
        transform-box: fill-box;
    }

    .crane--2 {
        animation-duration: 11s;
        animation-delay: -3s;
    }

    .crane--3 {
        animation-duration: 13s;
        animation-delay: -6s;
    }
}

@keyframes hero-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes lg-draw {
    from {
        stroke-opacity: 1;
    }

    to {
        stroke-dashoffset: 0;
        stroke-opacity: 1;
    }
}

@keyframes lg-ink {
    from {
        stroke-opacity: 1;
    }

    to {
        fill-opacity: 1;
        stroke-opacity: 0;
    }
}

@keyframes lg-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes lg-swoosh {
    from { clip-path: inset(-20% 100% -20% 0); }
    to { clip-path: inset(-20% 0 -20% 0); }
}

/* The dot follows the swoosh's centre line (start at the thin left end) and ends in place. */
/* The pop (grow from nothing, a little overshoot) and the run along the swoosh in ONE animation: as two separate
   ones (opacity/scale and translate) they could start a frame apart, and the dot flashed at its end position first. */
@keyframes lg-dot-go {
    0% { transform: translate(-99.2px, 3.06px) scale(0); opacity: 0; }
    8% { transform: translate(-91.3px, 3.41px) scale(.75); opacity: 1; }
    10% { transform: translate(-89.3px, 3.5px) scale(.84); opacity: 1; }
    16% { transform: translate(-83.4px, 3.69px) scale(1.12); opacity: 1; }
    20% { transform: translate(-79.4px, 3.81px) scale(1.09); opacity: 1; }
    30% { transform: translate(-69.4px, 3.66px) scale(1.01); opacity: 1; }
    40% { transform: translate(-59.5px, 3.31px) scale(1); opacity: 1; }
    50% { transform: translate(-49.6px, 2.82px) scale(1); opacity: 1; }
    60% { transform: translate(-39.7px, 2.23px) scale(1); opacity: 1; }
    70% { transform: translate(-29.8px, 1.58px) scale(1); opacity: 1; }
    80% { transform: translate(-19.8px, .94px) scale(1); opacity: 1; }
    90% { transform: translate(-9.9px, .44px) scale(1); opacity: 1; }
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}
@keyframes lg-dot-on {
    to { visibility: visible; }
}
@keyframes lg-dot-glow {
    0%, 70% { filter: drop-shadow(0 0 1px #FF5A4D) drop-shadow(0 0 2.5px #FF3B30) drop-shadow(0 0 5px rgba(255, 59, 48, .95)) drop-shadow(0 0 10px rgba(255, 59, 48, .6)); }
    100% { filter: drop-shadow(0 0 0 rgba(225, 38, 28, 0)); }
}

@keyframes lg-dot-run {
    0% { translate: -99.2px 3.06px; }
    10% { translate: -89.3px 3.5px; }
    20% { translate: -79.4px 3.81px; }
    30% { translate: -69.4px 3.66px; }
    40% { translate: -59.5px 3.31px; }
    50% { translate: -49.6px 2.82px; }
    60% { translate: -39.7px 2.23px; }
    70% { translate: -29.8px 1.58px; }
    80% { translate: -19.8px .94px; }
    90% { translate: -9.9px .44px; }
    100% { translate: 0 0; }
}

@keyframes lg-pop {
    from {
        opacity: 0;
        transform: scale(0);
    }
}

@keyframes ha-fire {
    0% { opacity: 0; transform: scale(.5); }
    20% { opacity: 1; }
    70% { opacity: .8; }
    100% { opacity: 0; transform: scale(1.3); }
}

/* Lava shooting out of the crater: the brush stroke is drawn, then fades. */
@keyframes ha-burst {
    0% { opacity: 0; stroke-dashoffset: 1; }
    6% { opacity: 1; }
    45% { opacity: 1; stroke-dashoffset: 0; }
    100% { opacity: 0; stroke-dashoffset: 0; }
}

/* Lava running down the flank, fading as the volcano cools. */
@keyframes ha-lava {
    0% { opacity: 0; stroke-dashoffset: 1; }
    5% { opacity: 1; }
    60% { stroke-dashoffset: 0; }
    75% { opacity: 1; }
    100% { opacity: 0; stroke-dashoffset: 0; }
}

/* Ink cloud: appears small at the crater, rises and spreads, thins out. */
@keyframes ha-smoke {
    0% { opacity: 0; transform: translateY(0) scale(.25); }
    12% { opacity: .95; }
    60% { opacity: .8; }
    100% { opacity: 0; transform: translateY(var(--rise)) scale(var(--grow)); }
}

/* Starts invisible: with "both" the first frame already shows during the delay. */
@keyframes ha-spark {
    0% { opacity: 0; transform: translate(0, 0); }
    6% { opacity: 1; }
    55% { opacity: 1; transform: translate(calc(var(--dx) * .6), -230px); }
    100% { opacity: 0; transform: translate(var(--dx), -40px); }
}

@keyframes ha-snow {
    from { transform: translateY(0); } /* snow line above the crater: no snow yet */
}

/* Black volcano: fully visible until it cools down. */
@keyframes ha-cool {
    from { opacity: 1; }
}

/* Starts low enough to be fully hidden, also beside the mountain where the sky reaches y≈810. */
@keyframes ha-sunrise {
    from { transform: translateY(820px); }
}

@keyframes ha-clouds-left {
    from { transform: translateX(-760px); }
}

@keyframes ha-clouds-right {
    from { transform: translateX(760px); }
}

@keyframes ha-birds {
    from { opacity: 0; transform: translate(-700px, 140px); }
    25% { opacity: 1; }
}

/* "translate" (not transform), so the scroll depth on the same group keeps working. */
@keyframes ha-cranes-in {
    from { opacity: 0; translate: -480px 110px; }
    25% { opacity: 1; }
}

@keyframes hc-rise {
    from { opacity: 0; transform: translateY(170px); }
    40% { opacity: 1; }
}

/* From one stack (each card turned back by its own angle) to the fan. */
@keyframes hc-fan {
    from { transform: rotate(calc(var(--angle) * -1)); }
}

@keyframes hc-flip {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

@keyframes hc-back {
    0%, 49.9% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes hc-front {
    0%, 49.9% { opacity: 0; }
    50%, 100% { opacity: 1; }
}

@keyframes hc-shine {
    from { opacity: 0; transform: skewX(-18deg) translateX(0); }
    20% { opacity: .55; }
    to { opacity: 0; transform: skewX(-18deg) translateX(560px); }
}

@keyframes glow-in {
    from { opacity: 0; }
}

@keyframes glow-breathe {
    to {
        opacity: .65;
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@keyframes mist-drift {
    to {
        transform: translateX(28px);
    }
}

/* Cranes float a little; "translate" keeps their own SVG transform intact. */
@keyframes crane-glide {
    to {
        translate: -10px -6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Shop (phase 2)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Small shared controls
   -------------------------------------------------------------------------- */
.link-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--step--1);
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;

    &:hover {
        color: var(--red-text);
    }
}

.field__hint {
    color: var(--muted);
    font-size: var(--step--1);
}

.field select,
.select select {
    width: 100%;
    min-height: 48px;
    padding: .7rem 2.4rem .7rem .9rem;
    border: 1px solid rgb(var(--ink-rgb) / .28);
    border-radius: var(--radius-s);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2315151A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .9rem center,
        var(--surface);
    color: var(--ink);
    font: inherit;
    appearance: none;

    &:focus-visible {
        border-color: var(--ink);
        box-shadow: 0 0 0 3px rgb(var(--ink-rgb) / .18);
        border-radius: var(--radius-s);
    }
}

.check {
    display: inline-flex;
    align-items: flex-start;
    gap: .65rem;
    min-height: 44px;
    padding-block: .6rem;
    cursor: pointer;
    line-height: 1.45;

    input {
        flex: none;
        width: 1.25rem;
        height: 1.25rem;
        /* Centred on the first line of the text, also when it wraps: the line is
           1.45 × the text size (line-height above); the checkbox takes over that
           text size, because form controls otherwise use their own smaller font. */
        font-size: inherit;
        margin: calc((1.45em - 1.25rem) / 2) 0 0;
    }
}

/* Every visible checkbox and radio on the site in the shop's style (the chip, shipping and condition
   pickers hide theirs and style a label instead). A rounded box that fills red with a white check;
   a radio is a ring with a red dot. Keyboard focus shows the focus ring, a wrong field the error red.
   :where() keeps these rules at zero specificity, so a component (e.g. .check, which centres the box on
   the first line of its text) always wins. */
:where(input[type="checkbox"], input[type="radio"]) {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    display: inline-grid;
    place-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    border: 2px solid rgb(var(--ink-rgb) / .35);
    border-radius: 6px;
    background: var(--surface);
    color: #fff;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);

    /* A fixed size: the box is a grid sized to its content, so a percentage would be 0. */
    &::before {
        content: "";
        width: .85rem;
        height: .85rem;
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E") center / contain no-repeat;
        transform: scale(0);
    }

    &:hover:not(:disabled) {
        border-color: var(--ink);
    }

    &:checked {
        border-color: var(--red);
        background: var(--red);

        &::before {
            transform: scale(1);
        }
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }

    &[aria-invalid="true"] {
        border-color: var(--error);
        box-shadow: 0 0 0 3px rgba(169, 27, 19, .15);
    }

    &:disabled {
        cursor: not-allowed;
        opacity: .45;
    }
}

:where(input[type="radio"]) {
    border-radius: 50%;

    &::before {
        width: .55rem;
        height: .55rem;
        border-radius: 50%;
        background: #fff;
        -webkit-mask: none;
        mask: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    /* The check pops in. */
    :where(input[type="checkbox"], input[type="radio"])::before {
        transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
    }
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: var(--space-s);
    padding: var(--space-l);
    border-radius: var(--radius-l);
    background: rgb(var(--surface-rgb) / .6);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .5rem;
    padding-block: var(--space-m);
    font-size: var(--step--1);
    color: var(--muted);

    /* Quiet links: no underline until you point at them. */
    a {
        display: inline-flex;
        align-items: center;
        gap: .4em;
        min-height: 44px;
        text-decoration: none;

        &:hover {
            color: var(--ink);
            text-decoration: underline;
            text-underline-offset: .2em;
        }
    }

    /* The separators are written as "/" in the markup; shown as a small chevron. */
    [aria-hidden="true"] {
        font-size: 0;

        &::before {
            content: "›";
            font-size: 1.1rem;
            line-height: 1;
            opacity: .6;
        }
    }

    /* The set code, small and grey behind the set name. */
    .breadcrumbs__code {
        font-size: .85em;
        opacity: .65;
    }

    /* The page you are on: darker, not a link. */
    [aria-current="page"] {
        color: var(--ink);
        font-weight: 500;
    }

    /* A phone: one line, a way back to the parent ("‹ Inferno X"), not the whole trail. */
    @media (max-width: 40rem) {
        > :not(a:last-of-type) {
            display: none;
        }

        a:last-of-type::before {
            content: "‹";
            font-size: 1.3rem;
            line-height: 1;
        }
    }
}

/* --------------------------------------------------------------------------
   Header: account icon, drawer open state
   -------------------------------------------------------------------------- */
.account-button {
    display: none;
}

/* The same link in the menu, only where the bar has no room for the icon; set apart by a line. */
.main-nav__item--account {
    margin-top: .3rem;
    padding-top: .3rem;
    border-top: 1px solid var(--line);

    .main-nav__link {
        gap: .6rem;
    }
}

@media (min-width: 30rem) {
    .account-button {
        display: inline-grid;
    }

    .main-nav__item--account {
        display: none;
    }
}

html.has-drawer {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Cart drawer
   -------------------------------------------------------------------------- */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;

    &[hidden] {
        display: none;
    }
}

.cart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(var(--ink-rgb) / .28);
    opacity: 0;
    transition: opacity .25s var(--ease);
}

.cart-drawer__panel {
    position: absolute;
    top: .6rem;
    right: .6rem;
    bottom: .6rem;
    display: flex;
    flex-direction: column;
    width: min(100% - 1.2rem, 26rem);
    padding: var(--space-m);
    overflow-y: auto;
    border-radius: var(--radius-l);
    background: var(--glass-bg-panel);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    box-shadow: var(--shadow-lift);
    transform: translateX(calc(100% + 1rem));
    transition: transform .3s var(--ease);

    &:focus-visible {
        outline: none;
        box-shadow: var(--shadow-lift);
    }
}

.cart-drawer.is-open {
    .cart-drawer__backdrop {
        opacity: 1;
    }

    .cart-drawer__panel {
        transform: none;
    }
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-s);
}

.cart-drawer__title {
    font-size: var(--step-2);
}

/* --------------------------------------------------------------------------
   Cart (drawer + page)
   -------------------------------------------------------------------------- */
.cart {
    display: grid;
    gap: var(--space-m);
}

.cart__empty {
    display: grid;
    justify-items: start;
    gap: var(--space-s);
    color: var(--ink-soft);
}

.cart__lines {
    display: grid;
    gap: var(--space-s);
    list-style: none;
    transition: opacity .2s;

    &.is-busy {
        opacity: .6;
    }
}

.cart-line {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: .4rem .9rem;
    padding-bottom: var(--space-s);
    border-bottom: 1px solid var(--line);
}

.cart-line__media {
    grid-row: span 2;

    img {
        width: 64px;
        height: 64px;
        border-radius: var(--radius-s);
        object-fit: cover;
        background: var(--surface-soft);
    }
}

.cart-line__info {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.cart-line__name {
    font-weight: 600;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

.cart-line__meta,
.cart-line__unit {
    color: var(--muted);
    font-size: var(--step--1);
}

.cart-line__qty {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    justify-self: start;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
}

.qty-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;

    &:hover:not(:disabled) {
        background: var(--surface-soft);
    }

    &:disabled {
        color: rgb(var(--ink-rgb) / .3);
        cursor: not-allowed;
    }
}

.qty-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.cart-line__total {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-weight: 600;
}

.cart--page .cart-line {
    grid-template-columns: 88px 1fr auto auto;
    align-items: center;

    .cart-line__media {
        grid-row: auto;

        img {
            width: 88px;
            height: 88px;
        }
    }

    .cart-line__qty {
        justify-self: center;
    }

    .cart-line__total {
        grid-column: auto;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
    }
}

@media (max-width: 36rem) {
    .cart--page .cart-line {
        grid-template-columns: 64px 1fr;

        .cart-line__media {
            grid-row: span 2;

            img {
                width: 64px;
                height: 64px;
            }
        }

        .cart-line__qty {
            justify-self: start;
        }

        .cart-line__total {
            grid-column: 1 / -1;
            flex-direction: row;
        }
    }
}

.cart__summary {
    display: grid;
    gap: .5rem;
}

.cart__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cart__row--total {
    font-size: var(--step-1);
}

.cart__note {
    color: var(--muted);
    font-size: var(--step--1);
}

.cart__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);

    .button {
        flex: 1 1 10rem;
    }
}

/* --------------------------------------------------------------------------
   Shop filters
   -------------------------------------------------------------------------- */
.filters {
    display: grid;
    gap: var(--space-m);
    margin-bottom: .6rem;
    padding: .6rem;
    border-radius: var(--radius-l);
    background: rgb(var(--surface-rgb) / .6);
}

/* One compact bar: search, drop-downs, in-stock chip. Narrower screens: a grid of equal cells with the search on its
   own row (a wrapping flex row stretched a lone last item, e.g. the sort menu, across the whole width). Desktop: ONE
   line, the drop-downs share the room and shorten their text with an ellipsis. */
.filters__bar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    align-items: center;
    gap: .5rem;
    /* A grid item of .filters: without this it stays as wide as its content and runs out of the box. */
    min-width: 0;
}

.filters__search {
    position: relative;
    display: flex;
    align-items: center;
    grid-column: 1 / -1;

    svg {
        position: absolute;
        left: .9rem;
        color: var(--muted);
        pointer-events: none;
    }

    input {
        width: 100%;
        min-height: 48px;
        padding: .7rem .9rem .7rem 2.5rem;
        border: 1px solid rgb(var(--ink-rgb) / .28);
        border-radius: var(--radius-pill);
        background: var(--surface);
        color: var(--ink);
        font: inherit;

        &:focus-visible {
            border-color: var(--ink);
            outline: none;
            box-shadow: 0 0 0 3px rgb(var(--ink-rgb) / .18);
            border-radius: var(--radius-pill);
        }
    }
}

.filters__field {
    min-width: 0;

    select {
        border-radius: var(--radius-pill);
    }

    select:focus-visible {
        border-radius: var(--radius-pill);
    }
}

/* Custom dropdown (main.js: createCustomSelect). The native select stays hidden in it. */
.cselect {
    position: relative;
}

.cselect__native {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.cselect__button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: .7rem 2.4rem .7rem 1rem;
    border: 1px solid rgb(var(--ink-rgb) / .28);
    border-radius: var(--radius-pill);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2315151A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 1rem center,
        var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;

    &:hover {
        border-color: var(--ink);
    }

    &:focus-visible {
        border-color: var(--ink);
        outline: none;
        box-shadow: 0 0 0 3px rgb(var(--ink-rgb) / .18);
        border-radius: var(--radius-pill);
    }

    .cselect.is-open & {
        border-color: var(--ink);
    }

    /* A filter is active: dark pill, like the selected chips. */
    .cselect.is-set & {
        border-color: var(--ink);
        background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 1rem center,
            var(--ink);
        color: #fff;
    }
}

/* In a form (e.g. the checkout country): same shape as the other input fields. */
.cselect--form .cselect__button {
    border-radius: var(--radius-s);

    &:focus-visible {
        border-radius: var(--radius-s);
    }

    &[aria-invalid="true"] {
        border-color: var(--error);
    }
}

.cselect__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cselect__panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + .4rem);
    left: 0;
    width: max(100%, 22rem);
    max-width: calc(100vw - 2 * var(--gutter));
    padding: .5rem;
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);

    &[hidden] {
        display: none;
    }

    /* Not enough room below the field (main.js): opens upward, the search field at the bottom next to the
       button and the results above it, so what you type and what it finds stay on screen. */
    &.is-up {
        top: auto;
        bottom: calc(100% + .4rem);
        display: flex;
        flex-direction: column-reverse;

        &[hidden] {
            display: none;
        }

        .cselect__search {
            margin: .4rem 0 0;
        }
    }
}

.cselect__search {
    width: 100%;
    min-height: 44px;
    margin-bottom: .4rem;
    padding: .6rem .9rem;
    border: 1px solid rgb(var(--ink-rgb) / .2);
    border-radius: var(--radius-pill);
    background: var(--surface-soft);
    font: inherit;

    &:focus,
    &:focus-visible {
        border-color: var(--ink);
        outline: none;
        box-shadow: none;
        border-radius: var(--radius-pill);
    }
}

.cselect__list {
    /* main.js sets the real cap: the room on screen (a short list shows whole, without scrolling). */
    max-height: 80vh;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;

    &:focus,
    &:focus-visible {
        outline: none;
        box-shadow: none;
    }
}

.cselect__group {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .55rem .6rem .3rem;
    background: var(--surface);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cselect__option {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 42px;
    padding: .45rem .6rem .45rem 1.9rem;
    border-radius: var(--radius-s);
    cursor: pointer;
    position: relative;

    &.is-active {
        background: rgb(var(--ink-rgb) / .07);
    }

    /* Check mark on the chosen option. */
    &[aria-selected="true"]::before {
        content: "";
        position: absolute;
        left: .7rem;
        width: .45rem;
        height: .8rem;
        border: solid var(--red);
        border-width: 0 2px 2px 0;
        transform: translateY(-2px) rotate(45deg);
    }

    &[aria-selected="true"] {
        font-weight: 600;
    }
}

.cselect__code {
    flex: none;
    min-width: 3.4rem;
    font-weight: 700;
}

/* Rarity symbols of English cards (public/images/rarity/, scripts/rarity-symbols/build.py): in the filter list, on its
   button and in the product facts. */
.rarity-symbol {
    display: inline-block;
    width: auto;
    height: 1.2em;
    vertical-align: -.25em;
}

/* Rarity symbols of English cards (public/images/rarity/, scripts/rarity-symbols/build.py), in the list and on the button. */
.cselect__symbol {
    display: inline-block;
    width: auto;
    height: 1.15em;
    vertical-align: -.2em;
}

.cselect__code .cselect__symbol {
    display: block;
    height: 1.3em;
}

.cselect__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cselect__meta {
    flex: none;
    color: var(--muted);
    font-size: var(--step--1);
}

.cselect__tag,
.cselect__count {
    flex: none;
    min-width: 1.6rem;
    padding: .05rem .45rem;
    border-radius: var(--radius-pill);
    background: rgb(var(--ink-rgb) / .08);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}

.cselect__tag {
    background: var(--ink);
    color: #fff;
}

.cselect__empty {
    padding: .6rem;
    color: var(--muted);
    text-align: center;
}

.filters__stock {
    flex: none;
    justify-self: start;

    span {
        min-height: 48px;
        white-space: nowrap;
    }
}

@media (min-width: 70rem) {
    .filters__bar {
        display: flex;
        flex-wrap: nowrap;
    }

    .filters__search {
        flex: 1.15 1 0;
        min-width: 9rem;
    }

    .filters__field {
        flex: 1 1 0;
        min-width: 6.5rem;

        /* A bit tighter, so more of each label fits. */
        .cselect__button {
            padding-inline: .85rem 1.9rem;
            background-position: right .75rem center;
        }
    }
}

.filters__group {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.filters__group--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s) var(--space-m);

    .select {
        min-width: 13rem;
    }
}

/* With JS the form submits on change, so the button is not needed. */
.filters.is-auto .filters__submit {
    display: none;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    position: relative;
    cursor: pointer;

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    span {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: .5rem 1.1rem;
        border: 1px solid rgb(var(--ink-rgb) / .2);
        border-radius: var(--radius-pill);
        background: var(--surface);
        font-weight: 500;
        transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
    }

    input:checked + span {
        background: var(--ink);
        border-color: var(--ink);
        color: #fff;
    }

    input:focus-visible + span {
        box-shadow: var(--focus);
    }

    &:hover span {
        border-color: var(--ink);
    }
}

.filters__count {
    margin: 0;
    color: var(--muted);
    font-size: var(--step--1);
}

.filters__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1rem;
    /* Close to the filter bar above and the products below: one line, not a section of its own. */
    margin-bottom: .75rem;
    padding-inline: .6rem;
}

/* Small label above a select or the search field */
.select,
.search-field {
    display: grid;
    gap: .35rem;
}

.select__label {
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 600;
}

.search-field {
    flex: 1 1 18rem;
}

.search-field__row {
    display: flex;
    gap: .5rem;

    input {
        flex: 1;
        min-width: 0;
        min-height: 48px;
        padding: .7rem .9rem;
        border: 1px solid rgb(var(--ink-rgb) / .28);
        border-radius: var(--radius-s);
        background: var(--surface);
        color: var(--ink);
        font: inherit;

        &:focus-visible {
            border-color: var(--ink);
            outline: none;
            box-shadow: 0 0 0 3px rgb(var(--ink-rgb) / .18);
        }
    }

    .button {
        min-height: 48px;
    }
}

/* Results area of the shop: dims briefly while the instant search loads. */
.shop-results {
    transition: opacity .15s var(--ease);

    &.is-loading {
        opacity: .55;
    }
}

/* Card language switch and category tabs above the filters */
.shop-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s);
    margin-bottom: var(--space-s);

    .shop-tabs {
        margin-bottom: 0;
    }
}

.lang-tabs {
    display: inline-flex;
    padding: .3rem;
    border-radius: var(--radius-pill);
    background: var(--ink);
}

.lang-tabs__tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem 1.1rem;
    border-radius: var(--radius-pill);
    color: #fff;
    font-weight: 600;
    text-decoration: none;

    &[aria-current="page"] {
        background: var(--red);
    }

    &:hover:not([aria-current]) {
        background: rgba(255, 255, 255, .12);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

/* Text at the bottom of a shop page (edited in the admin) */
.shop-about__inner {
    max-width: 46rem;

    p {
        color: var(--muted);
        margin-top: var(--space-s);
    }
}

.shop-about__title {
    font-size: var(--step-2);
}

.page-hero .breadcrumbs {
    margin-bottom: var(--space-s);
}

/* Set page hero: title, Japanese name and a short line on the left, the set logo on the right (replaces the painting). */
.page-hero--set .container::after {
    display: none;
}

.set-hero {
    display: grid;
    gap: var(--space-m);
    align-items: center;

    @media (min-width: 50rem) {
        grid-template-columns: minmax(0, 1fr) minmax(12rem, 20rem);
        gap: var(--space-xl);
    }
}

.set-hero__jp {
    margin: 0 0 var(--space-xs);
    font-size: var(--step-1);
    color: var(--muted);
}

.set-hero__logo {
    justify-self: center;
    width: 100%;
    max-width: 24rem;
    height: auto;
    max-height: 9rem;
    object-fit: contain;
    /* The logo files have a white background: multiply lets the page show through. */
    mix-blend-mode: multiply;
}

.set-hero .page-hero__intro {
    max-width: 52ch;
    font-size: var(--step-0);
}

/* The facts as one quiet row under the intro: small label above, value below, thin dividers. */
.set-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) 0;
    margin: var(--space-s) 0 0;

    > div {
        padding-inline: var(--space-m);
        border-left: 1px solid var(--line);

        &:first-child {
            padding-left: 0;
            border-left: 0;
        }
    }

    dt {
        margin-bottom: .15rem;
        /* Same label style as the product facts. */
        font-family: var(--font-label);
        font-size: .75rem;
        letter-spacing: var(--label-spacing);
        text-transform: uppercase;
        text-rendering: geometricPrecision;
        color: var(--ink-soft);
    }

    dd {
        margin: 0;
        font-weight: 600;
    }

    small {
        margin-left: .4em;
        font-weight: 400;
        color: var(--muted);
    }
}

/* Set page: headings above the product groups, facts next to each other, links to sibling sets. */
.set-section__title {
    margin: var(--space-l) 0 var(--space-s);
    font-size: var(--step-2);
}

.section--flush-top > .container > .set-section__title:first-child {
    margin-top: var(--space-s);
}

.section--flush-top .specs {
    margin-bottom: var(--space-m);
    max-width: 36rem;
}

.set-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-m);
    margin: 0;
    padding: 0;
    list-style: none;

    a {
        text-decoration: underline;
        text-underline-offset: .2em;
    }
}

/* Category tabs above the filters; scroll sideways on small screens. */
.shop-tabs {
    display: flex;
    gap: .25rem;
    margin-bottom: var(--space-s);
    padding: .3rem;
    overflow-x: auto;
    border-radius: var(--radius-pill);
    background: rgb(var(--surface-rgb) / .6);
    scrollbar-width: none;
    width: fit-content;
    max-width: 100%;
}

/* A sideways scroller with more to see fades out on that side (main.js initScrollFades sets the classes):
   the cut-off tab plus the fade say "swipe". Both sides when it is in the middle. */
[data-scroll-fade] {
    --fade: 2.75rem;

    &.can-scroll-right {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent);
    }

    &.can-scroll-left {
        -webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent);
        mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent);
    }

    &.can-scroll-left.can-scroll-right {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
        mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
    }
}

.shop-tabs__tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem 1.1rem;
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s var(--ease), color .2s var(--ease);

    &:hover {
        background: var(--surface);
    }

    &[aria-current="page"] {
        background: var(--ink);
        color: #fff;
    }

    &:focus-visible {
        box-shadow: var(--focus);
        outline: none;
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    margin-top: var(--space-l);
}

.pagination__link {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    padding-inline: .6rem;
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;

    &.is-current {
        background: var(--ink);
        color: #fff;
    }

    &.is-disabled {
        opacity: .35;
    }
}

/* The whole tile opens the product page: the title link is stretched over it. The cart button sits above. */
.product-card {
    position: relative;
}

.product-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.product-card__cart {
    display: contents;
}

.product-card__add {
    position: relative;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 .4rem 1rem rgba(225, 38, 28, .3);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);

    &:hover {
        transform: scale(1.08);
        box-shadow: 0 .5rem 1.2rem rgba(225, 38, 28, .4);
    }
}

/* Product card title is a link now */
.product-card__title a {
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

.product-card__media {
    display: block;
}

/* A single's square photo (the card centred at full height, white at the sides) cut to the card itself: 63:88
   is 71.6 % of the width, and a real card's 3 mm corners. Singles keep their white background on the server
   (App\Shop\PhotoCutout), so this is what keeps them from being a white square in dark mode: language tiles,
   cart, search suggestions, orders. (Product tiles use .product-card__media--card, the product page the holo card.) */
img.card-photo {
    clip-path: inset(0 14.2% round 3.4%);
    background: none;
}

/* --------------------------------------------------------------------------
   Product page
   -------------------------------------------------------------------------- */
.product {
    display: grid;
    gap: var(--space-l);
    padding-bottom: var(--space-2xl);
}

.product__photo-note {
    margin: var(--space-xs) 0 0;
    text-align: center;
    color: var(--muted);
    font-size: var(--step--1);
}

.product__thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* centred under the photo */
    gap: var(--space-xs);
    margin: var(--space-s) 0 0;
    padding: 0;
    list-style: none;
}

.product__thumb {
    display: block;
    padding: 0;
    width: 4.5rem;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    overflow: hidden;

    &[aria-current="true"] {
        border-color: var(--red);
    }

    &:focus-visible {
        outline: 2px solid var(--red);
        outline-offset: 2px;
    }

    /* .product__media img (below) would give the thumbnail its own radius and shadow: the button's
       rounded corners do the clipping, the picture just fills it. */
    .product__media & img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: contain;
        border-radius: 0;
        box-shadow: none;
        background: var(--surface);
    }
}

/* The big photo must fit on the screen together with its thumbnails: never taller than the
   viewport minus the header and the thumbnail row, and at most 38rem (a square, so the width follows). */
.product__media [data-gallery-main] {
    width: min(100%, 38rem, calc(100svh - var(--header-h, 5rem) - 10.5rem));
    margin-inline: auto;
    display: block;
    /* White space inside the frame, so the photo does not touch the edges. */
    padding: 5%;
    box-sizing: border-box;
    object-fit: contain;
    background: var(--surface);
}

.product__media img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    /* No ghost copy of the photo when the mouse drags over it (draggable="false" in the HTML; this for older WebKit). */
    -webkit-user-drag: none;
    user-select: none;
}

/* --------------------------------------------------------------------------
   Product page of a single: the card (its own photo, card-shaped) tilts towards the pointer and its foil
   catches the light. initHoloCards sets --px/--py (pointer, 0–100), --tx/--ty (-1…1 from the centre) and
   --hover (0–1, eased). Without JS or with reduced motion the card simply lies still, without shine.
   The kind of foil follows the rarity (App\Shop\CardShine): gloss, holo, textured, gold.
   -------------------------------------------------------------------------- */
.holo-stage {
    width: min(100%, 38rem, calc(100svh - var(--header-h, 5rem) - 10.5rem));
    aspect-ratio: 1;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    perspective: 1100px;
    /* A sideways drag tilts the card on touch screens; scrolling up and down keeps working. */
    touch-action: pan-y;
}

.holo-card {
    --px: 50;
    --py: 50;
    --tx: 0;
    --ty: 0;
    --hover: 0;
    --glitter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='1' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .92 0 0 0 0 .92 0 0 0 0 .9 0 0 0 13 -8.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");

    position: relative;
    height: 90%;
    aspect-ratio: 63 / 88;
    /* A real card's corners: 3 mm on 63 × 88 mm. */
    border-radius: 4.8% / 3.4%;
    overflow: hidden;
    isolation: isolate;
    background: #e9e9ee;
    transform: rotateY(calc(var(--tx) * 13deg)) rotateX(calc(var(--ty) * -13deg)) scale(calc(1 + var(--hover) * .035));
    /* The shadow falls away from the light and grows as the card lifts. */
    box-shadow:
        calc(var(--tx) * -14px) calc(8px + var(--ty) * -10px + var(--hover) * 10px) calc(16px + var(--hover) * 26px) rgb(18 22 40 / calc(.2 + var(--hover) * .12)),
        0 1px 2px rgb(18 22 40 / .18);
    will-change: transform;

    .product__media & img {
        display: block;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        padding: 0;
        object-fit: cover;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    > span {
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0;
    }
}

/* Light on the gloss: a soft spot under the pointer and a faint streak across the card. Every card has it. */
.holo-card__glare {
    background:
        radial-gradient(farthest-corner circle at calc(var(--px) * 1%) calc(var(--py) * 1%),
            rgb(255 255 255 / .8) 0%, rgb(255 255 255 / .28) 20%, rgb(0 0 0 / .3) 90%),
        linear-gradient(115deg, transparent 38%, rgb(255 255 255 / .35) 50%, transparent 62%)
            calc(var(--px) * 1%) calc(var(--py) * 1%) / 300% 300% no-repeat;
    mix-blend-mode: overlay;

    .holo-card > & {
        opacity: calc(var(--hover) * .85);
    }
}

/* Foil and glitter. Each pattern below fills these two layers; --light is the spot where the light falls (strongest
   there, fading away) and data-area cuts it to the artwork window or everything around it. The window of the current
   card layout is about 8–93 % wide and 10–48 % high (mask positions are a share of the free space: left 8.3 % of
   15.4 % free, top 9.8 % of 62 % free). Moving layers are bigger than the card and stay within 0–100 %, so no tile
   edge ever shows (an angled gradient doesn't line up with its next tile: that was a split in the rainbow). */
.holo-card__foil,
.holo-card__glitter {
    --light: radial-gradient(farthest-corner circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 10%, rgb(0 0 0 / .35) 75%);

    mask-image: var(--light);
    mask-repeat: no-repeat;
}

/* Glitter: tiny specks that only light up near the light and drift slightly against the turn. Screen, not
   colour-dodge: on the GPU colour-dodge turned near-white specks into black dots (a division by almost zero). */
.holo-card__glitter {
    --light: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 0%, transparent 42%);

    background: var(--glitter) calc(var(--px) * -.5px) calc(var(--py) * -.5px) / 180px 180px;
    mix-blend-mode: screen;
}

/* Only the artwork window (a classic holo). */
.holo-card[data-area="art"] > :is(.holo-card__foil, .holo-card__glitter) {
    mask-image: var(--light), linear-gradient(#000 0 0);
    mask-size: 100% 100%, 84.6% 38%;
    mask-position: 0 0, 53.9% 15.8%;
    mask-composite: intersect, add;
}

/* Everything except the artwork window, which stays matte (reverse holo, the ball patterns): the whole card minus
   the window (exclude), then within the light (intersect). */
.holo-card[data-area="around"] > :is(.holo-card__foil, .holo-card__glitter) {
    mask-image: var(--light), linear-gradient(#000 0 0), linear-gradient(#000 0 0);
    mask-size: 100% 100%, 84.6% 38%, 100% 100%;
    mask-position: 0 0, 53.9% 15.8%, 0 0;
    mask-composite: intersect, exclude, add;
}

/* Where the photo shows a speckled foil print (the printed Poké Ball / Master Ball pattern), outside the artwork:
   --foil-mask is App\Shop\FoilMask's PNG (opaque where the print is). Layers top to bottom: the light, the print
   mask, the artwork window: print minus window (subtract), then within the light (intersect). */
.holo-card[data-area="printed"] > :is(.holo-card__foil, .holo-card__glitter) {
    mask-image: var(--light), var(--foil-mask), linear-gradient(#000 0 0);
    mask-size: 100% 100%, 100% 100%, 84.6% 38%;
    mask-position: 0 0, 0 0, 53.9% 15.8%;
    mask-composite: intersect, subtract, add;
}

/* The patterns (App\Shop\CardShine, config striketcg.catalog.holo_patterns). Shape patterns are white shapes on black
   (public/images/holo/*.svg, drawn by scripts/holo-patterns/build.py) multiplied with the moving rainbow and laid on
   with colour-dodge: only the shapes catch colour, the black between them changes nothing. */
.holo-card {
    --rainbow: repeating-linear-gradient(115deg,
        hsl(355 85% 58%) 0%, hsl(40 95% 58%) 4%, hsl(95 75% 55%) 8%, hsl(175 85% 58%) 12%,
        hsl(220 90% 64%) 16%, hsl(280 80% 62%) 20%, hsl(355 85% 58%) 24%);
    --rainbow-at: calc(var(--px) * 1%) calc(var(--py) * 1%) / 400% 400% no-repeat;
}

/* Sheen: rainbow bands with a fine line pattern in them (holo rares, ex, reverse holo). */
.holo-card[data-shine="sheen"] > .holo-card__foil {
    background:
        repeating-linear-gradient(55deg, rgb(255 255 255 / 0) 0 5px, rgb(255 255 255 / .16) 5px 6px),
        var(--rainbow) var(--rainbow-at);
    background-blend-mode: overlay;
    mix-blend-mode: color-dodge;
    filter: brightness(.42) contrast(1.6) saturate(1.3);
    opacity: calc(var(--hover) * .7);
}

/* Art rares and full arts: an etched texture (fine crossing lines) that catches a narrow rainbow sheen, plus glitter.
   The bands are dark between the colours, so colour-dodge only lights up a stripe of colour where the light falls
   instead of tinting the whole artwork (a plain overlay rainbow looked like a coloured filter on dark cards). */
.holo-card[data-shine="textured"] {
    > .holo-card__foil {
        --light: radial-gradient(farthest-corner circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 5%, rgb(0 0 0 / .15) 55%, transparent 80%);

        background:
            repeating-linear-gradient(32deg, rgb(255 255 255 / 0) 0 3px, rgb(255 255 255 / .2) 3px 4px),
            repeating-linear-gradient(-32deg, rgb(255 255 255 / 0) 0 3px, rgb(255 255 255 / .2) 3px 4px),
            repeating-linear-gradient(115deg,
                #000 0%, hsl(350 80% 42%) 3%, hsl(35 85% 42%) 5%, #000 8%, hsl(150 70% 36%) 11%, hsl(195 85% 42%) 13%,
                #000 16%, hsl(255 70% 46%) 19%, hsl(310 70% 42%) 21%, #000 24%)
                calc(var(--px) * 1%) calc(var(--py) * 1%) / 200% 200% no-repeat;
        background-blend-mode: multiply, multiply, normal;
        mix-blend-mode: color-dodge;
        opacity: calc(var(--hover) * .5);
    }

    > .holo-card__glitter {
        opacity: calc(var(--hover) * .85);
    }
}

/* Gold cards: warm gold bands instead of a rainbow, and more glitter. */
.holo-card[data-shine="gold"] {
    > .holo-card__foil {
        background:
            repeating-linear-gradient(55deg, rgb(255 255 255 / 0) 0 5px, rgb(255 255 255 / .14) 5px 6px),
            repeating-linear-gradient(120deg,
                hsl(46 95% 62%) 0%, hsl(36 80% 32%) 5%, hsl(52 100% 78%) 10%, hsl(40 85% 38%) 15%, hsl(46 95% 62%) 20%)
                calc(var(--px) * 1%) calc(var(--py) * 1%) / 400% 400% no-repeat;
        background-blend-mode: overlay;
        mix-blend-mode: overlay;
        opacity: calc(var(--hover) * .75);
    }

    > .holo-card__glitter {
        opacity: var(--hover);
    }
}

/* Sparkle: dense glitter over a soft rainbow (shiny cards). */
.holo-card[data-shine="sparkle"] {
    > .holo-card__foil {
        background: var(--rainbow) var(--rainbow-at);
        mix-blend-mode: color-dodge;
        filter: brightness(.38) saturate(1.2);
        opacity: calc(var(--hover) * .5);
    }

    > .holo-card__glitter {
        --light: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 0%, transparent 60%);

        background-size: 110px 110px;
        opacity: var(--hover);
    }
}

/* Shape patterns: the shapes drift a little against the turn, the rainbow slides over them. */
.holo-card:is([data-shine="cosmos"], [data-shine="cracked-ice"], [data-shine="crosshatch"], [data-shine="sunburst"],
    [data-shine="poke-ball"], [data-shine="master-ball"]) > .holo-card__foil {
    --shapes: none;
    --shapes-size: 300px 300px;

    background:
        var(--shapes) calc(var(--px) * -.3px) calc(var(--py) * -.3px) / var(--shapes-size),
        var(--rainbow) var(--rainbow-at);
    background-blend-mode: multiply, normal;
    mix-blend-mode: color-dodge;
    filter: brightness(.95) saturate(1.3);
    opacity: var(--hover);
}

/* Cosmos: scattered dots and a few spirals. */
.holo-card[data-shine="cosmos"] > .holo-card__foil {
    --shapes: url("/images/holo/cosmos.svg");
}

/* Cracked ice: shards that each catch the light differently. */
.holo-card[data-shine="cracked-ice"] > .holo-card__foil {
    --shapes: url("/images/holo/cracked-ice.svg");
    --shapes-size: 320px 320px;

    filter: brightness(.8) saturate(1.3);
}

/* Crosshatch: a diamond grid. */
.holo-card[data-shine="crosshatch"] > .holo-card__foil {
    --shapes: url("/images/holo/crosshatch.svg");
    --shapes-size: 60px 60px;
}

/* Sunburst: rays from a point on the left. */
.holo-card[data-shine="sunburst"] > .holo-card__foil {
    background:
        repeating-conic-gradient(from calc(var(--py) * .3deg) at -5% 50%, #000 0deg 1.4deg, hsl(0 0% 92%) 2deg, #000 2.6deg),
        var(--rainbow) var(--rainbow-at);
}

/* Poké Ball / Master Ball pattern versions whose photo is the normal card's (around the artwork; the tile is a share of the
   card's width, so the balls are about as big as the printed ones at any size); the Master Ball in violet and pink. With their own photo the balls are printed in it: sheen only. */
.holo-card[data-shine="poke-ball"] > .holo-card__foil {
    --shapes: url("/images/holo/poke-ball.svg");
    --shapes-size: 36% auto;
}

.holo-card[data-shine="master-ball"] > .holo-card__foil {
    --shapes: url("/images/holo/master-ball.svg");
    --shapes-size: 36% auto;
    --rainbow: repeating-linear-gradient(115deg, hsl(285 70% 55%) 0%, hsl(320 75% 62%) 8%, hsl(250 65% 60%) 16%, hsl(285 70% 55%) 24%);
}

/* Mirror: a smooth chrome reflection that sweeps across, hardly any colour. */
.holo-card[data-shine="mirror"] > .holo-card__foil {
    background: linear-gradient(115deg, #000 25%, hsl(200 25% 70%) 44%, hsl(0 0% 88%) 50%, hsl(35 30% 70%) 56%, #000 75%)
        calc(var(--px) * 1%) calc(var(--py) * 1%) / 250% 250% no-repeat;
    mix-blend-mode: color-dodge;
    filter: brightness(.6);
    opacity: calc(var(--hover) * .8);
}

.product__info {
    display: grid;
    align-content: start;
    gap: var(--space-xs);

    /* Compact: everything (price, stock notice, description, facts) should be on screen at once. */
    .notice {
        margin-bottom: 0;
    }

    .specs {
        margin-top: var(--space-2xs, .25rem);

        div {
            padding-block: .4rem;
        }
    }
}

.product__title {
    font-size: var(--step-3);
}

.product__jp {
    margin-top: -.4rem;
    font-size: var(--step-1);
    color: var(--ink-soft);
}

.product__price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s);
    margin-top: var(--space-xs);

    .badge {
        border-color: var(--line);
    }
}

.product__price {
    font-size: var(--step-3);
    font-weight: 700;
}

.product__vat {
    margin-top: -.5rem;
    color: var(--muted);
    font-size: var(--step--1);
}

.product__description {
    color: var(--ink-soft);
}

/* Condition choice for singles: one tile per condition with its price and stock. */
.conditions {
    margin: 0 0 var(--space-s);
    padding: 0;
    border: 0;

    legend {
        margin-bottom: .5rem;
    }
}

.conditions__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: .5rem;
}

.condition {
    position: relative;
    cursor: pointer;

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    &:has(input:disabled) {
        cursor: not-allowed;
    }
}

.condition__box {
    display: grid;
    gap: .1rem;
    height: 100%;
    padding: .7rem .9rem;
    border: 1px solid rgb(var(--ink-rgb) / .2);
    border-radius: var(--radius-s);
    background: var(--surface);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);

    input:checked + & {
        border-color: var(--ink);
        box-shadow: inset 0 0 0 1px var(--ink);
    }

    input:focus-visible + & {
        box-shadow: var(--focus);
    }

    input:disabled + & {
        opacity: .5;
    }

    .condition:hover input:not(:disabled) + & {
        border-color: var(--ink);
    }
}

.condition__name {
    font-weight: 700;

    abbr {
        text-decoration: none;
    }
}

.condition__label,
.condition__stock {
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 400;
}

.condition__price {
    font-weight: 600;
}

.add-to-cart {
    container-type: inline-size;
    display: grid;
    gap: .5rem;
    padding: var(--space-m);
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.add-to-cart__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-s);
}

.field--qty {
    width: auto;
}

/* Quantity: a pill with − and + around the number (the cart uses the same look). */
.qty {
    display: inline-flex;
    align-items: center;
    height: 3.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;

    /* Typing or clicking in the field: a quiet darker edge, no red line and no second outline inside the pill. */
    &:focus-within {
        border-color: var(--ink-soft);
    }

    /* [type] so it outranks ".field input:not([type=…])", which drew a boxed field inside the pill. */
    input[type="number"] {
        width: 3rem;
        min-width: 0;
        height: 100%;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        text-align: center;
        font-size: 1.05rem;
        font-weight: 600;
        -moz-appearance: textfield;
        appearance: textfield;

        &::-webkit-outer-spin-button,
        &::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        &:focus,
        &:focus-visible {
            outline: none;
            box-shadow: none;
        }
    }
}

.qty__step {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-inline: .25rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease;

    &:hover:not(:disabled) {
        background: var(--surface-soft);
    }

    &:active:not(:disabled) {
        background: rgba(225, 38, 28, .1);
    }

    &:disabled {
        color: rgb(var(--ink-rgb) / .28);
        cursor: not-allowed;
    }
}

/* Without JavaScript the buttons do nothing: the number field alone does the job. */
html:not(.js) .qty__step {
    display: none;
}

.add-to-cart__button {
    flex: 1 1 12rem;
}

/* Narrow (phones): quantity and button each take the full width, so their edges line up; side by side the
   longer button texts (pt, de, fr) don't fit and the button wrapped under a half-width quantity pill. */
@container (max-width: 26rem) {
    .add-to-cart__row {
        flex-direction: column;
        align-items: stretch;
    }

    .add-to-cart__button {
        flex: none;
    }

    .add-to-cart .qty {
        display: flex;

        input[type="number"] {
            flex: 1;
        }
    }
}

.add-to-cart__added {
    color: var(--success);
    font-weight: 600;
}

.specs {
    display: grid;
    /* The label column is as wide as the longest label (all rows share it), so no label wraps; on a narrow screen it
       may wrap after all (max 45% of the width). */
    grid-template-columns: fit-content(45%) 1fr;
    column-gap: var(--space-s);
    margin: var(--space-s) 0 0;
    border-top: 1px solid var(--line);

    div {
        display: grid;
        grid-template-columns: subgrid;
        grid-column: 1 / -1;
        /* Both start at the top; the label gets the same line height as the value (below), so its capitals sit in the
           middle of that line, level with the value's text (a shared baseline put the small capitals too low). */
        align-items: start;
        gap: var(--space-s);
        padding-block: .7rem;
        border-bottom: 1px solid var(--line);
    }

    dt {
        font-family: var(--font-label);
        font-size: .75rem;
        letter-spacing: var(--label-spacing);
        text-transform: uppercase;
        text-rendering: geometricPrecision;
        color: var(--ink-soft);
        line-height: calc(1.6 * var(--step-0));
        white-space: nowrap;

        @media (max-width: 30rem) {
            white-space: normal;
        }
    }

    dd {
        margin: 0;
    }
}

@media (min-width: 56rem) {
    .product {
        /* Photo and info column share the width; the photo itself is capped below. */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-xl);
    }

    .product__media {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
        align-self: start;
    }
}

/* --------------------------------------------------------------------------
   Checkout
   -------------------------------------------------------------------------- */
.checkout {
    display: grid;
    /* minmax(0, …): a plain column grows to its widest unbreakable content and made the checkout wider than a phone. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-l);
    align-items: start;
}

.form__section {
    display: grid;
    gap: var(--space-s);
    /* A fieldset is at least as wide as its content by default (min-inline-size: min-content). */
    min-inline-size: 0;
    margin: 0;
    padding: 0 0 var(--space-m);
    border: 0;
    border-bottom: 1px solid var(--line);
}

.form__legend {
    margin-bottom: var(--space-xs);
    padding: 0;
    font-family: var(--font-label);
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.form__row {
    display: grid;
    gap: var(--space-s);
    /* A field with an error message under it must not stretch its neighbour's input. */
    align-items: start;
}

@media (min-width: 36rem) {
    .form__row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Shipping choice at checkout: method name with its price for the chosen country. */
.ship-methods {
    display: grid;
    gap: .5rem;
}

.ship-method {
    position: relative;
    cursor: pointer;

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    > span {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 52px;
        padding: .6rem 1rem;
        border: 1px solid rgb(var(--ink-rgb) / .2);
        border-radius: var(--radius-m);
        background: var(--surface);
        transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
    }

    input:checked + span {
        border-color: var(--ink);
        box-shadow: inset 0 0 0 1px var(--ink);
    }

    input:focus-visible + span {
        box-shadow: var(--focus);
    }
}

.ship-method__name {
    font-weight: 600;
}

.ship-method__price {
    font-weight: 700;
    white-space: nowrap;
}

.ship-single {
    font-weight: 600;
}

/* Checkout: saved addresses (initAddressPicker). The fields under it hide while a saved one is chosen. */
.address-picker {
    display: grid;
    gap: .5rem;

    &[hidden] {
        display: none;
    }
}

.address-fields {
    display: grid;
    gap: var(--space-s);

    &[hidden] {
        display: none;
    }
}

.address-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem 1rem;
    border: 1px solid rgb(var(--ink-rgb) / .2);
    border-radius: var(--radius-m);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);

    input {
        flex: none;
        margin-top: .15rem;
    }

    &:has(input:checked) {
        border-color: var(--ink);
        box-shadow: inset 0 0 0 1px var(--ink);
    }

    &:hover {
        border-color: rgb(var(--ink-rgb) / .45);
    }
}

.address-option__body {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.address-option__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    font-weight: 600;
}

.address-option__badge {
    padding: .2rem .5rem;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-label);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-transform: uppercase;
}

.address-option__lines {
    color: var(--muted);
    font-size: var(--step--1);
}

.address-option--new .address-option__name {
    color: var(--red-text);
}

.address-picker__manage {
    justify-self: start;
    color: var(--muted);
    font-size: var(--step--1);

    &:hover {
        color: var(--ink);
    }
}

/* The Stripe Payment Element (public/js/checkout.js) */
.pay-element {
    min-height: 8rem;
}

.pay-element__loading {
    margin: 0;
    color: var(--muted);
}

.checkout__form.is-busy {
    opacity: .85;
}

.checkout__ship-to {
    margin: 0;
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--ink-soft);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-top: var(--space-m);
}

.checkout__pay {
    justify-self: stretch;
    min-height: 56px;
    font-size: var(--step-1);
}

.checkout__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;

    /* The discount block has the lines above and below itself: the totals need no line of their own here. */
    .summary-totals {
        padding-top: 0;
        border-top: 0;
    }
}

.coupon {
    display: grid;
    gap: .4rem;
    padding-block: 1rem;
    border-block: 1px solid var(--line);
}

.coupon__row {
    display: flex;
    gap: .5rem;

    input {
        flex: 1;
        /* width 0: an input is ~20 characters wide by default, which with the button made the order summary
           wider than a phone (min-width alone doesn't change how wide the row asks to be). */
        width: 0;
        min-width: 0;
        min-height: 44px;
        padding: .5rem .8rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-pill);
        background: var(--surface);
        font: inherit;

        /* The code is typed in capitals, the placeholder stays normal. */
        &:not(:placeholder-shown) {
            text-transform: uppercase;
        }

        /* A soft red ring instead of the black outline when selected. */
        &:focus,
        &:focus-visible {
            outline: 0;
            border-color: var(--red);
            box-shadow: 0 0 0 3px rgba(225, 38, 28, .16);
        }
    }
}

.coupon__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: 0;
    color: var(--success);
}

.coupon__remove {
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: var(--step--1);
    text-decoration: underline;
    cursor: pointer;
}

.checkout__summary-title {
    font-size: var(--step-1);
}

.summary-lines {
    display: grid;
    gap: .6rem;
    list-style: none;

    li {
        display: flex;
        justify-content: space-between;
        gap: var(--space-s);
    }
}

.summary-lines__code {
    color: var(--muted);
    font-size: var(--step--1);
}

.summary-totals {
    display: grid;
    gap: .4rem;
    margin: 0;
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);

    div {
        display: flex;
        justify-content: space-between;
        gap: var(--space-s);
    }

    dd {
        margin: 0;
    }
}

/* A small line under a label in the totals, e.g. "incl. €2.50 insurance" under Shipping. */
.summary-totals__note {
    display: block;
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 400;

    &[hidden] {
        display: none;
    }
}

.summary-totals__total {
    padding-top: .4rem;
    font-size: var(--step-1);
    font-weight: 700;
}

@media (min-width: 60rem) {
    .checkout {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    }

    .checkout__summary {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
    }
}

/* Pending payment */
.loader {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-m);
    border: 3px solid rgb(var(--ink-rgb) / .12);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------------------------
   Order details / account / auth
   -------------------------------------------------------------------------- */
/* The confirmation hero gets room above and below, so the whole painting shows before the cards start. */
.page-hero--art.page-hero--order {
    padding-block: var(--space-l) calc(var(--space-m) + .5rem);

    /* Only the painting moves up; the text keeps its place. */
    @media (min-width: 60rem) {
        .container::after {
            top: calc((var(--space-l) + var(--space-m)) * -1);
        }
    }
}

.order-logo {
    margin-top: var(--space-m);

    .hero-logo {
        /* In the logo the swoosh draws 2.6 s after the start: here it starts at once. */
        --logo-start: -1.6s;
        width: min(100%, clamp(16rem, 10rem + 22vw, 30rem));
        height: auto;
        margin-left: 0;
    }
}

.order-label__short {
    display: none;
}

.order-headline {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    /* The same distance between title and check on every screen. */
    gap: var(--space-s) 1.375rem;

    /* The title keeps its width next to the painting; the check sits right behind the text. */
    .page-hero__title {
        max-width: none;
    }
}

.order-done {
    position: relative;
    flex: none;
    width: 3.75rem;
    height: 3.75rem;

    svg {
        display: block;
        width: 100%;
        height: 100%;
        overflow: visible;
    }

    /* A soft green disc with a ring that draws itself, then the tick. */
    .order-done__circle {
        fill: rgba(30, 107, 58, .14);
        stroke: var(--success);
        stroke-width: 2.5;
        stroke-dasharray: 151;
        stroke-dashoffset: 0;
    }

    .order-done__tick {
        fill: none;
        stroke: var(--success);
        stroke-width: 4.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 40;
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .order-done {
        animation: order-done-pop .5s var(--ease) 1.05s both;

        /* One ripple ring that fades out when the tick is done. */
        &::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid var(--success);
            opacity: 0;
            animation: order-done-ring 1s ease-out 1.05s;
        }

        .order-done__circle {
            animation: order-done-draw .7s ease-out both;
        }

        .order-done__tick {
            animation: order-done-tick .45s ease-out .6s both;
        }
    }

    @keyframes order-done-draw {
        from { stroke-dashoffset: 151; fill-opacity: 0; }
        to { stroke-dashoffset: 0; fill-opacity: 1; }
    }

    @keyframes order-done-tick {
        from { stroke-dashoffset: 40; }
        to { stroke-dashoffset: 0; }
    }

    @keyframes order-done-pop {
        0% { transform: scale(1); }
        50% { transform: scale(1.14); }
        100% { transform: scale(1); }
    }

    @keyframes order-done-ring {
        0% { opacity: .7; transform: scale(1); }
        100% { opacity: 0; transform: scale(1.7); }
    }
}

.order-done--failed {
    /* The ripple ring of the animation is red here too (it is green by default). */
    &::after {
        border-color: var(--red);
    }

    .order-done__circle {
        fill: rgba(225, 38, 28, .1);
        stroke: var(--red);
    }

    .order-done__tick {
        stroke: var(--red);
    }
}

/* A phone: title and check on one line, so both get smaller with the screen. */
@media (max-width: 40rem) {
    /* Only the numeric date on a phone ("20-11-2026"), so the label stays on one line. */
    .order-label__long {
        display: none;
    }

    .order-label__short {
        display: inline;
    }

    /* The label font is wide: a smaller, less spaced label that never wraps. */
    .order-label {
        font-size: clamp(.5rem, 3vw, .72rem);
        letter-spacing: .05em;
        white-space: nowrap;
    }

    .order-headline {
        .page-hero__title {
            flex: 0 1 auto;
            min-width: 0;
            font-size: clamp(.85rem, 4.6vw, 1.9rem);
            text-wrap: balance;
        }
    }

    .order-done {
        width: clamp(2rem, 9vw, 3rem);
        height: clamp(2rem, 9vw, 3rem);
    }
}

/* Confetti on the confirmation page (public/js/main.js, initConfetti): a canvas over the page. */
.confetti {
    position: fixed;
    inset: 0;
    z-index: 90; /* over the page, but never in the way of clicks */
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* The order: the items and totals on the left, address and help on the right (stacked on a narrow screen). */
.order-details {
    display: grid;
    gap: var(--space-m);
    align-items: start;

    /* A media query: a container query cannot style the container itself. */
    @media (min-width: 56rem) {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    }
}

.order-details__main {
    display: grid;
    gap: var(--space-s);
}

.order-items {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-item {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    gap: var(--space-s);
    align-items: center;
    padding-block: var(--space-s);
    border-bottom: 1px solid var(--line);

    &:first-child {
        padding-top: 0;
    }

    /* The totals have their own line above them: no second one under the last item. */
    &:last-child {
        padding-bottom: var(--space-s);
        border-bottom: 0;
    }

    p {
        margin: 0;
    }
}

.order-item__image {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-m);
    background: var(--surface);
    object-fit: contain;
}

.order-item__name {
    font-weight: 600;
}

.order-item__meta,
.order-item__qty {
    color: var(--muted);
    font-size: var(--step--1);
}

.order-item__total {
    font-weight: 700;
    white-space: nowrap;
}

.summary-totals__discount dd {
    color: var(--success);
}

.order-details__back {
    margin: 0;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--line);
    text-align: center;

    /* The card has its own padding: the link needs no extra height under it. */
    .link-arrow {
        min-height: 0;
        padding-block: .25rem;
    }
}

.order-details__main {
    padding-bottom: var(--space-s);
}

.order-details__side {
    display: grid;
    gap: var(--space-s);
}

.order-details__address,
.order-details__help,
.order-details__invoice,
.order-details__shipment {
    display: grid;
    gap: .4rem;

    address {
        font-style: normal;
    }

    p {
        margin: 0;
    }
}

.order-details__help .link-arrow {
    min-height: 0;
    padding-block: .15rem 0;
}

/* Shipped: carrier, date, code and a button to the carrier's track & trace page. */
.order-details__shipment {
    border-left: 4px solid var(--red);
}

.order-details__tracking {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .5rem;

    span {
        color: var(--muted);
        font-size: var(--step--1);
    }

    code {
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: .04em;
        word-break: break-all;
    }
}

.order-details__parcels {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        display: grid;
        gap: .15rem;
        padding-top: .5rem;
        border-top: 1px solid var(--line);
    }

    .link-arrow {
        justify-self: start;
        min-height: 0;
    }
}

.order-details__track {
    justify-self: start;
    margin-top: .3rem;
}

/* Cancel request: a quiet fold-out, so nobody cancels by accident. */
.order-details__cancel {
    display: grid;
    gap: .4rem;

    summary {
        cursor: pointer;
        color: var(--muted);
        font-weight: 600;
    }

    summary:hover {
        color: var(--ink);
    }

    p {
        margin: 0;
    }
}

.order-details__cancel--requested {
    border-left: 4px solid #E8840C;
}

.order-details__cancel-form {
    display: grid;
    gap: var(--space-s);
    margin-top: var(--space-s);

    textarea {
        width: 100%;
    }

    .button {
        justify-self: start;
    }
}

.order-details__credit {
    justify-self: start;
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 600;

    &:hover {
        color: var(--ink);
    }
}

.order-details__invoice-button {
    justify-self: start;
    gap: .5rem;
    margin-top: .3rem;
}

.order-details__method {
    color: var(--muted);
    font-size: var(--step--1);
}

/* --------------------------------------------------------------------------
   My account: a header with the customer, tabs (Orders / Security), then the tab's cards.
   -------------------------------------------------------------------------- */
.account-shell {
    display: grid;
    gap: var(--space-m);
    width: min(100% - 2 * var(--gutter), 46rem);
}

.account-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .4rem var(--space-m);
}

/* Initials on the red sun. */
.account-head__avatar {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #FF5A4C, var(--red) 55%, #B9170F);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 6px 18px rgba(225, 38, 28, .25);
}

.account-head__name {
    font-size: var(--step-3);
    line-height: 1.1;
}

.account-head__email {
    color: var(--muted);
    font-size: var(--step--1);
    overflow-wrap: anywhere;
}

.account-head__logout {
    align-self: start;
}

.account-tabs {
    margin-bottom: 0;
}

/* Phones: the header in one row (smaller avatar and name, compact log-out button top right), the tabs as two
   equal halves across the full width, and full-width buttons like the fields above them. */
@media (max-width: 39.99rem) {
    .account-head {
        gap: .2rem .8rem;
    }

    .account-head__avatar {
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.1rem;
    }

    .account-head__name {
        font-size: var(--step-2);
    }

    .account-head__logout .button {
        min-height: 36px;
        padding: .35rem .8rem;
        font-size: var(--step--1);
    }

    .account-tabs {
        width: 100%;

        .shop-tabs__tab {
            flex: 1 1 0;
            justify-content: center;
        }
    }

    .account-security .form .button,
    .account-empty .button {
        justify-self: stretch;
    }
}

.account-tabs__count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    margin-left: .45rem;
    padding-inline: .4rem;
    border-radius: 999px;
    background: rgb(var(--ink-rgb) / .08);
    font-size: .78rem;
    font-weight: 700;

    [aria-current] > & {
        background: rgba(255, 255, 255, .22);
    }
}

/* An order: reference, date and number of items, status pill; pictures; total and link. */
.account-order {
    display: grid;
    gap: var(--space-s);
}

.account-order__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem var(--space-m);
}

.account-order__ref {
    font-size: var(--step-1);
}

.account-order__meta {
    color: var(--muted);
    font-size: var(--step--1);
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: var(--step--1);
    font-weight: 700;
    white-space: nowrap;

    &::before {
        content: "";
        width: .5rem;
        height: .5rem;
        border-radius: 50%;
        background: currentColor;
    }
}

.order-status--paid { background: #E7F4EC; color: var(--success); }
.order-status--shipped { background: #E6EEF9; color: #1F4E8C; }
.order-status--pending { background: #FFF1E0; color: var(--amber-text); }
.order-status--cancelled { background: #FBEAE9; color: var(--error); }

.account-order__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;

    img,
    .account-order__more {
        width: 4rem;
        height: 4rem;
        border-radius: var(--radius-s);
        background: var(--surface-soft);
        object-fit: contain;
    }

    .account-order__more {
        display: grid;
        place-items: center;
        color: var(--muted);
        font-weight: 700;
    }
}

.account-order__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem var(--space-m);
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
}

.account-order__total {
    font-size: var(--step-1);
    font-weight: 800;
}

.account-order__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem var(--space-m);
}

.account-order__invoice {
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 600;

    &:hover {
        color: var(--ink);
    }
}

.account-empty {
    display: grid;
    justify-items: center;
    gap: .6rem;
    text-align: center;

    img {
        width: 7.5rem;
        height: auto;
        border-radius: var(--radius-m);
    }

    h2 {
        font-size: var(--step-2);
    }

    p {
        max-width: 34ch;
        color: var(--ink-soft);
    }
}

/* Addresses tab: a card per address (the default one with a red badge and border), then add / edit form. */
.account-addresses {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;

    @media (min-width: 40rem) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.account-address {
    position: relative;
    display: grid;
    align-content: space-between;
    gap: var(--space-s);

    &.is-default {
        box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--red);
    }

    address {
        font-style: normal;
        line-height: 1.55;
    }
}

.account-address__badge {
    justify-self: start;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-label);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: var(--label-spacing);
    text-indent: var(--label-spacing);
    text-transform: uppercase;
}

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

.account-address__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem var(--space-m);
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
    font-size: var(--step--1);

    a,
    .link-button,
    summary {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        color: var(--ink-soft);
        font-weight: 600;
        cursor: pointer;
    }
}

.account-address__delete {
    summary {
        list-style: none;
        color: var(--error);

        &::-webkit-details-marker {
            display: none;
        }
    }

    &[open] summary {
        display: none;
    }
}

.account-addresses__add {
    justify-self: start;
}

.account-addresses__note {
    color: var(--muted);
    font-size: var(--step--1);
}

.account-address-form {
    h2 {
        font-size: var(--step-2);
    }
}

.account-address-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.account-security {
    display: grid;
    gap: var(--space-s);

    h2 {
        font-size: var(--step-2);
    }
}

.account-security__intro {
    color: var(--ink-soft);
}

.account-security__forgot {
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--step--1);
}


/* --------------------------------------------------------------------------
   Very large screens: a wider page so content doesn't float in the middle.
   -------------------------------------------------------------------------- */
@media (min-width: 110rem) {
    :root {
        --container: 1400px;
    }
}

@media (min-width: 140rem) {
    :root {
        --container: 1680px;
    }
}

/* --------------------------------------------------------------------------
   Page builder blocks (resources/views/blocks)
   -------------------------------------------------------------------------- */
/* Text with picture */
.feature {
    display: grid;
    gap: var(--space-l);
    align-items: center;
}

.feature__text {
    display: grid;
    gap: var(--space-s);
    justify-items: start;
}

.feature__body {
    color: var(--ink-soft);
}

.feature__media img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-l);
}

@media (min-width: 48rem) {
    .feature:not(.feature--text-only) {
        grid-template-columns: 1fr 1fr;
    }

    .feature--left .feature__media {
        order: -1;
    }
}

/* Questions and answers */
.faq {
    display: grid;
    gap: .5rem;
    max-width: 52rem;
}

.faq .section__header {
    margin-bottom: var(--space-s);
}

.faq__item {
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(21, 21, 26, .06);

    summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 56px;
        padding: .8rem 1.2rem;
        font-weight: 600;
        cursor: pointer;
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: "";
            flex: none;
            width: .55rem;
            height: .55rem;
            border: solid currentColor;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
            transition: transform .2s var(--ease);
        }
    }

    &[open] summary::after {
        transform: rotate(-135deg);
    }

    p {
        padding: 0 1.2rem 1.1rem;
        color: var(--ink-soft);
    }
}

/* Pictures */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;

    img {
        width: 100%;
        height: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        border-radius: var(--radius-m);
    }
}

/* The checkout button in the quick cart wiggles now and then to invite a click (not with reduced motion). */
@media (prefers-reduced-motion: no-preference) {
    /* Starts 250 ms after the drawer opens (the drawer gets .is-open), then repeats. */
    .cart-drawer.is-open .button--wiggle {
        animation: button-wiggle 3.5s ease-in-out .25s infinite;

        &:hover,
        &:focus-visible {
            animation: none;
        }
    }

    /* The wiggle plus a red glow around the edges that fades in and out with it. */
    @keyframes button-wiggle {
        0%, 20%, 100% { transform: none; box-shadow: 0 6px 18px rgba(225, 38, 28, .28), 0 0 0 rgba(225, 38, 28, 0); }
        2% { transform: rotate(-3deg) scale(1.04); }
        4% { transform: rotate(3deg) scale(1.04); }
        6% { transform: rotate(-2.5deg) scale(1.04); }
        8% { transform: rotate(2.5deg) scale(1.04); }
        10% { transform: rotate(-1deg); box-shadow: 0 6px 18px rgba(225, 38, 28, .28), 0 0 2rem rgba(225, 38, 28, .6); }
        12% { transform: rotate(1deg); }
        14% { transform: none; }
    }
}

/* --------------------------------------------------------------------------
   Account pages (log in, create an account, forgot / check your inbox / choose a new
   password): one centred card with a big icon on the red sun (auth/_icon); the reset
   pages also get a 1-2-3 progress bar above it.
   -------------------------------------------------------------------------- */
/* Close under the header: the card is the whole page, it should not start halfway down. */
.auth-page {
    padding-block: var(--space-l) var(--space-xl);
}

.auth-shell {
    display: grid;
    gap: var(--space-m);
    width: min(100% - 2 * var(--gutter), 32rem);
}

.reset-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.reset-progress__step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .35rem;
    color: var(--muted);
    font-size: var(--step--1);

    /* The line to the next step, from dot to dot. */
    &:not(:last-child)::after {
        content: "";
        position: absolute;
        top: .9rem;
        left: calc(50% + 1.2rem);
        right: calc(-50% + 1.2rem);
        height: 2px;
        border-radius: 2px;
        background: rgb(var(--ink-rgb) / .15);
    }

    &.is-done::after {
        background: var(--success);
    }

    &.is-current {
        color: var(--ink);
        font-weight: 600;
    }
}

.reset-progress__dot {
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid rgb(var(--ink-rgb) / .2);
    border-radius: 50%;
    background: var(--surface);
    font-size: .8rem;
    font-weight: 700;

    svg {
        display: block;
    }

    .is-current & {
        border-color: var(--red);
        background: var(--red);
        color: #fff;
        box-shadow: 0 0 0 5px rgba(225, 38, 28, .15);
    }

    .is-done & {
        border-color: var(--success);
        background: var(--success);
        color: #fff;
    }
}

.auth-card {
    display: grid;
    justify-items: center;
    gap: var(--space-s);
    padding: var(--space-l) var(--space-l) var(--space-m);
    text-align: center;
}

.auth-card__title {
    margin-top: .2rem;
    font-size: var(--step-3);
    line-height: 1.1;
}

.auth-card__lead {
    max-width: 30ch;
    color: var(--ink-soft);
}

/* The form inside the card stays left-aligned and full width. */
.auth-card__form {
    justify-self: stretch;
    margin-top: var(--space-xs);
    text-align: left;

    .button {
        justify-self: stretch;
    }
}

.reset__email {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    max-width: 100%;
    padding: .55rem 1rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-weight: 700;

    svg {
        flex: none;
        color: var(--red);
    }

    span {
        overflow-wrap: anywhere;
    }
}

.reset__actions {
    display: grid;
    gap: .6rem;
    justify-self: stretch;
    margin-top: var(--space-xs);

    form,
    .button {
        display: grid;
    }
}

.reset__note {
    max-width: 38ch;
    color: var(--muted);
    font-size: var(--step--1);
}

.auth-card__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    justify-self: stretch;
    gap: .25rem var(--space-m);
    margin-top: var(--space-xs);
    padding-top: var(--space-s);
    border-top: 1px solid var(--line);
    /* The links are 44 px tall (tap target) with the text in the middle: pull the row down by that extra
       half, so the space under the text equals the space above it. */
    margin-bottom: calc((44px - 1lh) / -2);

    a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: var(--ink-soft);
    }
}

/* Big icon on the red sun with ink stripes (auth/_auth-icon). */
.auth-icon svg {
    display: block;
    width: 6rem;
    height: 6rem;
    overflow: visible;
}

.auth-icon__sun {
    fill: var(--red);
}

.auth-icon__stripes {
    stroke: var(--surface);
}

@media (prefers-reduced-motion: no-preference) {
    /* The letter slides into the envelope once. */
    .auth-icon__letter {
        animation: reset-letter 1.1s var(--ease) .25s both;
    }

    @keyframes reset-letter {
        from { transform: translateY(-16px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}

/* Password field with a show/hide button inside it. */
.field__control {
    position: relative;

    input {
        padding-right: 3.2rem;
    }
}

.field__toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);

    &:hover {
        color: var(--ink);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }

    .field__eye-off {
        display: none;
    }

    &[aria-pressed="true"] {
        .field__eye {
            display: none;
        }

        .field__eye-off {
            display: block;
        }
    }
}

/* Live checks under the password fields: grey circle, green check when met. */
.password-rules {
    display: grid;
    gap: .35rem;
    margin: -.4rem 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
    color: var(--muted);

    li {
        display: flex;
        align-items: center;
        gap: .55rem;

        &::before {
            content: "";
            flex: none;
            width: 1.05rem;
            height: 1.05rem;
            border: 2px solid rgb(var(--ink-rgb) / .25);
            border-radius: 50%;
            transition: background-color .2s, border-color .2s;
        }

        &.is-met {
            color: var(--success);

            &::before {
                border-color: var(--success);
                background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat;
            }
        }
    }
}

/* Small phones (iPhone SE: 375 × 667) and other low screens: the account card gets compact, so the form
   is in view without scrolling first: a smaller icon, a one-size-smaller title, less padding
   and a smaller progress bar. */
@media (max-width: 30rem), (max-height: 44rem) {
    .auth-page {
        padding-top: var(--space-s);
    }

    .auth-shell {
        gap: var(--space-s);
    }

    .reset-progress__label {
        font-size: .72rem;
    }

    .reset-progress__dot {
        width: 1.5rem;
        height: 1.5rem;
        font-size: .72rem;
    }

    .reset-progress__step:not(:last-child)::after {
        top: .75rem;
    }

    .auth-card {
        gap: .6rem;
        padding: var(--space-m) var(--space-m) var(--space-s);
    }

    .auth-icon svg {
        width: 3.75rem;
        height: 3.75rem;
    }

    .auth-card__title {
        margin-top: 0;
        font-size: var(--step-2);
    }

    .auth-card__lead {
        font-size: var(--step--1);
    }

    .auth-card__form {
        gap: var(--space-s);
        margin-top: 0;
    }
}

/* --------------------------------------------------------------------------
   Homepage scroll hint: three arrows at the bottom centre while there is more
   page below (main.js initScrollHint); fades out at the footer.
   -------------------------------------------------------------------------- */
.scroll-hint {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3.4rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(var(--surface-rgb) / .92);
    color: var(--red);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    translate: -50% 0;
    transition: opacity .35s var(--ease), translate .35s var(--ease);

    &[hidden] {
        display: none;
    }

    &.is-gone {
        opacity: 0;
        translate: -50% 1rem;
        pointer-events: none;
    }

    &:hover {
        color: var(--red-hover);
    }

    &:focus-visible {
        outline: none;
        box-shadow: var(--focus);
    }
}

/* Without motion: three steady arrows, the lower ones fainter. */
.scroll-hint__arrow:nth-child(1) { opacity: 1; }
.scroll-hint__arrow:nth-child(2) { opacity: .6; }
.scroll-hint__arrow:nth-child(3) { opacity: .3; }

@media (prefers-reduced-motion: no-preference) {
    /* The arrows light up one after the other, top to bottom, like a cascade. */
    .scroll-hint__arrow {
        animation: scroll-hint 1.6s ease-in-out infinite;
    }

    .scroll-hint__arrow:nth-child(2) { animation-delay: .2s; }
    .scroll-hint__arrow:nth-child(3) { animation-delay: .4s; }

    @keyframes scroll-hint {
        0%, 100% { opacity: .2; transform: translateY(-2px); }
        40% { opacity: 1; transform: translateY(1px); }
    }
}

/* ==========================================================================
   Dark mode: follows the phone or computer setting (prefers-color-scheme). The layout's
   <meta name="color-scheme" content="light dark"> tells browsers the site has its own dark look,
   so Samsung Internet and Chrome don't force theirs (that greyed the logo and dimmed the photos).
   Mostly the tokens above flipped; below them the few places with their own colours.
   Product photos lose their white background in main.js (initCutouts); singles are card-shaped.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #ECECF0;
        --ink-soft: #C9C9D1;
        --muted: #A6A6B1;
        --amber-text: #F5A04A;
        --red-text: #FF6E64;
        --red-hover: #F0392E;
        --bg-from: #1B1B21;
        --bg-to: #111115;
        --surface: #1D1D23;
        --surface-soft: #25252C;
        --surface-muted: #2A2A32;
        --line: rgba(255, 255, 255, .1);
        --success: #5CC98A;
        --error: #FF6E64;
        --on-ink: #15151A;
        --ink-rgb: 236 236 240;
        --surface-rgb: 29 29 35;

        --glass-bg: rgba(29, 29, 35, .6);
        --glass-bg-strong: rgba(29, 29, 35, .78);
        --glass-bg-fallback: rgba(29, 29, 35, .96);
        --glass-bg-panel: rgba(29, 29, 35, .94);
        --glass-border: 1px solid rgba(255, 255, 255, .08);

        --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
        --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
    }

    /* Ink-filled pills and buttons turn light, so their white text turns dark. */
    .skip-link,
    .button--ink,
    .mega__lang:hover,
    .mega__lang--tag,
    .lang-tag,
    .set-card__lang,
    .cselect.is-set .cselect__button,
    .cselect__tag,
    .chip input:checked + span,
    .shop-tabs__tab[aria-current="page"],
    .pagination__link.is-current {
        color: var(--on-ink);
    }

    .button--ink:hover {
        background: #FFFFFF;
    }

    /* Dark bars and banners stay dark, a step above the page. */
    .announcement--dark,
    .soon-banner,
    .lang-tabs {
        background: #2B2B33;
    }

    /* Logo: "Strike" and ストライク in light ink, TCG and the red line, dot and sun unchanged. */
    .hero-logo :is(.lg-strike, .lg-kana) [fill],
    .hero-logo .lg-swoosh path {
        fill: #F2F2F4;
    }

    /* The ink painting at night: inverted (white sky → dark, black ink → light), the hue turned back so the
       sun stays red. The waves and the seigaiha strip below it go along. */
    .hero__art,
    .hero-waves {
        filter: invert(1) hue-rotate(180deg);
    }

    /* The blurred painting beside the title of shop, checkout and set pages (desktop), at night too. */
    .page-hero--art .container::after {
        filter: invert(1) hue-rotate(180deg);
    }

    /* Multiply would turn the set logo black on a dark page; main.js cuts its white background out instead. */
    .set-hero__logo {
        mix-blend-mode: normal;
    }

    /* The sun inverted twice = its own red again. */
    .hero-art__sun {
        filter: invert(1) hue-rotate(180deg);
    }

    :root {
        --seigaiha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='.05'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M6 24a18 18 0 0 1 36 0M12 24a12 12 0 0 1 24 0M18 24a6 6 0 0 1 12 0'/%3E%3Cpath d='M-24 12a24 24 0 0 1 48 0M-18 12a18 18 0 0 1 36 0M-12 12a12 12 0 0 1 24 0M-6 12a6 6 0 0 1 12 0M24 12a24 24 0 0 1 48 0M30 12a18 18 0 0 1 36 0M36 12a12 12 0 0 1 24 0M42 12a6 6 0 0 1 12 0'/%3E%3C/g%3E%3C/svg%3E");
    }

    /* Rarity symbols drawn in black (● ◆ ★ ★★, promo, black-white) turn light; the coloured ones stay. Not on the
       light pill of an active filter. */
    img:is(.rarity-symbol, .cselect__symbol):is([src*="/en-C."], [src*="/en-U."], [src*="/en-R."], [src*="/en-RR."], [src*="/en-PR."], [src*="/en-BWR."]):not(.cselect.is-set .cselect__button *) {
        filter: invert(1);
    }

    /* Tile badges: dark glass instead of white glass (the light red text needs a dark ground). */
    .product-card__media .badge {
        background: rgba(29, 29, 35, .62);
        border-color: rgba(255, 255, 255, .12);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
    }

    .cselect__button {
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23ECECF0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 1rem center, var(--surface);
    }

    .cselect.is-set .cselect__button {
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2315151A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 1rem center, var(--ink);
    }

    /* Select arrows were drawn in ink inside the SVG. */
    .field select,
    .select select {
        background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23ECECF0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .9rem center,
            var(--surface);
    }

    /* Status colours: dark tints with the light text colours. */
    .alert--error,
    .order-status--cancelled { background: rgba(255, 110, 100, .14); }
    .order-status--paid { background: rgba(92, 201, 138, .14); }
    .order-status--shipped { background: rgba(110, 160, 230, .16); color: #9DBFF0; }
    .order-status--pending { background: rgba(245, 160, 74, .14); }

    .cart-drawer__backdrop {
        background: rgba(0, 0, 0, .55);
    }
}
