/* ═══════════════════════════════════════════════════════════════════════════
   DiceAudio site

   The three Dice sites share this sheet and differ only by the :root token
   block, the way DiceAudio's and DiceCombats' app.css do. The tokens are the
   apps' own (surface ramp, borders, text ramp, accents, radii, brand
   gradient), so a page and a screenshot of its app read as the same thing.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── DiceAudio: the values of DiceAudio/wwwroot/css/app.css ─────────── */
    --g1: rgba(238, 119, 82, 0.20); /* #EE7752 orange */
    --g2: rgba(231, 60, 126, 0.60); /* #E73C7E pink   */
    --g3: rgba(35, 166, 213, 0.90); /* #23A6D5 blue   */
    --g4: rgba(35, 166, 171, 1.00); /* #23A6AB teal   */
    --brand: linear-gradient(-45deg, var(--g1), var(--g2), var(--g3), var(--g4));
    --atrium-brand: linear-gradient(90deg, #FF3F9E, #A45CFF, #4A7DFF, #19D3FF, #35DC8C);

    --a1: #E73C7E;  /* primary            */
    --a1h: #F05A93; /* primary, hover     */
    --a1t: #FF7FA8; /* primary as text    */
    --a2: #23A6D5;  /* info, links        */
    --a3: #23A6AB;  /* section headings   */
    --ink: #140610; /* text on the accent */

    --s0: #09090F;
    --s1: #0D0D1A;
    --s2: #0F0F1B;
    --s3: #12121F;
    --s4: #1A1A30;
    --s5: #23233F;
    --s6: #2E2E58;
    --b1: #2A2A4A;
    --b2: #363660;
    --b3: #444470;
    --b4: #5555AA;

    --t1: #ffffff;
    --t2: rgba(255, 255, 255, 0.88);
    --t3: rgba(255, 255, 255, 0.64);
    --t4: rgba(255, 255, 255, 0.52);

    --bar-bg: rgba(9, 9, 15, .88);
    --glass: rgba(9, 9, 20, .55);
    --glass-hi: rgba(9, 9, 20, .75);
    --hero-glow: radial-gradient(900px 420px at 50% -140px, rgba(231, 60, 126, .22), rgba(35, 166, 213, .08) 48%, transparent 72%);

    /* ── radii and motion, identical in both apps ─────────────────────────── */
    --r-card: 12px;
    --r-panel: 10px;
    --r-tile: 9px;
    --r-bar: 8px;
    --r-btn: 7px;
    --r-chip: 5px;
    --r-pill: 999px;
    --fx: 160ms;

    --page: 1120px;
    --bar-h: 62px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bar-h) + 16px);
}

body {
    margin: 0;
    background: var(--s0);
    color: var(--t2);
    font-family: Roboto, "Helvetica Neue", Helvetica, system-ui, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: var(--a2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.wrap {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══ the top bar ══════════════════════════════════════════════════════════
   A website navigation in the apps' material. Three groups, each with one
   job: where you are (family / app), where to go on this page (sections),
   and what to do (source, language, download). The brand gradient runs
   along its bottom edge, the hairline every Dice app bar carries. */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background-image: var(--brand);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--bar-h);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.crumb-family {
    display: inline-flex;
    opacity: .8;
    transition: opacity var(--fx);
}

.crumb-family:hover {
    opacity: 1;
}

.crumb-family img {
    width: 24px;
    height: 24px;
}

.crumb-sep {
    color: var(--t4);
    font-size: 1.1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--t1);
    white-space: nowrap;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 32px;
    height: 32px;
}

.nav-sections {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-sections a {
    color: var(--t3);
    padding: 6px 11px;
    border-radius: var(--r-btn);
    font-size: .92rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--fx), color var(--fx);
}

.nav-sections a:hover {
    color: var(--t1);
    background: var(--s6);
    text-decoration: none;
}

.nav-util {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

/* The apps' square icon key, with the operable edge. */
.nav-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-btn);
    border: 1px solid var(--b2);
    color: var(--t2);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    transition: background var(--fx), border-color var(--fx), color var(--fx);
}

.nav-key:hover {
    background: var(--s6);
    border-color: var(--b3);
    color: var(--t1);
    text-decoration: none;
}

.nav-key img {
    width: 18px;
    height: 18px;
}

.nav-cta {
    min-height: 36px;
}

/* ═══ buttons ══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--r-btn);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--b2);
    color: var(--a1t);
    transition: background var(--fx), border-color var(--fx), color var(--fx);
}

.btn:hover {
    background: var(--s6);
    border-color: var(--b3);
    text-decoration: none;
}

/* Dark ink on the accent fill, as in the apps: white on the accent fails
   for anything but large text. */
.btn.primary,
.cta {
    background: var(--a1);
    border-color: transparent;
    color: var(--ink);
}

.btn.primary:hover,
.cta:hover {
    background: var(--a1h);
}

.btn img {
    height: 18px;
    width: auto;
}

/* The icons are white files; on the accent fill they take the ink. */
.btn.primary img,
.cta img {
    filter: brightness(0);
    opacity: .85;
}

/* ═══ hero ═════════════════════════════════════════════════════════════════ */

.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--b1);
    background: var(--hero-glow), var(--s0);
}

.hero-inner {
    max-width: var(--page);
    margin: 0 auto;
    padding: 64px 20px 44px;
    text-align: center;
}

.hero img.gem {
    width: 150px;
    height: auto;
    margin-bottom: 14px;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .5));
}

.hero h1 {
    margin: 0;
    color: var(--t1);
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -.01em;
}

.hero .tagline {
    margin: 12px auto 0;
    max-width: 740px;
    color: var(--t3);
    font-size: 1.1rem;
}

.badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 4px;
}

.badges img {
    height: 26px;
    border-radius: var(--r-chip);
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.hero-shot {
    margin: 38px auto 0;
    max-width: min(960px, 100%);
    border-radius: var(--r-card);
    border: 1px solid var(--b2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    display: block;
}

/* ═══ sections ═════════════════════════════════════════════════════════════
   A section title is the apps' section heading: uppercase, in the heading
   accent, underlined by the default border. */

section {
    padding: 60px 0;
    border-bottom: 1px solid var(--b1);
}

section h2 {
    margin: 0 0 14px;
    padding: 0 2px 9px;
    border-bottom: 1px solid var(--b1);
    color: var(--a3);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

section .lead {
    margin: 0 0 28px;
    color: var(--t3);
    max-width: 780px;
}

section p {
    color: var(--t3);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.card {
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-panel);
    padding: 18px 18px 20px;
    transition: border-color var(--fx), background var(--fx);
}

.card:hover {
    border-color: var(--b3);
    background: var(--s4);
}

.card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--t1);
}

/* The accent rule the apps put on a card that is "on". */
.card h3::before {
    content: "";
    display: block;
    width: 26px;
    height: 3px;
    margin-bottom: 10px;
    border-radius: 2px;
    background: var(--a1);
}

.card p {
    margin: 0;
    color: var(--t3);
    font-size: .95rem;
}

/* ═══ screenshot gallery ═══════════════════════════════════════════════════ */

.shots {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shot {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-card);
    padding: 18px;
}

.shot:nth-child(even) .shot-media {
    order: 2;
}

.shot-media img {
    max-width: 100%;
    max-height: 500px;
    display: block;
    border-radius: var(--r-bar);
    border: 1px solid var(--b2);
}

.shot-text h3 {
    margin: 0 0 8px;
    color: var(--t1);
    font-size: 1.2rem;
}

.shot-text p {
    margin: 0;
    color: var(--t3);
}

.shot-text ul {
    color: var(--t3);
}

/* A very wide screenshot (a toolbar, a widget): the image takes the whole
   card width and the text goes underneath instead of beside it. */
.shot-wide {
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-card);
    padding: 18px;
}

.shot-wide .shot-media img {
    width: 100%;
    max-height: none;
}

.shot-wide .shot-text {
    margin-top: 22px;
    max-width: 860px;
}

.shot-wide .shot-text h3 {
    margin-bottom: 16px;
}

.shot-wide .field-steps {
    margin-bottom: 0;
}

/* ═══ custom fields (DiceCombats) ══════════════════════════════════════════ */

.fields-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 28px;
    align-items: start;
}

.fields-split img {
    width: 100%;
    border-radius: var(--r-bar);
    border: 1px solid var(--b2);
}

/* One card per field type: the example carries the explanation. */
.ftypes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.ftype {
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-panel);
    padding: 16px;
}

.ftype h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--t1);
}

    .ftype > p {
        margin: 0 0 12px;
        color: var(--t3);
        font-size: .92rem;
    }

.ftype figure {
    margin: 0 0 12px;
}

    .ftype figure:last-of-type {
        margin-bottom: 0;
    }

/* Shown at their real size, only held back when a card is narrower. */
.ftype img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: var(--r-bar);
    border: 1px solid var(--b2);
    background: var(--s0);
}

/* Reads as: this configuration gives that card. */
.ftype-arrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--a1);
    margin: 12px 0;
}

    .ftype-arrow::before,
    .ftype-arrow::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--b2), transparent);
    }

    .ftype-arrow svg {
        flex: 0 0 auto;
    }

.ftype figcaption {
    margin-top: 6px;
    color: var(--t4);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.field-steps {
    counter-reset: step;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.field-steps li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 14px;
    color: var(--t3);
}

.field-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--r-tile);
    background: var(--a1);
    color: var(--ink);
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-steps li strong {
    color: var(--t1);
}

/* ═══ ecosystem ════════════════════════════════════════════════════════════ */

.atrium-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-card);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

/* The Atrium's own gradient, as the hairline every Dice app bar wears. */
.atrium-banner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--atrium-brand);
}

.atrium-banner > img {
    width: 120px;
    height: auto;
}

.atrium-banner h3 {
    margin: 0 0 8px;
    color: var(--t1);
    font-size: 1.4rem;
}

.atrium-banner p {
    margin: 0 0 14px;
    color: var(--t3);
}

.eco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

/* An app is shown as the apps show an object: a strip with a leading tile. */
.eco-app {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--s3);
    border: 1px solid var(--b1);
    border-radius: var(--r-card);
    padding: 16px 18px;
    transition: border-color var(--fx), background var(--fx);
}

.eco-app:hover {
    border-color: var(--b3);
    background: var(--s4);
}

.eco-app img {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.eco-app h3 {
    margin: 0 0 4px;
    color: var(--t1);
    font-size: 1.1rem;
}

.eco-app p {
    margin: 0 0 8px;
    color: var(--t3);
    font-size: .95rem;
}

.eco-app.self {
    border-color: var(--a1);
}

/* ═══ image lightbox ═══════════════════════════════════════════════════════ */

.zoomable {
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, .88);
    cursor: zoom-out;
}

    .lightbox.open {
        display: flex;
    }

    .lightbox img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        border-radius: var(--r-panel);
        border: 1px solid var(--b2);
        box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    }

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: var(--r-pill);
    background: var(--glass);
    color: var(--t1);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

    .lightbox-close:hover {
        background: var(--glass-hi);
        border-color: rgba(255, 255, 255, .5);
    }

body.lightbox-open {
    overflow: hidden;
}

/* ═══ lists, code, footer ══════════════════════════════════════════════════ */

ul.plain {
    padding-left: 20px;
    color: var(--t3);
}

ul.plain li {
    margin-bottom: 8px;
}

ul.plain strong {
    color: var(--t1);
}

code, .code-style {
    background: var(--s2);
    border: 1px solid var(--b1);
    border-radius: var(--r-chip);
    padding: 2px 7px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .9em;
    color: var(--t2);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

pre {
    background: var(--s2);
    border: 1px solid var(--b1);
    border-radius: var(--r-panel);
    padding: 14px 16px;
    overflow-x: auto;
}

pre code {
    border: none;
    background: none;
    padding: 0;
}

footer {
    padding: 30px 0 46px;
    color: var(--t3);
    font-size: .9rem;
}

footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

/* ═══ detailed pages ═══════════════════════════════════════════════════════
   A page meant to be read from top to bottom: a short head instead of the
   hero, then sections of headings, short paragraphs and numbered steps, in
   a column narrow enough to read comfortably. */

.card .card-more {
    margin: 12px 0 0;
    font-size: .95rem;
}

.page-head {
    border-bottom: 1px solid var(--b1);
    background: var(--hero-glow), var(--s0);
}

.page-head .wrap {
    padding-top: 48px;
    padding-bottom: 36px;
}

.page-back {
    display: inline-block;
    margin-bottom: 14px;
    font-size: .95rem;
}

.page-head h1 {
    margin: 0 0 10px;
    color: var(--t1);
    font-size: clamp(1.9rem, 5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.page-head p {
    margin: 0;
    max-width: 760px;
    color: var(--t3);
    font-size: 1.08rem;
}

.toc {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toc a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--b2);
    border-radius: var(--r-pill);
    background: var(--s3);
    color: var(--t2);
    font-size: .92rem;
}

.toc a:hover {
    border-color: var(--b4);
    text-decoration: none;
}

section.doc {
    padding: 44px 0;
}

.doc .wrap > * {
    max-width: 780px;
}

.doc h3 {
    margin: 28px 0 6px;
    color: var(--t1);
    font-size: 1.08rem;
}

.doc p {
    margin: 0 0 12px;
}

.doc strong {
    color: var(--t1);
}

.doc ul {
    margin: 0 0 14px;
    padding-left: 22px;
    color: var(--t3);
}

.doc ul li {
    margin-bottom: 6px;
}

.doc .field-steps {
    margin-top: 14px;
}

/* A remark set apart from the text: the accent rule of a card, on its side. */
.note {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--s3);
    border: 1px solid var(--b1);
    border-left: 3px solid var(--a1);
    border-radius: var(--r-panel);
}

.note p {
    margin: 0;
}
/* ═══ narrow windows ═══════════════════════════════════════════════════════ */

/* Below this the sections leave the bar; the page itself is the menu. */
@media (max-width: 960px) {
    .nav-sections {
        display: none;
    }
}

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

    .shot:nth-child(even) .shot-media {
        order: 0;
    }

    .fields-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        gap: 10px;
        padding: 0 14px;
    }

    .crumb-family img {
        width: 20px;
        height: 20px;
    }

    .brand {
        font-size: .98rem;
        gap: 8px;
    }

    .brand img {
        width: 28px;
        height: 28px;
    }

    .nav-util {
        gap: 6px;
    }

    .nav-cta {
        padding: 0 12px;
    }

    .atrium-banner {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
