/* ============================================================================
   DESIGN STUDIO — /tools/design-studio (prefix dsg-)
   The tool-guide system (docs/design/tool-guide-design-system.md): a screenshot
   of the studio as the stage, one-line stats, the lime bento, a four-step
   track, the plans table in the table shell, use cases, the dark card, FAQ.
   ============================================================================ */

.dsg .mono-container { max-width: 1200px; }
.dsg .mono-section { padding: clamp(40px, 6vw, 72px) 0; }
.dsg .mono-section-head { max-width: 760px; }
.dsg .mono-section-head .mono-lead { margin-top: 12px; }

/* hairline above container-less sections, on the rail so it matches 1200px */
.dsg .mono-section.dsg-sep { padding-top: 0; }
.dsg .mono-section.dsg-sep > .mono-container {
    border-top: 1px solid var(--mono-border);
    padding-top: clamp(40px, 6vw, 72px);
}

/* ---- hero -------------------------------------------------------------- */
.dsg-hero { text-align: center; }
.dsg-hero .dsg-h1 {
    margin: 14px auto 0;
    max-width: 22ch;
    font-family: var(--mono-font-display);
    font-size: clamp(1.9rem, 3.7vw, 3.7rem) !important;   /* the same size as before on desktop; site.css sets every h1 to clamp(.8rem, 3.7vw, ...) !important: 14px on a phone */
    font-weight: var(--mono-w-extrabold, 800);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--mono-ink);
}
.dsg-hero .mono-lead { max-width: 64ch; margin: 18px auto 0; }
.dsg-cta-row {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 12px 20px; margin: 24px 0 0;
}
.dsg-cta-row--left { justify-content: flex-start; }
.dsg-cta-row .mono-link svg { margin-right: 2px; }
.dsg-note { font-size: 13px; color: var(--mono-text-muted); }
.dsg-hero .dsg-cta-row { margin-top: 26px; }

.dsg-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
    max-width: 1100px; margin: 18px auto 0; padding: 0; list-style: none;
}
.dsg-stats li {
    display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left;
    padding: 10px 14px; background: var(--mono-white);
    border: 1px solid var(--mono-border); border-radius: 12px;
    font-size: 12.5px; line-height: 1.35; color: var(--mono-text-muted);
}
.dsg-stats li > svg { flex: 0 0 auto; width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--mono-ink); color: var(--mono-lime, #ccea4a); }
.dsg-stats li > span { min-width: 0; }
.dsg-stats strong { display: block; font-family: var(--mono-font-display); font-size: 13.5px; font-weight: 800; letter-spacing: -0.01em; color: var(--mono-ink); }

/* ---- what it does: the lime shell, an intro, then a bento of feature cards ---- */
.dsg-cap {
    display: grid; gap: 28px;
    background: var(--mono-lime, #CCEA4A);
    border-radius: var(--mono-radius-xl, 24px);
    padding: clamp(24px, 4vw, 48px);
    color: #111;
}
.dsg-cap__intro { max-width: 760px; }
.dsg-cap__intro .mono-eyebrow { color: #111; opacity: .7; }
.dsg-cap__h2 { margin: 8px 0 0; font-family: var(--mono-font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.dsg-cap__body { margin: 12px 0 0; font-size: var(--mono-fs-lead); line-height: 1.55; }
.dsg-feat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.dsg-feat__card {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start;
    padding: 18px; border-radius: 18px; background: rgba(255,255,255,.92); border: 1px solid rgba(17,17,17,.06);
    font-size: 13.5px; line-height: 1.5; color: #111;
    transition: transform var(--mono-dur, .2s) ease, box-shadow var(--mono-dur, .2s) ease, background var(--mono-dur, .2s) ease;
}
.dsg-feat__card:hover { background: #fff; transform: translateY(-3px); box-shadow: 0 14px 30px rgba(17,24,39,.12); }
.dsg-feat__card--wide { grid-column: span 2; grid-template-columns: 44px minmax(0, 1fr) 220px; align-items: center; }
.dsg-feat__i { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #111; color: var(--mono-lime, #ccea4a); }
.dsg-feat__card strong { display: block; font-family: var(--mono-font-display); font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.dsg-feat__card--wide strong { font-size: 17px; }
.dsg-feat__card p { margin: 0; color: #2a2a2a; }
.dsg-feat__art { width: 220px; height: 80px; display: block; overflow: hidden; }

/* ---- how it works: six steps on a lime track ------------------------- */
.dsg-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 22px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.dsg-flow__step { position: relative; display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.dsg-flow__step::before, .dsg-flow__step::after {
    content: ''; position: absolute; top: 19px; height: 2px; background: var(--mono-lime, #ccea4a); z-index: 0;
}
.dsg-flow__step::before { left: -22px; right: 50%; }      /* from the previous node */
.dsg-flow__step::after { left: 50%; right: -22px; }       /* to the next node */
.dsg-flow__step:nth-child(3n + 1)::before, .dsg-flow__step:nth-child(3n)::after, .dsg-flow__step:last-child::after { display: none; }
.dsg-flow__n {
    position: relative; z-index: 1; justify-self: center;
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--mono-ink); color: var(--mono-lime, #ccea4a);
    font-family: var(--mono-font-display); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--mono-lime, #ccea4a);
}
.dsg-flow__card {
    min-width: 0; padding: 22px; background: var(--mono-white);
    border: 1px solid var(--mono-border); border-radius: 18px;
    transition: transform var(--mono-dur, .2s) var(--mono-ease, ease), box-shadow var(--mono-dur, .2s) ease, border-color var(--mono-dur, .2s) ease;
}
.dsg-flow__step:hover .dsg-flow__card { transform: translateY(-3px); box-shadow: var(--mono-shadow-hover, 0 12px 28px rgba(17,24,39,.08)); border-color: var(--mono-lime, #ccea4a); }
.dsg-flow__i { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--mono-lime-pale, #fbfde8); color: var(--mono-ink); }
.dsg-flow__t { display: block; margin-top: 14px; font-family: var(--mono-font-display); font-size: 16px; font-weight: 800; letter-spacing: -0.01em; color: var(--mono-ink); }
.dsg-flow__d { display: block; margin-top: 6px; font-size: var(--mono-fs-sm); color: var(--mono-text-muted); line-height: 1.55; }

/* ---- table shell (exports) -------------------------------------------- */
.dsg-tablewrap { margin: 0; overflow-x: auto; background: var(--mono-white); border: 1px solid var(--mono-border); border-radius: 16px; }
.dsg-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.dsg-table th {
    padding: 14px 18px; text-align: left;
    font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--mono-text-muted); border-bottom: 1px solid var(--mono-border);
}
.dsg-table td { padding: 14px 18px; text-align: left; vertical-align: top; color: var(--mono-text-muted); border-bottom: 1px solid var(--mono-border); line-height: 1.5; }
.dsg-table td:first-child { font-weight: 600; color: var(--mono-ink); white-space: nowrap; }
.dsg-table tbody tr { transition: background var(--mono-dur, .2s) ease; }
.dsg-table tbody tr:hover { background: var(--mono-lime-pale, #fbfde8); }
.dsg-table tbody tr:last-child td { border-bottom: 0; }
.dsg-table--exports th:nth-child(2), .dsg-table--exports td:nth-child(2) { background: #f6f6f7; }
.dsg-table--exports tbody tr:hover td:nth-child(2) { background: #f1f2ee; }
.dsg-table--exports th:first-child, .dsg-table--exports td:first-child { padding-right: 24px; }
.dsg-fmt { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.dsg-fmt > svg { flex: 0 0 auto; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--mono-ink); color: var(--mono-lime, #ccea4a); }

/* ---- use cases 3x2 ----------------------------------------------------- */
.dsg-uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dsg-uses__card {
    padding: 20px 22px; background: var(--mono-white); border: 1px solid var(--mono-border); border-radius: 16px;
    transition: transform var(--mono-dur, .2s) var(--mono-ease, ease), box-shadow var(--mono-dur, .2s) ease, border-color var(--mono-dur, .2s) ease;
}
.dsg-uses__card:hover { transform: translateY(-3px); box-shadow: var(--mono-shadow-hover, 0 12px 28px rgba(17,24,39,.08)); border-color: var(--mono-lime, #ccea4a); }
.dsg-uses__i { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mono-lime-pale, #fbfde8); color: var(--mono-ink); margin-bottom: 12px; }
.dsg-uses__card h3 { margin: 0; font-family: var(--mono-font-display); font-size: 15.5px; font-weight: 700; color: var(--mono-ink); }
.dsg-uses__card p { margin: 6px 0 0; font-size: var(--mono-fs-sm); color: var(--mono-text-muted); line-height: 1.55; }
.dsg-uses__card a { color: var(--mono-ink); border-bottom: 2px solid var(--mono-lime); padding-bottom: 1px; text-decoration: none; }

/* ---- FAQ: the foundation accordion, centred ---------------------------- */
.dsg-faq .mono-section-head { margin-left: auto; margin-right: auto; text-align: center; }
.dsg-faq .mono-faq2 { grid-template-columns: 1fr; max-width: 860px; margin: 0 auto; }
.dsg-faq .dsg-cta-row { justify-content: center; margin-top: 32px; }

/* ---- motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .dsg-flow__card, .dsg-uses__card, .dsg-feat__card { transition: none; }
}

/* ---- narrow ------------------------------------------------------------ */
@media (max-width: 979px) {
    .dsg-feat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsg-feat__card--wide { grid-template-columns: 44px minmax(0, 1fr); }
    .dsg-feat__art { display: none; }
    .dsg-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsg-flow__step:nth-child(3n + 1)::before, .dsg-flow__step:nth-child(3n)::after { display: block; }
    .dsg-flow__step:nth-child(2n + 1)::before, .dsg-flow__step:nth-child(2n)::after { display: none; }
    .dsg-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
    .dsg-h1__br { display: none; }
}
@media (max-width: 620px) {
    .dsg-flow { grid-template-columns: minmax(0, 1fr); }
    .dsg-flow__step::before, .dsg-flow__step::after { display: none !important; }
    .dsg-feat { grid-template-columns: minmax(0, 1fr); }
    .dsg-feat__card--wide { grid-column: span 1; }
    .dsg-uses { grid-template-columns: minmax(0, 1fr); }
    .dsg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .dsg-stats { grid-template-columns: minmax(0, 1fr); }
}

/* ---- the stage: a screenshot of the studio in the guide frame ------------- */
.dsg-shot { position: relative; margin: 44px auto 0; max-width: 1100px; border-radius: 20px; overflow: hidden; border: 1px solid var(--mono-border); background: #0b0d10; box-shadow: var(--mono-shadow-card, 0 18px 50px rgba(17,17,17,.08)); }
.dsg-shot img { display: block; width: 100%; height: auto; }
.dsg-shot__tag { position: absolute; left: 14px; top: 14px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--mono-lime, #ccea4a); color: var(--mono-ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.dsg-shot__tag--r { left: auto; right: 14px; background: rgba(255,255,255,.92); }

/* ---- plans: the table shell with tick / cross tiles ---------------------- */
.dsg-table--plans th:nth-child(3), .dsg-table--plans td:nth-child(3) { background: var(--mono-lime-pale, #fbfde8); }
.dsg-table--plans tbody tr:hover td:nth-child(3) { background: #f4f9d6; }
.dsg-table--plans td:first-child { white-space: normal; }
.dsg-yes, .dsg-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; margin-right: 8px; vertical-align: -6px; }
.dsg-yes { background: var(--mono-ink); color: var(--mono-lime, #ccea4a); }
.dsg-no { background: var(--mono-surface-subtle, #f9fafb); border: 1px solid var(--mono-border); color: var(--mono-gray-400, #9ca3af); }
.dsg-yes svg, .dsg-no svg { width: 13px; height: 13px; }

/* ---- four steps in one row (the flow with a 4-up modifier) --------------- */
.dsg-flow--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dsg-flow--4 .dsg-flow__step:nth-child(3n + 1)::before, .dsg-flow--4 .dsg-flow__step:nth-child(3n)::after { display: block; }
.dsg-flow--4 .dsg-flow__step:first-child::before, .dsg-flow--4 .dsg-flow__step:last-child::after { display: none; }

/* ---- dark cards: Photogen, the library --------------------------------- */
.dsg-dark { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px 40px; align-items: center; background: var(--mono-ink); color: #fff; border-radius: var(--mono-radius-xl, 24px); padding: clamp(28px, 4.5vw, 52px); }
.dsg-dark .mono-eyebrow { color: var(--mono-lime, #ccea4a); }
.dsg-dark__h2 { margin: 10px 0 0; font-family: var(--mono-font-display); font-size: clamp(1.5rem, 2.8vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: #fff; }
.dsg-dark p { margin: 12px 0 0; font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.72); }
.dsg-dark .dsg-cta-row { justify-content: flex-start; margin-top: 22px; }
.dsg-dark .mono-btn--primary { background: var(--mono-lime, #ccea4a); color: var(--mono-ink); border-color: var(--mono-lime, #ccea4a); }
.dsg-dark .mono-link { color: #fff; }
.dsg-dark__small { margin: 16px 0 0; font-size: 12.5px; color: rgba(255,255,255,.5); }
.dsg-dark__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.dsg-dark__tags li { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; }
.dsg-dark__figures ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.dsg-dark__figures li { list-style: none; padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.dsg-dark__figures strong { display: block; font-family: var(--mono-font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--mono-lime, #ccea4a); line-height: 1.1; }
.dsg-dark__figures span { display: block; margin-top: 4px; font-size: 12.5px; color: rgba(255,255,255,.66); }
.dsg-dark__photo { border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.dsg-dark__photo img { display: block; width: 100%; height: auto; }


@media (max-width: 979px) {
    .dsg-flow--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsg-flow--4 .dsg-flow__step:nth-child(2n + 1)::before, .dsg-flow--4 .dsg-flow__step:nth-child(2n)::after { display: none; }
    .dsg-flow--4 .dsg-flow__step:nth-child(2n)::before, .dsg-flow--4 .dsg-flow__step:nth-child(2n + 1)::after { display: block; }
    .dsg-flow--4 .dsg-flow__step:last-child::after { display: none; }
    .dsg-dark { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
    .dsg-flow--4 { grid-template-columns: minmax(0, 1fr); }
    .dsg-flow--4 .dsg-flow__step::before, .dsg-flow--4 .dsg-flow__step::after { display: none !important; }
    .dsg-shot { margin-top: 28px; border-radius: 14px; }
}

/* ---- phones: less padding per layer so the text gets the width ---------- */
@media (max-width: 620px) {
    .dsg .mono-section { padding: 36px 0; }
    .dsg-cap { padding: 20px 14px; border-radius: 18px; gap: 20px; }
    .dsg-cap__h2 { font-size: 1.45rem; }
    .dsg-feat { gap: 10px; }
    .dsg-feat__card { padding: 14px; gap: 12px; border-radius: 14px; }
    .dsg-feat__card--wide { grid-template-columns: 44px minmax(0, 1fr); }
    .dsg-flow__card { padding: 16px; }
    .dsg-uses__card { padding: 16px; }
    .dsg-pair { padding: 12px 12px 10px; border-radius: 16px; }
    .dsg-stats li { padding: 9px 12px; }
    .dsg-cta-row .mono-btn { width: 100%; justify-content: center; }
    .dsg .mono-lead { font-size: 15px; }
    .dsg-shot__tag--r { display: none; }
    .dsg-shot__tag { font-size: 11px; padding: 5px 10px; left: 10px; top: 10px; }
    .dsg-dark { padding: 22px 16px; border-radius: 18px; }
}
