/* Validated.Directory 2.0.0 · Do I need a new website to be found by AI? (DIR 2.0.0 part D, BEA-432). Loads after
   guide.css. The main act: a made-up plumber's good-looking home page, and what an AI assistant reads from it. A reading
   line sweeps the page and the pictures go unread (the hours on the door, the phone in a banner); the facts come out of
   the pictures as words, a plain sentence says what the plumber does and where, and the reader's list fills, 1 of 5 to
   5 of 5, with the same design and no rebuild. page.js drives it. Still first, for scripts off and reduced motion: the
   page as fixed, the reader full, every step written out. In motion the stage pins for --xs-len screens. */

.xs { position: relative; z-index: 1; }
.xs-stage { position: relative; display: grid; gap: 22px; width: 100%; max-width: var(--max); margin: 0 auto; padding: 44px var(--gut-r) 44px var(--gut); }
.xs-head h2 { margin-top: 10px; max-width: 16ch; font-size: clamp(30px, 8.4vw, 52px); line-height: 1.06; color: var(--ink); }
.xs-tag { display: inline-block; max-width: 46ch; margin-top: 12px; padding: 6px 10px 7px; border: 1px solid var(--ink-2); background: var(--paper-hi); font: 500 12px/1.4 var(--mono); color: var(--ink); }
.xs-art { position: relative; min-width: 0; }
.xs-fit { position: relative; display: grid; gap: 20px; width: min(100%, 460px); margin: 0 auto; }
.xs-fx { display: none; }
.js .xs-fx { display: block; position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* The site, as a person sees it: a card of cardstock with a photo of the door and a banner, both pictures. */
.sw { position: relative; z-index: 2; display: grid; gap: 8px; padding: 10px 11px 12px; overflow: hidden; background: var(--paper-hi); border: 1px solid rgba(35, 31, 26, 0.45); box-shadow: 0 18px 32px -24px rgba(35, 31, 26, 0.6); }
.sw-url { padding: 4px 7px 5px; background: #ebe2cd; border: 1px solid rgba(35, 31, 26, 0.18); font: 500 11.5px/1.3 var(--mono); color: var(--ink-2); }
.sw-url span { color: var(--ink); }
.sw-name { font: 400 clamp(21px, 6vw, 26px)/1.1 var(--display); color: var(--ink); }
.sw-pic, .sw-ban { position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(35, 31, 26, 0.3); }
.sw-pic { aspect-ratio: 2.3; background: linear-gradient(90deg, #6d4c30 0 14%, #8a6440 14% 16%, #5b3e27 16% 84%, #8a6440 84% 86%, #6d4c30 86%); }
.sw-door { padding: 6px 12px 7px; text-align: center; font: 400 clamp(15px, 4.4vw, 19px)/1.2 var(--display); color: #f6e7c4; border: 1px solid rgba(246, 231, 196, 0.5); background: rgba(35, 25, 15, 0.35); }
.sw-ban { padding: 8px 8px 22px; background: linear-gradient(90deg, var(--barn), #8f3f31); }
.sw-ban > span { font: 700 13px/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: #fff4e8; }
.sw-file { position: absolute; left: 5px; bottom: 4px; padding: 1px 4px; font: 500 9.5px/1.3 var(--mono); font-style: normal; color: #f6e7c4; background: rgba(20, 14, 8, 0.6); }
.sw-flag { position: absolute; inset: 0; display: grid; place-items: center; font: 600 10.5px/1.3 var(--mono); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; color: #fff3ee; background: repeating-linear-gradient(135deg, rgba(120, 50, 38, 0.92) 0 3px, rgba(120, 50, 38, 0.78) 3px 7px); }
.sw-slot { display: grid; }
.sw-slot > * { grid-area: 1 / 1; }
.sw-bars { display: grid; align-content: center; gap: 6px; }
.sw-bars i { height: 6px; background: rgba(35, 31, 26, 0.12); }
.sw-bars i + i { width: 64%; }
html:not(.m) .sw-bars { display: none; }
.sw-line { padding: 3px 5px; font: 500 12.5px/1.4 var(--mono); color: var(--ink); background: rgba(244, 196, 90, 0.36); box-shadow: inset 0 0 0 1px var(--gold-ink); }
.sw-say { display: grid; font: 400 15.5px/1.35 var(--sans); color: var(--ink); }
.sw-say > * { grid-area: 1 / 1; }
.sw-new { padding: 2px 5px; background: rgba(244, 196, 90, 0.36); box-shadow: inset 0 0 0 1px var(--gold-ink); }
.sw-old { color: var(--ink-2); font-style: italic; }
html:not(.m) .sw-old, html:not(.m) .sw-flag { display: none; }
/* while the page is read, the words in its pictures are not there for the reader: they give way to the flag */
.m .sw-door, .m .sw-ban > span { transition: opacity 0.35s; }
.m .xs[data-k="2"] .sw-door, .m .xs[data-k="2"] .sw-ban > span { opacity: 0; }
.sw-scan { display: none; }
.m .sw-scan { display: block; position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: 3; pointer-events: none; border-top: 2px solid var(--gold-bright); background: linear-gradient(180deg, rgba(244, 196, 90, 0.28), rgba(244, 196, 90, 0) 34px); transform: translateY(calc(var(--u2, 0) * 100%)); opacity: 0; transition: opacity 0.3s; }
.m .xs[data-k="2"] .sw-scan { opacity: 1; }

/* What an AI assistant reads: a panel of night, since AI lives at night (FOUNDATION 2). Five facts, each "not found"
   until the page gives it as words, then lit gold; the count in mono; the answer at the end. */
.sr { position: relative; z-index: 2; display: grid; gap: 8px; padding: 11px 13px 12px; background: linear-gradient(180deg, var(--night-2), var(--night)); border: 1px solid rgba(35, 31, 26, 0.55); color: var(--cream); box-shadow: 0 20px 38px -24px rgba(10, 16, 36, 0.85); --cm: rgba(240, 230, 207, 0.62); }
.sr-k { font: 500 10.5px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-2); }
.sr-f { display: grid; gap: 0; }
.sr-f li { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; padding: 5px 0; border-top: 1px solid var(--rule); font: 500 12px/1.35 var(--mono); }
.sr-f b { flex: 0 0 auto; font-weight: 500; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-2); }
.sr-v { display: grid; justify-items: end; text-align: right; min-width: 0; }
.sr-v > * { grid-area: 1 / 1; }
.sr-ok { padding: 0 4px; color: var(--canvas); background: var(--gold-bright); }
.sr-no { color: #f0b3a6; }
html:not(.m) .sr-no { display: none; }
.sr-n { display: grid; font: 600 11.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-bright); }
.sr-n > * { grid-area: 1 / 1; }
html:not(.m) .sr-n > :not(:last-child) { display: none; }
.sr-a { display: grid; padding-top: 8px; border-top: 1px solid var(--rule); font: 400 17px/1.3 var(--display); color: var(--white); }
.sr-a > * { grid-area: 2 / 1; }
.sr-a > .sr-ak { grid-area: 1 / 1; margin-bottom: 4px; font: 500 10.5px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-2); }
html:not(.m) .sr-a > .sr-part { display: none; }

/* The steps, written out (still); in motion one at a time with its ticks. */
.xs-steps { display: grid; gap: 14px; }
.xs-steps > li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; align-content: start; gap: 3px 10px; padding-top: 12px; border-top: 1px solid rgba(35, 31, 26, 0.24); }
.xs-n { font: 500 11.5px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.xs-k { font: 600 16.5px/1.3 var(--sans); color: var(--ink); }
.xs-t { grid-column: 1 / -1; font-size: 16px; line-height: 1.45; color: var(--ink); }
.xs-tk { display: none; }

.m .xs-track { height: calc(var(--xs-len, 5.4) * 100vh); height: calc(var(--xs-len, 5.4) * 100svh); }
.m .xs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; gap: 12px; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: calc(76px + env(safe-area-inset-top, 0px)); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.m .xs-head h2 { margin-top: 6px; font-size: clamp(24px, 7vw, 44px); }
.m .xs-tag { margin-top: 8px; padding: 4px 8px 5px; font-size: 11.5px; }
.m .xs-art { display: grid; place-items: start center; min-height: 0; }
.m .xs-out { padding-top: 10px; border-top: 1px solid rgba(35, 31, 26, 0.24); }
.m .xs-steps { gap: 0; }
.m .xs-steps > li { grid-area: 1 / 1; padding-top: 0; border-top: 0; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s; }
.m .xs-steps > li.cur { opacity: 1; visibility: visible; transition: opacity 0.35s, visibility 0s; }
.m .xs-t { min-height: calc(3 * 1.45em); }
.m .xs-tk { display: flex; gap: 4px; margin-top: 8px; }
.xs-tk i { flex: 0 1 22px; height: 4px; background: rgba(35, 31, 26, 0.18); transition: background-color 0.3s; }
.xs-tk i.on { background: var(--gold-ink); }
/* the moves: what arrives (data-at) and what leaves (data-off), at its step */
.m .xs [data-at], .m .xs [data-off] { transition: opacity 0.45s, transform 0.45s; }
.m .xs [data-at]:not(.on) { opacity: 0; }
.m .xs .sw-line[data-at]:not(.on), .m .xs .sr-a > [data-at]:not(.on) { transform: translateY(6px); }
.m .xs .off { opacity: 0; }

@media (max-width: 380px) {
  .sw { padding: 9px 9px 10px; gap: 7px; }
  .sw-line { font-size: 11.5px; }
  .sw-say { font-size: 14.5px; }
  .sr-f li { font-size: 11px; }
}
@media (max-width: 899px) and (max-height: 760px) {
  .m .xs-head h2 { font-size: clamp(21px, 6.2vw, 26px); }
  .m .xs-stage { padding-top: calc(68px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .m .xs-t { min-height: calc(3 * 1.4em); font-size: 15px; line-height: 1.4; }
  .m .xs-tag, .m .xs-head .eyebrow { display: none; }
  .m .xs-fit { gap: 12px; }
  .m .sw { gap: 6px; padding: 8px 9px 9px; }
  .m .sw-pic { aspect-ratio: 3.4; }
  .m .sw-name { font-size: 20px; }
  .m .sr { gap: 5px; padding: 9px 11px 10px; }
  .m .sr-f li { padding: 3px 0; }
  .m .sr-a { padding-top: 5px; font-size: 16px; }
}
@media (min-width: 900px) {
  .xs-stage { max-width: none; width: 100%; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; column-gap: clamp(28px, 4vw, 56px); padding: 72px var(--read-x) 72px; }
  .xs-head { grid-column: 1; grid-row: 1; }
  .xs-out { grid-column: 1; grid-row: 2; }
  .xs-art { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .xs-fit { width: min(100%, 680px); grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: start; gap: 24px; }
  .m .xs-stage { grid-template-rows: auto minmax(0, 1fr) auto; padding-top: 108px; padding-bottom: 48px; padding-left: var(--read-x); padding-right: var(--read-x); }
  .m .xs-art { grid-row: 1 / 4; align-self: stretch; }   /* page.js centres the scaled drawing in its room */
  .m .xs-out { grid-row: 3; align-self: end; }
  .m .xs-head h2 { font-size: clamp(40px, 3.8vw, 58px); }
  .xs-t { font-size: 21px; line-height: 1.4; }
  .m .xs-t { min-height: calc(3 * 1.4em); }
  .xs-k { font-size: 20px; }
  .sw { padding: 14px 15px 16px; gap: 11px; }
  .sw-url { font-size: 12.5px; }
  .sw-say { font-size: 17px; }
  .sw-line { font-size: 13.5px; }
  .sr { padding: 14px 16px 16px; }
  .sr-f li { flex-direction: column; align-items: stretch; gap: 2px; font-size: 13px; }
  .sr-v { justify-items: start; text-align: left; }
  .sr-a { font-size: 19px; }
}
