/* Sharpe & Clear — live demos of the Level I sales page, version 2 (used with demo2.js).
   Everything sits inside .d2-strip and every class starts with "d2-": the page's classes and the demos' never meet.
   Two looks on the same tokens: navy cards by default (the site's look); white cards with .d2-strip.d2-light, used on
   the sales page so the demos stand out on the navy page, like the light app in the screenshots.
   No external file, no url(), no inline style (the site's CSP is style-src 'self'). */

.d2-strip {
  --d2-surface: #121a33; --d2-surface-2: #0e1631; --d2-surface-3: #18234a;
  --d2-line: #26335e; --d2-line-2: #3a4a7a;
  --d2-ink: #f1f5f9; --d2-ink-2: #cbd5e1; --d2-ink-3: #a3b1c6;
  --d2-sky: #38bdf8; --d2-sky-t: #38bdf8; --d2-teal: #2dd4bf; --d2-gold: #fbbf24; --d2-gold-t: #fbbf24; --d2-pink: #f472b6;
  --d2-good: #4ade80; --d2-bad: #fb7185; --d2-base: #3a4a7a; --d2-grid: #223058;
  --d2-grad: linear-gradient(135deg, #38bdf8, #2dd4bf); --d2-on-grad: #06121f;
  --d2-ring: rgba(56, 189, 248, .5); --d2-card-line: rgba(56, 189, 248, .35); --d2-shadow: 0 0 0 4px rgba(56, 189, 248, .10);
  --d2-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--d2-ink); font-size: 16px; line-height: 1.5; text-align: left;
}
.d2-strip.d2-light {
  --d2-surface: #ffffff; --d2-surface-2: #f4f7fb; --d2-surface-3: #e8eef6;
  --d2-line: #dfe6f0; --d2-line-2: #c3cedc;
  --d2-ink: #0b1020; --d2-ink-2: #334155; --d2-ink-3: #4f5d72;
  --d2-sky: #0284c7; --d2-sky-t: #0369a1; --d2-teal: #0d9488; --d2-gold: #d97706; --d2-gold-t: #b45309; --d2-pink: #db2777;
  --d2-good: #15803d; --d2-bad: #be123c; --d2-base: #8a9bb3; --d2-grid: #e6ecf4;
  --d2-ring: rgba(56, 189, 248, .55); --d2-card-line: #ffffff;
  --d2-shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 24px 60px rgba(0, 0, 0, .40);
}
.d2-strip.d2-light .d2-fallback { background: #ffffff; }
.d2-strip *, .d2-strip *::before, .d2-strip *::after { box-sizing: border-box; }
.d2-strip strong, .d2-strip b { color: inherit; }   /* the page's own strong colour (light text) must not leak into white cards */
.d2-strip [hidden] { display: none !important; }
.d2-fallback, .d2-error { margin: 0; padding: 16px; border: 1px dashed var(--d2-line-2); border-radius: 14px; color: var(--d2-ink-2); }

/* ---------------------------------------------------------------- tab bar */
.d2-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.d2-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; margin: 0;
          padding: 7px 4px; border: 1.5px solid var(--d2-line); border-radius: 14px; background: var(--d2-surface-2); color: var(--d2-ink-2);
          font: 700 14px/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer;
          transition: border-color .15s, background .15s, color .15s; }
.d2-tab:hover { border-color: var(--d2-sky); color: var(--d2-ink); }
.d2-tab[aria-selected="true"] { border-color: var(--d2-sky); background: var(--d2-surface); color: var(--d2-ink); box-shadow: 0 0 0 3px var(--d2-ring); }
.d2-tab .d2-ico { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d2-tab[aria-selected="true"] .d2-ico { stroke: var(--d2-sky-t); }
@media (min-width: 640px) {
  .d2-tabs.d2-n6, .d2-tabs.d2-n5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .d2-tabs.d2-n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .d2-tab { flex-direction: row; gap: 7px; min-height: 46px; font-size: 15px; }
}

/* ---------------------------------------------------------------- the card: one column on a phone, two on a wide screen */
.d2-card { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 7px; margin: 0; padding: 14px;
           grid-template-areas: "top" "title" "lead" "stats" "viz" "controls" "aha";
           background: var(--d2-surface); border: 1px solid var(--d2-card-line); border-radius: 20px; box-shadow: var(--d2-shadow); }
.d2-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.d2-topic { color: var(--d2-ink-3); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.d2-next { flex: none; margin: 0; padding: 4px 2px; border: 0; background: none; color: var(--d2-sky-t); font-family: inherit; font-size: 14px;
           font-weight: 700; line-height: 1.2; cursor: pointer; }
.d2-next:hover { text-decoration: underline; }
.d2-title { grid-area: title; margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: var(--d2-ink); }
.d2-lead { grid-area: lead; margin: 0; color: var(--d2-ink-2); font-size: 15px; line-height: 1.45; }
.d2-stats { grid-area: stats; display: flex; gap: 10px; }
.d2-stats:empty { display: none; }
.d2-viz { grid-area: viz; min-width: 0; }
.d2-aha { grid-area: aha; margin: 0; padding: 8px 12px; min-height: calc(2.8em + 16px); border-left: 3px solid var(--d2-gold); border-radius: 0 10px 10px 0;
          background: color-mix(in srgb, var(--d2-gold) 9%, var(--d2-surface)); color: var(--d2-ink); font-size: 15px; line-height: 1.4; }
.d2-controls { grid-area: controls; display: grid; gap: 10px 14px; align-content: start; }
.d2-controls.d2-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d2-controls.d2-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d2-controls .d2-span { grid-column: 1 / -1; }
.d2-viz > .d2-controls { margin-top: 10px; }
@media (min-width: 820px) {
  .d2-card { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); column-gap: 28px; row-gap: 10px; padding: 20px 24px;
             grid-template-areas: "top viz" "title viz" "lead viz" "stats viz" "controls viz" "aha viz" ". viz";
             grid-template-rows: auto auto auto auto auto auto 1fr; }
  .d2-title { font-size: 23px; }
  .d2-lead { font-size: 16px; }
  .d2-viz { align-self: center; }
  .d2-aha { font-size: 15.5px; }
}

/* ---------------------------------------------------------------- key numbers */
.d2-stat { flex: 1 1 0; min-width: 0; padding: 4px 10px 5px; border: 1px solid var(--d2-line); border-radius: 12px; background: var(--d2-surface-2); }
.d2-stat.d2-hl { border-color: var(--d2-card-line); background: color-mix(in srgb, var(--d2-sky) 9%, var(--d2-surface)); }
.d2-stat-v { color: var(--d2-ink); font: 800 22px/1.15 var(--d2-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d2-stat.d2-hl .d2-stat-v { color: var(--d2-sky-t); }
.d2-stat-l { color: var(--d2-ink-3); font-size: 13px; line-height: 1.3; }
.d2-t-up { color: var(--d2-good) !important; fill: var(--d2-good); }
.d2-t-down { color: var(--d2-bad) !important; fill: var(--d2-bad); }
@media (min-width: 820px) { .d2-stat-v { font-size: 26px; } }

/* ---------------------------------------------------------------- sliders */
.d2-slider { display: flex; flex-direction: column; gap: 0; margin: 0; min-width: 0; font-weight: 400; cursor: pointer; }
.d2-s-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.d2-s-label { color: var(--d2-ink-2); font-weight: 700; }
.d2-s-val { color: var(--d2-sky-t); font: 800 15px var(--d2-mono); white-space: nowrap; }
.d2-s-ticks { display: flex; justify-content: space-between; gap: 6px; margin-top: -2px; color: var(--d2-ink-3); font-size: 12.5px; }
.d2-strip input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 36px; margin: 0; padding: 0;
                                background: transparent; cursor: pointer; }
.d2-strip input[type="range"]:focus-visible { outline: 3px solid var(--d2-gold); outline-offset: 2px; border-radius: 8px; }
.d2-strip input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px;
  background: linear-gradient(to right, var(--d2-sky) 0 var(--p, 50%), var(--d2-line-2) var(--p, 50%) 100%); }
.d2-strip input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--d2-line-2); }
.d2-strip input[type="range"]::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--d2-sky); }
.d2-strip input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: var(--d2-surface); border: 4px solid var(--d2-sky); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .1s; }
.d2-strip input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--d2-surface); border: 4px solid var(--d2-sky); }
.d2-strip input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.d2-hint input[type="range"]::-webkit-slider-thumb { animation: d2-pulse 1.6s ease-out infinite; }
.d2-hint input[type="range"]::-moz-range-thumb { animation: d2-pulse 1.6s ease-out infinite; }
@keyframes d2-pulse { 0% { box-shadow: 0 0 0 0 var(--d2-ring); } 70% { box-shadow: 0 0 0 12px rgba(56, 189, 248, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }

/* ---------------------------------------------------------------- buttons */
.d2-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; margin: 0;
          padding: 8px 12px; border: 1.5px solid var(--d2-line-2); border-radius: 12px; background: var(--d2-surface-2); color: var(--d2-ink);
          font: 700 16px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; transition: transform .1s, border-color .15s; }
.d2-btn:hover { border-color: var(--d2-sky); }
.d2-btn:active { transform: scale(.97); }
.d2-btn:disabled { opacity: .45; cursor: default; transform: none; }
.d2-btn small { color: var(--d2-ink-3); font-size: 13px; font-weight: 600; }
.d2-btn-choice { font-size: 17px; }
.d2-btn-main { border: 0; background: var(--d2-grad); color: var(--d2-on-grad); }
.d2-btn-main:hover { filter: brightness(1.06); }
.d2-btn-grade { padding: 6px 4px; font-size: 15px; }

/* ---------------------------------------------------------------- charts */
.d2-chart { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; }
.d2-chart text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.d2-axis-t { fill: var(--d2-ink-3); font-size: 12px; }
.d2-note-t { fill: var(--d2-ink-3); font-size: 12px; font-style: italic; }
.d2-grid { stroke: var(--d2-grid); stroke-width: 1; }
.d2-axis { stroke: var(--d2-line-2); stroke-width: 1.2; }
.d2-face { stroke: var(--d2-ink-3); stroke-width: 1; stroke-dasharray: 4 4; opacity: .8; }
.d2-legend { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; color: var(--d2-ink-2); font-size: 13px; }
.d2-lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.d2-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.d2-sw-base, .d2-bar-base { background: var(--d2-base); fill: var(--d2-base); }
.d2-sw-int, .d2-bar-int { background: var(--d2-sky); fill: var(--d2-sky); }
.d2-sw-ioi, .d2-bar-ioi { background: var(--d2-gold); fill: var(--d2-gold); }
.d2-dbl { fill: var(--d2-gold-t); font-size: 12px; font-weight: 800; }
/* seesaw */
.d2-pivot { fill: var(--d2-surface-3); stroke: var(--d2-line-2); stroke-width: 1.5; }
.d2-ground { stroke: var(--d2-line-2); stroke-width: 2; stroke-linecap: round; }
.d2-plank { fill: var(--d2-ink-3); }
.d2-pill { fill: var(--d2-surface); stroke-width: 2.2; }
.d2-pill-rate { stroke: var(--d2-sky); }
.d2-pill-price { stroke: var(--d2-ink-3); transition: stroke .2s, fill .2s; }
.d2-pill-price.d2-up { stroke: var(--d2-good); fill: color-mix(in srgb, var(--d2-good) 12%, var(--d2-surface)); }
.d2-pill-price.d2-down { stroke: var(--d2-bad); fill: color-mix(in srgb, var(--d2-bad) 12%, var(--d2-surface)); }
.d2-pill-k { fill: var(--d2-ink-3); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.d2-pill-v { fill: var(--d2-ink); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d2-curve { fill: none; stroke: var(--d2-sky); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d2-guide { stroke: var(--d2-gold); stroke-width: 1.5; stroke-dasharray: 3 3; }
.d2-dot-now { fill: var(--d2-gold); stroke: var(--d2-surface); stroke-width: 2; }
.d2-dot-up { fill: var(--d2-good); stroke: var(--d2-surface); stroke-width: 1.5; }
.d2-dot-down { fill: var(--d2-bad); stroke: var(--d2-surface); stroke-width: 1.5; }
.d2-mark-t, .d2-leg-t { font-size: 13px; font-weight: 800; paint-order: stroke; stroke: var(--d2-surface); stroke-width: 4px; stroke-linejoin: round; }
.d2-cap { display: none; margin: 6px 0 0; color: var(--d2-ink-2); font-size: 14px; line-height: 1.4; }
@media (min-width: 820px) { .d2-cap { display: block; } }
/* eggs */
.d2-l-a { fill: none; stroke: var(--d2-sky); stroke-width: 2; opacity: .7; stroke-linejoin: round; }
.d2-l-b { fill: none; stroke: var(--d2-pink); stroke-width: 2; opacity: .7; stroke-linejoin: round; }
.d2-l-mix { fill: none; stroke: var(--d2-gold); stroke-width: 3.6; stroke-linejoin: round; stroke-linecap: round; }
.d2-lab-a { fill: var(--d2-sky-t); font-size: 13px; font-weight: 800; }
.d2-lab-b { fill: var(--d2-pink); font-size: 13px; font-weight: 800; }
.d2-lab-mix { fill: var(--d2-gold-t); font-size: 13px; font-weight: 800; }

/* ---------------------------------------------------------------- ethics: violation or OK? */
.d2-pips { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.d2-pip { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--d2-line-2); transition: background .2s, border-color .2s; }
.d2-pip-ok { background: var(--d2-good); border-color: var(--d2-good); }
.d2-pip-no { background: var(--d2-bad); border-color: var(--d2-bad); }
.d2-pip-label { margin-left: 6px; color: var(--d2-ink-3); font-size: 14px; font-weight: 700; }
.d2-case { padding: 14px 16px; border: 1.5px solid var(--d2-line-2); border-radius: 16px; background: var(--d2-surface-2); }
.d2-case-k { margin: 0 0 4px; color: var(--d2-ink-3); font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.d2-case-t { margin: 0; color: var(--d2-ink); font-size: 17px; font-weight: 650; line-height: 1.45; }
/* category (neutral) + one-line reason */
.d2-verdict { margin: 0; color: var(--d2-ink-2); font-size: 15.5px; line-height: 1.45; }
.d2-verdict.d2-shown { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--d2-line); animation: d2-pop .3s ease; }
.d2-cat { display: inline-block; margin-right: 4px; padding: 1px 9px; border: 1.5px solid var(--d2-ink-3); border-radius: 999px;
          background: var(--d2-surface); color: var(--d2-ink); font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
/* correctness: on the learner's own answer only */
.d2-yours { display: flex; flex-direction: column; justify-content: center; min-height: 48px; margin: 0; padding: 4px 12px; border: 2px solid; border-radius: 12px;
            line-height: 1.2; animation: d2-pop .3s ease; }
.d2-yours small { color: var(--d2-ink-3); font-size: 13px; font-weight: 700; }
.d2-yours b { font-size: 16px; font-weight: 800; }
.d2-yours-ok { border-color: var(--d2-good); background: color-mix(in srgb, var(--d2-good) 10%, var(--d2-surface)); }
.d2-yours-ok b { color: var(--d2-good); }
.d2-yours-no { border-color: var(--d2-bad); background: color-mix(in srgb, var(--d2-bad) 9%, var(--d2-surface)); }
.d2-yours-no b { color: var(--d2-bad); }
@keyframes d2-pop { from { opacity: 0; transform: translateY(4px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- flashcards */
.d2-track { width: 100%; }
.d2-rail { position: relative; height: 28px; border: 1px solid var(--d2-line); border-radius: 99px; background: var(--d2-surface-2); }
.d2-dot { position: absolute; left: 2px; top: 2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
          background: var(--d2-grad); color: var(--d2-on-grad); font: 800 12px/1 system-ui, sans-serif;
          transition: transform .6s cubic-bezier(.2, .9, .3, 1.25); }
.d2-dot-2 { margin-left: 5px; }
.d2-dot-3 { margin-left: 10px; }
.d2-ticks { display: flex; justify-content: space-between; margin-top: 3px; color: var(--d2-ink-3); font-size: 12px; }
.d2-flip { display: block; width: 100%; height: 150px; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit;
           text-align: left; cursor: pointer; perspective: 900px; }
.d2-flip:disabled { cursor: default; }
.d2-flip-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s ease; transform-style: preserve-3d; }
.d2-flip.d2-on .d2-flip-in { transform: rotateY(180deg); }
.d2-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px 18px;
           border: 1.5px solid var(--d2-line-2); border-radius: 16px; background: var(--d2-surface-2);
           -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.d2-back { transform: rotateY(180deg); border-color: var(--d2-teal); background: color-mix(in srgb, var(--d2-teal) 10%, var(--d2-surface)); }
.d2-face-k { color: var(--d2-ink-3); font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.d2-face-t { color: var(--d2-ink); font-size: 17px; font-weight: 700; line-height: 1.4; }
.d2-back .d2-face-t { font-size: 15.5px; font-weight: 650; }
@media (min-width: 820px) { .d2-flip { height: 160px; } .d2-face-t { font-size: 18px; } .d2-back .d2-face-t { font-size: 16.5px; } }

/* ---------------------------------------------------------------- trap of the day */
.d2-trapcard { padding: 12px 14px; border: 1.5px dashed var(--d2-gold); border-radius: 16px;
               background: color-mix(in srgb, var(--d2-gold) 8%, var(--d2-surface)); }
.d2-trap-k { margin: 0 0 5px; color: var(--d2-gold-t); font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.d2-trap-claim { margin: 0; color: var(--d2-ink); font-size: 16px; font-weight: 700; line-height: 1.4; }
.d2-shown .d2-trap-claim { color: var(--d2-ink-2); text-decoration: line-through; text-decoration-color: var(--d2-bad); text-decoration-thickness: 2px; }
.d2-trap-truth { margin: 8px 0 0; padding: 8px 11px; border: 1px solid var(--d2-line); border-left: 4px solid var(--d2-good); border-radius: 12px;
                 background: var(--d2-surface); color: var(--d2-ink); font-size: 14.5px; font-weight: 500; line-height: 1.4; animation: d2-pop .35s ease; }
.d2-trap-truth strong { font-weight: 800; }
@media (min-width: 820px) { .d2-trap-claim { font-size: 17px; } .d2-trap-truth { font-size: 15.5px; } }

@media (max-width: 360px) {
  .d2-card { padding: 12px; }
  .d2-stat-v { font-size: 19px; }
  .d2-case-t, .d2-face-t, .d2-trap-claim { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .d2-strip *, .d2-strip *::before, .d2-strip *::after { transition: none !important; animation: none !important; }
}
