/* The /ikage/ page: iKaru, web edition (src/en/ikage/index.html), and the header and footer it shares with the
   presentation page /ikaru/ (partials nav-ikage, footer-ikage). The app's own styles are synced from inkoation-ai
   (06_app/ikage-web: app.css, ikaru.css, hetzel.css, gate.css, chooser_eyes.css) and loaded after this file; this
   file only places the app in the page.

   Since 2026-11-17 the page serves the app's full edition, like an app: a slim site bar (the mark home, the way down
   to the legal line), then the stage, which fills the rest of the first screen edge to edge; the legal footer is
   under the first screen. The rules of the first web shell's page (.ikage-page, .ikage-mount: a framed box under one
   line of text) are kept at the foot for any page that still mounts that shell (app.js). */

/* ---- The app's page (body.ikage-app) ---------------------------------------------------------------------- */
.ikage-app { --ikage-bar: 2.75rem; --ikage-night: #0a1431; --ikage-ivory: #F5EDD8; --ikage-gilt: rgb(237 209 133); background: var(--ikage-night); overscroll-behavior-y: none; }

/* The bar: in the page's flow, one row, the night of the app's sky so that it reads as the app's own top edge. */
.ikage-app .ikage-nav { position: relative; inset: auto; height: var(--ikage-bar); padding: 0 0.75rem; background: var(--ikage-night); color: var(--ikage-ivory); border-bottom: 1px solid rgb(237 209 133 / 0.28); pointer-events: auto; }
.ikage-app .ikage-home { gap: 0.5rem; }
.ikage-app .ikage-home .mark { width: 1.9rem; height: 1.9rem; }
.ikage-app .ikage-home .brand-name { font-size: 0.68rem; }
.ikage-legal-jump, .ikage-back-up { display: none; }
.ikage-app .ikage-legal-jump { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.35rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ikage-gilt); text-decoration: underline; text-underline-offset: 0.2em; }
.ikage-app .ikage-back-up { display: inline; text-decoration: underline; text-underline-offset: 0.15em; }

/* The stage: what is left of the first screen. `contain: layout` makes it the box that the app's `position: fixed`
   layers fill (the app, the gate, the film, a cabin: the app's host.js mounts them here); the transform says the
   same to a browser without layout containment. `all: initial` first: nothing of the site's type (family, size,
   line height, width axes, smoothing) is inherited by the app, which sets its own on its roots. */
.ikage-stage {
  all: initial;
  display: block; position: relative; overflow: hidden; isolation: isolate;
  height: calc(100vh - var(--ikage-bar));
  height: calc(100svh - var(--ikage-bar));
  min-height: 20rem;
  contain: layout; transform: translate(0);
  background: var(--ikage-night);
}
/* The site's element rules stop at the stage's edge (style.css: border-box on everything, block pictures, the
   paragraphs' measure, the headings' weight, plain lists, inherited button type, the mark as pointer). Each is taken
   back to the browser's own value, as on the app's standalone page; :where() keeps these weaker than any rule of the
   app, which loads after this file. */
.ikage-stage :where(*), .ikage-stage :where(*)::before, .ikage-stage :where(*)::after { box-sizing: revert; }
.ikage-stage :where(img, svg) { display: revert; max-width: revert; }
.ikage-stage :where(a) { color: revert; text-decoration: revert; }
.ikage-stage :where(p) { margin: revert; max-width: revert; text-wrap: revert; }
.ikage-stage :where(ul, ol) { margin: revert; padding: revert; list-style: revert; }
.ikage-stage :where(h1, h2, h3, h4) { margin: revert; font-weight: revert; line-height: revert; text-wrap: revert; }
.ikage-stage :where(button) { font: revert; color: revert; }
.ikage-stage :where(a[href], button, summary, label, select, [role="button"]) { cursor: revert; }

/* The legal line, under the first screen. */
.ikage-app .ikage-footer { padding: 1.1rem 0.9rem 1.4rem; background: #070d22; color: rgb(245 237 216 / 0.78); }
.ikage-app .ikage-footer .footer-legal { margin-top: 0; padding-top: 0; border-top: 0; color: inherit; }

/* ---- The first web shell's page (app.js): kept for any page that still mounts it ---------------------------- */
/* The section fills the first screen: room for the fixed nav, the intro line, then the app, so the app's controls
   are in view on arrival. */

.ikage-page {
  display: grid;
  grid-template-rows: auto minmax(30rem, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  /* Below the fixed header (its gap and the 3.1rem mark: style.css .nav, .brand .mark), then 0.6rem. */
  padding: calc(var(--gap) + 3.25rem + 0.6rem) 0 var(--pad);
}
.ikage-head { padding-bottom: 0.85rem; }
.ikage-intro {
  margin: 0;
  max-width: 100ch;
  font-size: clamp(0.92rem, 0.8rem + 0.35vw, 1.08rem);
  line-height: 1.45;
  color: var(--fg);
}

/* The app's mount: its height is the grid row's (the app reads it through --ik-height). The background
   is the app's museum backdrop until the app has started (app.css sets the same colour on .ikage). */
.ikage-mount {
  --ik-height: 100%;
  height: 100%;
  min-height: 0;
  width: min(100% - 2 * var(--pad), 1680px);
  margin-inline: auto;
  border-radius: var(--radius-m);
  overflow: hidden;
  isolation: isolate;
  background: rgb(163 160 156);
}

/* Phones: the app runs edge to edge, down to the bottom of the first screen. */
@media (max-width: 759px) {
  .ikage-page { padding-bottom: 0; }
  .ikage-mount { width: 100%; border-radius: 0; }
}

/* The page's own header and footer (inkoation-ai decision 40: no commercial navigation on /ikage/):
   the mark home, and the legal line. */
.ikage-home .mark { width: 3.1rem; height: 3.1rem; flex: none; }
.ikage-footer { padding: 0 var(--pad) var(--pad); }
.ikage-footer .footer-legal { margin-top: 0; }
/* The header scrolls away with the page: over the app's own header it would cover its words. */
.ikage-nav { position: absolute; }
