/* Week 03 · Luxurious ("Calm glass"): shared by the switch, checkbox and radio prototypes.
   After a quiet, warm interior: a dusk-brown room lit by one low lamp, and every
   surface frosted glass, the light behind it softened rather than shown. Cream
   type in a tight modern sans, hairline edges, nothing that glints. The controls
   are glass too; turning something on fills it with warm lamplight. Motion is
   calm: it arrives on a spring with no bounce and leaves quickly.
   Every number the Spec section prints is a custom property here or on the
   component page, so the spec reads what the prototype runs on. */

@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500&display=swap");

:root {
  /* colour */
  --room-top: #4a3829;        /* the room, from the ceiling... */
  --room-mid: #6b5040;
  --room-low: #33261d;        /* ...to the floor */
  --lamp: rgba(236, 200, 152, .5);   /* the one warm light behind the glass */
  --cream: #f4eadf;           /* labels */
  --cream-soft: rgba(244, 234, 223, .7);   /* supporting text */
  --glass: rgba(255, 242, 228, .055);      /* the glass: barely tinted */
  --glass-edge: rgba(255, 242, 228, .32);  /* its hairline edge, a touch brighter so the clear pane still has a border */
  --glass-line: rgba(255, 242, 228, .55);  /* control outlines when off */
  --glass-fill: rgba(255, 242, 228, .08);  /* inside a control when off */
  --warm-1: #e2bf90;          /* lamplight, the fill when on */
  --warm-2: #f3dfc0;
  --umber: #3a2a1e;           /* the check and dot drawn on lamplight */

  /* type */
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --title-size: 22px;
  --title-line: 26px;
  --title-weight: 500;
  --label-size: 17px;
  --label-line: 22px;
  --label-weight: 500;
  --support-size: 12.5px;
  --support-line: 17px;
  --support-weight: 400;

  /* layout */
  --card-w: 380px;
  --card-r: 26px;
  --card-pad: 22px;
  --blur: 5px;                /* barely frosted: what is behind shows through, just softened */
  --row-h: 66px;
  --row-gap: 16px;

  /* line */
  --stroke: 1px;
  --mark-stroke: 1.75px;

  /* motion: arrive on a spring with no bounce, leave quicker */
  --arrive-dur: .67s;         /* 0.4 s visual; the rest is the settle */
  --arrive-ease: linear(0, 0.023, 0.077, 0.144, 0.223, 0.305, 0.38, 0.456, 0.527, 0.587, 0.645, 0.695, 0.738, 0.777, 0.811, 0.839, 0.864, 0.885, 0.903, 0.919, 0.932, 0.942, 0.952, 0.96, 0.966, 0.972, 0.976, 0.98, 0.984, 0.986, 0.989, 0.991, 0.992, 0.994, 0.995, 0.996, 0.996, 0.997, 0.997, 0.998, 1);
  --leave-dur: .22s;
  --leave-ease: cubic-bezier(.3, 0, .2, 1);
  --fade-dur: .32s;
  --draw-dur: .3s;
  --draw-delay: .12s;
  --press-dur: .18s;

  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  :root { --arrive-dur: .01s; --leave-dur: .01s; --draw-dur: .01s; --draw-delay: 0s; --press-dur: .01s; --fade-dur: .15s; }
}
/* inside the short preview cards on the week page, the same panel with less air */
@media (max-height: 380px) {
  :root { --card-pad: 14px; --row-h: 54px; --title-size: 18px; --title-line: 22px; }
  .stage { padding: 8px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--room-low); }
body {
  margin: 0; color: var(--cream);
  font: var(--label-weight) var(--label-size) / var(--label-line) var(--font);
  -webkit-font-smoothing: antialiased;
  /* a dusk room with one low lamp; soft shapes give the glass something to blur */
  background:
    radial-gradient(40% 26% at 50% 6%, var(--lamp), transparent 72%),     /* the lamp, high, like a ceiling light */
    radial-gradient(28% 40% at 18% 70%, rgba(160, 118, 82, .45), transparent 70%),
    radial-gradient(26% 36% at 84% 62%, rgba(120, 88, 62, .5), transparent 70%),
    linear-gradient(180deg, var(--room-top) 0%, var(--room-mid) 52%, var(--room-low) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.stage { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

/* something behind the glass to see through it: the lit edge of a curved canopy,
   like the bed's light strip in the reference, half hidden by the panel */
body::before {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  left: 50%; top: 50%; width: min(78vw, 340px); height: min(70vh, 380px);
  translate: -22% -58%;
  border: 2px solid rgba(240, 205, 160, .7);
  border-radius: 160px 160px 22px 22px;
  box-shadow: 0 0 26px rgba(240, 205, 160, .35), inset 0 0 26px rgba(240, 205, 160, .18);
}

/* a frosted glass panel: translucent, blurred, a hairline edge, a faint light along its top */
.card {
  width: min(100%, var(--card-w)); margin: 0; min-inline-size: 0;
  padding: var(--card-pad);
  border: var(--stroke) solid var(--glass-edge); border-radius: var(--card-r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.15); backdrop-filter: blur(var(--blur)) saturate(1.15);
  box-shadow: 0 30px 60px -28px rgba(20, 12, 6, .45), inset 0 1px 0 rgba(255, 242, 228, .26), inset 0 -1px 0 rgba(255, 242, 228, .08);
}
.card h1, .card legend {
  float: left; width: 100%;
  margin: 0 0 6px; padding: 0 4px;
  font-size: var(--title-size); line-height: var(--title-line); font-weight: var(--title-weight);
  letter-spacing: -.02em;
}
.card legend + *, .card h1 + * { clear: both; }

.row {
  position: relative;
  display: flex; align-items: center; gap: var(--row-gap);
  min-height: var(--row-h); padding: 8px 4px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 4px; right: 4px; border-top: var(--stroke) solid var(--glass-edge); opacity: .6; }
.text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.label { font-size: var(--label-size); line-height: var(--label-line); font-weight: var(--label-weight); letter-spacing: -.01em; }
.support { font-size: var(--support-size); line-height: var(--support-line); font-weight: var(--support-weight); color: var(--cream-soft); }

.sr-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sr-input:focus-visible + .ctl { outline: var(--stroke) solid var(--cream); outline-offset: 5px; }
.ctl { flex: none; position: relative; display: block; }
/* hover: the control's glass clears a little */
.row:hover .ctl { --glass-fill: rgba(255, 242, 228, .16); }

.back-pill {
  position: fixed; left: 12px; top: 12px; z-index: 9;
  font: 500 12px/1 var(--font); color: var(--cream);
  background: var(--glass); border: var(--stroke) solid var(--glass-edge);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 8px 12px; border-radius: 999px; text-decoration: none;
}

/* ---------- Spec, on a glass panel of its own ---------- */
.spec {
  max-width: 720px; margin: 0 auto 72px; padding: 28px 28px 32px;
  background: var(--glass); border: var(--stroke) solid var(--glass-edge); border-radius: var(--card-r);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.spec h2 { margin: 0 0 4px; font: 500 30px/36px var(--font); letter-spacing: -.02em; }
.spec > p { margin: 0 0 24px; font: 400 14px/21px var(--font); color: var(--cream-soft); }
.spec h3 { margin: 28px 0 8px; font: 500 11px/16px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--cream-soft); }
.spec table { width: 100%; border-collapse: collapse; font: 400 14px/21px var(--font); }
.spec td { padding: 10px 0; border-top: var(--stroke) solid var(--glass-edge); vertical-align: top; }
.spec tr:last-child td { border-bottom: var(--stroke) solid var(--glass-edge); }
.spec td:first-child { width: 42%; padding-right: 16px; color: var(--cream-soft); }
.spec td:last-child { font-variant-numeric: tabular-nums; }
.spec code { font: 400 12.5px/18px ui-monospace, Menlo, monospace; color: var(--cream-soft); }
.swatch { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: var(--stroke) solid var(--glass-edge); }
