/* Home page and hub pages: the hero shelf, the bench of app tiles, topics and
   the maker section. Builds on tokens.css and site.css. */

main > * {
    width: min(100% - 2 * var(--gutter), var(--max-width));
    margin-inline: auto;
}
main > * + * { margin-top: var(--section-gap); }
main > .hub-hero + * { margin-top: clamp(3rem, 2rem + 3vw, 5rem); }

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

.hero { padding-top: clamp(2.5rem, 1rem + 5vw, 5.5rem); }

.hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem);
    padding: 0.4rem 0.9rem 0.4rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    font-size: 0.9rem;
    font-weight: 560;
}

.dot {
    position: relative;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--signal);
}
.dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: dot-ping 2.8s var(--ease-out) infinite;
}
@keyframes dot-ping { 0%, 40% { opacity: 0.7; scale: 1; } 100% { opacity: 0; scale: 3; } }

.hero h1 { font-size: clamp(2.7rem, 1.2rem + 5.4vw, 5.9rem); }
.hero__first, .hero__second { display: block; }
.hero__second { color: var(--text-soft); }

/* A pencil line under the one word that matters, drawn in once on load. */
.scribble {
    position: relative;
    font-style: normal;
    color: var(--text);
    white-space: nowrap;
}
.scribble svg {
    position: absolute;
    left: -2%;
    bottom: -0.16em;
    width: 104%;
    height: 0.3em;
    overflow: visible;
    fill: none;
    stroke: var(--signal);
    stroke-width: 5;
    stroke-linecap: round;
    pointer-events: none;
}
.scribble path { stroke-dasharray: 320; stroke-dashoffset: 0; animation: draw 900ms var(--ease-out) 650ms both; }
.scribble path + path { stroke-width: 3.5; animation-delay: 900ms; animation-duration: 700ms; }
@keyframes draw { from { stroke-dashoffset: 320; } }

.hero__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
}

.hero__lead {
    max-width: 38rem;
    color: var(--text-muted);
    font-size: var(--step-1);
    line-height: 1.55;
}


/* ---------- The shelf ---------- */

.shelf { margin-top: clamp(3rem, 2rem + 3.5vw, 5rem); }

.shelf__row {
    --icon: clamp(3.6rem, 2.2rem + 4.2vw, 6rem);
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: clamp(0.5rem, 0.2rem + 1vw, 1.25rem);
    padding: 0 clamp(0.5rem, 2vw, 2rem) 1.1rem;
    list-style: none;
}

/* The plank the icons stand on. */
.shelf__row::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto 0 0;
    height: 1.1rem;
    border-radius: 0.5rem 0.5rem 0.9rem 0.9rem;
    background: linear-gradient(var(--bg-muted), color-mix(in oklab, var(--bg-muted) 82%, var(--text)));
    box-shadow: 0 1px 0 var(--line-strong) inset, 0 18px 30px -18px light-dark(rgba(40, 30, 10, 0.4), rgba(0, 0, 0, 0.8));
}

.shelf__item { position: relative; flex: 0 1 var(--icon); }

.shelf__item a {
    position: relative;
    display: block;
    text-decoration: none;
    transform-origin: 50% 100%;
    transition: transform 420ms var(--ease-spring);
}

.shelf__item .app-icon {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    box-shadow: 0 0 0 1px light-dark(rgba(26, 25, 21, 0.08), rgba(242, 237, 226, 0.12)), 0 10px 14px -8px light-dark(rgba(40, 30, 10, 0.45), rgba(0, 0, 0, 0.9));
    animation: land 900ms var(--ease-spring) both;
    animation-delay: calc(240ms + var(--i) * 60ms);
}
@keyframes land { from { opacity: 0; transform: translateY(-46px) rotate(-6deg); } 30% { opacity: 1; } }

.shelf__label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.7rem);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--text-inverse);
    background: var(--text);
    font-size: 0.82rem;
    font-weight: 620;
    white-space: nowrap;
    opacity: 0;
    translate: -50% 6px;
    transition: opacity var(--dur-fast), translate var(--dur-base) var(--ease-spring);
    pointer-events: none;
}

/* Dock magnification: the icon under the pointer rises most, its neighbours a
   little. :has() reaches the left neighbour, the sibling combinator the right. */
@media (hover: hover) {
    .shelf__item:hover a { transform: translateY(-14px) scale(1.14); }
    .shelf__item:hover + .shelf__item a,
    .shelf__item:has(+ .shelf__item:hover) a { transform: translateY(-6px) scale(1.06); }
}
.shelf__item a:focus-visible { transform: translateY(-14px) scale(1.14); outline-offset: 6px; border-radius: 26%; }
.shelf__item:hover .shelf__label,
.shelf__item a:focus-visible .shelf__label { opacity: 1; translate: -50% 0; }

@media (max-width: 700px) {
    .shelf__row {
        --icon: 100%;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 1.6rem 0.9rem;
        padding: 0;
    }
    .shelf__row::after { display: none; }
    .shelf__item { padding-bottom: 0.75rem; }
    /* The first icon of each row of five draws the plank for the whole row:
       five icon widths, four gaps, and a little overhang on both ends. */
    .shelf__item:nth-child(5n + 1)::after {
        content: "";
        position: absolute;
        z-index: -1;
        left: -0.6rem;
        bottom: 0;
        width: calc(500% + 4 * 0.9rem + 1.2rem);
        height: 0.75rem;
        border-radius: 0.35rem 0.35rem 0.6rem 0.6rem;
        background: linear-gradient(var(--bg-muted), color-mix(in oklab, var(--bg-muted) 82%, var(--text)));
        box-shadow: 0 1px 0 var(--line-strong) inset, 0 14px 22px -14px light-dark(rgba(40, 30, 10, 0.4), rgba(0, 0, 0, 0.8));
    }
    .shelf__label { display: none; }
}

/* ---------- The bench ---------- */

.bench__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(0.75rem, 0.5rem + 0.6vw, 1.25rem);
}

.tile {
    --phone: 15.5rem;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    grid-column: span 4;
    min-height: 32rem;
    overflow: hidden;
    padding: clamp(1.25rem, 1rem + 0.8vw, 1.85rem);
    border-radius: var(--radius-xl);
    background: var(--world-tint);
    transition: transform 520ms var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}

/* A soft spotlight of the app's own colour behind the device. */
.tile::before {
    content: "";
    position: absolute;
    z-index: -1;
    right: -10%;
    bottom: -25%;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in oklab, var(--world) 38%, transparent), transparent);
    opacity: 0.7;
    transition: opacity var(--dur-slow) var(--ease-out), scale var(--dur-slow) var(--ease-out);
}

.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile:hover::before { opacity: 1; scale: 1.12; }
.tile:has(:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 4px; }

.tile__copy { position: relative; z-index: 2; max-width: 30rem; }

.tile__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 560;
}
.tile__meta .app-icon { width: 3.25rem; height: 3.25rem; }

.tile__name {
    margin-top: 1.1rem;
    color: var(--world-ink);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.tile__name a { text-decoration: none; }
.tile__name a:focus-visible { outline: none; }
/* The heading link covers the whole tile. */
.tile__name a::after { content: ""; position: absolute; z-index: 3; inset: 0; }

.tile__headline {
    margin-top: 0.45rem;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.9rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.tile__media {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 12rem;
    margin-top: 1.5rem;
}

/* Phones rise out of the bottom edge and are cropped by it, so a tile shows the
   top of the screen, which is where each app says what it is. */
.tile__phone.iphone-device {
    width: var(--phone);
    flex: none;
    margin-bottom: calc(var(--phone) * -0.92);
    transition: transform 620ms var(--ease-spring);
}
.tile:hover .tile__phone { transform: translateY(-14px) rotate(-1.5deg); }

.tile__go {
    position: absolute;
    z-index: 2;
    top: clamp(1.25rem, 1rem + 0.8vw, 1.85rem);
    right: clamp(1.25rem, 1rem + 0.8vw, 1.85rem);
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    color: var(--text-inverse);
    background: var(--text);
    rotate: -45deg;
    scale: 0.85;
    opacity: 0;
    transition: rotate 520ms var(--ease-spring), scale 520ms var(--ease-spring), opacity var(--dur-fast);
}
.tile:hover .tile__go, .tile:has(:focus-visible) .tile__go { rotate: 0deg; scale: 1; opacity: 1; }

/* Sizes */
.tile--xl { grid-column: span 7; min-height: 40rem; --phone: 19rem; }
.tile--l { grid-column: span 5; min-height: 40rem; --phone: 17rem; }
.tile--xl .tile__headline { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.75rem); max-width: 16ch; }
.tile--l .tile__headline { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.4rem); }

.tile--wide {
    grid-column: span 6;
    min-height: 22rem;
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
}
.tile--wide .tile__copy { flex: 1 1 55%; }
.tile--wide .tile__media { flex: 1 1 45%; margin-top: 0; align-items: center; }
.tile--s { --phone: 13.5rem; min-height: 28rem; }
.tile--s .tile__headline { font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.55rem); }

/* Puzzle tile: the nine game icons, gently scattered. */
.tile__games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.6rem, 0.4rem + 0.6vw, 1rem);
    width: min(100%, 15rem);
}
.tile__games .app-icon {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    rotate: calc((var(--i) - 4) * 1.6deg);
    transition: rotate 520ms var(--ease-spring), transform 520ms var(--ease-spring);
    transition-delay: calc(var(--i) * 25ms);
}
.tile:hover .tile__games .app-icon { rotate: 0deg; transform: translateY(-4px); }

/* HRM tile: the watch face sits on a dark watch body. */
.tile__watch {
    width: min(100%, 12rem);
    padding: 0.9rem 0.8rem;
    border-radius: 2.6rem;
    background: #050505;
    box-shadow: 0 0 0 5px #2b2c2e, 0 0 0 6px #6b6d70, var(--shadow-lg);
    rotate: 4deg;
    transition: rotate 620ms var(--ease-spring), transform 620ms var(--ease-spring);
}
.tile__watch img { border-radius: 1.8rem; }
.tile:hover .tile__watch { rotate: 0deg; transform: translateY(-6px); }

/* Scroll-driven entrance where the browser supports it: devices rise into the
   tile as it scrolls into view. Uses `translate`, so hover's `transform` still
   composes on top. Without support, everything is simply in place. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .tile__media > * {
            animation: rise-in linear both;
            animation-timeline: view();
            animation-range: entry 5% cover 35%;
        }
    }
}
@keyframes rise-in { from { translate: 0 22%; } }

/* Two columns: every tile takes half, so ten tiles make five full rows and none
   is left alone at the end of a row. */
@media (max-width: 1040px) {
    .tile, .tile--s, .tile--wide { grid-column: span 6; }
    .tile--xl, .tile--l { grid-column: span 6; min-height: 34rem; --phone: 16rem; }
    .tile--wide { flex-direction: column; }
    .tile--wide .tile__media { margin-top: 1.5rem; }
}

@media (max-width: 680px) {
    .bench__grid { grid-template-columns: 1fr; }
    .tile, .tile--s, .tile--xl, .tile--l, .tile--wide { grid-column: auto; min-height: 0; --phone: 13.5rem; }
    .tile__media { min-height: 14rem; }
    .tile__phone.iphone-device { margin-bottom: calc(var(--phone) * -1.02); }
    .tile--wide { flex-direction: column; }
    .tile--wide .tile__media { min-height: 0; margin-top: 1.5rem; }
    .tile__go { opacity: 1; rotate: 0deg; scale: 0.9; }
}

/* ---------- Topics ---------- */

.topics__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(1rem, 3vw, 3rem);
    list-style: none;
    border-top: 1px solid var(--line);
}
.topics__list li { border-bottom: 1px solid var(--line); }

.topic-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
    min-height: 100%;
    padding: 1.35rem 0.75rem;
    margin-inline: -0.75rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background-color var(--dur-fast);
}
.topic-row:hover { background: var(--bg-elevated); }

/* Three icons at most: 3 × 2.4rem less two 0.8rem overlaps is the 5.6rem column. */
.topic-row__icons { display: flex; justify-content: center; width: 5.6rem; }
.topic-row__icons .app-icon {
    width: 2.4rem;
    height: 2.4rem;
    box-shadow: 0 0 0 3px var(--bg), var(--shadow-sm);
    transition: transform 420ms var(--ease-spring), box-shadow var(--dur-fast);
}
.topic-row__icons .app-icon + .app-icon { margin-left: -0.8rem; }
.topic-row:hover .app-icon { box-shadow: 0 0 0 3px var(--bg-elevated), var(--shadow-sm); }
.topic-row:hover .app-icon:nth-child(1) { transform: rotate(-8deg) translateX(-3px); }
.topic-row:hover .app-icon:nth-child(2) { transform: translateY(-3px); }
.topic-row:hover .app-icon:nth-child(3) { transform: rotate(8deg) translateX(3px); }

.topic-row__text { display: grid; gap: 0.2rem; }
.topic-row__title { font-family: var(--font-display); font-size: 1.28rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
.topic-row__description { color: var(--text-muted); font-size: 0.95rem; line-height: 1.45; }
.topic-row .arrow { color: var(--text-soft); transition: translate var(--dur-base) var(--ease-spring), color var(--dur-fast); }
.topic-row:hover .arrow { translate: 5px 0; color: var(--text); }

@media (max-width: 820px) {
    .topics__list { grid-template-columns: 1fr; }
}

/* ---------- Maker ---------- */

.maker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 5vw, 5rem);
    padding: clamp(2rem, 1rem + 4vw, 4.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background:
        radial-gradient(circle at 0 0, color-mix(in oklab, var(--signal) 12%, transparent), transparent 24rem),
        var(--bg-elevated);
}

.maker h2 { font-size: var(--step-4); max-width: 12ch; }
.maker__intro p { margin-block: 1.25rem 1.5rem; color: var(--text-muted); font-size: var(--step-1); line-height: 1.55; }

.maker__principles { display: grid; gap: 0; list-style: none; counter-reset: principle; }
.maker__principles li {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    column-gap: 1rem;
    padding-block: 1.4rem;
    border-top: 1px solid var(--line);
    counter-increment: principle;
}
.maker__principles li:first-child { border-top: 0; padding-top: 0.25rem; }
.maker__principles li::before {
    content: counter(principle, decimal-leading-zero);
    grid-row: span 2;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}
.maker__principles h3 { font-size: 1.3rem; }
.maker__principles p { margin-top: 0.35rem; color: var(--text-muted); }

@media (max-width: 860px) {
    .maker { grid-template-columns: 1fr; }
}

/* =====================================================================
   Hub pages: /apps, /guides, /support
   ===================================================================== */

.hub-hero { padding-top: clamp(2.5rem, 1rem + 5vw, 5.5rem); }
.hub-hero h1 { max-width: 18ch; font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5.4rem); }
.hub-hero__lead { max-width: 42rem; margin-top: 1.4rem; color: var(--text-muted); font-size: var(--step-1); line-height: 1.55; }
.hub-hero .actions { margin-top: 2rem; }

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 560;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Filter chips ---------- */

.filters { display: grid; gap: 0.75rem; margin-top: 2.25rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-bar a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.6rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--bg-elevated);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-base) var(--ease-spring);
}
.filter-bar a:hover { border-color: var(--text-soft); transform: translateY(-1px); }
.filter-bar a.is-active { color: var(--text-inverse); background: var(--text); border-color: var(--text); }
.filter-bar__count {
    display: inline-grid;
    place-items: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding-inline: 0.35rem;
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.filter-bar a.is-active .filter-bar__count { background: color-mix(in oklab, var(--text-inverse) 20%, transparent); color: inherit; }
.filter-bar--quiet a { min-height: 2.3rem; padding-block: 0.35rem; background: transparent; font-size: 0.86rem; }

[hidden] { display: none !important; }

/* ---------- Catalogue ---------- */

.catalogue {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(3.5rem, 2.5rem + 3vw, 6rem) 1rem;
}
/* A category with several apps takes the full width; single-app categories
   pair up side by side instead of leaving half a row empty. */
.catalogue__group { grid-column: 1 / -1; }
.catalogue__group:has(.catalogue__grid > :only-child) { grid-column: auto; }
.catalogue__group:has(.catalogue__grid > :only-child) .catalogue__grid { grid-template-columns: 1fr; }
.catalogue__group .section-head h2 { font-size: var(--step-3); }
.catalogue__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.catalog-row {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    padding: 1.6rem 1.6rem 1.5rem;
    padding-right: clamp(1.6rem, 10rem, 34%);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
    transition: border-color var(--dur-base), box-shadow var(--dur-base) var(--ease-out), transform 520ms var(--ease-spring);
}
.catalog-row::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: radial-gradient(circle at 100% 100%, var(--world-tint), transparent 70%);
    opacity: 0.9;
}
.catalog-row:hover { border-color: color-mix(in oklab, var(--world) 45%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-3px); }

.catalog-row__head { display: flex; align-items: center; gap: 1rem; }
.catalog-row__head .app-icon { width: 4.5rem; height: 4.5rem; }
.catalog-row__eyebrow { color: var(--text-soft); font-size: 0.82rem; font-weight: 560; }
.catalog-row h3 { margin-top: 0.15rem; font-size: 1.5rem; }
.catalog-row h3 a { text-decoration: none; }
.catalog-row h3 a:hover { text-decoration: underline; }
.catalog-row__summary { color: var(--text-muted); line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.chips li {
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in oklab, var(--world) 13%, var(--bg-elevated));
    color: var(--world-ink);
    font-size: 0.8rem;
    font-weight: 620;
}

.catalog-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: auto; padding-top: 0.25rem; }
.catalog-row__actions .store-badge img { height: 2.5rem; }
.catalog-row__links { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.95rem; }

/* A device peeking in from the right edge, cropped by the card. */
.catalog-row__peek {
    position: absolute;
    z-index: -1;
    right: -1.5rem;
    bottom: -45%;
    width: clamp(7rem, 25%, 10rem);
    rotate: -8deg;
    transition: translate 620ms var(--ease-spring), rotate 620ms var(--ease-spring);
    pointer-events: none;
}
.catalog-row__peek .iphone-device { width: 100%; flex: none; }
.catalog-row:hover .catalog-row__peek { translate: -0.4rem -1rem; rotate: -4deg; }

@media (max-width: 900px) {
    .catalogue, .catalogue__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .catalog-row { padding-right: 1.4rem; }
    .catalog-row__peek { display: none; }
}

/* ---------- Guide index ---------- */

.guide-index {
    display: grid;
    gap: clamp(3rem, 2rem + 3vw, 5rem);
}

.guide-topic__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.guide-topic__head h2 { font-size: var(--step-3); }
.guide-topic__head p { margin-top: 0.3rem; color: var(--text-muted); }
.guide-topic__count { color: var(--text-soft); font-size: 0.88rem; font-weight: 600; white-space: nowrap; }

.guide-topic__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.guide-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    transition: border-color var(--dur-base), transform 520ms var(--ease-spring), box-shadow var(--dur-base);
}
.guide-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.guide-card:has(:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.guide-card h3 { font-size: 1.25rem; line-height: 1.15; }
.guide-card h3 a { text-decoration: none; }
.guide-card h3 a:focus-visible { outline: none; }
.guide-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.guide-card > p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.guide-card__meta { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; padding-top: 0.4rem; color: var(--text-soft); font-size: 0.8rem; font-weight: 560; }
.guide-card__lang { padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--bg-muted); color: var(--text-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }

@media (max-width: 1000px) { .guide-topic__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .guide-topic__grid { grid-template-columns: 1fr; }
    .guide-topic__head { grid-template-columns: auto minmax(0, 1fr); }
    .guide-topic__count { display: none; }
}

/* ---------- Callouts ---------- */

.callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    padding: clamp(1.75rem, 1rem + 3vw, 3.5rem);
    border-radius: var(--radius-2xl);
    color: var(--panel-text);
    background:
        radial-gradient(circle at 100% 0, color-mix(in oklab, var(--signal) 30%, transparent), transparent 22rem),
        var(--panel-bg);
}
.callout > div { max-width: 40rem; }
.callout h2 { font-size: var(--step-3); }
.callout p { margin-top: 0.8rem; color: color-mix(in oklab, var(--panel-text) 75%, transparent); line-height: 1.6; }
.callout__kicker { margin: 0 0 0.6rem !important; color: var(--signal) !important; font-weight: 650; }
.callout .button--primary { color: var(--panel-bg); background: var(--panel-text); }

/* ---------- Support directory ---------- */

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

.support-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    transition: border-color var(--dur-base);
}
.support-card:hover { border-color: color-mix(in oklab, var(--world) 45%, var(--line)); }
.support-card__head { display: flex; align-items: center; gap: 0.85rem; }
.support-card__head .app-icon { width: 3rem; height: 3rem; }
.support-card h3 { font-size: 1.2rem; }
.support-card > p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.support-card__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.support-card__links a {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-muted);
    font-size: 0.85rem;
    font-weight: 620;
    text-decoration: none;
    transition: background-color var(--dur-fast), color var(--dur-fast);
}
.support-card__links a:hover { color: var(--text-inverse); background: var(--text); }

@media (max-width: 1000px) { .support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .support-grid { grid-template-columns: 1fr; } }

.site-data > * { max-width: 52rem; }
.site-data h2 { font-size: var(--step-3); }
.site-data__lead { margin-top: 0.6rem; color: var(--text-soft); }
.site-data__body { display: grid; gap: 1rem; margin-top: 1.5rem; color: var(--text-muted); line-height: 1.7; }
.site-data code { padding: 0.1rem 0.35rem; border-radius: 5px; background: var(--bg-muted); color: var(--text); }

/* ---------- Puzzle hub ---------- */

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

.game-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
    transition: transform 520ms var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base);
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.game-card:has(:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.game-card .app-icon { width: 4.5rem; height: 4.5rem; transition: rotate 520ms var(--ease-spring); }
.game-card:hover .app-icon { rotate: -6deg; }
.game-card h2 { font-size: 1.35rem; letter-spacing: -0.02em; }
.game-card h2 a { text-decoration: none; }
.game-card h2 a:focus-visible { outline: none; }
.game-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.game-card__platforms { color: var(--text-soft); font-size: 0.8rem; font-weight: 560; }
.game-card__blurb { margin-top: 0.2rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.45; }
.game-card .arrow { color: var(--text-soft); transition: translate var(--dur-base) var(--ease-spring); }
.game-card:hover .arrow { translate: 4px 0; color: var(--text); }

@media (max-width: 1000px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .game-grid { grid-template-columns: 1fr; } }

/* ---------- Topic and error pages ---------- */

.page-topic .catalogue__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .page-topic .catalogue__grid { grid-template-columns: 1fr; } }

.error { padding-block: clamp(3rem, 2rem + 6vw, 7rem) 0; }
.error__code {
    font-family: var(--font-display);
    font-size: clamp(6rem, 3rem + 14vw, 14rem);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 2px var(--line-strong);
}
.error h1 { margin-top: 1.5rem; font-size: var(--step-4); }
.error .actions { margin-top: 2rem; }

/* ---------- Playground ---------- */

/* A real board from the puzzle rules pages. play-board.css draws it in the
   product accent, so the section maps that onto the puzzles world. */
.playground {
    --product-accent: var(--world-ink);
    --product-accent-strong: color-mix(in oklab, var(--world-ink) 78%, var(--text));
    --product-accent-soft: color-mix(in oklab, var(--world) 12%, transparent);
    --product-accent-border: color-mix(in oklab, var(--world) 32%, transparent);
    --accent: var(--world-ink);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(1.75rem, 1rem + 4vw, 4.5rem);
    border-radius: var(--radius-2xl);
    background:
        radial-gradient(circle at 100% 100%, color-mix(in oklab, #f2a03a 22%, transparent), transparent 26rem),
        radial-gradient(circle at 0 0, color-mix(in oklab, var(--world) 16%, transparent), transparent 22rem),
        var(--world-tint);
}
.playground__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: var(--world-ink);
    font-weight: 650;
}
.playground h2 { max-width: 15ch; font-size: var(--step-4); }
.playground__copy > p:not(.playground__kicker) { max-width: 34rem; margin-block: 1.25rem 1.5rem; color: var(--text-muted); font-size: var(--step-1); line-height: 1.55; }
.playground__board {
    padding: clamp(1rem, 0.6rem + 1.5vw, 1.6rem);
    border-radius: var(--radius-xl);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
}
.playground__fallback { color: var(--text-muted); }

@media (max-width: 860px) {
    .playground { grid-template-columns: 1fr; }
    .playground__board { max-width: 28rem; }
}
