/* A Mac being used. Papers are the app's own tiles, at the size the app draws them. */
.demo { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; padding-top: calc(var(--nav) + env(safe-area-inset-top, 0px)); background: #fff; opacity: 0; visibility: hidden; }
.demo-top { flex: none; height: clamp(104px, 19vh, 190px); display: flex; flex-direction: column; justify-content: center; padding: clamp(8px, 1.8vh, 22px) var(--edge) clamp(8px, 1.6vh, 18px); text-align: center; }
.demo-title, .demo-note { overflow: hidden; }
.demo-title { padding-bottom: .1em; margin-bottom: -.1em; font-size: clamp(1.75rem, min(4.2vw, 6.8vh), 4.5rem); line-height: 1.04; letter-spacing: -.015em; }
.demo-note { margin-top: 5px; color: var(--soft); font-size: clamp(1rem, min(1.5vw, 2.6vh), 1.5rem); line-height: 1.25; }
.demo-title span, .demo-note span { display: block; }
.rail { margin-top: 2px; display: flex; justify-content: center; }
.rail button { position: relative; width: 30px; height: 26px; }
.rail button::after { content: ""; position: absolute; left: 3px; right: 3px; top: 11px; height: 4px; border-radius: 3px; background: #85858b; transition: scale 200ms var(--out); }
.rail button[aria-current="step"]::after { background: var(--ink); scale: 1 1.9; }

.mac {
  position: relative; flex: 1; min-height: 0; margin: 0 10px 10px; overflow: hidden; container-type: size;
  border: clamp(7px, .9vw, 14px) solid #050607; border-radius: clamp(18px, 2vw, 32px); background: #fff;
  -webkit-user-select: none; user-select: none; pointer-events: none;
}
.m-wall { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 35%; }
.m-bar {
  position: absolute; z-index: 5; inset: 0 0 auto; height: 30px; padding: 0 14px;
  display: flex; align-items: center; gap: 18px; white-space: nowrap;
  background: #f4f4f6; font-size: 13px; line-height: 1;
}
.m-icon { margin-left: auto; width: 34px; height: 24px; display: grid; place-items: center; border-radius: 6px; }
.m-icon img { width: 19px; height: 19px; }
.m-icon.on { background: #c9c9cf; }
.m-win { position: absolute; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 18px 44px rgba(0, 0, 0, .3); }
.m-title { position: relative; flex: none; height: 32px; padding: 0 12px; display: flex; align-items: center; gap: 7px; background: #ececef; font-size: 13px; }
.m-title i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.m-title i:nth-child(2) { background: #febc2e; }
.m-title i:nth-child(3) { background: #28c840; }
.m-title span { position: absolute; left: 50%; translate: -50% 0; white-space: nowrap; }
.m-read { z-index: 3; left: 3%; top: calc(30px + 5%); width: 43%; height: 80%; }
.m-article { padding: 4cqh 2.4cqw; font-size: clamp(14px, min(1.55cqw, 3cqh), 25px); line-height: 1.56; }
.m-article > b { display: block; margin-bottom: .55em; font-size: 1.7em; line-height: 1.1; font-weight: 650; }
.m-article p + p { margin-top: .7em; }
.m-code { z-index: 1; left: 40%; top: calc(30px + 2.5%); width: 32%; height: 46%; }
.m-code pre { margin: 0; padding: 2.4cqh 1.6cqw; font: 450 clamp(12px, min(1.15cqw, 2.3cqh), 19px)/1.5 ui-monospace, monospace; }
.m-code em { color: #8a1f5c; font-style: normal; }
.m-code u { color: #3f6b3a; text-decoration: none; }
.m-photo { z-index: 1; left: 47%; bottom: 3%; width: 31%; height: 46%; }
.m-photo > img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.m-dim { position: absolute; z-index: 2; inset: 30px 0 0; background: rgba(0, 0, 0, .62); opacity: 0; transition: opacity 360ms ease; }

.m-menu {
  position: absolute; z-index: 6; right: 8px; top: 35px; width: clamp(230px, 24cqw, 360px); max-height: calc(100% - 43px);
  padding: 14px; display: grid; gap: clamp(7px, 1.6cqh, 14px); overflow: hidden;
  border-radius: 18px; background: #fff; box-shadow: 0 22px 54px rgba(0, 0, 0, .34);
  transform-origin: 78% 0; opacity: 0; visibility: hidden; font-size: 13px; line-height: 1.1;
}
.mm-head { display: flex; justify-content: space-between; align-items: center; }
.mm-head b { font: 400 22px/1 "Washi Menu"; }
.mm-head i { position: relative; width: 38px; height: 23px; border-radius: 12px; background: var(--ink); }
.mm-head i::after { content: ""; position: absolute; right: 2px; top: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; }
.mm-now { position: relative; height: clamp(72px, 23cqh, 170px); padding: 12px; border-radius: 12px; overflow: hidden; background: #fff center / cover; background-blend-mode: multiply; }
.mm-now small { font-size: 12px; }
.mm-now strong { position: absolute; left: 12px; bottom: 10px; font: 400 30px/1 "Washi Menu"; }
.mm-now output { position: absolute; right: 12px; bottom: 11px; font: 400 18px/1 "Washi Menu"; font-variant-numeric: tabular-nums; }
.mm-papers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.mm-papers i { height: clamp(28px, 9cqh, 62px); border-radius: 8px; background: #fff center / cover; background-blend-mode: multiply; box-shadow: inset 0 0 0 1px #dedee3; }
.mm-papers i.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.mm-weight { display: flex; align-items: center; gap: 12px; }
.mm-weight > div { position: relative; flex: 1; height: 22px; background: repeating-linear-gradient(90deg, #8e8e93 0 1px, transparent 1px 10%) 0 50% / 100% 10px no-repeat; }
.mm-weight i { position: absolute; left: 50%; top: 0; width: 5px; height: 22px; margin-left: -2px; border-radius: 3px; background: #c72c1c; }
.mm-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mm-tools span { height: 30px; display: grid; place-items: center; border-radius: 15px; background: #ececef; }
.mm-tools span.on { background: var(--ink); color: #f5f5f7; }

.m-light { position: absolute; z-index: 7; inset: 0; opacity: 0; transition: opacity 420ms var(--out); }
.m-guide { position: absolute; z-index: 7; left: 0; right: 0; top: 0; height: 36px; box-shadow: 0 0 0 3000px rgba(0, 0, 0, .34); opacity: 0; }
.m-rest, .m-art { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; clip-path: inset(0 0 100% 0); }
.m-rest { background: #f1f3f4; }
.m-rest i { width: 28cqh; height: 28cqh; border: 2px solid var(--ink); border-radius: 50%; }
.m-rest b { padding: 0 14px; text-align: center; font: 400 clamp(24px, min(4.6cqw, 8cqh), 72px)/1.1 "Washi Menu"; }
.m-rest span { font: 400 clamp(22px, 6cqh, 52px)/1 "Washi Menu"; font-variant-numeric: tabular-nums; }
.m-art { background: #e4e7e9; }
.m-art img { width: auto; height: auto; max-width: 82%; max-height: 68%; border: 2.4cqh solid #fff; outline: 1cqh solid #18181a; }
.m-art p { padding: 0 12px; text-align: center; font-size: 13px; line-height: 1.35; }
.m-sheets { position: absolute; z-index: 9; inset: 0; pointer-events: none; }
.m-sheets i { position: absolute; inset: 0; background: 0 0 / 512px 512px repeat; clip-path: inset(0 0 100% 0); }
.m-edge { position: absolute; z-index: 10; left: 0; right: 0; top: 0; height: 3px; background: #c72c1c; opacity: 0; }
.m-loupe { position: absolute; z-index: 11; left: 55%; top: 22%; width: min(44cqh, 34cqw); aspect-ratio: 1; opacity: 0; }
.m-loupe i { position: absolute; inset: 0; border: 4px solid var(--ink); border-radius: 50%; background: #fff; overflow: hidden; }
.m-loupe i::after { content: ""; position: absolute; inset: 0; background: #eef1f1 url(assets/papers/linen.webp) 40% 60% / 190%; background-blend-mode: multiply; filter: brightness(.7) contrast(2.4); }
.m-loupe span { position: absolute; left: 50%; bottom: 8%; translate: -50% 0; padding: 7px 13px; border-radius: 16px; background: var(--ink); color: #f5f5f7; font-size: 13px; white-space: nowrap; }
.m-cursor { position: absolute; z-index: 12; left: 0; top: 0; width: 24px; fill: #000; stroke: #fff; stroke-width: 1.5; opacity: 0; transform-origin: 2px 2px; }

.mac.night .m-win, .mac.night .m-menu { background: #232325; color: #f5f5f7; }
.mac.night .m-bar, .mac.night .m-title, .mac.night .mm-tools span { background: #343437; color: #f5f5f7; }
.mac.night .mm-tools span.on { background: #f5f5f7; color: var(--ink); }
.mac.night .mm-now { color: var(--ink); }
.mac.night .mm-head i { background: #6a6a6e; }
.mac.night .m-wall { filter: brightness(.32); }
.mac.night .m-code em { color: #f09abd; }
.mac.night .m-code u { color: #9fd08f; }
.mac.focusing .m-dim { opacity: 1; }
.mac.lit .m-light { opacity: 1; }

/* Before and after */
.compare { padding: clamp(56px, 9vh, 110px) 12px 0; background: #fff; }
.compare > .title, .compare-sub { padding: 0 calc(var(--edge) - 12px); }
.compare-sub { margin: 12px 0 clamp(20px, 3vh, 36px); color: var(--soft); font-size: clamp(1.0625rem, 1.5vw, 1.5rem); }
.versus { position: relative; height: min(72svh, 780px); min-height: 400px; overflow: hidden; border: clamp(7px, .9vw, 14px) solid #050607; border-radius: clamp(18px, 2vw, 32px); background: #fff; --cut: 50%; }
.page-demo { position: absolute; inset: 0; display: grid; grid-template-columns: 1.1fr .9fr; }
.page-demo article { padding: clamp(56px, 9vh, 100px) clamp(20px, 4vw, 70px) 20px; font-size: clamp(1.0625rem, 1.65vw, 1.75rem); line-height: 1.55; }
.page-demo article b { display: block; margin-bottom: .5em; font-size: 1.9em; line-height: 1.1; font-weight: 650; }
.page-demo article p + p { margin-top: .7em; }
.page-demo img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.versus-paper { position: absolute; inset: 0; background: url(assets/tiles/linen-day.webp) 0 0 / 512px 512px; opacity: .82; clip-path: inset(0 0 0 var(--cut)); pointer-events: none; }
.versus-edge { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 3px; margin-left: -1px; background: #c72c1c; pointer-events: none; }
.versus-edge b { position: absolute; left: 50%; top: 62%; translate: -50% -50%; width: 52px; height: 52px; border-radius: 50%; background: #c72c1c; }
.versus-edge b::before, .versus-edge b::after { content: ""; position: absolute; top: 22px; width: 8px; height: 8px; border: solid #fff; border-width: 2px 2px 0 0; }
.versus-edge b::before { left: 14px; rotate: -135deg; }
.versus-edge b::after { right: 14px; rotate: 45deg; }
.versus input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.versus:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.versus-tag { position: absolute; top: 12px; padding: 8px 15px; border-radius: 20px; background: var(--ink); color: #f5f5f7; font-size: .9375rem; font-weight: 600; pointer-events: none; }
.versus-tag.without { left: 12px; }
.versus-tag.with { right: 12px; }
.reasons { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 14px 34px; padding: clamp(22px, 4vh, 44px) calc(var(--edge) - 12px) 0; font-size: clamp(1.0625rem, 1.3vw, 1.375rem); line-height: 1.3; }
.reasons b { display: block; margin-bottom: 4px; font-size: 1.35em; font-weight: 640; }

@media (max-width: 700px) {
  .m-read { left: 4%; top: calc(30px + 3%); width: 92%; height: 72%; }
  .m-code { left: 34%; width: 72%; height: 38%; top: auto; bottom: 14%; }
  .m-photo { left: -6%; bottom: 2%; width: 56%; height: 32%; }
  .m-article { padding: 14px; font-size: clamp(14px, min(4.4cqw, 3cqh), 22px); line-height: 1.5; }
  .m-bar { gap: 10px; }
  .m-bar > span:not(.m-clock) { display: none; }
  .m-menu { left: 6px; right: 6px; width: auto; }
  .mm-papers i { height: clamp(28px, 7cqh, 48px); }
  .mm-now { height: clamp(64px, 17cqh, 120px); }
  .m-loupe { left: 22%; top: 38%; width: min(56cqw, 40cqh); }
  .page-demo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .page-demo article { padding: 58px 18px 16px; }
  .page-demo article p + p { display: none; }
  .reasons { grid-template-columns: minmax(0, 1fr); }
  .rail button { width: 24px; }
  .demo-top { height: 158px; padding: 4px 14px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .demo-top { height: 66px; padding: 4px 16px 2px; }
  .demo-note { display: none; }
  .demo-title { font-size: 1.5rem; }
  .mm-head { display: none; }
  .m-menu { gap: 5px; padding: 8px; }
  .mm-now { height: 52px; }
  .mm-papers i { height: 24px; }
  .versus { min-height: 270px; height: 80svh; }
}
