/* The page is the demo: switch it on and everything you are reading is on Washi */
.worn { position: fixed; z-index: 55; inset: 0; overflow: hidden; pointer-events: none; }
.worn i { position: absolute; inset: 0; background: 0 0 / 512px 512px repeat; clip-path: inset(0 0 100% 0); }
.lamp-wash { position: fixed; z-index: 56; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: multiply; }

.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 22px 0 9px; border-radius: 30px; background: var(--mist); box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); font-weight: 600; font-size: 1.0625rem; white-space: nowrap; pointer-events: auto; }
.switch i { position: relative; width: 60px; height: 36px; flex: none; border-radius: 20px; background: #8a8a90; }
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff url(assets/washi-sheet.webp) center / 460%;
  transition: translate 220ms var(--out);
}
.switch[aria-checked="true"] i { background: #2f7d4f; }
.switch[aria-checked="true"] i::after { translate: 24px 0; }
.switch:active { scale: .97; }
.say .offer .m > span { flex-wrap: wrap; justify-content: center; white-space: normal; gap: 10px 14px; }
.say .offer .m { max-width: 100%; }

.dock {
  position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); translate: -50% 0;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 16px); padding: 6px 18px 6px 6px;
  border-radius: 34px; background: var(--ink); color: #f5f5f7; font-size: .9375rem; white-space: nowrap;
  transition: transform 320ms var(--out);
}
.dock.away { transform: translateY(170%); visibility: hidden; }
.dock .switch { min-height: 44px; padding: 0 10px 0 3px; box-shadow: none; background: transparent; color: inherit; }
.dock input { width: 130px; height: 40px; margin: 0; accent-color: #f5f5f7; touch-action: pan-y; }
.dock output { min-width: 64px; font-variant-numeric: tabular-nums; }
.dock a { display: flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }

/* The demo, in the page */
.how { background: #fff; }
.how .demo { position: relative; inset: auto; height: 100vh; height: 100svh; min-height: 540px; max-height: 1300px; opacity: 1; visibility: visible; }
.demo-controls { display: flex; align-items: center; justify-content: center; gap: 4px; }
.demo-controls .rail { margin: 0; }
.demo-controls .rail button { height: 44px; }
.demo-controls .rail button::after { top: 20px; }
.demo-play { position: relative; width: 44px; height: 44px; flex: none; }
.demo-play i { position: absolute; left: 16px; top: 15px; width: 12px; height: 14px; border: solid var(--ink); border-width: 0 4px; }
.demo-play.paused i { left: 18px; width: 0; height: 0; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent var(--ink); }

/* Twenty papers */
.papers { padding: clamp(56px, 9vh, 110px) 12px 12px; background: #fff; }
.papers > .title, .papers-sub { padding: 0 calc(var(--edge) - 12px); }
.papers-sub { margin: 12px 0 clamp(20px, 3vh, 36px); color: var(--soft); font-size: clamp(1.0625rem, 1.5vw, 1.5rem); }
.sheets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sheets button {
  position: relative; width: 100%; height: clamp(150px, 22vh, 250px); padding: 16px 18px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  border-radius: 20px; background: #fff center / cover; background-blend-mode: multiply; color: var(--ink); text-align: left;
  box-shadow: inset 0 0 0 1px #dedee3; transition: scale 180ms var(--out);
}
.sheets button.pale { color: #fff; }
.sheets b { font-size: clamp(1.125rem, 1.6vw, 1.75rem); line-height: 1.1; font-weight: 640; }
.sheets span { margin-top: 4px; font-size: .9375rem; line-height: 1.25; }
.sheets em { position: absolute; left: 18px; top: 14px; font: normal 400 1.5rem "Washi Menu"; }
.sheets button[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: -4px; }
.sheets button:active { scale: .97; }

/* A lamp with a switch */
.lamps-stage > .fill { transition: filter 420ms ease; }
.pool { transition: opacity 420ms ease; }
.lamps-stage.off > .fill { filter: brightness(.16); }
.lamps-stage.off .pool { opacity: 0; }
.lamps-stage.off .lamp-names button { color: #93999d; }
.lamps-sub { margin-top: 12px; color: #c7cbce; font-size: clamp(1rem, 1.3vw, 1.3125rem); font-weight: 500; }
.lamps-words .switch { align-self: flex-start; margin-top: clamp(12px, 2.4vh, 28px); }

@media (hover: hover) and (pointer: fine) {
  .switch:hover { scale: 1.03; }
  .sheets button:hover { scale: 1.025; }
}
@media (max-width: 900px) {
  .sheets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sheets button { height: 124px; padding: 12px; }
  .sheets em { left: 12px; top: 8px; font-size: 1.125rem; }
  .sheets span { font-size: .875rem; }
  .dock { gap: 8px; padding-right: 14px; }
  .dock output { display: none; }
  .dock input { width: 78px; }
  .lamps-words { padding-top: 14px; padding-bottom: 74px; }
  .lamps-words .switch { min-height: 44px; margin-top: 8px; }
  .lamps-stage > .fill { height: 56%; }
  .demo-controls .rail button { width: 22px; }
}
@media (max-width: 600px) {
  .demo-controls .rail button { width: auto; flex: 1; min-width: 0; }
  .demo-controls .rail { flex: 1; }
  .demo-controls { align-self: stretch; }
}
@media (max-width: 420px) {
  .dock a { display: none; }
  .say .offer .pill, .say .offer .switch { min-height: 46px; font-size: 1rem; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .how .demo { min-height: 0; }
  .demo-controls .rail button, .demo-play { height: 26px; }
  .demo-controls .rail button::after { top: 11px; }
  .demo-play i { top: 6px; }
  .lamps-words .switch { min-height: 38px; margin-top: 4px; }
}

/* Room for the dock, and for the words above the Macs */
.how .demo { padding-bottom: 64px; }
@media (max-aspect-ratio: 17/20) {
  .open .product { display: none; }
  .say .offer .pill, .say .offer .switch { min-height: 46px; }
}
@media (max-width: 600px) {
  .demo-controls .rail li { flex: 1; min-width: 0; }
  .demo-controls .rail button { width: 100%; }
  .say .offer .pill, .say .offer .switch { padding-right: 14px; font-size: .9375rem; }
  .say .offer .pill { padding-left: 14px; }
  .say .offer .switch { padding-left: 5px; gap: 8px; }
  .say .offer .switch i { width: 52px; }
  .say .offer .switch[aria-checked="true"] i::after { translate: 16px 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .open .product, .open .does { display: none; }
  .say .offer .pill, .say .offer .switch { min-height: 42px; }
  .dock input, .dock a, .dock output { display: none; }
  .how .demo { padding-bottom: 8px; }
  .mm-now small { display: none; }
}
@media (max-width: 360px) {
  .say { left: 12px; right: 12px; }
  .say h1, .say h2 { font-size: 2.125rem; }
  .open .does { font-size: .9375rem; }
}
@media (max-width: 420px) and (max-height: 620px) {
  .open .does { display: none; }
}
