/* Stack-showcase homepage and bundle review (ShowcaseOptions). Loaded only under the ioflex preset.
   The page is one vertical section through the stack on Ink, so the accent is Royal Bright throughout. */

/* The showcase page is dark end to end, so the shell's light-preset browser surfaces flip to the
   dark world here: Royal Bright selection and focus, Slate on Ink scrollbar. */
.theme-ioflex:has(.stack-home) {
    scrollbar-color: var(--io-slate) var(--io-ink);
}

.theme-ioflex:has(.stack-home) ::selection {
    background: var(--io-royal-bright);
    color: var(--io-ink);
}

.theme-ioflex:has(.stack-home) :focus-visible {
    outline-color: var(--io-royal-bright);
}

.theme-ioflex .stack-home {
    --sh-pad: clamp(20px, 4vw, 56px);
    --sh-max: 1320px;
    --sh-rule: rgb(206 201 217 / 0.14);
    --sh-rule-strong: rgb(206 201 217 / 0.32);
    background: var(--io-ink);
    color: var(--io-bone);
    font-family: var(--pv-font-body);
}

.theme-ioflex .stack-home ::selection {
    background: var(--io-royal-bright);
    color: var(--io-ink);
}

.theme-ioflex .stack-home :focus-visible {
    outline: 2px solid var(--io-royal-bright);
    outline-offset: 3px;
}

.theme-ioflex .stack-home h1[tabindex="-1"]:focus { outline: none; }

.theme-ioflex .stack-home h1,
.theme-ioflex .stack-home h2 {
    font-family: var(--pv-font-heading);
    font-weight: 700;
    color: var(--io-bone);
    margin: 0;
    text-wrap: balance;
}

.theme-ioflex .stack-home p {
    margin: 0;
}

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

/* ── Buttons ── */
.theme-ioflex .io-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: 600 0.95rem/1 var(--pv-font-body);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-ioflex .io-btn-sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.875rem;
}

.theme-ioflex .io-btn-primary {
    background: var(--io-royal-bright);
    color: var(--io-ink);
}

.theme-ioflex .io-btn-primary:hover {
    background: color-mix(in srgb, var(--io-royal-bright) 82%, var(--io-bone));
}

.theme-ioflex .io-btn-quiet {
    border-color: var(--sh-rule-strong, rgb(206 201 217 / 0.32));
    color: var(--io-bone);
}

.theme-ioflex .io-btn-quiet:hover {
    border-color: var(--io-royal-bright);
}

.theme-ioflex .io-btn.is-disabled {
    background: transparent;
    border-color: var(--sh-rule-strong);
    color: var(--io-mist);
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Head ── */
.theme-ioflex .stack-head {
    max-width: var(--sh-max);
    margin: 0 auto;
    padding: clamp(36px, 5vh, 64px) var(--sh-pad) clamp(28px, 4vh, 44px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 64px;
    row-gap: 28px;
    align-items: end;
}

.theme-ioflex .stack-title {
    font-size: clamp(2.5rem, 5.2vw, 4.75rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    grid-row: span 2;
}

.theme-ioflex .stack-lede {
    color: var(--io-mist);
    font-size: 1.0625rem;
    line-height: 1.6;
    max-width: 56ch;
}

.theme-ioflex .stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Strata: one band per layer, getting deeper toward the metal ── */
.theme-ioflex .strata {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--sh-rule-strong);
}

.theme-ioflex .stratum {
    --depth: 0;
    background: color-mix(in srgb, var(--io-graphite) calc(100% - var(--depth) * 20%), var(--io-ink));
    border-bottom: 1px solid var(--sh-rule);
    animation: stratum-settle 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc((5 - var(--depth)) * 70ms);
}

.theme-ioflex .stratum:nth-child(2) { --depth: 1; }
.theme-ioflex .stratum:nth-child(3) { --depth: 2; }
.theme-ioflex .stratum:nth-child(4) { --depth: 3; }
.theme-ioflex .stratum:nth-child(5) { --depth: 4; }
.theme-ioflex .stratum:nth-child(n+6) { --depth: 5; }

@keyframes stratum-settle {
    from { transform: translateY(14px); }
    to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-ioflex .stratum { animation: none; }
}

.theme-ioflex .stratum-row {
    max-width: var(--sh-max);
    margin: 0 auto;
    padding: 16px var(--sh-pad);
    display: grid;
    grid-template-columns: 170px minmax(0, 0.75fr) minmax(0, 1.75fr);
    gap: 32px;
    align-items: center;
}

.theme-ioflex .stratum-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    background: none;
    border: 0;
    color: var(--io-bone);
    font: 700 1.125rem/1.2 var(--pv-font-heading);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    justify-self: start;
    justify-content: flex-start;
    cursor: pointer;
}

.theme-ioflex .stratum-name:hover { color: var(--io-royal-bright); }

.theme-ioflex .stratum-caret {
    width: 16px;
    height: 16px;
    color: var(--io-mist);
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-ioflex .stratum.is-open .stratum-caret { transform: rotate(180deg); }

.theme-ioflex .stratum-runs {
    color: var(--io-mist);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ── Offerings: the bundle controls, in the band they belong to ── */
.theme-ioflex .offers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-ioflex .offer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--sh-rule-strong);
    background: rgb(13 11 20 / 0.35);
    color: var(--io-bone);
    font: 500 0.875rem/1.2 var(--pv-font-body);
    cursor: pointer;
    transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), color 160ms;
}

.theme-ioflex .offer:hover {
    border-color: var(--io-royal-bright);
    background: rgb(155 109 255 / 0.1);
}

.theme-ioflex .offer-price {
    font-family: var(--pv-font-data);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    color: var(--io-mist);
}

.theme-ioflex .offer-mark {
    width: 14px;
    height: 14px;
    color: var(--io-royal-bright);
}

.theme-ioflex .offer.is-added {
    background: var(--io-royal-bright);
    border-color: var(--io-royal-bright);
    color: var(--io-ink);
}

.theme-ioflex .offer.is-added .offer-price,
.theme-ioflex .offer.is-added .offer-mark { color: var(--io-ink); }

.theme-ioflex .offer:disabled {
    cursor: default;
    opacity: 0.7;
}

/* ── Metal: measured figures as section callouts ── */
.theme-ioflex .figures {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
}

.theme-ioflex .figure {
    display: flex;
    flex-direction: column-reverse;
}

.theme-ioflex .figure dd {
    margin: 0;
    font: 500 1.875rem/1.1 var(--pv-font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--io-bone);
}

.theme-ioflex .figures-source {
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--io-mist);
}

.theme-ioflex .figure dt {
    font-size: 0.8125rem;
    color: var(--io-mist);
}

/* ── Opened band ── */
.theme-ioflex .stratum-detail {
    max-width: var(--sh-max);
    margin: 0 auto;
    padding: 4px var(--sh-pad) 28px calc(var(--sh-pad) + 190px + 32px);
    display: grid;
    gap: 16px;
    color: var(--io-mist);
    line-height: 1.6;
}

.theme-ioflex .stratum-detail[hidden] { display: none; }

.theme-ioflex .stratum-detail > p { max-width: 68ch; }

.theme-ioflex .runs-here span { color: var(--io-bone); font-weight: 600; }

.theme-ioflex .offer-detail {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 32px;
}

.theme-ioflex .offer-detail dt { color: var(--io-bone); font-weight: 600; }
.theme-ioflex .offer-detail dt span { color: var(--io-mist); font-weight: 400; font-size: 0.8125rem; margin-left: 6px; }
.theme-ioflex .offer-detail dd { margin: 2px 0 0; font-size: 0.875rem; }

/* ── Bundle tally, docked to the bottom of the section ── */
.theme-ioflex .bundle-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px max(var(--sh-pad), calc((100% - var(--sh-max)) / 2 + var(--sh-pad)));
    background: rgb(13 11 20 / 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgb(155 109 255 / 0.45);
}

.theme-ioflex .bundle-empty,
.theme-ioflex .bundle-note {
    color: var(--io-mist);
    font-size: 0.875rem;
}

.theme-ioflex .bundle-sum {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.theme-ioflex .bundle-count { color: var(--io-bone); font-weight: 600; }

.theme-ioflex .bundle-total {
    font: 700 1.5rem/1 var(--pv-font-heading);
    font-variant-numeric: tabular-nums;
}

.theme-ioflex .bundle-total small { font-size: 0.875rem; color: var(--io-mist); margin-left: 2px; }

/* ── Story, people, clients, tailored ── */
.theme-ioflex .story,
.theme-ioflex .clients,
.theme-ioflex .tailored,
.theme-ioflex .checkout {
    max-width: var(--sh-max);
    margin: 0 auto;
    padding: clamp(64px, 9vh, 112px) var(--sh-pad);
}

.theme-ioflex .story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 32px 64px;
}

.theme-ioflex .story h2,
.theme-ioflex .clients h2,
.theme-ioflex .tailored h2 {
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
}

.theme-ioflex .story-body {
    display: grid;
    gap: 18px;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--io-mist);
    max-width: 66ch;
}

.theme-ioflex .story-body p:first-child { color: var(--io-bone); }

.theme-ioflex .people {
    grid-column: 1 / -1;
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    border-top: 1px solid var(--sh-rule-strong);
}

.theme-ioflex .person {
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 20px 24px 20px 0;
    border-bottom: 1px solid var(--sh-rule);
}

.theme-ioflex .person-name { font-weight: 600; font-size: 1.0625rem; }
.theme-ioflex .person-role { color: var(--io-mist); font-size: 0.9375rem; }

.theme-ioflex .sample-tag {
    justify-self: start;
    margin-top: 6px;
    padding: 2px 8px;
    border: 1px dashed var(--io-mist);
    border-radius: 6px;
    color: var(--io-mist);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.theme-ioflex .clients { border-top: 1px solid var(--sh-rule); }

.theme-ioflex .client-list {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0 32px;
}

.theme-ioflex .client-list li {
    display: grid;
    gap: 4px;
    padding: 20px 0;
    border-top: 1px solid var(--sh-rule-strong);
}

.theme-ioflex .client-name { font: 700 1.375rem/1.2 var(--pv-font-heading); }
.theme-ioflex .client-sector { color: var(--io-mist); font-size: 0.9375rem; }

.theme-ioflex .tailored {
    display: grid;
    gap: 20px;
    justify-items: start;
    background: var(--io-graphite);
    max-width: none;
    padding-inline: max(var(--sh-pad), calc((100% - var(--sh-max)) / 2 + var(--sh-pad)));
}

.theme-ioflex .tailored p {
    color: var(--io-mist);
    font-size: 1.0625rem;
    line-height: 1.6;
    max-width: 60ch;
}

/* ── Bundle review ── */
.theme-ioflex .checkout { display: grid; gap: 24px; min-height: 70vh; align-content: start; }

.theme-ioflex .bundle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.theme-ioflex .bundle-table th,
.theme-ioflex .bundle-table td {
    padding: 14px 16px 14px 0;
    border-bottom: 1px solid var(--sh-rule);
    text-align: left;
    vertical-align: top;
    color: var(--io-mist);
}

.theme-ioflex .bundle-table thead th {
    font-size: 0.8125rem;
    font-weight: 600;
    border-bottom-color: var(--sh-rule-strong);
}

.theme-ioflex .bundle-table tbody th { font-weight: 400; }
.theme-ioflex .bundle-table tbody th > span { display: block; }
.theme-ioflex .bundle-table tbody th > span + span { margin-top: 4px; }
.theme-ioflex .bundle-table thead .num { font-family: var(--pv-font-body); color: var(--io-mist); }
.theme-ioflex .bundle-table .offer-name { color: var(--io-bone); font-weight: 600; }
.theme-ioflex .bundle-summary { font-size: 0.875rem; }

.theme-ioflex .bundle-table .num {
    text-align: right;
    padding-right: 0;
    font-family: var(--pv-font-data);
    font-variant-numeric: tabular-nums;
    color: var(--io-bone);
}

.theme-ioflex .bundle-table tfoot th,
.theme-ioflex .bundle-table tfoot td {
    color: var(--io-bone);
    font-weight: 600;
    border-bottom: 0;
}

.theme-ioflex .bundle-table tfoot .num { font: 700 1.5rem/1 var(--pv-font-heading); }

.theme-ioflex .checkout-steps {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    gap: 8px;
    counter-reset: step;
}

.theme-ioflex .checkout-steps li {
    counter-increment: step;
    flex: 1;
    padding: 12px 0 0;
    border-top: 2px solid var(--sh-rule-strong);
    color: var(--io-mist);
    font-size: 0.875rem;
}

.theme-ioflex .checkout-steps li::before { content: counter(step) ". "; }

.theme-ioflex .checkout-steps li.is-current {
    border-top-color: var(--io-royal-bright);
    color: var(--io-bone);
    font-weight: 600;
}

.theme-ioflex .checkout-notice {
    padding: 16px 20px;
    border: 1px solid rgb(155 109 255 / 0.45);
    border-radius: 10px;
    background: rgb(155 109 255 / 0.08);
    color: var(--io-bone);
    max-width: 72ch;
}

/* ── Shell under the preset ── */
.theme-ioflex:has(.stack-home) .mud-main-content { background: var(--io-ink); }

.theme-ioflex .shell-footer {
    background: var(--io-ink);
    color: var(--io-mist);
    border-top: 1px solid rgb(206 201 217 / 0.14);
}

.theme-ioflex .shell-footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px clamp(20px, 4vw, 56px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
}

.theme-ioflex .shell-footer-brand {
    display: grid;
    gap: 10px;
    font-size: 0.875rem;
}

.theme-ioflex .shell-footer-brand img { display: block; height: 32px; width: auto; }

.theme-ioflex .shell-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.theme-ioflex .shell-footer a {
    color: var(--io-bone);
    font-size: 0.9375rem;
    text-decoration: none;
}

.theme-ioflex .shell-footer a:hover { color: var(--io-royal-bright); }

/* ── Narrow frames: bands stack, controls stay in their band ── */
@media (max-width: 960px) {
    .theme-ioflex .stack-head { grid-template-columns: 1fr; }
    .theme-ioflex .stack-title { grid-row: auto; }
    .theme-ioflex .stratum-row { grid-template-columns: 1fr; gap: 10px; padding-block: 18px; }
    .theme-ioflex .stratum-detail { padding-left: var(--sh-pad); }
    .theme-ioflex .story { grid-template-columns: 1fr; }
    .theme-ioflex .bundle-bar { flex-wrap: wrap; }
    .theme-ioflex .bundle-note { flex-basis: 100%; }
    .theme-ioflex .bundle-bar.is-empty { display: none; }
    .theme-ioflex .bundle-bar { padding-block: 10px; gap: 10px; }
    .theme-ioflex .stack-head { padding-top: 28px; padding-bottom: 24px; row-gap: 16px; }
    .theme-ioflex .stack-title { font-size: 2.25rem; }
    .theme-ioflex .stack-lede { font-size: 1rem; line-height: 1.5; }
    .theme-ioflex .figure dd { font-size: 1.5rem; }
}

/* Narrow checkout: the unit folds under the offering name so the total and the send action stay in reach. */
.theme-ioflex .bundle-table tbody th > .bundle-unit { display: none; }

@media (max-width: 600px) {
    .theme-ioflex .checkout { padding-top: 32px; gap: 18px; }
    .theme-ioflex .checkout .stack-title { font-size: 2.25rem; }
    .theme-ioflex .bundle-table thead { display: none; }
    .theme-ioflex .bundle-table .col-unit { display: none; }
    .theme-ioflex .bundle-table tbody th > .bundle-summary { display: none; }
    .theme-ioflex .bundle-table tbody th > .bundle-unit { display: block; font-size: 0.8125rem; }
    .theme-ioflex .bundle-table th,
    .theme-ioflex .bundle-table td { padding-block: 10px; }
}
