/* ============================================================
   Spec-Driven Development workshop — scoped styles
   Reuses the site palette: green #1b8e2d / #166124, purple accent
   ============================================================ */

/* What & why strip on case intros */
.sdd-what-why { display: grid; gap: .5rem; margin-top: 1rem; }
.sdd-what-why > div { color: #2d3748; }
.sdd-tag {
    display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; background: #edf2f7; color: #4a5568;
    padding: 2px 8px; border-radius: 999px; margin-right: .5rem;
}

/* The 7-beat arc */
.sdd-arc {
    list-style: none; padding: 0; margin: 1.25rem 0 0;
    display: flex; flex-wrap: wrap; gap: .6rem;
}
.sdd-arc > li {
    flex: 1 1 110px; background: #fff; border-radius: 10px; padding: .9rem .75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.08); text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    border-bottom: 3px solid #e2e8f0;
}
.sdd-arc > li strong { color: #2d3748; font-size: .95rem; }
.sdd-arc > li small { color: #718096; font-size: .75rem; }
.sdd-arc__n {
    width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #1b8e2d; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}

/* ==== Two-phase framing: before code (you decide) vs after code (agent, gate, human) ==== */
.sdd-phases { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.25rem; align-items: start; margin: 1.25rem 0 0; }
.sdd-phase__label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: .1rem; }
.sdd-phase__label small { display: block; font-weight: 600; letter-spacing: 0; text-transform: none; color: #a0aec0; font-size: .72rem; margin-top: .15rem; }
.sdd-phase--before .sdd-phase__label { color: #2b6cb0; }
.sdd-phase--after .sdd-phase__label { color: #7c3aed; }
.sdd-phase__rule { align-self: stretch; width: 2px; min-height: 100%; background: linear-gradient(#2b6cb0, #7c3aed); border-radius: 2px; }
.sdd-phase--before .sdd-arc__n { background: #2b6cb0; }
.sdd-phase--after .sdd-arc__n { background: #7c3aed; }
.sdd-phase--before .sdd-arc > li { border-bottom-color: #2b6cb0; }
.sdd-phase--after .sdd-arc > li { border-bottom-color: #7c3aed; }

/* Phase header band in the guided path */
.sdd-phase-head { display: flex; align-items: baseline; gap: .85rem; margin: 2rem 0 .25rem; padding-bottom: .5rem; border-bottom: 2px solid #edf2f7; flex-wrap: wrap; }
.sdd-phase-head__n { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; color: #fff; }
.sdd-phase-head--before .sdd-phase-head__n { background: #2b6cb0; }
.sdd-phase-head--after .sdd-phase-head__n { background: #7c3aed; }
.sdd-phase-head h3 { margin: 0; color: #2d3748; font-size: 1.1rem; }
.sdd-phase-head p { margin: .15rem 0 0; color: #718096; font-size: .85rem; flex-basis: 100%; }

/* Before-code beats use the planning (blue) accent; after-code beats use the agent (purple) accent */
.sdd-beat.sdd-beat--before { border-left-color: #2b6cb0; background: #f4f8fc; }
.sdd-beat--before .sdd-beat__n { background: #2b6cb0; }
.sdd-beat--before .sdd-beat__head h3 { color: #2b6cb0; }
.sdd-beat.sdd-beat--after { border-left-color: #7c3aed; background: #f8f5fe; }
.sdd-beat--after .sdd-beat__n { background: #7c3aed; }
.sdd-beat--after .sdd-beat__head h3 { color: #7c3aed; }

/* Shape coding (accessible, not colour-dependent):
   before-code steps = triangle, after-code steps = circle. */
.sdd-phase--before .sdd-arc__n,
.sdd-beat--before .sdd-beat__n {
    border-radius: 0;
    clip-path: polygon(50% 3%, 97% 97%, 3% 97%);
    box-sizing: border-box;
    padding-top: .45em;
}
.sdd-phase--before .sdd-arc__n { width: 2rem; height: 2rem; }
.sdd-beat--before .sdd-beat__n { width: 2.2rem; height: 2.2rem; }
.sdd-phase--after .sdd-arc__n,
.sdd-beat--after .sdd-beat__n { border-radius: 50%; }

@media (max-width: 720px) {
    .sdd-phases { grid-template-columns: 1fr; }
    .sdd-phase__rule { display: none; }
}

/* A single beat block in the guided path */
.sdd-beat {
    background: #fff; border-radius: 12px; padding: 1.25rem 1.5rem; margin: 1.25rem 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); border-left: 5px solid #1b8e2d;
}
.sdd-beat--twist { border-left-color: #d69e2e; background: #fffdf6; }
.sdd-beat__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.sdd-beat__head h3 { margin: 0; color: #2d3748; }
.sdd-beat__n {
    flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; background: #1b8e2d; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.sdd-beat--twist .sdd-beat__n { background: #d69e2e; }
.sdd-beat p { color: #4a5568; }
.sdd-beat kbd {
    background: #2d3748; color: #fff; border-radius: 4px; padding: 1px 6px;
    font-size: .8rem; font-family: ui-monospace, Menlo, monospace;
}

/* Code snippet with copy badge (dark) */
.sdd-code {
    position: relative; background: #1a202c; border-radius: 8px; padding: 1rem 1rem .9rem;
    margin: .75rem 0; overflow-x: auto;
}
.sdd-code pre { margin: 0; }
.sdd-code code {
    color: #e2e8f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem;
    white-space: pre; line-height: 1.5;
}
.sdd-code .copy-badge { position: absolute; top: .5rem; right: .5rem; }

/* Checkpoint */
.sdd-checkpoint {
    background: #f0fff4; border: 1px solid #9ae6b4; border-radius: 8px;
    padding: .75rem 1rem; margin: .75rem 0 0; color: #22543d;
}

/* Plan sign-off gate */
.sdd-signoff {
    display: flex; gap: .9rem; align-items: flex-start;
    background: #ebf8ff; border: 1px dashed #4299e1; border-radius: 8px;
    padding: 1rem 1.25rem; margin: 1rem 0;
}
.sdd-signoff i { color: #3182ce; font-size: 1.4rem; margin-top: .1rem; }
.sdd-signoff div { color: #2a4365; }

/* The "plan was wrong" box */
.sdd-twist-box { margin: 1rem 0; border-radius: 8px; overflow: hidden; border: 1px solid #f6e05e; }
.sdd-twist-row { padding: .7rem 1rem; background: #fffff0; color: #5f4b13; border-top: 1px solid #f6e05e; }
.sdd-twist-row:first-child { border-top: none; }
.sdd-twist-row--fix { background: #f0fff4; color: #22543d; }
.sdd-twist-label {
    display: inline-block; min-width: 74px; font-weight: 700; text-transform: uppercase;
    font-size: .68rem; letter-spacing: .04em; margin-right: .5rem; opacity: .8;
}

/* Prose-vs-sensor comparison */
.sdd-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.sdd-vs__col { border-radius: 8px; padding: 1rem; color: #2d3748; }
.sdd-vs__col span {
    display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; margin-bottom: .35rem;
}
.sdd-vs__col--bad { background: #fff5f5; border: 1px solid #feb2b2; }
.sdd-vs__col--bad span { color: #c53030; }
.sdd-vs__col--good { background: #f0fff4; border: 1px solid #9ae6b4; }
.sdd-vs__col--good span { color: #22543d; }

/* Stretch goals */
.sdd-stretch { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .75rem; }
.sdd-stretch > li {
    display: flex; gap: .9rem; align-items: flex-start; background: #fff; border-radius: 10px;
    padding: 1rem 1.25rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.08); border-left: 4px solid #7c3aed;
}
.sdd-stretch > li i { color: #7c3aed; font-size: 1.1rem; margin-top: .15rem; width: 1.2rem; text-align: center; }
.sdd-stretch > li div { color: #4a5568; }

/* Pills / quotes */
.sdd-pill {
    display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px;
    border-radius: 999px; vertical-align: middle; margin-left: .5rem;
}
.sdd-pill--green { background: #1b8e2d; color: #fff; }
.sdd-pill--purple { background: #7c3aed; color: #fff; }
.sdd-quote {
    border-left: 4px solid #1b8e2d; padding: .5rem 0 .5rem 1rem; margin: 1rem 0 0;
    color: #2d3748; font-style: italic;
}
.sdd-download {
    display: inline-flex; align-items: center; gap: .5rem; background: #1b8e2d; color: #fff;
    padding: .5rem 1rem; border-radius: 6px; text-decoration: none; font-weight: 600;
}
.sdd-download:hover { background: #166124; }

/* Case chooser on the landing page */
.sdd-cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.sdd-case-card {
    display: block; background: #fff; border-radius: 12px; padding: 1.5rem; text-decoration: none; color: inherit;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); border-top: 5px solid #1b8e2d; transition: transform .2s, box-shadow .2s;
}
.sdd-case-card:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -6px rgba(0,0,0,.18); }
.sdd-case-card__emoji { font-size: 2.2rem; }
.sdd-case-card h3 { margin: .5rem 0; color: #2d3748; }
.sdd-case-card p { color: #718096; }
.sdd-case-card__cta { display: inline-block; margin-top: .75rem; color: #1b8e2d; font-weight: 700; }

/* Four-artifact vocabulary row */
.sdd-artifacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.sdd-artifact { background: #fff; border-radius: 10px; padding: 1rem 1.25rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.08); border-bottom: 3px solid #7c3aed; }
.sdd-artifact h4 { margin: 0 0 .3rem; color: #2d3748; }
.sdd-artifact code { background: #edf2f7; padding: 1px 6px; border-radius: 4px; font-size: .8rem; color: #4a5568; }
.sdd-artifact p { color: #718096; font-size: .9rem; margin: .4rem 0 0; }
.sdd-artifact__example {
    display: inline-block;
    margin-top: .55rem;
    font-size: .82rem;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
}
.sdd-artifact__example:hover { text-decoration: underline; }
.js-artifact-example-link {
    color: #7c3aed;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 2px;
}
.js-artifact-example-link:hover { color: #5b21b6; }
.js-artifact-example-link:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Artifact example modal */
.sdd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, .65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.sdd-modal-overlay.open { display: flex; }
.sdd-modal-box {
    width: min(900px, 100%);
    max-height: 85vh;
    overflow: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .45);
}
.sdd-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem .4rem;
}
.sdd-modal-head h3 {
    margin: 0;
    color: #2d3748;
}
.sdd-modal-close {
    border: 0;
    border-radius: 6px;
    background: #edf2f7;
    color: #4a5568;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
}
.sdd-modal-close:hover { background: #e2e8f0; }
.sdd-modal-code { margin: .25rem 1rem 1rem; }
body.sdd-modal-open { overflow: hidden; }

/* Optional / time-permitting badge */
.sdd-optional {
    display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; color: #975a16; background: #fefcbf;
    border: 1px solid #f6e05e; border-radius: 999px; padding: 2px 10px; vertical-align: middle;
}

/* Hand-done → OpenSpec mapping */
.sdd-map { display: grid; gap: .5rem; margin: 1.25rem 0; }
.sdd-map__row {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem;
    background: #fff; border-radius: 8px; padding: .7rem 1rem; box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.sdd-map__hand { color: #4a5568; }
.sdd-map__arrow { color: #7c3aed; font-weight: 800; }
.sdd-map__os { color: #2d3748; font-weight: 600; }
.sdd-map__os code { background: #edf2f7; padding: 1px 6px; border-radius: 4px; font-size: .8rem; color: #4a5568; }

/* Lifecycle steps: propose → apply → archive */
.sdd-lifecycle { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.sdd-lifecycle__step { background: #fff; border-radius: 10px; padding: 1rem 1.25rem; border-top: 3px solid #7c3aed; box-shadow: 0 4px 6px -1px rgba(0,0,0,.08); }
.sdd-lifecycle__step h4 { margin: 0 0 .3rem; color: #2d3748; }
.sdd-lifecycle__step code { background: #edf2f7; padding: 1px 6px; border-radius: 4px; font-size: .8rem; color: #4a5568; }
.sdd-lifecycle__step p { color: #718096; font-size: .9rem; margin: .4rem 0 0; }

/* Bridge concepts */
.sdd-bridge { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.sdd-bridge > div { background: #faf5ff; border-radius: 10px; padding: 1rem 1.25rem; border-left: 3px solid #7c3aed; }
.sdd-bridge h4 { margin: 0 0 .3rem; color: #2d3748; }
.sdd-bridge p { color: #4a5568; font-size: .9rem; margin: 0; }

@media (max-width: 640px) {
    .sdd-vs { grid-template-columns: 1fr; }
    .sdd-map__row { grid-template-columns: 1fr; text-align: left; }
    .sdd-map__arrow { display: none; }
}

/* Credits / technologies used (about page) */
.sdd-credit-group { margin: 1.5rem 0; }
.sdd-credit-group > h3 { color: #2d3748; margin: 0 0 .25rem; }
.sdd-credit-group > p { color: #718096; margin: 0 0 1rem; }
.sdd-credits { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.sdd-credit {
    background: #fff; border-radius: 10px; padding: 1rem 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.08); border-left: 4px solid #2b6cb0;
}
.sdd-credit__name { margin: 0 0 .3rem; color: #2d3748; font-size: 1.05rem; }
.sdd-credit__name a { font-weight: 700; }
.sdd-credit__role { color: #4a5568; font-size: .9rem; margin: 0 0 .5rem; }
.sdd-credit__meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.sdd-credit__tag {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
    padding: 2px 8px; border-radius: 999px; background: #edf2f7; color: #4a5568;
}
.sdd-credit__tag--license { background: #e6fffa; color: #234e52; }
.sdd-credit--method { border-left-color: #7c3aed; }
.sdd-credit--build { border-left-color: #1b8e2d; }
