/* _shared/who-i-am.css — the "Who I Am" room on Home (review/who-i-am). Built by _shared/who-i-am.js;
   every rule is scoped to .wia-*, so nothing here touches the page until the room is opened. */
html.wia-lock { overflow: hidden; }

.wia-room {
  position: fixed; inset: 0; z-index: var(--z-dialog, 9999);
  background: var(--wia-night, #050506); color: var(--color-ink);   /* #050506: the same near-black as the .his-words screens; no design token for it */
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  opacity: 0; transition: opacity 900ms cubic-bezier(.2, .6, .2, 1);
  overscroll-behavior: contain;
}
.wia-room[hidden] { display: none; }
.wia-room.wia-open { opacity: 1; }

/* top: the title and the one control */
.wia-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0;
}
.wia-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(212, 175, 55, .72); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wia-close {
  flex: none; min-width: 44px; min-height: 44px; padding: 0 14px; margin-right: -8px;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid rgba(212, 175, 55, .35); color: var(--color-gold-light);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; transition: border-color .2s ease, background-color .2s ease;
}
.wia-close:hover { border-color: var(--color-gold-light); background: rgba(242, 202, 80, .08); }
.wia-close:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 3px; }
.wia-close .wia-x { font-size: 18px; line-height: 1; letter-spacing: 0; }

/* the progress line: his voice, as a thread */
.wia-prog { position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: rgba(212, 175, 55, .12); }
.wia-prog i { display: block; height: 100%; width: 100%; background: var(--color-gold-light); transform-origin: 0 50%; transform: scaleX(0); }

/* the work */
/* the image fills the stage box minus its margins and is fitted whole (contain), whatever its shape */
.wia-stage { --pt: clamp(12px, 3vh, 32px); --px: clamp(16px, 4vw, 48px); --pb: 0px; --pl: var(--px); --pr: var(--px);
  position: relative; min-height: 0; overflow: hidden; }
.wia-stage img {
  position: absolute; top: var(--pt); left: var(--pl); width: calc(100% - var(--pl) - var(--pr)); height: calc(100% - var(--pt) - var(--pb));
  display: block; object-fit: contain;
  opacity: 0; transition: opacity 1400ms ease-out;
}
.wia-stage img.wia-ready { opacity: 1; }
/* the site-wide img[src*="artworks"]:hover glow says "clickable"; nothing here is, so the work stays bare */
.wia-room .wia-stage img, .wia-room .wia-stage img:hover { box-shadow: none; }
.wia-open .wia-stage img.wia-ready { animation: wia-drift 38s cubic-bezier(.37, 0, .63, 1) both; }
@keyframes wia-drift {
  from { transform: translate3d(-1.2%, .8%, 0) scale(1); }
  to   { transform: translate3d(1.2%, -.8%, 0) scale(1.06); }
}

/* his words, a line at a time */
.wia-words { padding: clamp(14px, 3vh, 36px) clamp(20px, 6vw, 72px) max(18px, env(safe-area-inset-bottom)); }
.wia-lines { position: relative; display: grid; min-height: 3.6em; font-size: clamp(26px, calc(2.6vw + 14px), 56px); }
/* cards.css gives every h2/h3/p a forwards-filled entrance animation, which would hold the hidden lines at opacity 1 */
.wia-room p { animation: none; }
.wia-line {
  grid-area: 1 / 1; align-self: center; justify-self: center; margin: 0; max-width: 17em; text-align: center;
  font-family: 'Newsreader', Georgia, serif; font-weight: 300; font-size: 1em; line-height: 1.18; letter-spacing: -.005em;
  color: var(--color-gold-light); text-wrap: balance;
  opacity: 0; transform: translateY(.3em); filter: blur(3px);
  transition: opacity 700ms cubic-bezier(.2, .6, .2, 1), transform 900ms cubic-bezier(.2, .6, .2, 1), filter 700ms ease-out;
}
.wia-line.is-on { opacity: 1; transform: none; filter: none; }
.wia-line.is-past { opacity: 0; transform: translateY(-.25em); filter: blur(2px); transition-duration: 500ms; }
.wia-cap {
  margin: clamp(10px, 2vh, 22px) 0 0; text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(153, 144, 124, .85);
}
.wia-cap .wia-est { font-style: italic; color: rgba(153, 144, 124, .7); }
.wia-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* wide screens: the work on the left, the words beside it */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .wia-room { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .wia-top { grid-column: 1 / -1; }
  .wia-stage { --pt: clamp(20px, 4vh, 48px); --pb: clamp(20px, 4vh, 48px); --pl: clamp(24px, 4vw, 64px); --pr: 0px; }
  .wia-words { display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(28px, 4vw, 72px); }
  .wia-lines { font-size: clamp(30px, calc(1.9vw + 12px), 54px); }
  .wia-line { justify-self: start; text-align: left; max-width: 11em; }
  .wia-cap { text-align: left; }
}

/* Reduced motion: the module never opens the room; if the setting changes mid-play, nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .wia-room, .wia-line, .wia-stage img { transition: none !important; animation: none !important; filter: none !important; transform: none !important; }
}
