/* The shell page in the miragetalk.com look; colours and type come from site_tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
}
h1 { font-size: clamp(26px, 5vw, 32px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0; }

a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

:focus-visible {
  outline: 3px solid var(--accent-line);
  outline-offset: 3px;
  border-radius: 8px;
}

.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

/* ---------- header ---------- */

.shell-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  margin-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.mark-back  { fill: var(--accent); opacity: .55; }
.mark-front { fill: var(--accent); }
.mark-dot   { fill: var(--signal); }

.badge {
  display: inline-block;
  margin-left: auto;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--key-ink);
  background: var(--key-soft);
}

/* ---------- stage and card ---------- */

.art { margin: 4px 0 18px; }
.art:empty { display: none; }
.art svg { width: 100%; height: auto; display: block; overflow: visible; }
.art .scene-small { max-width: 300px; margin: 0 auto; }
.art .scene-parcel { max-width: 440px; margin: 0 auto; }

.card > * { min-width: 0; }

.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  padding: 28px;
  display: grid;
  gap: 18px;
}

.title { display: grid; gap: 4px; justify-items: start; }
.title .underline { width: 132px; height: 12px; overflow: visible; }
.title .underline path {
  fill: none;
  stroke: var(--key);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 0;
}
.title.rise .underline path {
  stroke-dashoffset: 320;
  animation: draw 1.1s .35s cubic-bezier(.6,.1,.3,1) forwards;
}

.kicker {
  display: inline-block;
  justify-self: start;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
}

.muted { color: var(--dim); }
.mono { font-family: var(--font-mono); font-size: .92em; overflow-wrap: anywhere; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--sunk);
}
.facts dt { color: var(--dim); font-weight: 600; font-size: 14.5px; }
.facts dd { margin: 0; color: var(--ink); }
.facts dd.mono { color: var(--accent); }

/* ---------- status ---------- */

.status {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: grid;
  gap: 2px;
  background: var(--sunk);
  color: var(--ink);
}
.status strong { font-family: var(--font-display); font-weight: 700; }
.status p { color: var(--fg); font-size: 15.5px; }
.status-ok { background: var(--signal-soft); }
.status-ok strong { color: var(--signal-ink); }
.status-warn { background: var(--key-soft); }
.status-warn strong { color: var(--key-ink); }
.status-error { background: var(--alert-soft); }
.status-error strong { color: var(--alert-ink); }
.status-muted { background: var(--sunk); }
.status-muted strong { color: var(--ink); }

.status-ok, .status-warn, .status-error { position: relative; padding-left: 38px; }
.status-ok::before, .status-warn::before, .status-error::before {
  content: "";
  display: block;
  position: absolute;
  left: 16px;
  top: 21px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.status-ok::before { background: var(--signal); }
.status-warn::before { background: var(--key); animation: blink 1.6s steps(1) infinite; }
.status-error::before { background: var(--alert); }

.link-card {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.title + .link-card { border-top: 0; padding-top: 0; }

/* ---------- boot steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.step { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.step::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line-2);
}
.step-done::before { background: var(--signal); box-shadow: none; }
.step-active { font-weight: 650; }
.step-active::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: blink 1.6s steps(1) infinite; }
.step-todo { color: var(--dim); }

/* ---------- buttons and inputs ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button.primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 22px -10px var(--accent);
}
.button.primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px var(--accent);
}
.button.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.button.secondary:hover { box-shadow: inset 0 0 0 1.5px var(--dim); transform: translateY(-1px); }
.button:active { transform: none; }

label { font-weight: 700; color: var(--ink); font-size: 15px; }

input[type="text"], input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--sunk);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  transition: border-color .15s, background .15s;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
}
input[type="file"] { font: inherit; color: var(--fg); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 650;
  margin-right: 12px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--chip);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--chip-hover); }

.restore {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.restore h2 { margin-bottom: 4px; }
.restore .button { justify-self: start; margin-top: 10px; }
.restore .fields { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.restore .fields[disabled] { opacity: .7; }

.join-name { display: grid; gap: 8px; }

.sas {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  color: var(--ink);
  background: var(--sunk);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.device-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  background: var(--sunk);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.device-label { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.device-class {
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
}
.device-class-full { color: var(--signal-ink); background: var(--signal-soft); }
.device-class-limited { color: var(--key-ink); background: var(--key-soft); }
.device-self { font-size: 13px; color: var(--accent); font-weight: 650; }
.device-added { font-size: 13px; color: var(--dim); margin-left: auto; }

/* ---------- illustration kit ---------- */

.ill-line   { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.ill-panel  { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.ill-sunk   { fill: var(--sunk); }
.ill-chrome { fill: var(--sunk); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.ill-ink    { fill: var(--ink); }
.ill-dim    { fill: var(--dim); }
.ill-mute   { fill: var(--line-2); }
.ill-accent { fill: var(--accent); }
.ill-accent-soft { fill: var(--accent-soft); }
.ill-signal { fill: var(--signal); }
.ill-signal-soft { fill: var(--signal-soft); }
.ill-key    { fill: var(--key); }
.ill-key-soft { fill: var(--key-soft); }
.ill-alert  { fill: var(--alert); }
.ill-alert-soft { fill: var(--alert-soft); }
.ill-skin-a { fill: var(--skin-a); }
.ill-skin-b { fill: var(--skin-b); }
.ill-hair   { fill: var(--hair); }
.ill-white  { fill: var(--panel); }
.ill-bubble-me { fill: var(--accent); }
.ill-stroke { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.ill-stroke-thin { stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.ill-text   { font-family: var(--font-display); font-weight: 650; fill: var(--ink); }
.ill-text-on { font-family: var(--font-display); font-weight: 650; fill: #fff; }
.ill-label  { font-family: var(--font-display); font-weight: 700; fill: var(--dim); letter-spacing: .02em; }
.ill-mono   { font-family: var(--font-mono); fill: var(--accent); font-weight: 600; }
.ill-dash   { fill: none; stroke: var(--accent-line); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; }
.ill-dash-broken { fill: none; stroke: var(--alert); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; opacity: .5; }
.ill-check  { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ill-cross  { fill: none; stroke: var(--alert); stroke-width: 4; stroke-linecap: round; }

/* ---------- motion ---------- */

.march { animation: march 1.2s linear infinite; }

.parcel      { animation: parcel 7s cubic-bezier(.45,.05,.35,1) infinite; }
.shackle     { transform-box: fill-box; transform-origin: 100% 100%; animation: shackle 7s infinite; }
.bubble-in   { animation: bubble-in 7s infinite; }
.bubble-out  { animation: bubble-out 7s infinite; }
.peek        { animation: peek 7s infinite; }
.blink       { animation: blink 1.6s steps(1) infinite; }
.blink.b2    { animation-delay: .5s; }
.blink.b3    { animation-delay: 1.1s; }

.bob   { animation: bob 3.2s ease-in-out infinite; }
.bob.b2 { animation-delay: -1.1s; }
.bob.b3 { animation-delay: -2.2s; }
.spark { transform-box: fill-box; transform-origin: center; animation: sparkle 2.4s ease-in-out infinite; }
.spark.s2 { animation-delay: .8s; }
.spark.s3 { animation-delay: 1.6s; }

.scene-stalled .march { animation-play-state: paused; }
.scene-stalled .far { opacity: .45; }
.scene-stalled .blink { fill: var(--key); }
.stall-clock { display: none; }
.scene-stalled .stall-clock { display: inline; }

.rise { animation: rise .7s cubic-bezier(.2,.7,.3,1) both; }
.rise.r2 { animation-delay: .08s; }
.rise.r3 { animation-delay: .16s; }
.rise.r4 { animation-delay: .24s; }

@keyframes parcel {
  0%   { transform: translate(150px, 212px) scale(0); opacity: 0; }
  8%   { transform: translate(150px, 212px) scale(1); opacity: 1; }
  40%  { transform: translate(300px, 318px) scale(1); }
  58%  { transform: translate(300px, 318px) scale(1); }
  88%  { transform: translate(450px, 212px) scale(1); opacity: 1; }
  96%  { transform: translate(450px, 212px) scale(.4); opacity: 0; }
  100% { transform: translate(450px, 212px) scale(.4); opacity: 0; }
}
@keyframes shackle {
  0%, 84% { transform: rotate(0deg) translateY(0); }
  90%, 100% { transform: rotate(-28deg) translateY(-2px); }
}
@keyframes bubble-in {
  0%, 2%   { opacity: 0; transform: translateY(6px); }
  6%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes bubble-out {
  0%, 88%  { opacity: 0; transform: translateY(6px); }
  93%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes peek {
  0%, 36%  { opacity: .28; }
  42%, 60% { opacity: 1; }
  66%, 100% { opacity: .28; }
}
@keyframes blink {
  0%   { opacity: 1; }
  50%  { opacity: .25; }
}
@keyframes march { to { stroke-dashoffset: -24; } }
@keyframes draw  { to { stroke-dashoffset: 0; } }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50%      { opacity: 1; transform: scale(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- footer ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.shell-footer { margin-top: 22px; text-align: center; font-size: 14px; color: var(--dim); }

@media (max-width: 520px) {
  .card { padding: 22px 18px; }
  .button { white-space: normal; max-width: 100%; text-align: center; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .parcel { transform: translate(300px, 318px); }
  .bubble-out, .bubble-in { opacity: 1; }
  .peek { opacity: 1; }
  .spark { opacity: 1; }
  .title.rise .underline path { stroke-dashoffset: 0; }
}
