/* S-03 Web: a browser window you resize yourself. The site inside is laid out at the
   chosen VIRTUAL width and scaled by --k (px per virtual px), so container queries
   on .wb-site reflow it live. All line work inside is sized in screen pixels (--lw). */

/* ------------------------------------------------------------ device row */
.wb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; }
.wb-dev { display: inline-flex; min-width: 0; }
.wb-dev__b {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.wb-dev__b + .wb-dev__b { margin-left: -1px; }
.wb-dev__b:hover { background: var(--paper-2); }
.wb-dev__b[aria-pressed="true"] { z-index: 1; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.wb-dev__b:focus-visible { z-index: 2; }
.wb-dev__i { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.wb-dev__n { font-size: 14px; font-weight: 500; line-height: 1; }
.wb-dev__w { font: 500 11px/1 var(--mono); letter-spacing: .04em; opacity: .62; }

/* ----------------------------------------------------------------- stage */
.wb {
  --pl: 18px; --pr: 26px; --pt: 14px; --pb: 20px;
  --rh: 48px;          /* ruler height */
  --k: .9;             /* screen px per virtual px, set by web.js */
  aspect-ratio: 1.6 / 1;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle, rgba(31, 53, 99, .17) .8px, transparent 1.3px) 0 0 / 18px 18px,
    var(--paper);
}
.wb__area { position: absolute; left: var(--pl); right: var(--pr); top: var(--pt); bottom: var(--pb); }

/* title-block note: what the layout does at the current width */
.wb-nb {
  position: absolute; z-index: 0; right: 4px; bottom: 0; width: 188px;
  border: 1px solid var(--line-strong); background: var(--sheet);
  transition: opacity .25s var(--ease);
}
.wb.is-nb-off .wb-nb { opacity: 0; }
.wb-nb__t {
  padding: 7px 10px 6px;
  border-bottom: 1px solid var(--line-strong);
  font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.wb-nb__r { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 8px 10px 8px; }
.wb-nb__r + .wb-nb__r { border-top: 1px dashed var(--line); }
.wb-nb__k { font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.wb-nb__v { display: none; font-size: 14px; font-weight: 500; line-height: 1.1; }
.wb-nb__v.is-on { display: block; animation: wb-flash .9s var(--ease); }
@keyframes wb-flash { from { color: var(--red); } to { color: var(--ink); } }

/* ruler: tick labels, scale with minor ticks, and the live dimension line */
.wb__ruler { position: absolute; left: 0; top: 0; width: calc(1280px * var(--k)); height: var(--rh); pointer-events: none; }
.wb__tk {
  position: absolute; top: 0; left: calc(var(--at) * var(--k) * 1px);
  transform: translateX(-50%);
  height: 24px;
  font: 500 10.5px/12px var(--mono); letter-spacing: .06em; color: var(--ink-3);
  transition: color .2s var(--ease);
}
.wb__tk::after {
  content: ""; position: absolute; left: 50%; top: 14px; width: 1px; height: 10px; margin-left: -.5px;
  background: var(--ink-3); transition: background .2s var(--ease);
}
.wb__tk--end { transform: translateX(-100%); }
.wb__tk--end::after { left: auto; right: 0; margin-left: 0; }
.wb__tk.is-on { color: var(--red); }
.wb__tk.is-on::after { background: var(--red); }
.wb__scale {
  position: absolute; left: 0; top: 24px; width: 100%; height: 6px;
  border-top: 1px solid var(--ink-3);
  background: repeating-linear-gradient(90deg, var(--ink-3) 0 1px, transparent 1px calc(80px * var(--k))) 0 0 / 100% 5px no-repeat;
}
.wb__dim {
  position: absolute; left: 0; top: 32px; height: 14px; width: calc(1280px * var(--k));
  background:
    linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 0 / 1px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 1px 100% no-repeat;
}
.wb__dim::before, .wb__dim::after {
  content: ""; position: absolute; top: 50%; margin-top: -3px;
  border: 3px solid transparent;
}
.wb__dim::before { left: 1px; border-left-width: 0; border-right: 7px solid var(--ink); }
.wb__dim::after { right: 1px; border-right-width: 0; border-left: 7px solid var(--ink); }
.wb__w {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 4px 7px 3px;
  background: var(--ink); color: var(--paper);
  width: max-content;
  font: 500 11px/1 var(--mono); letter-spacing: .04em; white-space: nowrap;
}
.wb__w i { font-style: normal; }
.wb__w b { font-weight: 500; display: inline-block; min-width: 3ch; text-align: right; }

/* dashed construction lines at the three standard widths */
.wb__guide {
  position: absolute; z-index: 0;
  left: calc(var(--at) * var(--k) * 1px);
  top: calc(var(--rh) + 2px); bottom: 0;
  border-left: 1px dashed rgba(31, 53, 99, .34);
}

/* ---------------------------------------------------------- browser window */
.wb__win {
  position: absolute; z-index: 1; left: 0; top: calc(var(--rh) + 12px); bottom: 0;
  width: calc(1280px * var(--k));
  display: flex; flex-direction: column;
  border-radius: 2px;
  background: #FBFAF6;
  box-shadow: 0 1px 0 rgba(31, 53, 99, .06), 0 26px 34px -28px rgba(31, 53, 99, .5);
  container: wbwin / inline-size;
}
.wb__win::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border: 1.5px solid var(--ink); border-radius: 2px;
}
.wb__chrome {
  flex: none; display: flex; align-items: center; gap: 12px;
  height: 34px; padding: 0 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
}
.wb__dots { display: flex; gap: 6px; }
.wb__dots i { width: 9px; height: 9px; border: 1.3px solid var(--ink); border-radius: 50%; }
.wb__addr {
  flex: 1; min-width: 0; height: 20px; padding: 0 10px;
  display: flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--sheet);
  font: 500 clamp(5.2px, 7.6cqi, 11px)/1 var(--mono); letter-spacing: 0; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden;
}
@container wbwin (max-width: 190px) {
  .wb__dots { display: none; }
  .wb__chrome { height: 26px; }
  .wb__chrome { padding: 0 4px; }
  .wb__addr { height: 16px; padding: 0 3px; justify-content: center; }
}
.wb__view {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - clamp(34px, 20%, 78px)), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - clamp(34px, 20%, 78px)), transparent);
}

/* drag handle on the right edge: the invisible hit area is 44px wide */
.wb__handle {
  position: absolute; z-index: 4; top: 0; bottom: 0; right: -16px; width: 44px;
  cursor: ew-resize; touch-action: pan-y; outline: none;
}
.wb__handle::before {
  content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--red); opacity: 0; transition: opacity .2s var(--ease);
}
.wb__grip {
  position: absolute; left: 28px; top: 50%; width: 16px; height: 60px; margin: -30px 0 0 -8px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  border-radius: 8px; background: var(--ink);
  box-shadow: 0 0 0 3px rgba(244, 241, 234, .92), 0 8px 16px -8px rgba(31, 53, 99, .65);
  transition: transform .25s var(--ease);
}
.wb__grip i { width: 1.5px; height: 22px; background: var(--paper); opacity: .85; }
.wb__handle:hover .wb__grip, .wb.is-dragging .wb__grip { transform: scale(1.1); }
.wb__handle:hover::before, .wb__handle:focus-visible::before, .wb.is-dragging .wb__handle::before { opacity: 1; }
.wb__handle:focus-visible .wb__grip { box-shadow: 0 0 0 3px rgba(244, 241, 234, .92), 0 0 0 5px var(--red); }

/* ------------------------------------------------- the fictional company site */
.wb-site {
  --m: calc(1px / max(var(--k), .235));       /* about one screen pixel in virtual px (capped so tiny stages stay sane) */
  --lw: max(1px, calc(1.3px / var(--k)));     /* line width: always about 1.3 screen px */
  --hs: calc(7px / var(--k));                 /* hatch pitch */
  --c: var(--ink);
  --c2: rgba(31, 53, 99, .52);
  --c3: rgba(31, 53, 99, .2);
  --hatch: repeating-linear-gradient(-45deg, var(--c3) 0 var(--lw), transparent var(--lw) var(--hs));
  position: absolute; left: 0; top: 0; width: 1280px;
  transform-origin: 0 0;
  container: wbsite / inline-size;
  background: #FBFAF6; color: var(--ink);
  font-family: var(--font);
  pointer-events: none;
}
.wb-site > * {
  --px: clamp(22px, 5cqi, 64px);
  --fl: max(clamp(15px, 1.7cqi, 21px), calc(7.5 * var(--m)));
  --fn: max(clamp(13px, 1.3cqi, 17px), calc(7 * var(--m)));
  --fh: max(clamp(30px, 4.5cqi, 58px), calc(11 * var(--m)));
  --fp: max(clamp(14px, 1.45cqi, 19px), calc(7 * var(--m)));
  --fb: max(clamp(13px, 1.2cqi, 16px), calc(6.5 * var(--m)));
  --fc: max(clamp(15px, 1.6cqi, 21px), calc(7.5 * var(--m)));
}

.ws__head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(14px, 2.2cqi, 24px) var(--px);
  border-bottom: var(--lw) solid var(--c);
}
.ws__logo { display: inline-flex; align-items: center; gap: .55em; font-size: var(--fl); font-weight: 800; line-height: 1; letter-spacing: .1em; }
.ws__mark {
  width: 1.15em; height: 1.15em; flex: none;
  border: var(--lw) solid var(--c);
  background: var(--hatch);
}
.ws__nav { display: flex; align-items: center; gap: clamp(16px, 2.8cqi, 38px); font-size: var(--fn); font-weight: 500; line-height: 1; white-space: nowrap; }
.ws__cta { padding: .62em 1.15em; border: var(--lw) solid var(--c); border-radius: 99px; }
.ws__burger {
  display: none; flex-direction: column; align-items: center; justify-content: space-between;
  --bs: max(42px, calc(13 * var(--m)));
  box-sizing: border-box; width: var(--bs); height: var(--bs); padding: calc(var(--bs) * .27) 0;
  border: var(--lw) solid var(--c); border-radius: 6px;
}
.ws__burger i { width: 48%; height: var(--lw); background: var(--c); }

.ws__hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: clamp(22px, 4cqi, 56px);
  padding: clamp(22px, 4.2cqi, 52px) var(--px);
}
.ws__copy { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(12px, 1.7cqi, 22px); min-width: 0; }
.ws__tag {
  width: clamp(74px, 9cqi, 118px); height: clamp(18px, 2cqi, 26px);
  border: var(--lw) solid var(--c); border-radius: 99px;
  background: var(--hatch);
}
.ws__h {
  display: block;
  font-family: var(--display); font-size: var(--fh); font-weight: 500; line-height: 1.07; letter-spacing: -.03em;
  text-wrap: balance;
}
.ws__p { display: block; max-width: 30em; font-size: var(--fp); line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.ws__row { display: flex; align-items: center; gap: .9em; font-size: var(--fb); margin-top: .4em; }
.ws__btn {
  display: inline-flex; align-items: center; height: 3em; padding: 0 1.7em;
  border-radius: 99px; background: var(--c); color: var(--paper);
  font-weight: 600; line-height: 1; white-space: nowrap; max-width: 100%; overflow: hidden;
}
.ws__ghost { width: 4.4em; height: 3em; border: var(--lw) solid var(--c); border-radius: 99px; background: var(--hatch); }
.ws__img {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 16 / 11;
  border: var(--lw) solid var(--c);
  background:
    linear-gradient(to top right, transparent calc(50% - var(--lw) / 2), var(--c2) calc(50% - var(--lw) / 2) calc(50% + var(--lw) / 2), transparent calc(50% + var(--lw) / 2)),
    linear-gradient(to bottom right, transparent calc(50% - var(--lw) / 2), var(--c2) calc(50% - var(--lw) / 2) calc(50% + var(--lw) / 2), transparent calc(50% + var(--lw) / 2)),
    var(--hatch);
}
.ws__img svg {
  box-sizing: border-box; width: 22%; aspect-ratio: 1; padding: 5.5%;
  border: var(--lw) solid var(--c); border-radius: 50%;
  background: #FBFAF6;
  fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round;
}

.ws__cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.2cqi, 28px);
  padding: clamp(4px, .8cqi, 10px) var(--px) clamp(28px, 4.5cqi, 56px);
}
.ws__card {
  display: flex; flex-direction: column; gap: clamp(10px, 1.3cqi, 16px); min-width: 0;
  padding: clamp(16px, 2.2cqi, 28px);
  border: var(--lw) solid var(--c);
}
.ws__ico {
  width: clamp(30px, 3.6cqi, 46px); aspect-ratio: 1;
  border: var(--lw) solid var(--c); border-radius: 50%;
  background: var(--hatch);
}
.ws__ico--sq { border-radius: 2px; }
.ws__ico--tri { border-radius: 2px; transform: rotate(45deg) scale(.78); }
.ws__ct { display: block; font-size: var(--fc); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.ws__lines { display: grid; gap: clamp(8px, 1cqi, 13px); }
.ws__lines i { display: block; height: var(--lw); background: var(--c2); }
.ws__lines i:nth-child(2) { width: 88%; }
.ws__lines i:nth-child(3) { width: 58%; }

.ws__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(18px, 2.6cqi, 32px) var(--px);
  border-top: var(--lw) solid var(--c);
  background: var(--hatch);
}
.ws__fl { display: flex; gap: clamp(14px, 2.4cqi, 34px); }
.ws__fl i { display: block; width: clamp(40px, 6cqi, 80px); height: var(--lw); background: var(--c); }
.ws__dom { font: 500 var(--fn)/1 var(--mono); letter-spacing: .04em; }

/* ---- the live reflow: these rules answer to the site's own (virtual) width ---- */
@container wbsite (max-width: 900px) {
  .ws__hero { grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 3cqi, 28px); padding-top: clamp(20px, 3.2cqi, 34px); padding-bottom: clamp(20px, 3cqi, 30px); }
  .ws__img { aspect-ratio: 2.6 / 1; }
  .ws__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws__card:nth-child(3) { grid-column: 1 / -1; }
}
@container wbsite (max-width: 620px) {
  .ws__nav { display: none; }
  .ws__burger { display: flex; }
  .ws__ghost { display: none; }
  .ws__btn { padding: 0 1.2em; }
  .ws__cards { grid-template-columns: minmax(0, 1fr); }
  .ws__card:nth-child(3) { grid-column: auto; }
  .ws__foot { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1023px) {
  .wb { aspect-ratio: 1.42 / 1; }
}
@media (max-width: 760px) {
  .wb-nb { width: 150px; }
  .wb-nb__t { padding: 6px 8px 5px; font-size: 9.5px; }
  .wb-nb__r { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; padding: 7px 8px 6px; }
  .wb-nb__k { font-size: 9.5px; letter-spacing: .04em; }
  .wb-nb__v { font-size: 13px; }
}
@media (max-width: 600px) {
  .wb-bar .wb-range { display: none; }
  .wb-dev { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .wb-dev__b { flex-direction: column; justify-content: center; gap: 5px; min-height: 52px; padding: 6px 2px; }
  .wb-dev__i { display: none; }
  .wb-dev__n { font-size: 13px; }
  .wb-dev__w { font-size: 10.5px; }
  .wb { --pl: 12px; --pr: 18px; --pt: 12px; --pb: 14px; aspect-ratio: 1 / 1.08; }
  .wb__tk { font-size: 10px; letter-spacing: .02em; }
  .wb__w { padding: 3px 5px 2px; font-size: 10px; }
  /* the scaled-up text of a tiny stage has no room for a third menu item */
  .ws__nav > :nth-child(3) { display: none; }
}

/* the range note beside the device buttons */
.wb-range { font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .wb-nb__v.is-on { animation: none; }
}

@media (max-width: 359px) {
  .wb__w i { display: none; }
}
