/* ForgeOS — the first minute, phone first (wave 15, lane a-first).
 * Read with forgeos-w15-first.js. Tokens only; the buttons are the shared .m19-btn.
 * The try page: Ember's line, the page in a phone or a laptop (its room held from the
 * first frame), and the keep bar. Sign-up and sign-in: what happens next, and an email
 * typo mended. Welcome back on the homepage, and real pictures on the empty home. */

/* ── the try page ─────────────────────────────────────────────────────────── */
.w15f-ember {
  display: flex; align-items: flex-start; gap: var(--m19-space-2);
  margin: 0 0 var(--m19-space-3); color: var(--m19-ink);
  font-size: var(--m19-text-base); line-height: 1.45;
}
.w15f-ember[hidden] { display: none; }
.w15f-face { flex: none; inline-size: 28px; block-size: 28px; }
.w15f-face .fg-face { inline-size: 28px; block-size: 28px; }
.w15f-said { min-inline-size: 0; overflow-wrap: anywhere; }

.w15f-stage { margin: 0 0 var(--m19-space-4); }
.w15f-switch { display: flex; gap: var(--m19-space-2); margin: 0 0 var(--m19-space-2); }
.w15f-dev { min-block-size: 44px; }
.w15f-dev[aria-pressed="true"] {
  --b-bg: var(--m19-surface-2); --b-ink: var(--m19-ink); --b-line: var(--m19-line-strong);
}
/* The room the page takes, held before the page arrives: nothing below it moves. */
.w15f-device {
  position: relative; overflow: hidden; margin-inline: auto;
  border: 1px solid var(--m19-line-strong); border-radius: var(--m19-radius-lg);
  background: var(--m19-surface-2); box-shadow: var(--m19-shadow-sm);
}
.w15f-stage[data-device="phone"] .w15f-device {
  inline-size: min(100%, 390px); aspect-ratio: 390 / 600; border-radius: var(--m19-radius-xl);
}
.w15f-stage[data-device="laptop"] .w15f-device { inline-size: 100%; aspect-ratio: 16 / 10; }
.w15f-device .try-preview { position: absolute; inset: 0; margin: 0; }
/* Unseen, still laid out, until the page arrives: a switch fits it however late it comes. */
.w15f-device .try-preview[hidden] { display: block; visibility: hidden; }
.w15f-device .try-preview-label {
  position: absolute; inset-block-end: var(--m19-space-2); inset-inline-start: var(--m19-space-2); z-index: 1;
  margin: 0; padding: var(--m19-space-1) var(--m19-space-2); border-radius: var(--m19-radius-pill);
  background: var(--m19-surface); color: var(--m19-ink-2); font-size: var(--m19-text-xs);
  box-shadow: var(--m19-shadow-xs);
}
/* The page is laid out at the device's own width and scaled to fit (forgeos-w15-first.js). */
.w15f-device .try-frame {
  position: absolute; inset-block-start: 0; inset-inline-start: 0; block-size: 600px; inline-size: 390px;
  border: 0; border-radius: 0; background: var(--m19-surface); transform-origin: 0 0;
}
[dir="rtl"] .w15f-device .try-frame { transform-origin: 100% 0; }
.w15f-stage[data-device="laptop"] .w15f-device .try-frame { inline-size: 1280px; block-size: 800px; }
.w15f-wait {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: var(--m19-space-6);
  color: var(--m19-ink-3); font-size: var(--m19-text-sm); text-align: center;
}
.w15f-wait::before {
  content: ""; position: absolute; inset: var(--m19-space-4); border-radius: var(--m19-radius-md);
  background: linear-gradient(180deg, var(--m19-surface-3) 0 18%, transparent 18% 26%, var(--m19-surface-3) 26% 30%,
    transparent 30% 34%, var(--m19-surface-3) 34% 38%, transparent 38%);
  opacity: .7;
}
.w15f-device:has(.try-preview:not([hidden])) .w15f-wait { visibility: hidden; }
/* Revealed once, when the first picture arrives; never under reduced motion. */
.w15f-revealed .w15f-device { animation: w15f-in var(--m19-motion-slow) var(--m19-ease-out) 1; }
@keyframes w15f-in { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .w15f-revealed .w15f-device { animation: none; } }

/* The keep bar: the one primary action, at the thumb, from the first second. */
.w15f-keep {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: var(--m19-z-raised);
  display: flex; align-items: center; justify-content: space-between; gap: var(--m19-space-3);
  padding: var(--m19-space-3) var(--m19-space-4) calc(var(--m19-space-3) + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--m19-line); background: var(--m19-surface); box-shadow: var(--m19-shadow-md);
}
.w15f-keep[hidden] { display: none; }
.w15f-keep-said { margin: 0; min-inline-size: 0; color: var(--m19-ink-2); font-size: var(--m19-text-sm); }
.w15f-keep-go { flex: none; min-block-size: 48px; padding-inline: var(--m19-space-6); }
.w15f-bar .try { padding-block-end: calc(96px + env(safe-area-inset-bottom, 0px)); }
.w15f-bar .cw-shared-foot { padding-block-end: calc(96px + env(safe-area-inset-bottom, 0px)); }
/* One primary action: the bar's Keep it stands for the header's and the box's. */
.w15f-bar #try-keep-top, .w15f-bar #try-keep-box { display: none; }
@media (min-width: 900px) {
  .w15f-keep { inset-inline: auto var(--m19-space-6); inset-block-end: var(--m19-space-6);
    max-inline-size: 460px; border: 1px solid var(--m19-line); border-radius: var(--m19-radius-lg); }
}

/* Visible focus, everywhere this lane draws something to press. */
.w15f-dev:focus-visible, .w15f-keep-go:focus-visible, .try-steps summary:focus-visible, .w15f-pic:focus-visible,
.w15f-typo:focus-visible, .w15f-back a:focus-visible, .w15f-back button:focus-visible, .w15f-again:focus-visible {
  outline: var(--m19-focus-ring); outline-offset: var(--m19-focus-offset);
}

/* ── busy ─────────────────────────────────────────────────────────────────── */
.w15f-busy-ask { margin: var(--m19-space-2) 0; color: var(--m19-ink-2); overflow-wrap: anywhere; }

/* ── sign-up and sign-in ──────────────────────────────────────────────────── */
/* .w15f-held: the same line in sign-up's markup, so the form never moves when it is drawn. */
.w15f-next, .w15f-held {
  display: flex; align-items: flex-start; gap: var(--m19-space-2); margin: var(--m19-space-2) 0 var(--m19-space-4);
  padding: var(--m19-space-3); border-radius: var(--m19-radius-md); background: var(--m19-surface-2);
  color: var(--m19-ink); font-size: var(--m19-text-sm); line-height: 1.45;
}
/* Empty until a domain is mended: a bare <p>'s margins moved the form 39px after first paint. */
.w15f-typo-row { margin: 0; }
/* Empty until a mistyped domain is offered mended: as an empty grid item it still took the form's gap (55px under the email field, live audit 2026-11-20). */
.w15f-typo-row:empty { display: none; }
.w15f-typo {
  display: inline-flex; margin-block-start: var(--m19-space-2); min-block-size: 44px;
}

/* ── welcome back, on Home (/os/home, drawn by forgeos-home-notice.js) ────── */
.w15f-back {
  position: fixed; inset-inline: var(--m19-space-4); inset-block-end: var(--m19-space-4); z-index: var(--m19-z-toast);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--m19-space-3);
  max-inline-size: 520px; margin-inline-start: auto; padding: var(--m19-space-4);
  border: 1px solid var(--m19-line); border-radius: var(--m19-radius-lg);
  background: var(--m19-surface); color: var(--m19-ink); box-shadow: var(--m19-shadow-lg);
}
.w15f-back p { flex: 1 1 220px; margin: 0; font-size: var(--m19-text-sm); line-height: 1.45; }
.w15f-back strong { display: block; font-size: var(--m19-text-base); }
.w15f-back-actions { display: flex; gap: var(--m19-space-2); }
/* On Home it sits on the page's one floating line (--hf-float, forgeos-home-feed.css): above the
 * bottom bar and, on a phone, the Ask button, never over either; and the page keeps room beneath
 * it, so nothing it floats over is out of reach. */
.hf-page .w15f-back { inset-block-end: var(--hf-float, var(--m19-space-4)); }
@media (max-width: 899.98px) { .hf-page:has(.w15f-back) { padding-block-end: 50dvh; } }

/* ── the empty home and empty Projects: real pictures ─────────────────────── */
.w15f-pics { margin: var(--m19-space-4) 0 0; padding: 0; }
.w15f-pics-head { margin: 0 0 var(--m19-space-2); color: var(--m19-ink-2); font-size: var(--m19-text-sm); }
.w15f-pics ul {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--m19-space-3);
  margin: 0; padding: 0; list-style: none;
}
.w15f-pic {
  display: block; inline-size: 100%; padding: 0; overflow: hidden; text-align: start; cursor: pointer;
  border: 1px solid var(--m19-line); border-radius: var(--m19-radius-md); background: var(--m19-surface);
  color: var(--m19-ink); font: inherit;
}
.w15f-pic img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 16 / 10; object-fit: cover; }
/* At a desk the pointer answers on a picture as on every other control: a border, no box moved. */
@media (hover: hover) { .w15f-pic:hover { border-color: var(--m19-ink-2); background: var(--m19-surface-2, var(--m19-surface)); } }
.w15f-pic span { display: block; padding: var(--m19-space-2); font-size: var(--m19-text-sm); line-height: 1.35; }
@media (max-width: 599.98px) {
  .w15f-pics ul { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-block-end: var(--m19-space-2); }
  .w15f-pics li { scroll-snap-align: start; }
  .w15f-keep-said { font-size: var(--m19-text-xs); }
}

/* The status, when Ember's line says the same: kept for screen readers, not shown twice. */
.try-status.w15f-quiet {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
