:root {
    color-scheme: light dark;

    --bg1: #2f76ff;
    --bg2: #5a3bff;
    --bg3: #2b8cff;

    --page-max: 980px;
    --card-radius: 18px;
    --card-shadow: 0 18px 60px rgba(0, 0, 0, .14);
    --card-border: var(--border-subtle);

    --text: rgba(15, 23, 42, .92);
    --text-soft: rgba(15, 23, 42, .58);
    --muted: rgba(15, 23, 42, .62);
    --hair: rgba(15, 23, 42, .10);

    --link: #2563eb;
    --code-bg: rgba(2, 6, 23, .06);

    --callout-bg: rgba(16, 185, 129, .10);
    --callout-border: rgba(16, 185, 129, .55);

    --card-pad: 44px;
    --card-pad-mobile: 22px;

    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

    --glow1: rgba(255, 255, 255, .22);
    --glow2: rgba(255, 255, 255, .14);

    --surface-1: rgba(255, 255, 255, .94);
    --surface-2: var(--callout-icon-bg);
    --surface-3a: rgba(255, 255, 255, .75);
    --surface-3b: rgba(255, 255, 255, .45);
    --surface-4: rgba(255, 255, 255, .8);
    --surface-5: rgba(255, 255, 255, .75);
    --surface-6: rgba(255, 255, 255, .6);
    --surface-hover: rgba(255, 255, 255, .92);

    --border: rgba(15, 23, 42, .10);
    --border-strong: rgba(15, 23, 42, .12);
    --border-subtle: rgba(0, 0, 0, .06);
    --border-tint: rgba(15, 23, 42, .08);
    --code-border: rgba(2, 6, 23, .06);

    --pre-bg: rgba(2, 6, 23, .06);
    --pre-border: rgba(2, 6, 23, .10);

    --text-2: rgba(15, 23, 42, .78);
    --text-3: rgba(15, 23, 42, .60);
    --text-4: rgba(15, 23, 42, .50);
    --ink: rgba(2, 6, 23, .85);

    --quote-border: rgba(15, 23, 42, .25);

    --tint-1: rgba(15, 23, 42, .06);
    --tint-2: rgba(15, 23, 42, .04);

    --shadow-1: 0 10px 26px rgba(0, 0, 0, .06);
    --shadow-2: 0 14px 44px rgba(0, 0, 0, .10);
    --shadow-accent: 0 16px 40px rgba(37, 99, 235, .14);

    --border-accent: rgba(37, 99, 235, .28);

    --callout-border-soft: rgba(16, 185, 129, .22);
    --callout-shadow: 0 10px 28px rgba(16, 185, 129, .10);
    --callout-icon-bg: rgba(255, 255, 255, .65);
    --callout-icon-border: rgba(16, 185, 129, .18);

    --embed-bg: white;
}

@media (prefers-color-scheme: dark) {
    :root {

        /* keep brand hues but tune for dark surfaces */
        --bg1: #4c8dff;
        --bg2: #7a5cff;
        --bg3: #49a1ff;

        /* shadows in dark mode should be deeper + less spread */
        --card-shadow: 0 18px 60px rgba(0, 0, 0, .55);

        /* borders flip from dark transparency → light transparency */
        --card-border: rgba(255, 255, 255, .10);

        /* text becomes light */
        --text: rgba(248, 250, 252, .92);
        --text-soft: rgba(248, 250, 252, .56);
        --muted: rgba(248, 250, 252, .62);

        /* subtle separators */
        --hair: rgba(255, 255, 255, .12);

        /* links slightly brighter for contrast on dark */
        --link: #60a5fa;

        /* dark surface with gentle lift */
        --code-bg: rgba(255, 255, 255, .06);

        /* callout stays green but tuned for dark contrast */
        --callout-bg: rgba(16, 185, 129, .18);
        --callout-border: rgba(52, 211, 153, .70);

        /* padding + fonts unchanged */
        --card-pad: 44px;
        --card-pad-mobile: 22px;

        --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

        --glow1: rgba(255, 255, 255, .08);
        --glow2: rgba(255, 255, 255, .05);

        --surface-1: rgba(2, 6, 23, .72);
        --surface-2: rgba(2, 6, 23, .52);
        --surface-3a: rgba(2, 6, 23, .70);
        --surface-3b: rgba(2, 6, 23, .40);
        --surface-4: rgba(2, 6, 23, .60);
        --surface-5: rgba(2, 6, 23, .56);
        --surface-6: rgba(2, 6, 23, .55);
        --surface-hover: rgba(255, 255, 255, .08);

        --border: rgba(255, 255, 255, .10);
        --border-strong: rgba(255, 255, 255, .14);
        --border-subtle: rgba(255, 255, 255, .08);
        --border-tint: rgba(255, 255, 255, .08);
        --code-border: rgba(255, 255, 255, .10);

        --pre-bg: rgba(0, 0, 0, .30);
        --pre-border: rgba(255, 255, 255, .12);

        --text-2: rgba(248, 250, 252, .78);
        --text-3: rgba(248, 250, 252, .58);
        --text-4: rgba(248, 250, 252, .50);
        --ink: rgba(248, 250, 252, .86);

        --quote-border: rgba(255, 255, 255, .20);

        --tint-1: rgba(255, 255, 255, .06);
        --tint-2: rgba(255, 255, 255, .04);

        --shadow-1: 0 10px 26px rgba(0, 0, 0, .45);
        --shadow-2: 0 14px 44px rgba(0, 0, 0, .60);
        --shadow-accent: 0 16px 46px rgba(96, 165, 250, .18);

        --border-accent: rgba(96, 165, 250, .28);

        --callout-border-soft: rgba(52, 211, 153, .28);
        --callout-shadow: 0 10px 28px rgba(16, 185, 129, .22);
        --callout-icon-bg: rgba(255, 255, 255, .08);
        --callout-icon-border: rgba(52, 211, 153, .35);

        --embed-bg: rgba(2, 6, 23, .40);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100dvh;
    overscroll-behavior: none;
    overflow: hidden;
}

body {
    min-height: 100dvh;
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 15% 10%, var(--glow1), transparent 55%),
        radial-gradient(900px 600px at 80% 0%, var(--glow2), transparent 60%),
        linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
    /* padding: 0; */
}

html,
body {
    height: 100%;
    margin: 0;

    /* Fill the safe areas with the same background */
    background:
        radial-gradient(1200px 700px at 15% 10%, var(--glow1), transparent 55%),
        radial-gradient(900px 600px at 80% 0%, var(--glow2), transparent 60%),
        linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* helps some iOS cases */

    /* Ensure the background paints under notch/home indicator */
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

/* Page wrapper */
.wrap {
    max-width: var(--page-max);
    margin: 0 auto;
}

/* “Export card” */
.card {
    background: var(--surface-1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* Header strip (optional) */
.topbar {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(to bottom, var(--surface-3a), var(--surface-3b));
}

.doc-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .10);
    background: var(--surface-6);
    color: rgba(15, 23, 42, .7);
}

/* Content */
.content {
    padding: var(--card-pad);
    /* 0 var(--card-pad) var(--card-pad); */
}

@media (max-width: 720px) {
    /* body {
        padding: 28px 14px 44px;
    } */

    .content {
        padding: var(--card-pad-mobile);
    }
}

/* “Craft-ish” typography */
h1,
h2,
h3 {
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 34px;
    line-height: 1.12;
    font-weight: 750;
}

h2 {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    /* margin-top: 28px; */
}

h3 {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    margin-top: 22px;
}

p {
    margin: 10px 0 0;
    line-height: 1.7;
    color: var(--text);
    font-size: 15.5px;
}

.muted {
    color: var(--muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--hair);
    margin: 26px 0;
}

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

a:hover {
    text-decoration: underline;
}

ul,
ol {
    margin: 10px 0 0;
    padding-left: 22px;
    line-height: 1.7;
    font-size: 15.5px;
}

li {
    margin: 6px 0;
}

/* Inline code + code blocks */
code {
    font-family: var(--mono);
    font-size: .92em;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--code-border);
}

pre {
    margin: 14px 0 0;
    padding: 14px 16px;
    background: var(--code-border);
    border: 1px solid var(--pre-border);
    border-radius: 12px;
    overflow: auto;
    line-height: 1.55;
    font-size: 13.5px;
    font-family: var(--mono);
    color: var(--ink);
}

pre code {
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Block quote (markdown) */
blockquote {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-left: 4px solid var(--quote-border);
    background: var(--tint-2);
    border-radius: 12px;
    color: rgba(15, 23, 42, .80);
}

blockquote p {
    margin: 0;
}

/* Callout (Craft-ish) */
.callout {
    margin: 16px 0 0;
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--callout-bg);
    border: 1px solid var(--callout-border-soft);
    box-shadow: var(--callout-shadow);
    align-items: flex-start;
}

.callout::before {
    content: "";
    width: 4px;
    border-radius: 999px;
    background: var(--callout-border);
    align-self: stretch;
    margin-right: 4px;
}

.callout-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--callout-icon-border);
    flex: 0 0 auto;
    margin-top: 2px;
}

.callout-title {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}

.callout-body {
    margin-top: 4px;
    color: rgba(15, 23, 42, .72);
    font-size: 14.5px;
    line-height: 1.6;
}

/* “Block link” (Craft export link preview-ish) */
.link-card {
    margin: 14px 0 0;
    display: flex;
    gap: 14px;
    padding: 14px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: 0 10px 26px var(--border-subtle);
    align-items: center;
    text-decoration: none;
}

.link-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tint-1);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.link-meta {
    min-width: 0;
}

.link-title {
    margin: 0;
    font-weight: 700;
    font-size: 14.5px;
    color: rgba(15, 23, 42, .86);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: rgba(15, 23, 42, .60);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
    transition: .15s ease;
}

/* Image(s) like Craft export: rounded, subtle border */
figure {
    margin: 16px 0 0;
}

.img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    display: block;
    background: var(--surface-4);
}

figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

/* Image grid (like your screenshot bottom row) */
.img-grid {
    /* margin-top: 16px; */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-width: 100%;
}

@media (min-width:720px) {
    .img-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 840px) {
    .img-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* .img-grid a {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    background: var(--surface-3a);
} */
/* Tile container */
.img-grid figure {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    background: var(--surface-3a);

    /* Optional: gives nice consistent row height */
    min-height: 180px;
}

/* .img-grid img {
    width: 100%;
    height: auto;
    display: block;
} */

/* Image: FIT, don't crop, keep proportions */
.img-grid img {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* PDF embed block */
.pdf {
    margin-top: 16px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    background: var(--surface-4);
}

.pdf .pdf-bar {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border-tint);
}

.pdf .pdf-name {
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(15, 23, 42, .74);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf object,
.pdf iframe {
    width: 100%;
    height: 520px;
    display: block;
    border: 0;
    background: var(--embed-bg);
}

@media (max-width: 720px) {

    .pdf object,
    .pdf iframe {
        height: 220px;
    }
}

/* Small “comment input” line like Craft exports sometimes show */
.comment-line {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-4);
    font-size: 14px;
}

.comment-dot {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, .05);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 12px;
}

/* Footer spacing */
.spacer {
    height: 10px;
}
















/* Horizontal scroller holding the columns */
/* .pages {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px 18px;
} */

.pages {
    height: 100dvh;
    overflow-x: auto;
    overflow-y: visible;
    /* important: don’t let .pages become a vertical scroller */

    display: flex;
    gap: 0px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    /* prevent “stretch” vibes */
}

/* Each page column */
/* .page {
    flex: 0 0 auto;
    width: min(720px, calc(100vw - 56px));
    scroll-snap-align: start;
} */

.page {
    flex: 0 0 auto;
    width: min(720px, calc(100dvw - 0px));
    height: 100%;
    /* fill .pages height */
    padding: 20px;
    overflow-y: auto;
    /* ✅ the page scrolls */
    overscroll-behavior: contain;
    scroll-snap-align: start;
}

/* Independent vertical scrolling inside each page */
.card {
    height: auto;
    margin-bottom: 20px;
    /* overflow: hidden; */
}

.page .content {
    height: auto;
    /*100dvh*/
    overflow-y: auto;
    /* padding: 44px; */
}

/* @media (max-width: 720px) {
    .page .content {
        padding: 22px;
    }
} */

/* Child header (breadcrumb + close) */
.child-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 10px;
}

.breadcrumb .sep {
    opacity: .55;
    padding: 0 6px;
}

.child-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface-3a);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.child-close:hover {
    background: var(--surface-hover);
}

/* Page block link styling (Craft-ish) */
.page-block {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: 0 10px 26px var(--border-subtle);
    text-decoration: none;
    color: inherit;
}

.page-block:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
    transition: .15s ease;
}

.page-block__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tint-1);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.page-block__meta {
    min-width: 0;
    flex: 1;
}

.page-block__title {
    font-weight: 700;
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-block__desc {
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-block__chev {
    color: rgba(15, 23, 42, .45);
    font-size: 20px;
    line-height: 1;
}

/* Empty child state */
.child-empty {
    padding: 8px 0;
}

.pages:has(.page[data-role="child"]) {
    justify-content: flex-start;
}

.pages {
    justify-content: center;
    /* centers parent when alone */
}




.cardly-achievements-details {
    position: relative;
    /* margin-left: 18px; */
    /* indentation */
}

/* vertical line
.cardly-achievements-details::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 0.4em;
    bottom: 0.4em;
    width: 2px;
    background: rgba(140, 140, 140, 0.35);
    border-radius: 2px;
    cursor: pointer;
} */

/* summary styling */
.cardly-achievements-summary {
    cursor: pointer;
    font-weight: normal;
    list-style: none;
}

/* remove default triangle */
.cardly-achievements-summary::-webkit-details-marker {
    display: none;
}

/* custom arrow */
.cardly-achievements-summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 8px;
    transition: transform .18s ease;
}

/* rotate arrow when open */
.cardly-achievements-details[open]>.cardly-achievements-summary::before {
    transform: rotate(90deg);
}

/* content indentation
.cardly-achievements-content {
    margin-top: 8px;
    padding-left: 2px;
}*/

footer {
    font-size: small;
    font-weight: lighter;
    align-items: center;
    /* content: "Made by Daniel Gehrman • © 2026 Cardly • Cardly™ is a product name."; */
}

.mobile-break {
    display: none;
}

@media (max-width: 640px) {
    .mobile-break {
        display: block;
    }
}

mark {
    color: var(--text);
}