/* ============================================================
   Suite showcase — stylised screens of Rigid Logic Suite with sample data, drawn in HTML/CSS (index.html): the hero's
   picture and the Suite story, where the screen changes with the step being read (scripts/showcase.js).
   Inside a stage everything is sized in em and the em follows the panel's width (container query units), so a
   picture scales like an image and stays sharp. Cards stack like sheets; the one being pointed at carries the
   amber selection with its handles, as everywhere on the site. Bars stand in for data, like a wireframe.
   ============================================================ */

.showcase {
    container-type: inline-size;
}

.scene.showcase {
    aspect-ratio: 6 / 5;
    max-height: none;
}

/* the hero's picture is a little taller (46em) */
.hero .scene.showcase {
    aspect-ratio: 25 / 23;
}

/* the drawing: 50em wide, 41.67em tall */
.sc-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 11px;
    font-size: 2cqw;
    line-height: 1.3;
    color: var(--text);
}

.sc-stage svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sc-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 0.8em;
    box-shadow:
        0.55em 0.55em 0 -1px var(--surface-2),
        0.55em 0.55em 0 0 var(--line-2),
        0 1.6em 3em -1.6em rgba(15, 20, 25, 0.3);
}

/* what is pointed at: the amber selection with corner handles */
.sc-selected {
    z-index: 3;
    outline: 2px solid var(--accent);
    outline-offset: 0.4em;
}

.sc-selected::after {
    --sc-h: linear-gradient(var(--accent), var(--accent));
    content: '';
    position: absolute;
    inset: calc(-0.72em - 1px);
    pointer-events: none;
    background:
        var(--sc-h) left top / 0.64em 0.64em no-repeat,
        var(--sc-h) right top / 0.64em 0.64em no-repeat,
        var(--sc-h) left bottom / 0.64em 0.64em no-repeat,
        var(--sc-h) right bottom / 0.64em 0.64em no-repeat;
}

.sc-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72em;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.sc-title {
    display: block;
    margin-top: 0.2em;
    font-family: var(--font-display);
    font-size: 1.7em;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--slate);
}

.sc-bar {
    display: block;
    height: 0.6em;
    border-radius: 1em;
    background: var(--line);
}

.sc-bar.thin {
    height: 0.45em;
    background: var(--surface-2);
}

.sc-bar.strong {
    height: 0.85em;
    background: var(--line-2);
}

.sc-stage .w40 { width: 40%; }
.sc-stage .w45 { width: 45%; }
.sc-stage .w50 { width: 50%; }
.sc-stage .w55 { width: 55%; }
.sc-stage .w60 { width: 60%; }
.sc-stage .w65 { width: 65%; }
.sc-stage .w70 { width: 70%; }
.sc-stage .w75 { width: 75%; }
.sc-stage .w80 { width: 80%; }
.sc-stage .w85 { width: 85%; }
.sc-stage .w95 { width: 95%; }

/* a labelled box floating over the screen, like a fieldset */
.sc-field {
    position: absolute;
    z-index: 2;
    padding: 0.7em 1.1em 0.6em;
    border: 1.5px solid var(--slate-line);
    border-radius: 0.55em;
    background: var(--surface);
    white-space: nowrap;
    box-shadow: 0 0.9em 1.8em -1.1em rgba(15, 20, 25, 0.4);
}

.sc-legend {
    position: absolute;
    left: 0.8em;
    top: -0.55em;
    padding: 0 0.35em;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.74em;
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: var(--text-3);
}

.sc-val {
    font-size: 1.4em;
    font-weight: 500;
    color: var(--slate);
}

.sc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.62em 1em;
    border-radius: 0.45em;
    background: var(--slate);
    color: #fff;
    font-size: 0.76em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sc-btn b {
    font-size: 1.3em;
    line-height: 0.8;
}

.sc-btn.ghost {
    background: transparent;
    color: var(--slate);
    box-shadow: inset 0 0 0 1px var(--line-2);
}

/* ---------- 1. company suggestions (the hero) ---------- */
.sc-area {
    left: 2em;
    top: 3.4em;
    width: 28.5em;
    padding: 1.1em 1.3em 2em;
}

.sc-badge {
    position: absolute;
    top: -1.2em;
    right: 1.4em;
    display: flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.42em 0.8em;
    border-radius: 0.45em;
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 0.6em 1.2em -0.6em rgba(224, 148, 18, 0.75);
}

.sc-badge svg {
    width: 1.5em;
    height: 1.5em;
}

.sc-badge > span {
    display: flex;
    flex-direction: column;
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1.15;
}

.sc-badge small {
    font-size: 0.8em;
    font-weight: 500;
    opacity: 0.8;
}

.sc-meta {
    display: flex;
    gap: 1.3em;
    margin-top: 0.95em;
}

.sc-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45em;
    flex: 1;
    min-width: 0;
    color: var(--slate);
}

.sc-meta-item svg {
    width: 1.35em;
    height: 1.35em;
    flex: none;
}

.sc-meta-item > span {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 0.3em;
}

.sc-meta-item small {
    font-size: 0.72em;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}

.sc-meta-item b {
    font-size: 0.84em;
    font-weight: 700;
    white-space: nowrap;
}

.sc-sort {
    left: 16em;
    top: 11.9em;
}

.sc-table {
    left: 1em;
    top: 14.5em;
    width: 46.8em;
    padding-bottom: 0.5em;
    overflow: hidden;
}

.sc-thead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: 0.6em 1.1em 0;
}

.sc-tabs {
    display: flex;
    gap: 1.8em;
}

.sc-tabs span {
    position: relative;
    padding: 0.7em 0 0.9em;
    font-family: var(--font-mono);
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-3);
}

.sc-tabs .is-on {
    color: var(--slate);
}

.sc-tabs .is-on::after {
    content: '';
    position: absolute;
    left: -0.6em;
    right: -0.6em;
    bottom: 0;
    height: 0.28em;
    border-radius: 1em;
    background: var(--slate);
}

.sc-tools {
    display: flex;
    gap: 0.6em;
    padding: 0.7em 1.1em;
    border-top: 1px solid var(--line);
}

.sc-input {
    flex: 1;
    min-width: 0;
    padding: 0.42em 0.7em;
    border: 1px solid var(--line-2);
    border-radius: 0.35em;
    font-size: 0.76em;
    white-space: nowrap;
    overflow: hidden;
    color: var(--text-3);
}

.sc-input:first-child {
    flex: 2;
}

.sc-tr {
    display: grid;
    grid-template-columns: 1em 1.5fr 1fr 2.3fr 1.3fr 0.55fr 1.35fr;
    align-items: center;
    gap: 0.9em;
    padding: 0.62em 1.1em;
    border-top: 1px solid var(--line);
}

.sc-th {
    padding-top: 0.55em;
    padding-bottom: 0.55em;
}

.sc-th > span {
    font-family: var(--font-mono);
    font-size: 0.64em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-3);
}

.sc-box {
    width: 1em;
    height: 1em;
    border: 1.5px solid var(--line-2);
    border-radius: 0.22em;
}

.sc-chips {
    display: flex;
    gap: 0.3em;
    min-width: 0;
    overflow: hidden;
}

.sc-chips em {
    padding: 0.2em 0.55em;
    border: 1px solid var(--line);
    border-radius: 1em;
    background: var(--surface-2);
    font-size: 0.66em;
    font-style: normal;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-fit {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.sc-fit i {
    display: block;
    height: 0.62em;
    border-radius: 1em;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.sc-fit .f92 { width: 64%; }
.sc-fit .f88 { width: 59%; }
.sc-fit .f81 { width: 53%; }
.sc-fit .f76 { width: 47%; }

.sc-fit b,
.sc-score {
    font-family: var(--font-mono);
    font-size: 0.74em;
    font-weight: 700;
    color: var(--text-2);
}

.sc-score.bad { color: var(--err); }
.sc-score.mid { color: var(--accent-text); }
.sc-score.good { color: var(--ok); }

.sc-status {
    justify-self: start;
    padding: 0.32em 0.7em;
    border-radius: 0.35em;
    font-size: 0.66em;
    font-weight: 700;
    white-space: nowrap;
}

.sc-status.new {
    background: var(--accent);
    color: var(--accent-ink);
}

.sc-status.crm {
    background: rgba(20, 147, 95, 0.14);
    color: var(--ok);
}

.sc-status.sent {
    background: var(--surface-2);
    color: var(--text-2);
    box-shadow: inset 0 0 0 1px var(--line-2);
}

.sc-search {
    left: 3.6em;
    top: 33.1em;
}

.sc-donut {
    left: 28.6em;
    top: 33.9em;
    width: 19.4em;
    padding: 0.9em 1.1em 1em;
}

.sc-donut-row {
    display: flex;
    align-items: center;
    gap: 1.1em;
    margin-top: 0.55em;
}

.sc-ring {
    position: relative;
    flex: none;
    width: 7.4em;
    height: 7.4em;
}

.sc-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sc-ring circle {
    stroke-width: 13;
}

.sc-ring .trk {
    stroke: var(--surface-2);
}

.sc-ring .val {
    stroke: var(--slate);
    stroke-linecap: butt;
    stroke-dasharray: var(--v) 100;
}

.sc-ring .v45 { --v: 45; }
.sc-ring .v38 { --v: 38; stroke: var(--err); }

.sc-ring > span {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
}

.sc-ring b {
    font-family: var(--font-display);
    font-size: 1.75em;
    font-weight: 800;
    color: var(--slate);
}

.sc-ring small {
    margin-top: 0.2em;
    font-size: 0.64em;
    color: var(--text-3);
}

.sc-donut dl {
    display: grid;
    gap: 0.75em;
}

.sc-donut dt,
.sc-metrics small {
    font-size: 0.72em;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-donut dd,
.sc-metrics b {
    font-family: var(--font-display);
    font-size: 1.45em;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    color: var(--slate);
}

/* ---------- 2. site and brand analysis ---------- */
.sc-report {
    left: 1.8em;
    top: 3.4em;
    width: 30.6em;
    padding: 1.1em 1.3em 1.3em;
}

.sc-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sc-pill {
    padding: 0.25em 0.75em;
    border: 1px solid var(--line-2);
    border-radius: 1em;
    background: var(--surface-2);
    font-size: 0.68em;
    font-weight: 600;
    color: var(--text-2);
}

.sc-report .strong {
    margin-top: 0.8em;
}

.sc-report-body {
    display: flex;
    align-items: center;
    gap: 1.3em;
    margin-top: 1.1em;
}

.sc-report .sc-ring {
    width: 7em;
    height: 7em;
}

.sc-scores {
    display: grid;
    flex: 1;
    gap: 0.75em;
    list-style: none;
}

.sc-scores li {
    display: grid;
    grid-template-columns: 7.4em 1fr 1.7em;
    align-items: center;
    gap: 0.6em;
}

.sc-scores span {
    font-size: 0.74em;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-meter {
    display: block;
    height: 0.55em;
    border-radius: 1em;
    background: var(--surface-2);
    overflow: hidden;
}

.sc-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.sc-meter .m72 { width: 72%; }
.sc-meter .m81 { width: 81%; background: var(--ok); }
.sc-meter .m67 { width: 67%; }

.sc-scores b {
    font-family: var(--font-mono);
    font-size: 0.76em;
    text-align: right;
}

.sc-issues {
    display: grid;
    gap: 0.6em;
    margin-top: 1.1em;
    padding-top: 1em;
    border-top: 1px solid var(--line);
    list-style: none;
}

.sc-issues li {
    display: flex;
    align-items: center;
    gap: 0.55em;
    font-size: 0.8em;
    white-space: nowrap;
}

.sc-issues svg {
    width: 1.35em;
    height: 1.35em;
    flex: none;
    color: var(--err);
}

.sc-actions {
    display: flex;
    gap: 0.6em;
    margin-top: 1.2em;
}

.sc-why {
    left: 30.4em;
    top: 6.4em;
}

.sc-brand {
    left: 24.6em;
    top: 23.4em;
    width: 23.6em;
    padding: 1em 1.2em 1.15em;
}

.sc-quote {
    display: grid;
    gap: 0.55em;
    margin: 0.85em 0 0.95em;
    padding-left: 0.8em;
    border-left: 0.22em solid var(--accent);
}

.sc-opps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
}

.sc-opps small {
    margin-right: 0.2em;
    font-size: 0.7em;
    font-weight: 600;
    color: var(--text-2);
}

.sc-opps em {
    padding: 0.25em 0.7em;
    border-radius: 1em;
    background: var(--accent-soft);
    font-size: 0.72em;
    font-style: normal;
    font-weight: 600;
    color: var(--accent-text);
}

/* ---------- 3. sales pipeline and earnings ---------- */
.sc-metrics {
    left: 1.4em;
    top: 3.4em;
    width: 46.8em;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 1em 0.4em;
}

.sc-metrics > div {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    padding: 0.1em 1em;
    border-left: 1px solid var(--line);
}

.sc-metrics > div:first-child {
    border-left: 0;
}

.sc-metrics .is-hi b {
    color: var(--accent-text);
}

.sc-board {
    left: 14.4em;
    top: 11.8em;
    width: 33.6em;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8em;
    padding: 0.9em;
}

.sc-col {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    min-width: 0;
}

.sc-col-head {
    display: flex;
    align-items: center;
    gap: 0.45em;
    padding-bottom: 0.15em;
}

.sc-chip {
    padding: 0.22em 0.65em;
    border-radius: 1em;
    background: var(--surface-2);
    font-size: 0.7em;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-col.is-won .sc-chip {
    background: rgba(20, 147, 95, 0.14);
    color: var(--ok);
}

.sc-col-head .n {
    font-size: 0.7em;
    color: var(--text-3);
}

.sc-col-head small {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.66em;
    white-space: nowrap;
    color: var(--text-3);
}

.sc-deal {
    position: relative;
    display: grid;
    gap: 0.45em;
    padding: 0.7em 0.75em;
    border: 1px solid var(--line);
    border-radius: 0.5em;
    background: var(--surface);
}

.sc-col.is-won .sc-deal {
    border-color: rgba(20, 147, 95, 0.35);
}

.sc-deal b {
    font-family: var(--font-mono);
    font-size: 0.8em;
    font-weight: 700;
    color: var(--slate);
}

.sc-av {
    position: absolute;
    right: 0.65em;
    bottom: 0.6em;
    width: 1.3em;
    height: 1.3em;
    border-radius: 50%;
    background: var(--line-2);
}

.sc-av.a1 { background: #f5c46b; }
.sc-av.a2 { background: #8fb3a1; }
.sc-av.a3 { background: #9aa9bd; }

.sc-more {
    padding: 0.35em;
    border: 1px dashed var(--line-2);
    border-radius: 0.5em;
    font-size: 0.72em;
    text-align: center;
    color: var(--text-3);
}

.sc-stage-pick {
    left: 34.6em;
    top: 35.4em;
}

.sc-chart {
    left: 1.4em;
    top: 21.4em;
    width: 18.8em;
    padding: 0.9em 1.1em 0.6em;
}

.sc-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.7em;
    height: 10em;
    margin: 0.4em 0 1.6em;
    padding-top: 1.8em;
}

.sc-bars span {
    position: relative;
    flex: 1;
    height: var(--bh);
    border-radius: 0.3em 0.3em 0 0;
    background: var(--line-2);
    transform-origin: bottom;
}

/* six months, oldest first: height and the order they grow in */
.sc-bars .b1 { --bh: 44%; --i: 0; }
.sc-bars .b2 { --bh: 57%; --i: 1; }
.sc-bars .b3 { --bh: 51%; --i: 2; }
.sc-bars .b4 { --bh: 69%; --i: 3; }
.sc-bars .b5 { --bh: 78%; --i: 4; }
.sc-bars .b6 { --bh: 100%; --i: 5; }

.sc-bars .is-hi {
    background: linear-gradient(var(--accent), var(--accent-2));
}

.sc-bars small {
    position: absolute;
    left: 50%;
    bottom: -2.3em;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.62em;
    color: var(--text-3);
}

.sc-bars b {
    position: absolute;
    left: 50%;
    top: -1.9em;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.66em;
    white-space: nowrap;
    color: var(--accent-text);
}

/* a narrow panel has no room for the corner labels next to the cards */
@container (max-width: 520px) {
    .showcase .scene-label {
        display: none;
    }
}

/* ---------- small parts the story screens share ---------- */
.sc-logo {
    width: 2.6em;
    height: 2.6em;
    flex: none;
    border-radius: 0.55em;
    background: #f1d9a6;
}

.sc-logo.l2 { background: #c7dccf; }
.sc-logo.l3 { background: #cfd7e5; }

/* a person: initials on a colour */
.sc-face {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.1em;
    height: 2.1em;
    border-radius: 50%;
    font-size: 0.6em;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: #b97f17;
}

.sc-face.a2 { background: #3f7d63; }
.sc-face.a3 { background: #5b6b85; }
.sc-face.a4 { background: #9b5c7a; }

/* ---------- story 1: company suggestions ---------- */
.sc-list {
    left: 1.6em;
    top: 3.4em;
    width: 29.6em;
    padding: 1.1em 1.2em 0.4em;
}

.sc-list .sc-title,
.sc-project .sc-title {
    font-size: 1.45em;
}

.sc-lead {
    display: grid;
    grid-template-columns: 2.6em minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85em;
    padding: 0.85em 0;
    border-top: 1px solid var(--line);
}

.sc-list .sc-title + .sc-lead {
    margin-top: 0.8em;
}

.sc-lead-main {
    display: grid;
    gap: 0.4em;
    min-width: 0;
}

.sc-why {
    font-size: 0.74em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-2);
}

.sc-tags {
    display: flex;
    gap: 0.3em;
}

.sc-tags em {
    padding: 0.15em 0.55em;
    border-radius: 1em;
    background: var(--accent-soft);
    font-size: 0.66em;
    font-style: normal;
    font-weight: 600;
    color: var(--accent-text);
}

.sc-fitpill {
    padding: 0.3em 0.55em;
    border-radius: 0.4em;
    background: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8em;
    font-weight: 700;
    color: var(--accent-ink);
}

.sc-areas {
    left: 31.6em;
    top: 8.8em;
    width: 16.8em;
    padding: 1em 1.1em 1.05em;
}

.sc-area-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.75em;
}

.sc-area-row svg {
    width: 1.3em;
    height: 1.3em;
    flex: none;
    color: var(--accent-2);
}

.sc-area-row span {
    flex: 1;
    min-width: 0;
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-area-row small {
    font-size: 0.66em;
    color: var(--text-3);
}

.sc-sector {
    left: 3.4em;
    top: 33.4em;
}

.sc-toast {
    left: 30.6em;
    top: 29.6em;
    width: 17.8em;
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.85em 1em;
}

.sc-toast svg,
.sc-notif > svg {
    width: 2em;
    height: 2em;
    flex: none;
    color: var(--ok);
}

.sc-toast b,
.sc-notif b {
    display: block;
    font-size: 0.84em;
}

.sc-toast small,
.sc-notif small {
    font-size: 0.7em;
    color: var(--text-3);
}

/* ---------- story 3: a CRM card ---------- */
.sc-contact {
    left: 1.6em;
    top: 3.4em;
    width: 30.6em;
    padding: 1.1em 1.3em 1.2em;
}

.sc-contact-head {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.sc-contact-head > div {
    display: grid;
    flex: 1;
    gap: 0.45em;
}

.sc-track {
    display: flex;
    gap: 0.3em;
    margin-top: 1em;
}

.sc-track span {
    flex: 1;
    padding: 0.42em 0;
    border-radius: 0.35em;
    background: var(--surface-2);
    font-size: 0.7em;
    font-weight: 700;
    text-align: center;
    color: var(--text-3);
}

.sc-track .done {
    background: rgba(20, 147, 95, 0.12);
    color: var(--ok);
}

.sc-track .is-on {
    background: var(--accent);
    color: var(--accent-ink);
}

.sc-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85em 1.2em;
    margin-top: 1.05em;
}

.sc-fields dt {
    font-family: var(--font-mono);
    font-size: 0.62em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.sc-fields dd {
    display: flex;
    align-items: center;
    gap: 0.45em;
    min-height: 1.3em;
    margin-top: 0.3em;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.sc-fields dd .sc-bar {
    flex: 1;
}

.sc-deals {
    display: grid;
    gap: 0.55em;
    margin-top: 1.05em;
    padding-top: 0.9em;
    border-top: 1px solid var(--line);
}

.sc-deal-row {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 0.8em;
    font-weight: 600;
}

.sc-deal-row b {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--slate);
}

.sc-template {
    left: 29.4em;
    top: 5.6em;
}

.sc-mail {
    left: 25.6em;
    top: 23.4em;
    width: 22.6em;
    padding: 1em 1.1em 1.1em;
}

.sc-mail-line {
    display: grid;
    grid-template-columns: 4.6em minmax(0, 1fr);
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.78em;
    white-space: nowrap;
}

.sc-mail-line small {
    color: var(--text-3);
}

.sc-mail .sc-quote {
    margin-bottom: 0.4em;
}

.sc-mail-foot {
    display: flex;
    justify-content: flex-end;
}

.sc-btn svg {
    width: 1.25em;
    height: 1.25em;
}

/* ---------- story 5: a project board and the week ---------- */
.sc-project {
    left: 1.4em;
    top: 3.4em;
    width: 34.4em;
    padding: 1em 1.1em 0.6em;
}

.sc-project-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1em;
}

.sc-progress {
    display: grid;
    justify-items: end;
    gap: 0.35em;
}

.sc-progress small {
    font-size: 0.7em;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-progress .sc-meter {
    width: 8em;
}

.sc-meter .m58 { width: 58%; background: var(--ok); }

.sc-lanes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7em;
    margin-top: 0.9em;
}

.sc-lane-head {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin-bottom: 0.55em;
    font-size: 0.7em;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-lane-head svg {
    width: 1.3em;
    height: 1.3em;
    color: var(--text-3);
}

.sc-lane-head.is-prog svg { color: var(--accent-2); }
.sc-lane-head.is-done svg { color: var(--ok); }

.sc-task {
    display: grid;
    gap: 0.45em;
    margin-bottom: 0.55em;
    padding: 0.65em 0.7em;
    border: 1px solid var(--line);
    border-radius: 0.5em;
    background: var(--surface);
}

.sc-task code {
    font-family: var(--font-mono);
    font-size: 0.62em;
    color: var(--text-3);
}

.sc-task.done code {
    text-decoration: line-through;
}

.sc-task.done .sc-bar {
    background: var(--surface-2);
}

.sc-task-meta {
    display: flex;
    align-items: center;
    gap: 0.45em;
}

.sc-task-meta em {
    padding: 0.12em 0.45em;
    border-radius: 0.3em;
    background: var(--surface-2);
    font-size: 0.62em;
    font-style: normal;
    font-weight: 600;
    color: var(--text-2);
}

.sc-task-meta .sc-face {
    margin-left: auto;
}

/* priority: three bars, filled by level */
.sc-prio {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.14em;
    height: 0.8em;
}

.sc-prio i {
    display: block;
    width: 0.2em;
    border-radius: 0.1em;
    background: var(--line-2);
}

.sc-prio i:nth-child(1) { height: 40%; }
.sc-prio i:nth-child(2) { height: 70%; }
.sc-prio i:nth-child(3) { height: 100%; }
.sc-prio.p1 i:nth-child(-n+1),
.sc-prio.p2 i:nth-child(-n+2),
.sc-prio.p3 i:nth-child(-n+3) { background: var(--slate); }

.sc-team {
    left: 3.2em;
    top: 33.6em;
}

.sc-week {
    left: 28.8em;
    top: 22.6em;
    width: 19.4em;
    padding: 0.9em 1em 1em;
}

.sc-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35em;
    height: 9em;
    margin-top: 0.7em;
}

.sc-day {
    position: relative;
    border-radius: 0.35em;
    background: var(--surface-2);
}

.sc-day small {
    position: absolute;
    top: 0.5em;
    left: 0;
    right: 0;
    font-family: var(--font-mono);
    font-size: 0.6em;
    text-align: center;
    color: var(--text-3);
}

.sc-ev {
    position: absolute;
    left: 0.22em;
    right: 0.22em;
    padding: 0.35em 0.3em;
    border-radius: 0.3em;
    font-size: 0.56em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.sc-ev.e1 { top: 30%; height: 26%; background: var(--accent); color: var(--accent-ink); }
.sc-ev.e2 { top: 56%; height: 22%; background: var(--slate); color: #fff; }
.sc-ev.e3 { top: 42%; height: 30%; background: rgba(20, 147, 95, 0.16); color: var(--ok); }

/* ---------- story 6: messages, a mention, its notification ---------- */
.sc-chat {
    left: 1.4em;
    top: 3.4em;
    width: 26.4em;
    overflow: hidden;
}

.sc-chat-head {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.85em 1em;
    border-bottom: 1px solid var(--line);
}

.sc-chat-head .sc-face {
    font-size: 0.72em;
}

.sc-chat-head b {
    display: block;
    font-size: 0.86em;
}

.sc-chat-head small {
    display: block;
    font-size: 0.68em;
    color: var(--text-3);
}

.sc-online {
    width: 0.6em;
    height: 0.6em;
    margin-left: auto;
    border-radius: 50%;
    background: var(--ok);
}

.sc-thread {
    display: flex;
    flex-direction: column;
    gap: 0.45em;
    padding: 0.9em 1em;
}

.sc-msg {
    max-width: 80%;
    padding: 0.5em 0.75em;
    border-radius: 0.8em;
    font-size: 0.76em;
    line-height: 1.35;
}

.sc-msg.in {
    align-self: flex-start;
    border-bottom-left-radius: 0.25em;
    background: var(--surface-2);
}

.sc-msg.out {
    align-self: flex-end;
    border-bottom-right-radius: 0.25em;
    background: var(--slate);
    color: #fff;
}

.sc-msg .q {
    display: block;
    margin-bottom: 0.35em;
    padding: 0.3em 0.55em;
    border-left: 0.22em solid var(--accent);
    border-radius: 0.3em;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.9em;
}

.sc-msg .q b {
    display: block;
}

.sc-msg.file {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.sc-msg.file svg {
    width: 1.7em;
    height: 1.7em;
    flex: none;
}

.sc-msg.file small {
    display: block;
    font-size: 0.85em;
    opacity: 0.7;
}

.sc-composer {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.7em 1em;
    border-top: 1px solid var(--line);
}

.sc-composer > svg {
    width: 1.3em;
    height: 1.3em;
    flex: none;
    color: var(--text-3);
}

.sc-composer span {
    flex: 1;
    padding: 0.45em 0.7em;
    border: 1px solid var(--line-2);
    border-radius: 0.45em;
    font-size: 0.74em;
    color: var(--text-3);
}

.sc-composer i {
    display: grid;
    place-items: center;
    width: 2.1em;
    height: 2.1em;
    border-radius: 0.45em;
    background: var(--slate);
    color: #fff;
}

.sc-composer i svg {
    width: 1.1em;
    height: 1.1em;
}

.sc-comment {
    left: 25.4em;
    top: 19.4em;
    width: 22.8em;
    padding: 0.95em 1.1em 1em;
}

.sc-comment p {
    margin-top: 0.6em;
    font-size: 0.8em;
    line-height: 1.45;
}

.sc-comment .at {
    font-weight: 700;
    color: var(--accent-text);
}

.sc-caret {
    display: inline-block;
    width: 1px;
    height: 1.1em;
    margin-left: 1px;
    vertical-align: -0.2em;
    background: var(--text);
}

.sc-mentions {
    margin-top: 0.6em;
    padding: 0.3em;
    border: 1px solid var(--line-2);
    border-radius: 0.5em;
    box-shadow: 0 0.8em 1.6em -1em rgba(15, 20, 25, 0.35);
}

.sc-mentions div {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0.5em;
    border-radius: 0.35em;
    font-size: 0.76em;
}

.sc-mentions .is-on {
    background: var(--surface-2);
    font-weight: 600;
}

.sc-notif {
    left: 26.4em;
    top: 31.6em;
    width: 21.6em;
    display: flex;
    align-items: flex-start;
    gap: 0.7em;
    padding: 0.9em 1em;
}

.sc-notif > svg {
    color: var(--accent-2);
}

/* ---------- story 7: roles, two-step verification, your own brand ---------- */
.sc-roles {
    left: 1.4em;
    top: 3.4em;
    width: 30em;
    padding: 1em 1.2em 1.1em;
}

.sc-perm {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 0.55em 0.6em;
    margin-top: 0.9em;
}

.sc-perm > span {
    font-size: 0.76em;
    font-weight: 600;
}

.sc-perm > b {
    padding: 0.25em 0;
    border-radius: 1em;
    background: var(--surface-2);
    font-size: 0.66em;
    text-align: center;
    white-space: nowrap;
    color: var(--text-2);
}

.sc-perm svg,
.sc-perm-legend svg {
    width: 1.3em;
    height: 1.3em;
    justify-self: center;
}

.sc-stage .yes { color: var(--ok); }
.sc-stage .view { color: var(--accent-2); }
.sc-stage .no { color: var(--line-2); }

.sc-perm-legend {
    display: flex;
    gap: 1.1em;
    margin-top: 0.95em;
    padding-top: 0.85em;
    border-top: 1px solid var(--line);
}

.sc-perm-legend span {
    display: flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.68em;
    color: var(--text-2);
}

.sc-2fa {
    left: 31.6em;
    top: 6.2em;
    width: 16.8em;
    padding: 1em 1.1em;
}

.sc-2fa-row {
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.sc-2fa-row svg {
    width: 1.9em;
    height: 1.9em;
    flex: none;
    color: var(--ok);
}

.sc-2fa-row b {
    font-size: 0.8em;
    line-height: 1.2;
}

.sc-switch {
    position: relative;
    flex: none;
    width: 2.4em;
    height: 1.35em;
    margin-left: auto;
    border-radius: 1em;
    background: var(--ok);
}

.sc-switch::after {
    content: '';
    position: absolute;
    top: 0.18em;
    right: 0.18em;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background: #fff;
}

.sc-2fa small {
    display: block;
    margin-top: 0.65em;
    font-size: 0.68em;
    color: var(--text-3);
}

.sc-role-pick {
    left: 3.2em;
    top: 33.4em;
}

.sc-white {
    left: 24.8em;
    top: 21.4em;
    width: 23.2em;
    padding: 1em 1.1em 1.05em;
}

.sc-mini-login {
    display: grid;
    justify-items: center;
    gap: 0.55em;
    margin-top: 0.7em;
    padding: 1em;
    border: 1px solid var(--line);
    border-radius: 0.6em;
    background: var(--bg-2);
}

.sc-mini-login .logo {
    width: 2.4em;
    height: 2.4em;
    border-radius: 0.55em;
    background: #0f766e;
}

.sc-mini-login .inp {
    width: 100%;
    height: 1.6em;
    border: 1px solid var(--line-2);
    border-radius: 0.35em;
    background: var(--surface);
}

.sc-mini-login .go {
    width: 100%;
    padding: 0.45em;
    border-radius: 0.35em;
    background: #0f766e;
    font-size: 0.72em;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.sc-white p {
    margin-top: 0.7em;
    font-size: 0.8em;
    font-weight: 600;
}

/* ---------- the story: steps and their screens ----------
   By default (phones, or no script) each step is followed by its screen: the step and screen lists are "display:
   contents", so their items line up in one column, put in order below. On a wide screen with the script running
   (.story-js) the steps scroll by on the left while the screens share one sticky frame on the right. */
.story-grid {
    display: flex;
    flex-direction: column;
    margin-top: 40px;
}

.story-steps,
.story-stage,
.story-screens {
    display: contents;
}

.story-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 44px 0 22px;
}

.story-step:first-child {
    padding-top: 8px;
}

.story-step:nth-child(1) { order: 1; }
.story-screen:nth-child(1) { order: 2; }
.story-step:nth-child(2) { order: 3; }
.story-screen:nth-child(2) { order: 4; }
.story-step:nth-child(3) { order: 5; }
.story-screen:nth-child(3) { order: 6; }
.story-step:nth-child(4) { order: 7; }
.story-screen:nth-child(4) { order: 8; }
.story-step:nth-child(5) { order: 9; }
.story-screen:nth-child(5) { order: 10; }
.story-step:nth-child(6) { order: 11; }
.story-screen:nth-child(6) { order: 12; }
.story-step:nth-child(7) { order: 13; }
.story-screen:nth-child(7) { order: 14; }

.story-kicker {
    position: relative;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.story-step h3 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.3vw, 1.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.story-step p {
    max-width: 34rem;
    color: var(--text-2);
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.story-tags li {
    padding: 3px 10px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text-2);
}

.story-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-top: 64px;
    padding: 26px 30px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--bg-2);
}

.story-cta p {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
}

@media (min-width: 960px) {
    .story-js .story-grid {
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 64px;
        align-items: start;
    }

    /* the steps hang on a rail that fills as you read */
    .story-js .story-steps {
        display: block;
        position: relative;
        padding-left: 30px;
    }

    .story-js .story-steps::before,
    .story-js .story-steps::after {
        content: '';
        position: absolute;
        left: 3px;
        top: 0;
        width: 1px;
    }

    .story-js .story-steps::before {
        bottom: 0;
        background: var(--line-2);
    }

    .story-js .story-steps::after {
        height: calc(var(--story-progress, 0) * 100%);
        background: var(--accent-2);
    }

    .story-js .story-step {
        min-height: 62vh;
        justify-content: center;
        padding: 0;
        opacity: 0.35;
        transition: opacity 0.4s var(--ease);
    }

    .story-js .story-step.is-on {
        opacity: 1;
    }

    .story-js .story-kicker::before {
        content: '';
        position: absolute;
        left: -30px;
        top: 50%;
        width: 7px;
        height: 7px;
        margin-top: -4px;
        border: 1px solid var(--line-2);
        background: var(--bg);
        transition: background-color 0.3s, border-color 0.3s;
    }

    .story-js .story-step.is-on .story-kicker::before {
        border-color: var(--accent-2);
        background: var(--accent);
    }

    .story-js .story-stage {
        display: block;
        position: sticky;
        top: calc(var(--nav-h) + 7vh);
    }

    .story-js .story-screens {
        display: block;
        position: relative;
        aspect-ratio: 6 / 5;
    }

    /* one frame: the screen being read comes up, the one before it leaves upwards */
    .story-js .story-screen {
        position: absolute;
        inset: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(26px) scale(0.985);
        transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.6s;
    }

    .story-js .story-screen.is-past {
        transform: translateY(-26px) scale(0.985);
    }

    .story-js .story-screen.is-on {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0s;
    }
}

@media (min-width: 960px) and (prefers-reduced-motion: reduce) {
    .story-js .story-screen,
    .story-js .story-screen.is-past {
        transform: none;
    }
}

/* ---------- motion: cards settle in, numbers fill; only for those who want motion ----------
   .sc-auto plays on load (the hero); a story screen plays each time it comes up (.is-on, scripts/showcase.js). */
@media (prefers-reduced-motion: no-preference) {
    .sc-auto .sc-card,
    .sc-auto .sc-field,
    .story-screen.is-on .sc-card,
    .story-screen.is-on .sc-field {
        animation: sc-in 0.7s var(--ease) both;
    }

    /* on a phone a screen waits, still, until it comes into view */
    .story-ready:not(.story-js) .story-screen:not(.is-on) .sc-card,
    .story-ready:not(.story-js) .story-screen:not(.is-on) .sc-field {
        opacity: 0;
    }

    .showcase .d2 { animation-delay: 0.12s; }
    .showcase .d3 { animation-delay: 0.24s; }
    .showcase .d4 { animation-delay: 0.36s; }

    .sc-auto .sc-ring .val,
    .story-screen.is-on .sc-ring .val {
        animation: sc-ring 1.1s var(--ease) 0.5s both;
    }

    .sc-auto .sc-fit i,
    .sc-auto .sc-meter i,
    .story-screen.is-on .sc-fit i,
    .story-screen.is-on .sc-meter i {
        animation: sc-fill 0.9s var(--ease) 0.4s both;
    }

    .story-screen.is-on .sc-bars span {
        animation: sc-grow 0.8s var(--ease) both;
        animation-delay: calc(0.45s + var(--i) * 0.07s);
    }

    .sc-caret {
        animation: sc-blink 1.1s steps(1) infinite;
    }
}

@keyframes sc-in {
    from {
        opacity: 0;
        transform: translateY(0.9em);
    }
}

@keyframes sc-ring {
    from { stroke-dasharray: 0 100; }
}

@keyframes sc-fill {
    from { width: 0; }
}

@keyframes sc-grow {
    from { transform: scaleY(0); }
}

@keyframes sc-blink {
    50% { opacity: 0; }
}
