

/* ============================================================
   Depth layer — «Рельеф» (2026-11-21)
   A customization on top of the site's stylesheet above. Three
   levels: raised (white, a ring and a dense layered shadow),
   well (a flat fill, no ring, no inner shadow) and flat (sections
   and reading text). Light comes from straight above; shadow
   ink is the system's ink (29, 29, 31), never pure black.
   The grammar is AlignUI's: nested fills white → paper → white,
   the Fancy button, a segmented thumb that floats.
   ============================================================ */
:root {
  /* A ring, then layers where blur = y and spread = -y/2, y doubling, alpha flat. */
  --shadow-raised: 0 0 0 1px rgba(29, 29, 31, .08), 0 1px 1px -.5px rgba(29, 29, 31, .035), 0 3px 3px -1.5px rgba(29, 29, 31, .035), 0 6px 6px -3px rgba(29, 29, 31, .035), 0 12px 12px -6px rgba(29, 29, 31, .035), 0 24px 24px -12px rgba(29, 29, 31, .035);
  --shadow-chip: 0 1px 2px rgba(29, 29, 31, .08);
  --shadow-seg-thumb: 0 0 0 1px rgba(29, 29, 31, .06), 0 2px 4px rgba(29, 29, 31, .06), 0 6px 10px rgba(29, 29, 31, .08);
  --shadow-range-knob: 0 0 0 1px rgba(29, 29, 31, .1), 0 2px 4px rgba(29, 29, 31, .1), 0 6px 10px rgba(29, 29, 31, .1), inset 0 1px 0 #fff;
  --pill-fill: #0068d2;
  --pill-fill-pressed: #005cb8;
}
/* Each section theme sets the raised surface, the well on the ground and the well inside a raised object. */
.sec[data-theme=light] { --raised: #fff; --well: #eaeaec; --well-in: var(--paper); --chip: #fff; }
.sec[data-theme=white] { --raised: #fff; --well: var(--paper); --well-in: var(--paper); --chip: #fff; }
.sec[data-theme=dark] { --raised: linear-gradient(180deg, #1e1e20, #151516); --well: #0f0f10; --well-in: rgba(255, 255, 255, .05); --chip: #2a2a2c; --shadow-raised: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 1px 0 rgba(255, 255, 255, .1); --shadow-chip: inset 0 1px 0 rgba(255, 255, 255, .08); }

/* ---------- Raised: every object that sits on a section ---------- */
.tile, .card, .plan, .compare > div, .voice, .chart, .aside, .table-wrap, #ch8-calc .ch8-calc { background: var(--raised, #fff); box-shadow: var(--shadow-raised); }
/* The stepper keeps its own long shadow and gains the ring. */
.stepper { box-shadow: 0 0 0 1px rgba(29, 29, 31, .08), 0 40px 80px -40px rgba(29, 29, 31, .16); }

/* ---------- Wells: flat fills ---------- */
/* A plan's head sits in a well: outer radius 30, inset 8, inner radius 22. Markup: .plan > .plan-head + dl. */
.plan:has(> .plan-head) { grid-row: span 4; padding: 8px 8px 28px; }
.plan-head { background: var(--well-in); border-radius: 22px; padding: 22px 20px 18px; }
.plan:has(> .plan-head) dl > div { padding: 0 20px; }
/* The callout is a well on the ground. A figure in it is a chip: outer radius 30, inset 10, inner radius 20. */
.callout, #ch5-levels .ch5-evidence { background: var(--well); }
.callout:has(> .api) { padding: 10px 10px 10px 34px; }
.callout .api { background: var(--chip); border-radius: 20px; padding: 16px 22px; box-shadow: var(--shadow-chip); }
.sec[data-theme=dark] .callout .api { color: var(--night-ink-2); }
.sec[data-theme=dark] .callout .api b { color: #fff; }
/* The decision panel of chapter 6: raised with wells inside on paper, a well with chips inside on white. */
#ch6[data-theme=light] .ch6-decide { box-shadow: var(--shadow-raised); }
#ch6[data-theme=white] :is(.ch6-q, .ch6-out:not(.is-write)) { box-shadow: var(--shadow-chip); }

/* ---------- Pills ---------- */
.pill { position: relative; -webkit-tap-highlight-color: transparent; transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
/* Primary: a ring in the fill colour, a 1px 2px drop, a 1px rim and a sheen that goes from 16% to 24% on hover.
   The fill is #0068d2, not --blue, so that white text keeps 4.5:1 under the sheen. */
.pill.primary, .pill.primary:hover { background: var(--pill-fill); box-shadow: 0 0 0 1px var(--pill-fill), 0 1px 2px rgba(29, 29, 31, .24); }
.pill.primary::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.pill.primary::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0) 40%); opacity: .16; transition: opacity .2s var(--ease); }
@media (hover: hover) { .pill.primary:hover::after { opacity: .24; } }
.pill.primary:active { background: var(--pill-fill-pressed); box-shadow: 0 0 0 1px var(--pill-fill-pressed), 0 1px 2px rgba(29, 29, 31, 0), inset 0 2px 3px rgba(0, 35, 95, .45); transform: scale(.985); }
.pill.primary:active::after { opacity: 0; }
/* Quiet: white, a ring and a small drop. Hover takes the drop away, press sinks it. */
.pill.quiet, .pill.quiet:hover { background: #fff; box-shadow: 0 0 0 1px rgba(29, 29, 31, .1), 0 1px 3px rgba(29, 29, 31, .12); }
@media (hover: hover) { .pill.quiet:hover { background: #f5f5f7; box-shadow: 0 0 0 1px rgba(29, 29, 31, .1), 0 1px 3px rgba(29, 29, 31, 0); } }
.pill.quiet:active { background: #ededf0; box-shadow: 0 0 0 1px rgba(29, 29, 31, .14), 0 1px 3px rgba(29, 29, 31, 0), inset 0 1px 3px rgba(29, 29, 31, .14); transform: scale(.985); }
.sec[data-theme=dark] .pill.quiet, .sec[data-theme=dark] .pill.quiet:hover { background: linear-gradient(180deg, #2c2c2e, #1c1c1e); color: #f5f5f7; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .14); }
@media (hover: hover) { .sec[data-theme=dark] .pill.quiet:hover { background: linear-gradient(180deg, #343436, #222224); } }
.sec[data-theme=dark] .pill.quiet:active { background: #111113; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 1px 2px rgba(0, 0, 0, .6); }

/* ---------- Calculator controls: the track is a well, the thumb and the knob are raised ---------- */
#ch8-calc .ch8-seg { background: #ececef; }
#ch8-calc .ch8-thumb { background: linear-gradient(180deg, #fff, #f8f8fa); box-shadow: var(--shadow-seg-thumb); }
#ch8-calc input[type=range]::-webkit-slider-thumb { background: linear-gradient(180deg, #fff, #efeff2); box-shadow: var(--shadow-range-knob); }
#ch8-calc input[type=range]::-moz-range-thumb { background: linear-gradient(180deg, #fff, #efeff2); box-shadow: var(--shadow-range-knob); }
#ch8-calc input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(0, 113, 227, .65), 0 3px 8px rgba(0, 0, 0, .16); }
#ch8-calc input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(0, 113, 227, .65), 0 3px 8px rgba(0, 0, 0, .16); }

/* ---------- Narrow screens ---------- */
@media (max-width: 680px) {
  /* The plans scroll sideways; the scroller needs room below or it clips the cards' shadows. */
  .plans { padding-top: 6px; padding-bottom: 44px; margin-bottom: -40px; }
  .callout:has(> .api) { padding: 24px 10px 10px; }
  .callout:has(> .api) p { padding: 0 22px; }
  .callout .api { max-width: none; }
  /* Tables fold into rows: the wrap goes flat, each stacked row is raised. */
  .table-wrap:has(> .dt-stack), .table-wrap:not(:has(.dt-stack)) { box-shadow: none; }
  .dt-stack tbody tr, .dt-stack tbody tr:nth-child(odd) { background: var(--raised, #fff); box-shadow: var(--shadow-raised); }
}
