:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #f1f5ed;
  background: #0d1915;
  --muted: #b1c4af;
  --lime: #c9e98e;
  --border: #344939;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; font: inherit; }
button:focus-visible, a:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.masthead, main {
  width: min(100%, 874px);
  margin-inline: auto;
  padding-inline: 24px;
}
.masthead {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: max(25px, env(safe-area-inset-top));
  padding-bottom: 22px;
}
.brand {
  position: relative;
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 17px;
  background: #000;
}
.brand img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand span {
  position: absolute;
  inset: 62.5% 0 7.5%;
  display: grid;
  place-items: center;
  padding-bottom: 1px;
  background: #000;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.6px;
}
h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 42px);
  font-weight: 550;
  line-height: 1.05;
  letter-spacing: -.034em;
}
main { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.preview {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #18291f;
}
.preview-heading, .phase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-heading { margin-bottom: 12px; }
.preview-heading h2 {
  margin: 0;
  padding-left: 4px;
  color: var(--lime);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #49613e;
  border-radius: 12px;
  padding: 8px 12px;
  background: #253b2c;
  color: #e2efcf;
  font-size: 14px;
  white-space: nowrap;
}
.outline:hover { background: #304b36; }
.viewport {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 245px;
  aspect-ratio: 1.85;
  border-radius: 14px;
  background: #24362e;
  isolation: isolate;
}
.viewport canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.viewport canvas:active { cursor: grabbing; }
.viewport canvas:focus-visible { outline-offset: -3px; }
.loading, .failure {
  z-index: 1;
  place-self: center;
  margin: 0;
  max-width: calc(100% - 24px);
  padding: 12px 16px;
  border: 1px solid #5a735f;
  border-radius: 12px;
  background: #0e1d16ed;
  color: #f1f5ed;
  text-align: center;
  font-size: 14px;
}
.loading { pointer-events: none; }
.failure p { margin: 0 0 10px; }
.phase { padding: 13px 4px 3px; }
.phase-name { margin: 0; font-size: 17px; font-weight: 600; }
.tap-hint { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.phase-count {
  flex: none;
  color: var(--lime);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .07em;
}
.ar-launch {
  display: block;
  width: min(100%, 480px);
  margin: 17px auto 0;
  border-radius: 18px;
}
.ar-launch img { display: block; width: 100%; height: auto; }
.preview.expanded {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: #12231a;
}
.preview.expanded .viewport { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
body:has(.preview.expanded) { overflow: hidden; }
@media (max-width: 560px) {
  .masthead, main { padding-inline: 16px; }
  .masthead { gap: 14px; padding-top: max(17px, env(safe-area-inset-top)); padding-bottom: 17px; }
  .brand { flex-basis: 56px; width: 56px; height: 56px; border-radius: 14px; }
  .brand span { font-size: 17px; }
  .preview { padding: 10px; border-radius: 18px; }
  .viewport { aspect-ratio: 1.14; min-height: 256px; }
  .preview-heading h2 { font-size: 12px; }
  .phase-name { font-size: 15px; }
  .ar-launch { margin-top: 14px; }
}
