/* Annotated screenshots ("stages") — Features page, first-run hints, Mizan tour.
   Colours come from the app's M3 tokens, with fallbacks so the light-only Mizan page can use it too. */
.tone-green { --tone: #2f6b12; --tone-rgb: 124, 190, 55; }
.tone-teal { --tone: #0f6b75; --tone-rgb: 53, 212, 234; }
.tone-violet { --tone: #5b3fb0; --tone-rgb: 179, 139, 255; }
.tone-amber { --tone: #915407; --tone-rgb: 255, 200, 87; }

.features { display: grid; gap: 24px; max-width: 1120px; margin-inline: auto; }
.features__intro h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -0.01em; }
.features__intro p { margin: 0 0 16px; max-width: 70ch; color: var(--on-surface-variant, #6f6961); line-height: 1.6; }
.features__toc { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 8px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; text-decoration: none;
  color: var(--on-surface, #2f2921); border: 1px solid var(--outline-variant, #cdcbc8); background: var(--surface-container-low, #f8f6f4); }
.chip-link span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.75rem; color: var(--on-primary, #fff); background: var(--primary, #4f8a1c); }
.chip-link:hover { background: var(--surface-container-high, #edebe9); }
.chip-link:focus-visible, .stagecard__cta:focus-visible, .stage__zoom:focus-visible { outline: 3px solid var(--primary, #4f8a1c); outline-offset: 2px; }

.stagecard { container-type: inline-size; container-name: card; margin: 0; min-width: 0; scroll-margin-top: 80px; border-radius: 24px;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 3vw, 36px) clamp(12px, 2vw, 20px); color: var(--on-surface, #2f2921);
  background: linear-gradient(155deg, color-mix(in srgb, var(--tone) 22%, var(--surface-container-low, #f8f6f4)), color-mix(in srgb, var(--tone) 6%, var(--surface-container-low, #f8f6f4)));
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  --stage-line: var(--tone); --stage-halo: rgba(255, 255, 255, 0.92); }
:root[data-theme="dark"] .stagecard { --stage-line: rgb(var(--tone-rgb)); --stage-halo: rgba(0, 0, 0, 0.5);
  background: linear-gradient(155deg, color-mix(in srgb, rgb(var(--tone-rgb)) 20%, var(--surface-container-low)), color-mix(in srgb, rgb(var(--tone-rgb)) 5%, var(--surface-container-low))); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stagecard { --stage-line: rgb(var(--tone-rgb)); --stage-halo: rgba(0, 0, 0, 0.5);
    background: linear-gradient(155deg, color-mix(in srgb, rgb(var(--tone-rgb)) 20%, var(--surface-container-low)), color-mix(in srgb, rgb(var(--tone-rgb)) 5%, var(--surface-container-low))); }
}
.stagecard__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px 32px; align-items: start; margin-bottom: 10px; }
.stagecard__head h2, .stagecard__head h3 { margin: 0; font-weight: 500; font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.15; letter-spacing: -0.015em; }
.stagecard__head p { margin: 0 0 12px; color: var(--on-surface-variant, #4d4b48); font-size: 0.98rem; line-height: 1.6; }
.stagecard__cta { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; color: #fff; background: var(--tone); text-decoration: none; }
.stagecard__cta:hover { filter: brightness(1.15); }
.stagecard__cta .msym, .stagecard__where .msym { font-size: 18px; }
.stagecard__where { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 500; color: var(--on-surface-variant, #4d4b48); }

.stage { container-type: inline-size; overflow: hidden; }
.stage__inner { position: relative; aspect-ratio: 2 / 1; cursor: zoom-in; }
.stage__frame, .stage__wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__wires { pointer-events: none; }
.stage__spark { fill: rgba(var(--tone-rgb), 0.75); }
.stage__screen { position: absolute; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 0.5cqw; }
.stage__halo { fill: none; stroke: var(--stage-halo); stroke-width: 4; }
.stage__line { fill: none; stroke: var(--stage-line); stroke-width: 1.8; stroke-dasharray: 6 5; }
.stage__ring { fill: rgba(var(--tone-rgb), 0.22); stroke: #fff; stroke-width: 1.6; }
.stage__dot { fill: var(--tone); stroke: #fff; stroke-width: 1; }
.stage__chip { position: absolute; max-width: 16.5cqw; padding: 0.55cqw 1.1cqw; border-radius: 0.95cqw; font-size: clamp(11px, 1.22cqw, 15px); font-weight: 600; line-height: 1.28; color: #fff; background: var(--tone); box-shadow: 0 1cqw 2cqw rgba(0, 0, 0, 0.32); }
.stage__chip--l { transform: translate(-100%, -50%); }
.stage__chip--r { transform: translate(0, -50%); }
.stage__crop { position: absolute; border-radius: 0.9cqw; overflow: hidden; background: #1a1c20; border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: 0 1.6cqw 3.4cqw rgba(0, 0, 0, 0.5); }
.stage__crop i { display: block; height: 1.25cqw; background: linear-gradient(90deg, var(--tone), rgba(var(--tone-rgb), 0.5)); }
.stage__crop img { display: block; width: 100%; height: auto; }
.stage__badge { position: absolute; width: 5.6cqw; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 0.9cqw 2.2cqw rgba(0, 0, 0, 0.35); }
.stage__badge svg { width: 56%; height: 56%; }
.stage__badge .ico { fill: none; stroke: var(--tone); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stage__badge .ico .fill { fill: rgba(var(--tone-rgb), 0.3); stroke: none; }
.stage__badge .ico .dot { fill: var(--tone); stroke: none; }
.stage__list { display: none; list-style: none; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 6px; }
.stage__list li { padding: 6px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; line-height: 1.3; color: #fff; background: var(--tone); }

.stage__zoom { position: absolute; z-index: 3; right: 1.2%; top: 2%; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; padding: 0;
  background: rgba(12, 14, 19, 0.78); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.stage__zoom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.stage__zoom:hover, .stage__zoom:focus-visible { background: var(--tone, #2f6b12); }

/* narrow cards (phones, or a squeezed content pane): crop the device in, hide the chips, list the labels under it */
@container card (max-width: 700px) {
  .stagecard__head { grid-template-columns: 1fr; }
  .stage:not(.lightbox__stage) .stage__inner { width: 158%; margin-left: -29%; }
  .stage:not(.lightbox__stage) .stage__zoom { right: 20%; top: 3%; }
  .stage:not(.lightbox__stage) :is(.stage__chip, .stage__wires, .stage__crop, .stage__badge, .stage__spark) { display: none; }
  .stage__list { display: flex; }
}

/* first-run hint: a small preview that links to the Features page */
.feature-peek { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 10px 16px 10px 10px; border-radius: 16px; text-decoration: none; text-align: left;
  color: var(--on-surface, #2f2921); background: var(--surface-container, #f2f1ef); border: 1px solid var(--outline-variant, #cdcbc8); }
.feature-peek:hover { background: var(--surface-container-high, #edebe9); }
.feature-peek:focus-visible { outline: 3px solid var(--primary, #4f8a1c); outline-offset: 2px; }
.feature-peek img { flex: none; width: 128px; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--outline-variant, #cdcbc8); }
.feature-peek__text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 0.88rem; color: var(--on-surface-variant, #4d4b48); }
.feature-peek__text b { font-size: 0.95rem; color: var(--on-surface, #2f2921); }

/* Mizan landing: a closed-by-default tour */
.tour > summary { cursor: pointer; }

/* the enlarge viewer (stage.js) — always dark, whatever the theme */
.lightbox-open { overflow: hidden; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #06070a; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox__bar { position: absolute; inset: 0 0 auto; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: linear-gradient(rgba(6, 7, 10, 0.9), rgba(6, 7, 10, 0)); }
.lightbox__cap { flex: 1; min-width: 0; font-size: 0.88rem; color: rgba(255, 255, 255, 0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox__btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; text-decoration: none; padding: 0; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); }
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: rgba(255, 255, 255, 0.22); }
.lightbox__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lightbox__view { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; padding: 68px 16px 16px; touch-action: pan-x pan-y pinch-zoom; }
.lightbox__content { cursor: zoom-in; }
.lightbox.is-actual .lightbox__content { cursor: zoom-out; }
.lightbox.is-actual .lightbox__view { place-items: start; }
.lightbox__stage { --stage-line: rgb(var(--tone-rgb)); --stage-halo: rgba(0, 0, 0, 0.5); width: min(calc(100vw - 32px), calc((100dvh - 100px) * 2)); }
.lightbox.is-actual .lightbox__stage { width: 1500px; }
.lightbox .lightbox__stage .stage__inner { width: auto; margin-left: 0; cursor: inherit; }
.lightbox .lightbox__stage .stage__chip { font-size: 1.22cqw; }
@media (max-width: 760px) { .lightbox.is-actual .lightbox__stage { width: 820px; } }
@media (prefers-reduced-motion: no-preference) { .stage__zoom, .stagecard__cta { transition: background-color 0.15s, filter 0.15s; } }
.empty-peek { max-width: 520px; margin: 0 auto 8px; }

/* Features page: each screen gets a header, then the screen, then the plain-words explanation */
.ftcard__head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 6px clamp(14px, 2.5vw, 28px); align-items: center; margin-bottom: 14px; }
.ftcard__no { font-size: clamp(2.6rem, 5.5vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--stage-line); opacity: 0.4; }
.ftcard__kick { margin: 0 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stage-line); }
.ftcard__head h2 { margin: 0; font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2.05rem); line-height: 1.12; letter-spacing: -0.02em; }
.ftcard__cap { margin: 0; color: var(--on-surface-variant, #4d4b48); font-size: 0.98rem; line-height: 1.55; }
.ftcard__explain { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px clamp(20px, 4vw, 52px); margin-top: 6px; padding: 20px 4px 10px; border-top: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.ftcard__label { margin: 0 0 12px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-surface-variant, #4d4b48); }
.ftcard__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.ftcard__points li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: 0.97rem; line-height: 1.5; }
.ftcard__points li::before { content: ""; width: 8px; height: 8px; margin: 0.5em auto 0; background: var(--stage-line); transform: rotate(45deg); }
.ftcard__para { margin: 0 0 16px; font-size: 0.98rem; line-height: 1.7; color: var(--on-surface, #2f2921); }
@container card (max-width: 700px) {
  .ftcard__head { grid-template-columns: auto minmax(0, 1fr); }
  .ftcard__cap { grid-column: 1 / -1; }
  .ftcard__explain { grid-template-columns: 1fr; }
}
