/* The hero's four tabs, each a short story told in type (explainer/type.html, one scene per tab). The scene is drawn
   at 16:9 and scales to the window; the words are repeated in .sr for screen readers. */
.app.why { display: block; padding: 0; height: auto; aspect-ratio: 16 / 9; max-height: clamp(380px, 46vw, 560px); background: transparent; }
.app.why[hidden] { display: none; }
.app.why iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.app.why .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* a tab arrives with a short crossfade, never a cut */
.app.why:not([hidden]) { animation: why-in .7s cubic-bezier(.16, 1, .3, 1); } @keyframes why-in { from { opacity: 0; } }
/* on a phone the scenes have a portrait layout of their own */
@media (max-width: 900px) { .app.why { max-height: none; aspect-ratio: 3 / 4; } }
@media (prefers-reduced-motion: reduce) { .app.why:not([hidden]) { animation: none; } }
/* the scenes fill the window: no menubar, no grid, no border, no inset; the picture and the type are the whole frame */
.frame:has(.app.why) { border: 1px solid var(--line); border-top: 0; background: transparent; }   /* one object with the tabs above it: the same hairline down both sides and across the foot */
.frame:has(.app.why)::before, .frame:has(.app.why) .menubar { display: none; }
.frame .app.why { width: 100%; margin: 0; max-height: none; }

/* the tabs and the window: one rounded object with one light hairline round it (no ink rule on top); the chosen tab
   takes the window's own lavender, so the tab runs straight into the app below it */
.show-tabs { border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-card, 10px) var(--r-card, 10px) 0 0; overflow: hidden; }
.show-tabs button:last-child { border-right: 0; }
.show-tabs button[aria-selected="true"] { background: #c9d3ea; color: #1d1d1f; } .show-tabs button[aria-selected="true"] span { color: #4a4a50; }
.show-tabs button::after { top: 0; }
.frame:has(.app.why) { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-card, 10px) var(--r-card, 10px); overflow: hidden; }
/* the tabs boxed in a stronger hairline (the window below takes the same), and the timer: a 3px bronze rule across the
   chosen tab's top, filling while its story plays */
.show-tabs { border-color: var(--line-2); } .show-tabs button { border-right-color: var(--line-2); border-bottom-color: var(--line-2); } .show-tabs button:last-child { border-right: 0; }
.show-tabs button[aria-selected="true"] { border-bottom-color: transparent; }
.frame:has(.app.why) { border-color: var(--line-2); }
.show-tabs button::after { height: 3px; background: var(--bronze); transition: width .1s linear; }
.night .show-tabs button::after { background: #c9a77a; }
/* the timer in ink (bone at night), drawn with a transform every frame rather than a width, so it runs smooth */
.show-tabs button::after { width: 100% !important; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: none; will-change: transform; }
.show-tabs button[aria-selected="true"]::after { transform: scaleX(var(--tq, 0)); }
.night .show-tabs button::after { background: var(--bone); }
