/* content-page.css - the renderer's blocks, wired to the content-config.js variables; loaded after team.css / project.css */

/* ── 1. settings from content-config.js ── */

/* main stays at screen width on mobile; wide blocks scroll inside their own frame */
.project-main { width: 100%; }

.project-section-head,
.project-text,
.project-figure {
    max-width: var(--content-measure, 720px);
}

.project-text {
    gap: var(--content-paragraph-gap, 1rem);
}

.project-text p {
    font-size:   var(--content-body-size, 0.98rem);
    line-height: var(--content-line-height, 1.85);
}

.project-section-title {
    font-size: var(--content-title-size, clamp(1.5rem, 3vw, 2.2rem));
}

.project-figure {
    border-radius: var(--fig-radius, 32px);
}

.project-figure img {
    object-fit: var(--fig-fit, cover);
}

.glass-caption {
    font-size: var(--caption-size, 0.85rem);
}

.ref-body {
    font-size: var(--ref-font-size, 0.84rem);
}

.project-ref-item {
    padding-top:    var(--ref-gap, 0.85rem);
    padding-bottom: var(--ref-gap, 0.85rem);
}

/* ── 2. shared by every block: centred at the text width ── */

.content-block {
    width: 100%;
    max-width: var(--content-measure, 720px);
    margin-inline: auto;
    font-family: 'Quicksand', sans-serif;
}

.content-block-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 0.8rem 0;
}

.content-block-intro {
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(0,0,0,0.58);
    margin: 0 0 0.9rem 0;
}

/* ── 3. lists · { type: "list", style: "..." } ── */

.content-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.92rem;
    line-height: 1.75;
    color: rgba(0,0,0,0.58);
}

.content-list li strong {
    color: #1A1A1A;
    font-weight: 600;
}

/* ── bullets (default): a dot in the page colour ── */
.content-list--bullets li,
.content-list--checks li {
    position: relative;
    padding: 0.45rem 0 0.45rem 1.3rem;
}

.content-list--bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(49,64,49,0.45);
}

/* ── checks: for commitments / conclusions ── */
.content-list--checks li::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 0.85em;
    width: 10px;
    height: 5px;
    border-left: 1.8px solid rgba(49,64,49,0.65);
    border-bottom: 1.8px solid rgba(49,64,49,0.65);
    transform: rotate(-45deg);
}

/* ── numbered ── */
.content-list--numbered {
    counter-reset: content-li;
}

.content-list--numbered li {
    position: relative;
    padding: 0.45rem 0 0.45rem 2rem;
    counter-increment: content-li;
}

.content-list--numbered li::before {
    content: counter(content-li, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.55em;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* ── pairs: "term → explanation", with rules between ── */
.content-list--pairs {
    border-top: 1px solid rgba(0,0,0,0.07);
}

.content-list--pairs li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.8rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.content-list--pairs li strong { flex-shrink: 0; }
.content-list--pairs li span   { color: var(--text-muted); }

/* ── 4. tables · size: compact|normal|wide|full · density: tight|normal|cozy · mobile: scroll|stack ── */

.content-tablewrap { width: 100%; margin-inline: auto; font-family: 'Quicksand', sans-serif; }

.content-tablewrap--compact { max-width: 520px; }
.content-tablewrap--normal  { max-width: var(--content-measure, 720px); }
.content-tablewrap--wide    { max-width: 920px; }
.content-tablewrap--full    { max-width: 100%; }

/* only the table scrolls sideways, never the page */
.content-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.07);
    background: rgba(255,255,255,0.55);
}

.content-table-scroll:focus-visible {
    outline: 2px solid rgba(49,64,49,0.5);
    outline-offset: 2px;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(0,0,0,0.62);
}

.content-table-caption {
    caption-side: bottom;
    padding: 0.7rem 1rem 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: left;
}

.content-table th,
.content-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.content-table thead th {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(49,64,49,0.05);
    white-space: nowrap;
}

.content-table tbody th {
    font-weight: 600;
    color: #1A1A1A;
}

.content-table tbody tr:last-child th,
.content-table tbody tr:last-child td { border-bottom: none; }

.content-table tbody tr:hover { background: rgba(49,64,49,0.03); }

.content-table strong { color: #1A1A1A; font-weight: 600; }

/* per-column alignment - from the block's `align: [...]` */
.content-table .is-right  { text-align: right; }
.content-table .is-center { text-align: center; }
.content-table .is-left   { text-align: left; }

/* density */
.content-table--tight th, .content-table--tight td { padding: 0.5rem 0.8rem; }
.content-table--cozy  th, .content-table--cozy  td { padding: 1.05rem 1.2rem; }

.content-table-note {
    margin: 0.7rem 0 0;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ── mobile: "stack" mode - every row becomes a card ── */
@media (max-width: 700px) {
    .content-table--m-stack thead { display: none; }

    .content-table--m-stack tbody tr {
        display: block;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.07);
    }

    .content-table--m-stack tbody tr:last-child { border-bottom: none; }

    .content-table--m-stack tbody th,
    .content-table--m-stack tbody td {
        display: flex;
        gap: 0.8rem;
        justify-content: space-between;
        border: none;
        padding: 0.35rem 1rem;
        text-align: left;
    }

    /* the column header reappears next to the value */
    .content-table--m-stack tbody td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-family: 'Quicksand', sans-serif;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--text-muted);
        padding-top: 0.15em;
    }

    .content-table--m-stack tbody th { font-size: 0.95rem; padding-top: 0.5rem; }
}

/* ── 4b. timeline: one column, line and dots on the left ── */

.content-timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

/* line fades out under the last entry */
.content-timeline-list::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0.6rem;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg,
                rgba(49,64,49,0.22) 0,
                rgba(49,64,49,0.22) calc(100% - 60px),
                rgba(49,64,49,0) 100%);
}

.content-timeline-item {
    position: relative;
    padding: 0 0 2rem 2rem;
}

.content-timeline-item:last-child { padding-bottom: 0; }

/* the dot - a filled circle with a white ring so it cuts cleanly through the line behind it. */
.content-timeline-marker {
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary, #3A4B3A);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.75);
}

.content-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.7rem;
    margin: 0 0 0.25rem 0;
}

.content-timeline-date {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.content-timeline-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(49,64,49,0.08);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
}

.content-timeline-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.35;
    margin: 0 0 0.45rem 0;
}

/* timeline text uses the column as its frame */
.content-timeline-body .project-text,
.content-timeline-body .content-block { max-width: 100%; margin-inline: 0; }

.content-timeline-body .project-text p { font-size: 0.92rem; line-height: 1.75; }

.content-timeline-body > * + .content-block { margin-top: 0.9rem; }

/* compact: for long lists (e.g. a notebook) */
.content-timeline--compact .content-timeline-item { padding-bottom: 1.1rem; }
.content-timeline--compact .content-timeline-title { font-size: 0.95rem; margin-bottom: 0.2rem; }

@media (max-width: 700px) {
    .content-timeline-item { padding-left: 1.6rem; padding-bottom: 1.6rem; }
}

/* ── 5. quote · { type: "quote", ... } ── */

.content-quote {
    padding: 1.1rem 1.3rem;
    background: #ffffff;
    border-left: 3px solid rgba(49,64,49,0.5);
    border-radius: 4px 12px 12px 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.content-quote p {
    margin: 0 0 0.6rem 0;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.75;
    color: rgba(0,0,0,0.68);
}

.content-quote footer {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── 6. callout · { type: "callout", tone: "note|insight|quiet" } ── */

.content-callout {
    padding: 1.8rem;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px;
}

.content-callout + .content-callout { margin-top: 1.5rem; }

.content-callout-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 1rem 0;
}

.content-callout-intro,
.content-callout-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(0,0,0,0.58);
    margin: 0 0 0.8rem 0;
}

.content-callout-text strong,
.content-callout-intro strong { color: #1A1A1A; font-weight: 600; }

.content-callout .content-list { border-top: 1px solid rgba(0,0,0,0.07); }

.content-callout .content-list li {
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.content-callout .content-list li:last-child { border-bottom: none; }

/* insight: a green touch - for "what we learned" */
.content-callout--insight {
    background: rgba(49,64,49,0.05);
    border-color: rgba(49,64,49,0.12);
}

/* quiet: a discreet note, no frame (e.g. a transparency note) */
.content-callout--quiet {
    padding: 1.4rem 0 0;
    background: none;
    border: none;
    border-top: 1px solid rgba(0,0,0,0.07);
    border-radius: 0;
}

.content-callout--quiet .content-callout-title { font-size: 0.9rem; }

.content-callout--quiet .content-callout-text {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.content-callout a {
    color: rgba(49,64,49,0.85);
    text-decoration: none;
    border-bottom: 1px solid rgba(49,64,49,0.3);
}

.content-callout a:hover { color: #1A1A1A; border-color: currentColor; }

/* ── 7. cards: Team-card glass; photo/name/role/hook visible, the rest opens on click ── */

.content-cards { display: flex; flex-direction: column; gap: 1.2rem; }

.content-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-card, 30px);
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,0.05);
    transition: transform 0.5s var(--apple-ease, ease), box-shadow 0.5s ease, background 0.4s ease;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.75);
}

.content-card.is-open {
    box-shadow: 0 20px 45px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.78);
}

.content-card-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.3rem;
    padding: 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.content-card-header:focus-visible {
    outline: 2px solid rgba(49,64,49,0.5);
    outline-offset: -2px;
}

/* initials on a gradient until a photo: "https://static.igem.wiki/..." covers them */
.content-card-photo {
    --photo-img: none;
    flex-shrink: 0;
    width: 104px;
    height: 104px;
    border-radius: calc(var(--radius-card, 30px) * 0.6);
    background-image: var(--photo-img), linear-gradient(135deg, #3A4B3A, #6b8f5e);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.5px;
}

.content-card-photo::before { content: attr(data-initials); }

.content-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.content-card-name {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
}

.content-card-role {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.content-card-hook {
    font-size: 0.88rem;
    font-style: italic;
    color: rgba(0,0,0,0.55);
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* circle + chevron, the same "expand hint" as Team */
.content-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(49,64,49,0.07);
    position: relative;
    transition: background 0.25s ease, transform 0.4s var(--apple-ease, ease);
}

.content-card-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    margin: -5px 0 0 -6px;
    border-right: 1.5px solid rgba(49,64,49,0.75);
    border-bottom: 1.5px solid rgba(49,64,49,0.75);
    transform: rotate(45deg);
    transition: transform 0.4s var(--apple-ease, ease);
}

.content-card-header:hover .content-card-icon { background: rgba(49,64,49,0.14); }
.content-card.is-open  .content-card-icon     { transform: rotate(180deg); }

/* [hidden] has to beat the display:flex below - otherwise the cards would always show open. */
.content-card-detail[hidden] { display: none; }

.content-card-detail {
    padding: 1.5rem 1.2rem 1.6rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.content-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* blocks inside a card have no width or background of their own */
.content-card-detail .content-block,
.content-card-detail .project-text { max-width: 100%; }

.content-card-detail .content-callout { padding: 1rem 1.2rem; border-radius: 12px; }
.content-card-detail .content-callout-title { font-size: 0.82rem; letter-spacing: 0.3px; text-transform: uppercase; color: rgba(49,64,49,0.75); margin-bottom: 0.4rem; }
.content-card-detail .project-text p { font-size: 0.9rem; line-height: 1.75; }

/* ── 8. DBTL ring: click a phase, chevrons change cycle; colours are the dark hero pastels ── */

.content-dbtl {
    max-width: 980px;
    /* one duration and curve for everything that appears together */
    --dbtl-enter: 1.15s;
    --dbtl-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* left column in rem so the SVG wheel scales with text size */
.dbtl-shell {
    display: grid;
    grid-template-columns: minmax(11.875rem, 17.5rem) minmax(0, 1fr);
    column-gap: 2.6rem;
    align-items: start;
}

/* controls + wheel stay together on screen */
/* the controls stay up top, next to the cycle title, and follow as you read. */
.dbtl-side {
    position: sticky;
    top: calc(var(--nav-h, 45px) + 1.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
}

.dbtl-main { position: relative; min-width: 0; }

/* hidden measuring copy for the title + aim line (same width/style). */
.dbtl-ghost-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    visibility: hidden;
    pointer-events: none;
}

/* ── under the wheel: cycle picker + paddle, in rem ── */
.dbtl-topbar {
    position: relative;        /* sets the bounds of .dbtl-menu, see there */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 3.5rem;        /* room so the ring is not clipped */
}

/* picker: pill with a stories-style progress ring */
/* step 0 of the birth: collapsed onto the button, to its right. */
.dbtl-picker {
    position: relative;
    flex: 0 0 auto;
    transform: scaleX(0);
    transform-origin: right center;
    opacity: 0;
    transition: transform 0.46s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity   0.1s ease;
}

/* same material as the paddle; dark green only on the progress ring */
.dbtl-pick-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    height: 2.125rem;
    padding: 0 0.9375rem;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    color: #243024;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(49,64,49,0.10);
    transition: transform 0.4s var(--apple-ease, ease),
                background 0.3s var(--apple-ease, ease),
                box-shadow 0.4s var(--apple-ease, ease);
}

.dbtl-pick-label {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dbtl-pick-chev {
    width: 0.8125rem;
    height: 0.8125rem;
    opacity: 0;
    transition: transform 0.35s var(--apple-ease, ease),
                opacity   0.3s  ease;
}

@media (hover: hover) {
    .dbtl-pick-btn:hover {
        transform: translateY(-1px);
        background: #fff;
        box-shadow: 0 7px 20px rgba(49,64,49,0.16);
    }
}

/* on touch the feedback comes from the press, not the hover. */
.dbtl-pick-btn:active { transform: scale(0.97); transition-duration: 0.12s; }
.dbtl-picker.is-open .dbtl-pick-chev { transform: rotate(180deg); }

/* one ring path per cycle on the pill outline */
.dbtl-ring {
    position: absolute;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dbtl-ring-seg {
    fill: none;
    stroke: var(--primary, #3A4B3A);
    stroke-width: 0.1875rem;   /* rem: the ring viewBox is in px */
    stroke-linecap: round;
    opacity: 0.22;
    transition: opacity 0.5s var(--apple-ease, ease);
}

.dbtl-ring-seg.is-done { opacity: 1; }

/* dropdown spans the text column (child of .dbtl-topbar), never over the wheel */
.dbtl-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 18.75rem;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.14);
}

.dbtl-menu-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dbtl-menu-item:hover,
.dbtl-menu-item:focus-visible { background: rgba(49,64,49,0.08); outline: none; }

.dbtl-menu-item.is-current { background: rgba(49,64,49,0.12); }

.dbtl-menu-num {
    flex: none;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dbtl-menu-name {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #1A1A1A;
}

/* ── paddles: fixed frame, they split in two as they appear ── */
.dbtl-paddles {
    --btn-size: 2.75rem;
    --btn-r: 1.375rem;
    flex: 0 0 auto;
    width: var(--btn-size);
    height: var(--btn-size);
}

.dbtl-nav {
    width: var(--btn-size);
    height: var(--btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--btn-r);
    color: var(--primary, #3A4B3A);
    cursor: pointer;
    transition: background 0.3s var(--apple-ease, ease),
                box-shadow 0.4s var(--apple-ease, ease),
                transform 0.15s ease;
}

.dbtl-nav svg { width: 1.0625rem; height: 1.0625rem; opacity: 0; }

@media (hover: hover) {
    .dbtl-nav:hover { background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
}
.dbtl-nav:active { transform: scale(0.88); transition-duration: 0.15s; }

/* ── controls birth, like the Explore More nav: s1 button pops, s2 pill unfolds left, s3 content ── */
.dbtl-paddles .dbtl-nav {
    transform: scale(0);
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s var(--apple-ease, ease),
                box-shadow 0.4s var(--apple-ease, ease);
}

.dbtl-topbar.is-s1 .dbtl-nav { transform: scale(1); }

.dbtl-topbar.is-s2 .dbtl-picker { transform: scaleX(1); opacity: 1; }

.dbtl-topbar.is-s3 .dbtl-pick-label,
.dbtl-topbar.is-s3 .dbtl-pick-chev,
.dbtl-topbar.is-s3 .dbtl-ring,
.dbtl-topbar.is-s3 .dbtl-nav svg { opacity: 1; }

/* restore press feedback after the birth */
.dbtl-topbar.is-s3 .dbtl-nav:active { transform: scale(0.88); transition-duration: 0.15s; }

/* ── the cycle title, on the right ── */
.dbtl-reader-title {
    margin: 0 0 0.5rem 0;
    font-family: 'Quicksand', sans-serif;
    /* title: 1.25rem floor keeps size monotonic across widths */
    font-size: clamp(1.25rem, calc(2vw * var(--fs-scale, 1)), 1.35rem);
    font-weight: 600;
    color: #1A1A1A;
}

/* ── the ring: thin, with round caps ── */
/* wheel size on the wrapper (explicit width + auto margins) */
.dbtl-wheel-side {
    width: 100%;
    max-width: 17.5rem;
    margin-inline: auto;
}

.dbtl-wheel { display: block; width: 100%; height: auto; overflow: visible; }

.dbtl-seg { cursor: pointer; }

/* hit area: invisible 90° slice under the arc */
.dbtl-seg-hit {
    fill: transparent;
    stroke: none;
}

.dbtl-seg-arc {
    fill: none;
    pointer-events: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-width var(--dbtl-enter) var(--dbtl-ease),
                stroke      var(--dbtl-enter) var(--dbtl-ease),
                opacity     var(--dbtl-enter) var(--dbtl-ease);
}

/* inactive = grey; only the phase you are reading takes colour. */
.dbtl-seg:not(.is-active) .dbtl-seg-arc { stroke: rgba(36,48,36,0.2) !important; }

/* hover only with a real pointer */
@media (hover: hover) {
    .dbtl-seg:not(.is-active):hover .dbtl-seg-arc { stroke: rgba(36,48,36,0.38) !important; }
}

/* the phase colour as components, so it can go into rgba() at a different alpha per state. */
.dbtl-seg--design { --dbtl-tint:  72, 93, 68; }   /* #485D44 */
.dbtl-seg--build  { --dbtl-tint:  74,108,125; }   /* #4A6C7D */
.dbtl-seg--test   { --dbtl-tint: 128, 91, 33; }   /* #805B21 */
.dbtl-seg--learn  { --dbtl-tint:  95, 74,151; }   /* #5F4A97 */

/* read phases stay coloured at α 0.75 (≥ 3:1, SC 1.4.11) */
.dbtl-seg.is-seen:not(.is-active):not(.is-empty) .dbtl-seg-arc {
    stroke: rgba(var(--dbtl-tint), 0.75) !important;
}

@media (hover: hover) {
    .dbtl-seg.is-seen:not(.is-active):not(.is-empty):hover .dbtl-seg-arc {
        stroke: rgba(var(--dbtl-tint), 0.8) !important;
    }
}

.dbtl-seg.is-seen:not(.is-active):not(.is-empty) .dbtl-seg-label {
    fill: rgba(36,48,36,0.5);
}

/* "Go to" preview: target arc breathes; pulse ends at the base opacity */
.dbtl-seg-ghost {
    fill: none;
    pointer-events: none;
    stroke: rgba(var(--dbtl-tint), 0.75);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-opacity: 1;
    opacity: 0;
    transition: opacity        0.26s var(--apple-ease, ease),
                stroke-opacity 0.26s var(--apple-ease, ease);
}

.dbtl-seg.is-target:not(.is-active):not(.is-empty) .dbtl-seg-ghost {
    opacity: 1;
    /* ease-in-out for a back-and-forth pulse */
    animation: dbtl-ghost-pulse 2.1s ease-in-out infinite;
}

@keyframes dbtl-ghost-pulse {
    0%, 100% { stroke-opacity: 1; }
    50%      { stroke-opacity: 0.55; }
}

.dbtl-seg.is-active .dbtl-seg-arc {
    stroke-width: 14;
    animation: dbtl-draw var(--dbtl-enter) var(--dbtl-ease) both;
}

/* pathLength="100" so the fill dash is the same in every quadrant */
@keyframes dbtl-draw {
    from { stroke-dasharray: 100; stroke-dashoffset: 100; }
    to   { stroke-dasharray: 100; stroke-dashoffset: 0; }
}

.dbtl-seg.is-empty { cursor: default; }
.dbtl-seg.is-empty .dbtl-seg-arc { stroke: rgba(36,48,36,0.08) !important; }

/* the hero's 4 pastels as a gradient - visible only on the active phase. */
.dbtl-grad--design .dbtl-stop-a { stop-color: #B8CFB2; }
.dbtl-grad--design .dbtl-stop-b { stop-color: #7FA477; }

.dbtl-grad--build  .dbtl-stop-a { stop-color: #B4CBD6; }
.dbtl-grad--build  .dbtl-stop-b { stop-color: #7BA0B3; }

.dbtl-grad--test   .dbtl-stop-a { stop-color: #DCC9AC; }
.dbtl-grad--test   .dbtl-stop-b { stop-color: #B99A6B; }

.dbtl-grad--learn  .dbtl-stop-a { stop-color: #C9BFE4; }
.dbtl-grad--learn  .dbtl-stop-b { stop-color: #9787C2; }

/* labels on per-word arcs computed in JS (no dominant-baseline) */
.dbtl-seg-label {
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.6px;
    fill: rgba(36,48,36,0.34);
    cursor: pointer;
    user-select: none;
    transform: translate(0, 0);
    transition: fill      var(--dbtl-enter) var(--dbtl-ease),
                transform var(--dbtl-enter) var(--dbtl-ease);
}

.dbtl-seg.is-active .dbtl-seg-label { fill: #243024; font-weight: 700; }

/* active arc thickens outward; label follows */
.dbtl-seg.is-active .dbtl-seg-label {
    transform: translate(var(--dbtl-push-x, 0), var(--dbtl-push-y, 0));
}
.dbtl-seg.is-empty  .dbtl-seg-label { fill: rgba(36,48,36,0.16); }

/* focus ring follows the arc shape */
.dbtl-seg:focus,
.dbtl-seg:focus-visible { outline: none; }

.dbtl-seg:focus-visible .dbtl-seg-arc {
    filter: drop-shadow(0 0 2px #243024) drop-shadow(0 0 2px #243024);
}

/* ── right: the phase text ── */
.dbtl-reader { position: relative; min-width: 0; }

/* hidden measuring copy of the panel (out of flow and a11y tree) */
.dbtl-ghost {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    visibility: hidden;
    pointer-events: none;
    min-height: 0 !important;
}

.dbtl-aim {
    margin: 0 0 0.9rem 0;
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--text-body);
    font-style: italic;
}

.dbtl-panel {
    position: relative;
    transition: min-height var(--dbtl-enter) var(--dbtl-ease);
    /* keep room at the bottom for the button, which is absolute down there. */
    padding: 1.6rem 1.6rem calc(1.6rem + 44px + 1.2rem);
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-card, 30px);
}

.dbtl-panel:focus-visible { outline: 2px solid rgba(49,64,49,0.7); outline-offset: 3px; }

/* the panel stops growing at a cap; the phase text scrolls inside it (the ghost copies share this, so the locked height stops at the cap too) */
.dbtl-panel--capped {
    display: flex;
    flex-direction: column;
    max-height: 36rem;
}

.dbtl-panel--capped .dbtl-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.28) transparent;
}

.dbtl-panel--capped .dbtl-panel-body.is-scrollable { padding-right: 0.6rem; }

.dbtl-panel--capped .dbtl-panel-body.is-scrollable:not(.is-end) {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.4rem), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 2.4rem), transparent);
}

.dbtl-panel-body:focus-visible { outline: 2px solid rgba(49,64,49,0.7); outline-offset: 4px; border-radius: 8px; }

.dbtl-panel-phase {
    margin: 0 0 0.7rem 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.dbtl-panel-phase--design { color: #485D44; }
.dbtl-panel-phase--build  { color: #4A6C7D; }
.dbtl-panel-phase--test   { color: #805B21; }
.dbtl-panel-phase--learn  { color: #5F4A97; }

.dbtl-panel-empty { font-size: 0.88rem; color: var(--text-body); margin: 0; }

.dbtl-panel .project-text { max-width: 100%; margin-inline: 0; text-align: left; }
.dbtl-panel .content-block { max-width: 100%; margin-top: 1rem; }

.dbtl-next {
    margin: 1.2rem 0 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.07);
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.dbtl-next strong { color: rgba(49,64,49,0.9); }

/* "Go to Build" - bottom right inside the frame */
/* fixed size regardless of zoom or label */
/* footer pinned to the bottom of the locked panel */
.dbtl-foot {
    position: absolute;
    left: 1.6rem;
    right: 1.6rem;
    bottom: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;   /* the pill stays right */
    gap: 1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(0,0,0,0.07);
}

.dbtl-go {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: fit-content;
    min-width: 158px;
    height: 44px;
    margin: 0;
    padding: 0 22px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 22px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--primary, #3A4B3A);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s var(--apple-ease, ease),
                box-shadow 0.3s var(--apple-ease, ease);
}

/* glow in the next phase's colour (--go-glow) */
.dbtl-go {
    --go-glow: rgba(127,164,119,0.55);
    animation: dbtl-go-glow 3.4s ease-in-out infinite;
}

@keyframes dbtl-go-glow {
    0%, 100% { box-shadow: 0 2px 10px rgba(0,0,0,0.05),
                           0 0 12px -2px var(--go-glow); }
    50%      { box-shadow: 0 4px 16px rgba(0,0,0,0.07),
                           0 0 26px 2px var(--go-glow); }
}

@media (hover: hover) {
    .dbtl-go:hover {
        transform: translateY(-2px);
        animation: none;
        box-shadow: 0 8px 22px rgba(0,0,0,0.09), 0 0 30px 3px var(--go-glow);
    }
}

/* ── entrance: same curve/blur as the Explore More labels ── */
.dbtl-rise {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    filter: blur(8px);
    transition: opacity   var(--dbtl-enter) var(--dbtl-ease),
                transform var(--dbtl-enter) var(--dbtl-ease),
                filter    var(--dbtl-enter) var(--dbtl-ease);
}

.dbtl-rise.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* ── stacked: no wheel, everything visible ── */
.dbtl-flat {
    padding: 1.6rem;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px;
    scroll-margin-top: calc(var(--nav-h, 64px) + 1rem);
}

.dbtl-flat + .dbtl-flat { margin-top: 1.2rem; }

.dbtl-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.4rem 0;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dbtl-tag {
    padding: 2px 8px;
    background: rgba(49,64,49,0.08);
    border-radius: 20px;
    letter-spacing: 1.5px;
}

.dbtl-flat-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 0.4rem 0;
}

.dbtl-flat .dbtl-aim { text-align: left; margin-bottom: 1.2rem; }

.dbtl-flat-step { padding-left: 1rem; border-left: 2px solid rgba(0,0,0,0.08); }

.dbtl-flat-step + .dbtl-flat-step { margin-top: 1.2rem; }

.dbtl-flat-step--design { border-left-color: #5B7A5A; }
.dbtl-flat-step--build  { border-left-color: #4E6E78; }
.dbtl-flat-step--test   { border-left-color: #7A6A4E; }
.dbtl-flat-step--learn  { border-left-color: #5A5170; }

.dbtl-flat-label {
    margin: 0 0 0.4rem 0;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dbtl-flat .project-text { max-width: 100%; margin-inline: 0; text-align: left; }

/* ── 9. embed · { type: "embed", templateId: "..." } - a custom widget, we just give it room ── */

.content-embed { max-width: 100%; }

/* ══ 10. RESPONSIVE ══ */

/* DBTL below 58em: wheel beside the text (em so it follows text zoom) */
@media (max-width: 58em) {
    .dbtl-shell {
        position: relative;               /* for the hidden ghost-head */
        /* 42/58 split: smaller wheel, more room for text */
        grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
        grid-template-areas:
            "wheel pill"
            "wheel title"
            "body  body";
        align-items: center;
        column-gap: 1rem;
        row-gap: 0.4rem;
        /* space above the wheel */
        margin-top: 1.2rem;
    }

    /* display: contents so title, wheel and panel share one grid */
    .dbtl-side,
    .dbtl-main { display: contents; }

    /* wheel grows with the column up to its 17.5rem cap */
    .dbtl-wheel-side { grid-area: wheel; }

    /* labels scale with the smaller wheel */
    .dbtl-seg-label { font-size: 17px; }

    .dbtl-topbar {
        grid-area: pill;
        justify-content: start;
        min-height: 0;
        align-self: end;
    }

    /* extra space above the title only */
    .dbtl-reader-title { grid-area: title; align-self: start; margin: 0.6rem 0 0 0; }

    /* more space between the wheel and the aim text */
    .dbtl-reader { grid-area: body; margin-top: 0.8rem; }

    /* measuring copy spans both columns */
    .dbtl-ghost-head { grid-area: body; }

    /* chevron hidden: the dropdown and "Next cycle" cover it */
    .dbtl-paddles { display: none; }

    /* pill grows from its left edge here */
    .dbtl-picker { transform-origin: left center; }
}

@media (max-width: 700px) {
    .content-callout { padding: 1.4rem; border-radius: 16px; }

    .dbtl-panel,
    .dbtl-flat { padding: 1.2rem; border-radius: 16px; }

    /* keep the room under the text for the Go-to button */
    .dbtl-panel--capped { padding-bottom: calc(1.2rem + 44px + 1.1rem + 1.2rem); }
    .dbtl-panel--capped .dbtl-foot { left: 1.2rem; right: 1.2rem; bottom: 1.2rem; }

    .content-card-header { gap: 0.9rem; padding: 1rem; }

    .content-card-photo {
        width: 72px;
        height: 72px;
        font-size: 1.2rem;
    }

    .content-list--pairs li { flex-direction: column; gap: 0.15rem; }

    .content-table-scroll { border-radius: 14px; }
}

/* ── touch screens (by pointer type, not width) ── */
@media (pointer: coarse) {
    /* 44px targets: bump the pill */
    .dbtl-pick-btn { height: 2.75rem; padding: 0 1.15rem; }

    /* room for the ring outside the bigger pill */
    .dbtl-topbar { min-height: 4.5rem; }
}

/* no grey flash on tap and no double-tap delay. */
.dbtl-seg,
.dbtl-nav,
.dbtl-pick-btn,
.dbtl-menu-item,
.dbtl-go {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* less motion for anyone who asked for it in their OS */
@media (prefers-reduced-motion: reduce) {
    .content-card,
    .content-card-icon,
    .content-card-icon::before,
    .dbtl-seg-arc,
    .dbtl-seg-ghost,
    .dbtl-seg-label,
    .dbtl-go,
    .dbtl-nav,
    .dbtl-picker,
    .dbtl-pick-label,
    .dbtl-pick-chev,
    .dbtl-ring { transition: none; }

    .content-card:hover { transform: none; }

    .dbtl-go:hover { transform: none; }

    /* no glow pulse and no "drawing" of the arc. */
    .dbtl-go { animation: none; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
    .dbtl-seg.is-active .dbtl-seg-arc { animation: none; }
    .dbtl-seg.is-target .dbtl-seg-ghost { animation: none; }
    .dbtl-ring-seg,
    .dbtl-panel { transition: none; }

    /* the button appears straight in place. */
    .dbtl-paddles .dbtl-nav { opacity: 1; transform: none; transition: none; }

    /* no entrance motion - the content is just there. */
    .dbtl-rise {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}
