/* The selling devices of wave 8 (tools/devices.py, site/js/devices.js): paper, plum ink and berry, the colors flat and exact.
   Without JavaScript or with reduced motion every device shows its final state; .is-wait is only ever set by the script. */

.dv { --dv-gap: var(--s4); color: var(--ink); }
.dv-h3 { font: 400 clamp(24px, 2.4vw, 32px)/1.15 var(--serif); letter-spacing: -.015em; margin: 0; }
.dv-h3 em { font-style: italic; color: var(--berry); }
.dv-more { margin: 0; font-size: var(--fs-2); line-height: 1.5; }
.dv-foot { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
html:not(.js) .dv-ctl { display: none; }

/* chips with their color, and the skin depth scale */
.dv-ctl { display: grid; gap: var(--s3); }
.dv-row { display: grid; gap: var(--s2); }
.dv-row-k { margin: 0; font: 600 12.5px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); }
.dv-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.dv-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card);
  color: var(--ink); font: 500 14.5px/1.2 var(--sans); cursor: pointer; }
.dv-chip::before { content: ""; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px var(--line-2); }
.dv-chip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dv-chip:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }
/* skin depth: a thin track painted with the scale, lighter to deeper, and a round thumb in the skin it gives; 44px tall to touch */
.dv-scale { display: grid; gap: 2px; max-width: 360px; }
.dv-depth-in { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.dv-depth-in::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--grad); box-shadow: inset 0 0 0 1px rgba(43, 34, 48, .18); }
.dv-depth-in::-moz-range-track { height: 10px; border-radius: 999px; background: var(--grad); box-shadow: inset 0 0 0 1px rgba(43, 34, 48, .18); }
.dv-depth-in::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: var(--sk); border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px var(--ink), 0 6px 14px -6px rgba(43, 34, 48, .6); }
.dv-depth-in::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--sk); border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px var(--ink), 0 6px 14px -6px rgba(43, 34, 48, .6); }
.dv-depth-in:focus { outline: none; }
.dv-depth-in:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 5px var(--berry); }
.dv-depth-in:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 5px var(--berry); }
.dv-ends { display: flex; justify-content: space-between; margin: 0; font: 500 12.5px/1.2 var(--sans); color: var(--ink-2); }

/* ---------- the drape ---------- */
.dv-drape-grid { display: grid; gap: var(--s4); align-items: start; }
.dv-stage { position: relative; max-width: 420px; width: 100%; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: var(--s3) var(--s3) 0; }
.dv-face { display: block; width: 100%; height: auto; overflow: visible; }
.dv-face .dv-skin { stroke: var(--ink); stroke-width: 2.2; }
.dv-face .dv-hair { fill: var(--ink); }
.dv-face .dv-cloth { stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.dv-face .dv-folds path { stroke: rgba(43, 34, 48, .28); stroke-width: 2; stroke-linecap: round; }
.dv-face .dv-refl { opacity: .34; }
.dv-face .dv-cast { opacity: .2; }
.dv-face .dv-tired { opacity: .13; }
.dv-face .dv-glow { opacity: .07; }
.dv-face .dv-ink path { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dv-face .dv-line { stroke: var(--paper); stroke-width: 4; }
.dv-face .dv-knob circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.dv-face .dv-knob path { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html:not(.js) .dv-face .dv-knob { display: none; }
.dv-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.dv-stage:has(.dv-range:focus-visible) { outline: 3px solid var(--berry); outline-offset: 3px; }
.dv-side { display: grid; gap: var(--s4); align-content: start; }
.dv-says { display: grid; gap: var(--s3); }
.dv-say { display: grid; gap: 6px; padding-top: var(--s3); border-top: 1px solid var(--line-2); }
.dv-say p { margin: 0; font-size: var(--fs-3); line-height: 1.5; }
.dv-say-k { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dv-say-k b { font: 400 21px/1.2 var(--serif); letter-spacing: -.01em; }
.dv-say--r .dv-say-k b { color: var(--berry); }
.dv-sw { flex: none; width: 22px; height: 22px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px var(--line-2); }
/* two columns only when the device itself is wide (the home page); in a narrow column (a guide's body, an article) it stacks */
.dv-drape { container-type: inline-size; }
@container (min-width: 720px) {
  .dv-drape-grid { grid-template-columns: minmax(300px, 5fr) 6fr; gap: clamp(32px, 4vw, 64px); }
  .dv-stage { margin: 0; }
}

/* ---------- three apps ---------- */
.dv-apps { display: grid; gap: var(--s5); }
.dv-phones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dv-ph { display: grid; gap: var(--s2); align-content: start; cursor: default; }
.dv-ph[role="button"] { cursor: pointer; }
.dv-ph:focus-visible { outline: 3px solid var(--berry); outline-offset: 4px; border-radius: 18px; }
.dv-ph-screen { position: relative; display: grid; justify-items: center; gap: 6px; aspect-ratio: 9 / 16; padding: 18px 8px 12px; border: 6px solid var(--ink); border-radius: 20px;
  background: var(--tint); overflow: hidden; text-align: center; align-content: center; }
.dv-ph-screen::before { content: ""; position: absolute; top: 4px; left: 50%; width: 28%; height: 5px; margin-left: -14%; border-radius: 3px; background: var(--ink); }
.dv-ph-k { margin: 0; font: 600 12.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.dv-mini { width: 72%; max-width: 92px; height: auto; }
.dv-mini .dv-hair { fill: var(--ink); }
.dv-mini-skin { stroke: var(--ink); stroke-width: 1.6; }
.dv-mini-ink { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.dv-ph-r { margin: 0; font: 400 13px/1.25 var(--sans); color: var(--ink); }
.dv-ph-r b { display: block; font: 400 clamp(15px, 1.6vw, 21px)/1.15 var(--serif); letter-spacing: -.01em; }
.dv-ph-sw { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
.dv-ph-sw li { width: 16px; height: 16px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(43, 34, 48, .18); }
.dv-ph-why { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.dv-ph-scan { display: none; margin: 0; font: 500 12.5px/1.2 var(--sans); color: var(--ink-2); }
.dv-apps.is-wait .dv-ph:not(.is-done) .dv-ph-scan { display: block; }
.dv-apps.is-wait .dv-ph:not(.is-done) .dv-ph-r, .dv-apps.is-wait .dv-ph:not(.is-done) .dv-ph-sw { opacity: 0; transform: translateY(6px); }
.dv-apps.is-wait .dv-ph-r, .dv-apps.is-wait .dv-ph-sw { transition: opacity .45s var(--ease), transform .45s var(--ease); }
.dv-apps.is-wait .dv-ph:not(.is-done) .dv-ph-screen::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; top: 30%; background: var(--berry); opacity: .7; animation: dv-scan 1.1s ease-in-out infinite alternate; }
@keyframes dv-scan { to { top: 62%; } }
.dv-apps-side { display: grid; gap: var(--s3); align-content: start; }
.dv-ours { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.dv-ours li { padding-top: var(--s3); border-top: 1px solid var(--line-2); font-size: var(--fs-3); line-height: 1.5; }
.dv-ours b { font-weight: 700; }
@media (min-width: 900px) {
  .dv-apps { grid-template-columns: 6fr 5fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
  .dv-phones { gap: var(--s4); }
  .dv-ph-sw li { width: 22px; height: 22px; }
  .dv-ph-r { font-size: 14.5px; }
}

/* ---------- the same swatch, three lights ---------- */
.dv-light { display: grid; gap: var(--s4); }
.dv-lts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.dv-lt { display: grid; gap: 6px; align-content: start; }
.dv-lt-sw { display: block; aspect-ratio: 4 / 3; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .5s var(--ease); }
.dv-lt--color .dv-lt-sw { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.dv-lt-k, .dv-lt-x { margin: 0; }
.dv-lt-k b { font: 400 19px/1.2 var(--serif); letter-spacing: -.01em; }
.dv-lt-k code { display: block; margin-top: 2px; font: 500 13px/1.2 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .04em; color: var(--ink-2); }
.dv-lt-x { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.dv-light.is-wait .dv-lt { opacity: 0; transform: translateY(10px); }
.dv-light.is-in .dv-lt { transition: opacity .6s var(--ease) calc(var(--i) * 140ms), transform .6s var(--ease) calc(var(--i) * 140ms); }
@media (min-width: 900px) { .dv-lts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); } }

/* ---------- two fans ---------- */
.dv-twin { display: grid; gap: var(--s3); }
.dv-tw-fans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.dv-tw-side { margin: 0; display: grid; gap: var(--s2); justify-items: center; padding: var(--s3) var(--s2) var(--s2); background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.dv-tw-n { font: 400 clamp(19px, 2vw, 26px)/1.15 var(--serif); letter-spacing: -.01em; text-align: center; }
.dv-tw-side[data-side="b"] .dv-tw-n { color: var(--berry); }
.dv-twin .fan { --stick-w: 22px; --stick-h: 124px; --arc: 64deg; width: 100%; }
.dv-twin .stick span { font-size: 12.5px; max-height: calc(var(--stick-h) * .3); }
.dv-twin .stick.is-match { box-shadow: 0 0 0 2px var(--berry), 0 10px 22px -12px rgba(43, 34, 48, .6); }
.dv-twin .stick.is-up { transform: rotate(var(--a)) translateY(-16px); }
.dv-tw-out { margin: 0; min-height: 3em; font-size: var(--fs-3); line-height: 1.5; text-align: center; }
.dv-tw-out b { font-weight: 700; }
@media (min-width: 900px) { .dv-twin .fan { --stick-w: 34px; --stick-h: 210px; --arc: 84deg; } .dv-tw-fans { gap: var(--s4); } }

/* ---------- one pain at a time ---------- */
.dv-rot { display: grid; margin: 0; }
.dv-rot-i { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.dv-rot-i.is-on { opacity: 1; transform: none; }
.hh-pain { font: italic 400 clamp(20px, 1.9vw, 26px)/1.3 var(--serif); letter-spacing: -.01em; color: var(--berry); max-width: 26ch; }

/* ---------- the sample, part by part (/guides/<season>) ---------- */
.sh-ans { display: block; margin-top: 4px; font: 600 12.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--berry); }
.dv-sample { list-style: none; margin: var(--s4) 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.dv-sample li { display: grid; gap: 6px; align-content: start; }
.dv-sample img, .dv-sample .dv-toc { display: block; width: 100%; height: auto; aspect-ratio: 8.5 / 11; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 0 rgba(43, 34, 48, .1), 0 12px 22px -16px rgba(43, 34, 48, .6); background: var(--card); }
.dv-toc { padding: 14% 12%; box-sizing: border-box; }
.dv-toc b { display: block; margin-bottom: 16px; font: 400 clamp(14px, 1.4vw, 19px)/1 var(--serif); }
.dv-toc i { display: block; height: 2px; margin: 0 0 12px; background: var(--line-2); }
.dv-toc i:nth-child(odd) { width: 78%; }
.dv-sample p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.dv-sample p b { display: block; font: 600 12.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--berry); }
@media (min-width: 900px) { .dv-sample { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* the pain line that opens the skin pages and the device block under it */
.sk-pain { margin: 0 0 var(--s3); font: italic 400 clamp(20px, 2vw, 26px)/1.3 var(--serif); color: var(--berry); max-width: 30ch; }
.dv-block { margin: var(--s6) auto; }
.dv-block > .dv-h3 { margin-bottom: var(--s4); }

@media (prefers-reduced-motion: reduce) {
  .dv-rot-i, .dv-lt, .dv-lt-sw, .dv-ph-r, .dv-ph-sw { transition: none; }
  .dv-apps .dv-ph-screen::after { animation: none; display: none; }
}
.dv-lede { margin: 0 0 var(--s4); max-width: 52ch; font-size: var(--fs-3); line-height: 1.55; }
.dv-drape > .sl-sub-h { margin-bottom: var(--s2); }
.sp-tw-h { margin: var(--s6) 0 var(--s3); font: 400 clamp(24px, 2.4vw, 32px)/1.15 var(--serif); letter-spacing: -.015em; }
.sp-tw-h em, .dv-drape .sl-sub-h em { color: var(--berry); }
.ha-go { margin: var(--s3) 0 0; }
.tp-dv-head { margin-bottom: var(--s5); }
/* the small fans of the twin: the names live in the line under them, so the sticks are all color */
.dv-twin .stick span { position: absolute; left: 0; top: 0; max-height: none; opacity: 0; pointer-events: none; }
.dv-twin .stick::before { height: calc(100% - 5px); }
.sec.ha { padding-bottom: 0; margin-bottom: -12px; }
