/* 03 Always summer: the Island spread (js/weather.js), picked by Sam on Nov 21. Half and half: a translucent paper page
   with the month's almanac on the left, the island picture (on the page's canvas) on the right, the knob on the seam.
   Centre stage, the wheel and the knob layouts live on in versions/r21-options-night.
   Nov 21 evening: the knob in layers, the two-column almanac with its year chart, the caption pill, July's postmark
   by the month, and the exit in layers (see js/weather.js). */

html[data-wx="spread"] .dial { display: none !important; }
.as { position: absolute; inset: 0; pointer-events: none; --isle: #19B5B8; --isle-glow: rgba(25, 181, 184, .55); }
/* the head card's own wrapper, so the exit can move it (the card's drop-in stays js/main.js's) */
.as__hx { position: absolute; inset: 0; z-index: 3; pointer-events: none; transform-origin: 12% 26%; }

/* ---------- the left page: translucent paper over the moving bay, a fold shadow at the seam ---------- */
.as__page {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50%; z-index: 1;
  background: linear-gradient(100deg, rgba(255, 250, 240, .9) 0%, rgba(255, 248, 236, .82) 70%, rgba(255, 246, 232, .74) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 18px 0 40px rgba(15, 59, 64, .12), inset -1px 0 0 rgba(255, 255, 255, .6);
}
.as__page::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 10% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(to left, rgba(15, 59, 64, .07), rgba(15, 59, 64, 0) 9%); }
/* paper tooth: a fine noise, multiplied in */
.as__grain { position: absolute; inset: 0; opacity: .32; mix-blend-mode: multiply; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .48 0 0 0 0 .38 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* the window onto the island picture (the picture itself is on the canvas below) */
.as__win { position: absolute; left: 50%; right: 0; top: 0; bottom: 0; z-index: 1; }
.as__win .slot-label { top: 92px; left: auto; right: 20px; }

/* the caption on the picture: a frosted glass pill with a lit edge, the island's colour as a small bead */
.as__cap { position: absolute; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 9px; isolation: isolate;
  padding: 9px 15px 9px 11px; border-radius: 99px; font-size: 10.5px; line-height: 1; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .84) 0%, rgba(252, 248, 239, .7) 55%, rgba(246, 240, 228, .66) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), inset 0 -1px 0 rgba(15, 59, 64, .1), inset 0 0 0 1px rgba(255, 255, 255, .4),
    0 1px 2px rgba(15, 59, 64, .18), 0 6px 14px -4px rgba(15, 59, 64, .22), 0 18px 34px -12px rgba(15, 59, 64, .34); }
.as__cap::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: .38; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .42 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.as__capdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 45%), var(--isle);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .85), 0 0 12px var(--isle-glow), inset 0 -1px 1.5px rgba(0, 0, 0, .2); transition: background-color .5s, box-shadow .5s; }
.as__cap b { font-weight: 700; }
.as__capsep { width: 1px; height: 11px; background: rgba(15, 59, 64, .22); }
.as__capt { opacity: .55; margin-left: -1px; }

/* ---------- the words on the page ---------- */
html[data-wx="spread"] .weather__head {
  z-index: 3; left: var(--gutter); top: 12.5vh; width: calc(50vw - var(--gutter) - min(200px, 23vh) - 48px);
  background: none; box-shadow: none; padding: 0; transform: none; text-shadow: none;
}
html[data-wx="spread"] .weather__head::before, html[data-wx="spread"] .weather__head::after { display: none; }
html[data-wx="spread"] .weather__head .label { color: var(--ink); opacity: .62; }
html[data-wx="spread"] .weather__head .h2 { font-size: clamp(42px, 4.4vw, 76px); }
html[data-wx="spread"] .weather__line { font-size: 17px; max-width: 34ch; font-weight: 500; }

.as__copy { position: absolute; z-index: 3; left: var(--gutter); top: 46vh; width: calc(50vw - var(--gutter) - min(200px, 23vh) - 48px);
  display: grid; gap: var(--cg, clamp(12px, 2vh, 20px)); color: var(--ink); }
.as__why { margin: 0; font: italic 500 clamp(19px, 1.55vw, 24px)/1.3 var(--display); letter-spacing: -.012em; max-width: 30ch; text-wrap: balance; }

/* the month in five figures, each over a hairline gauge on its own scale (the almanac's language) */
.as__stats { margin: 0; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); padding-top: 12px; border-top: 1px solid rgba(15, 59, 64, .16); }
.as__st { display: grid; gap: 6px; align-content: start; padding: 0 10px; border-left: 1px solid rgba(15, 59, 64, .1); min-width: 0; }
.as__st:first-child { padding-left: 0; border-left: 0; }
.as__sl { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; opacity: .55; }
.as__st b { font: 700 17px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.as__st--isle b { color: var(--isle); transition: color .5s; }
.as__g { display: block; height: 3px; border-radius: 2px; background: rgba(15, 59, 64, .08); overflow: hidden; }
.as__g i { display: block; height: 100%; border-radius: inherit; background: var(--isle); transition: background-color .5s; }

/* the almanac: twelve months in two columns, each a bar of its air temperature in its island's colour */
.as__alm { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; position: relative; }
.as__alm::before { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1px; background: rgba(15, 59, 64, .1); }
.as__col { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--rg, 3px); }
.as__row { display: grid; grid-template-columns: 2.5em 1fr 2.2em; align-items: center; gap: 8px; height: var(--rh, clamp(15px, 2.15vh, 20px));
  padding: 0 7px 0 6px; margin: 0 -7px 0 -6px; border-radius: 8px; transition: background-color .35s, box-shadow .35s; }
.as__rm { font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .5; transition: opacity .3s; }
.as__bar { position: relative; display: block; height: 76%; border-radius: 99px; background: rgba(15, 59, 64, .045); }
.as__bar i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) * 100%); border-radius: inherit; background: var(--ct); overflow: hidden; transition: background .35s; }
.as__bar s { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 100%); visibility: hidden; }
.as__bar em { position: absolute; left: 7px; top: 50%; translate: 0 -50%; font: normal 500 7.8px/1 var(--mono); letter-spacing: .17em; text-transform: uppercase; color: rgba(15, 59, 64, .62); white-space: nowrap; transition: color .35s; }
.as__rv { font: 700 12px/1 var(--display); text-align: right; opacity: .62; transition: opacity .3s; }
.as__row.is-on { background-color: rgba(255, 255, 255, .8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(15, 59, 64, .05), 0 3px 10px rgba(15, 59, 64, .13); }
.as__row.is-on .as__rm { opacity: 1; font-weight: 700; }
.as__row.is-on .as__bar i { background: linear-gradient(90deg, var(--c), var(--c2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .08); }
.as__row.is-on .as__bar em { color: var(--tx); font-weight: 700; }
.as__row.is-on .as__rv { opacity: 1; }

/* the year as a small chart: hours of sun, the islands along the bottom, a marker on the knob's month */
.as__yr { display: block; width: 100%; height: 46px; overflow: visible; }
.as__yr .t { font: 500 8px var(--mono); letter-spacing: .2em; text-transform: uppercase; fill: rgba(15, 59, 64, .5); }
.as__yr .ar { fill: url(#asSun); }
.as__yr .ln { fill: none; stroke: #E39A2E; stroke-width: 1.6; stroke-linecap: round; }
.as__yr .ph line { stroke: rgba(15, 59, 64, .4); stroke-width: 1; stroke-dasharray: 2 2.5; }
.as__yr .ph circle { fill: var(--isle); stroke: #FFFDF8; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(15, 59, 64, .35)); transition: fill .5s; }

/* the big month: its mask leaves room for the italic's lean and the descenders (July, September), so it's never cut */
.as__read { position: absolute; z-index: 3; left: var(--gutter); bottom: 7.5vh; color: var(--ink); }
.as__rx { position: relative; display: grid; gap: 8px; justify-items: start; transform-origin: 0 100%; }
.as__num { font-size: 12px; letter-spacing: .2em; opacity: .5; }
.as__mask { display: block; overflow: hidden; font-size: var(--mfs, clamp(64px, min(7vw, 12.5vh), 124px)); padding: .06em .24em .26em .08em; margin: -.06em -.24em -.26em -.08em; }
.as__month { display: block; font: italic 800 1em/.92 var(--display); letter-spacing: -.045em; color: var(--accent); white-space: nowrap; }
/* July's postmark, pressed by the end of the month's name (placed by js/weather.js) */
.as__pmw { position: absolute; left: 0; top: 0; width: 240px; pointer-events: none; }
html[data-wx="spread"] .as__pmw .weather__mark { position: relative; left: auto; top: auto; width: 100%; mix-blend-mode: multiply; }
html[data-wx="spread"] .as__pmw .pm { filter: url(#ink); }

/* ---------- the knob on the seam, in layers at different heights, lit from up and to the left ----------
   1em is a hundredth of the knob, so it scales whole on a phone. --px / --py (-1 to 1) drift the layers apart. */
.as__dial { --d: min(400px, 46vh); --px: 0; --py: 0; position: absolute; z-index: 4; width: var(--d); height: var(--d); font-size: calc(var(--d) / 100);
  left: calc(50% - var(--d) / 2); top: calc(50% - var(--d) / 2 + 1vh); }
.as__dial > * { position: absolute; border-radius: 50%; }
/* the base plate: ceramic on the page, a raised rim with a bevel (a bright crest, darker towards its outer edge) */
.kb__plate { inset: 0;
  background: radial-gradient(circle closest-side, #F6EFE2 0 86%, #FFFDF8 89.5%, #F7F0E3 92.5%, #E6D9C2 97%, #CFBFA2 100%);
  box-shadow: 0 .4em .5em rgba(15, 59, 64, .16), 0 2.4em 4em -1em rgba(15, 59, 64, .2), 0 7em 9em -3em rgba(15, 59, 64, .32), 0 0 0 1px rgba(120, 96, 60, .14); }
/* the rim's light: bright where it faces the lamp (top left), in its own shade bottom right */
.kb__plate::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 135deg, rgba(70, 52, 28, .3), rgba(70, 52, 28, .08) 22%, rgba(255, 255, 255, .9) 50%, rgba(70, 52, 28, .08) 78%, rgba(70, 52, 28, .3));
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 86.5%, #000 88.5%); mask-image: radial-gradient(circle closest-side, transparent 86.5%, #000 88.5%); }
/* the printed face, a step below the rim: the rim shades its top left edge, light catches its bottom right */
.kb__face { inset: 6.2%;
  background: radial-gradient(circle at 38% 30%, #FFFEFA 0%, #FAF4E8 55%, #F0E5D2 100%);
  box-shadow: inset 1.3em 1.9em 2.8em -1em rgba(95, 70, 35, .38), inset -.6em -.8em 1.2em -.5em rgba(255, 255, 255, .95), 0 0 0 .22em rgba(110, 86, 52, .2), 0 0 0 .6em rgba(255, 255, 255, .35); }
.kb__face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .38 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.kb__scale { inset: 0; width: 100%; height: 100%; overflow: visible; border-radius: 0; transform-origin: 50% 50%; }
.kb__track { fill: none; stroke: rgba(15, 59, 64, .07); stroke-width: 6; }
.kb__hair { fill: none; stroke: rgba(15, 59, 64, .12); stroke-width: .8; }
.kb__prog { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.kb__scale line { stroke: rgba(15, 59, 64, .32); stroke-width: 1.3; }
.kb__scale line.l { stroke: rgba(15, 59, 64, .7); stroke-width: 2.4; }
.kb__m { font: 500 12.5px var(--mono); letter-spacing: .1em; fill: rgba(15, 59, 64, .5); transition: fill .25s; }
.kb__m.is-on { fill: var(--accent); font-weight: 700; }
/* the skirt's cast shadow on the face: it floats, so the shadow sits well off it and soft (it moves less than the knob) */
.kb__shadow { inset: 24%; background: radial-gradient(circle closest-side, rgba(12, 38, 42, .58) 58%, rgba(12, 38, 42, 0) 100%);
  filter: blur(1.5em); translate: calc(3em + var(--px) * .5em) calc(4.6em + var(--py) * .5em); }
/* the knob: a knurled metal skirt with a ceramic cap on it; a tight contact shadow where it nears the face */
.kb__knob { inset: 26%; will-change: transform; translate: calc(var(--px) * 1.4em) calc(var(--py) * 1.4em);
  box-shadow: 0 .3em .4em rgba(10, 30, 32, .42), .5em 1.2em 1.4em -.5em rgba(10, 30, 32, .45), 0 0 0 .2em rgba(40, 36, 28, .1); }
.kb__skirt, .kb__skirt-light { position: absolute; inset: 0; border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 0 70%, #000 71%); mask-image: radial-gradient(circle closest-side, transparent 0 70%, #000 71%); }
.kb__skirt { background: repeating-conic-gradient(from 0deg, #6c7377 0deg 1.4deg, #e6eaec 1.4deg 2.8deg, #a7aeb2 2.8deg 3.6deg); will-change: transform; }
/* the skirt's still light: brushed-metal streaks facing the lamp, a chamfer on its outer edge, shade where the cap sits */
.kb__skirt-light { background:
    conic-gradient(from 0deg, rgba(0, 0, 0, .06) 0deg, rgba(255, 255, 255, .25) 280deg, rgba(255, 255, 255, .78) 312deg, rgba(255, 255, 255, .22) 340deg, rgba(0, 0, 0, .06) 360deg),
    conic-gradient(from 0deg, rgba(0, 0, 0, 0) 90deg, rgba(0, 0, 0, .36) 140deg, rgba(255, 255, 255, .2) 168deg, rgba(0, 0, 0, .3) 190deg, rgba(0, 0, 0, 0) 250deg),
    radial-gradient(circle closest-side, rgba(0, 0, 0, .42) 70%, rgba(0, 0, 0, .05) 76%, rgba(0, 0, 0, 0) 88%, rgba(255, 255, 255, .28) 93%, rgba(0, 0, 0, .3) 100%);
  box-shadow: inset 0 0 0 1px rgba(36, 42, 46, .5); }
/* the cap's own shadow, cast onto the skirt (it sits a step higher) */
.kb__capshadow { inset: 13.5%; background: radial-gradient(circle closest-side, rgba(8, 20, 24, .66) 62%, rgba(8, 20, 24, 0) 100%);
  filter: blur(.75em); translate: calc(1.3em + var(--px) * .3em) calc(1.9em + var(--py) * .3em); }
.kb__top { position: absolute; inset: 14%; border-radius: 50%; translate: calc(var(--px) * 1em) calc(var(--py) * 1em); }
/* the cap: warm ceramic, a slight dish, a lit rim, an engraved coral line that shows the month */
.kb__cap, .kb__cap-light { position: absolute; inset: 0; border-radius: 50%; }
.kb__cap { background: radial-gradient(circle at 42% 36%, #FFFFFF 0%, #FAF5EC 38%, #EFE5D3 78%, #E0D2B9 100%); will-change: transform;
  box-shadow: 0 0 0 .38em rgba(70, 60, 50, .32), inset -1em -1.6em 2.4em rgba(120, 92, 55, .3), inset .7em 1em 1.2em rgba(255, 255, 255, .95), inset 0 0 0 .3em rgba(255, 255, 255, .45); }
.kb__line { position: absolute; left: 50%; top: 7%; width: 1.25em; height: 30%; margin-left: -.62em; border-radius: 1em; background: var(--accent);
  box-shadow: inset 0 .25em .5em rgba(110, 20, 10, .55), 0 .25em 0 rgba(255, 255, 255, .8); }
.kb__dot { position: absolute; left: 50%; top: 50%; width: 16%; height: 16%; margin: -8% 0 0 -8%; border-radius: 50%;
  background: radial-gradient(circle at 60% 65%, #FFFFFF 0%, #EFE6D6 60%, #E2D6C1 100%); box-shadow: inset 0 .5em .75em rgba(120, 95, 60, .35), 0 .15em 0 rgba(255, 255, 255, .9); }
/* the cap's gloss: it slides a little against the drift, as a real highlight would */
.kb__cap-light { pointer-events: none;
  background: radial-gradient(circle at calc(32% - var(--px) * 5%) calc(25% - var(--py) * 5%), rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 72% 80%, rgba(110, 85, 50, .18), rgba(110, 85, 50, 0) 55%),
    conic-gradient(from 135deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0) 25%, rgba(255, 255, 255, .3) 50%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, .14));
  -webkit-mask-image: radial-gradient(circle closest-side, #000 0 99%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 0 99%, transparent 100%); }

/* ---------- fitting short screens: tighter first, then the head's line goes ---------- */
html[data-wx-fit="1"] .as__copy, html[data-wx-fit="2"] .as__copy { --cg: 11px; --rh: 15px; --rg: 2px; }
html[data-wx-fit="2"][data-wx="spread"] .weather__line { display: none; }
html[data-wx-fit="2"][data-wx="spread"] .weather__head .h2 { font-size: clamp(40px, min(4.4vw, 7.4vh), 76px); }
@media (min-width: 761px) { html[data-wx-fit="2"] .as__mask { font-size: var(--mfs, clamp(60px, min(7vw, 12vh), 124px)); } }

@media (prefers-reduced-motion: reduce) { .as__row, .as__rm, .as__rv, .as__bar i, .as__bar em { transition: none; } }

/* ---------- phone: the picture on top, the page below, the knob on the seam at the right ---------- */
@media (max-width: 760px) {
  .as__page { left: 0; right: 0; top: 50%; bottom: 0; width: auto; box-shadow: 0 -14px 34px rgba(15, 59, 64, .12); }
  .as__page::before { background: radial-gradient(90% 70% at 0% 0%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 60%),
    linear-gradient(to bottom, rgba(15, 59, 64, .07), rgba(15, 59, 64, 0) 8%); }
  .as__win { left: 0; right: 0; top: 0; bottom: 50%; }
  .as__win .slot-label { top: 70px; right: auto; left: 14px; }
  .as__cap { bottom: 12px; right: auto; left: 14px; font-size: 9px; gap: 7px; padding: 7px 12px 7px 9px; }
  .as__capdot { width: 7px; height: 7px; }
  .as__dial { --d: 150px; left: auto; right: 14px; top: calc(50% - 75px); }
  .kb__m { font-size: 0; }
  html[data-wx="spread"] .weather__head { top: calc(50% + 18px); left: 16px; width: calc(100vw - 32px - 160px); }
  html[data-wx="spread"] .weather__head .h2 { font-size: 30px; }
  html[data-wx="spread"] .weather__line { display: none; }
  .as__copy { left: 16px; right: 16px; width: auto; top: calc(50% + 140px); gap: 12px; }
  .as__why { font-size: 15px; max-width: none; }
  .as__stats { padding-top: 9px; }
  .as__st { padding: 0 7px; gap: 5px; }
  .as__sl { font-size: 7.5px; letter-spacing: .16em; }
  .as__st b { font-size: 13.5px; }
  .as__alm { display: none; }
  .as__yr { height: 40px; }
  .as__read { left: 16px; bottom: 16px; }
  .as__rx { gap: 4px; }
  .as__num { font-size: 10px; }
  .as__mask { font-size: var(--mfs, 54px); }
}
