/*
  VOICE   a calm stage: the phone is the subject, everything else steps back
  IDEA    a product demo podium under house lights, F.O.R.T.E.'s Midnight Steel night palette
  PICTURE the live Appetize iPhone, as tall as the screen allows
  COLOUR  Midnight Steel dark tokens (design/midnight-steel.md): canvas navy, blue actions, teal only for the logo
  TYPE    the system UI face (no outside fonts, so the CSP stays self + appetize.io)
*/
:root {
  color-scheme: dark;
  --canvas: #060d1a;
  --nav-bg: #081224;
  --nav-border: #16243c;
  --surface: #0e1b31;
  --surface-header: #16274a;
  --border: #22324d;
  --text: #f2f5f8;
  --muted: #8fa0b8;
  --teal: #2ee0b4;
  --action: #4a9ee8;
  --action-text: #05080f;
  --action-hover: #6bb1ee;
  --secondary-bg: #18335a;
  --secondary-border: #55709a;
  --secondary-text: #8cc4f5;
  --secondary-hover: #1e3e6b;
  --bar-h: 64px;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--canvas);
  color: var(--text);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  overflow-x: clip;
}
.stage {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  grid-template-rows: var(--bar-h) minmax(0, 1fr);
  grid-template-areas:
    "bar bar"
    "guide phone";
  height: 100vh;
  height: 100dvh;
}
.bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 max(3vw, 16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.name {
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 17px;
}
.descriptor {
  color: var(--teal);
  font-size: 13px;
  letter-spacing: 0.12em;
}
.env {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.tools {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
button {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}
.primary {
  background: var(--action);
  color: var(--action-text);
  border: 1px solid var(--action);
}
.primary:hover {
  background: var(--action-hover);
}
.secondary {
  background: var(--secondary-bg);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
}
.secondary:hover {
  background: var(--secondary-hover);
}
.guide {
  grid-area: guide;
  overflow-y: auto;
  padding: 36px max(3vw, 16px) 32px;
  border-right: 1px solid var(--nav-border);
}
h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
  margin: 0 0 12px;
  text-wrap: balance;
  font-weight: 650;
}
.lede {
  color: var(--muted);
  margin: 0 0 28px;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 16px 58px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-header);
  color: var(--secondary-text);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps h2 {
  font-size: 17px;
  margin: 0 0 4px;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.steps strong {
  color: var(--text);
  font-weight: 600;
}
.note {
  color: var(--muted);
  font-size: 14px;
  margin: 24px 0 0;
}
kbd {
  font: inherit;
  font-size: 13px;
  padding: 1px 7px;
  border: 1px solid var(--secondary-border);
  border-radius: 6px;
  color: var(--text);
}
.phone {
  grid-area: phone;
  position: relative;
  display: grid;
  place-items: center;
  padding: 20px;
}
.frame-slot {
  width: 100%;
  height: 100%;
}
.frame-slot iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  /* Match Appetize's own (light) scheme, or the browser paints an opaque white box behind the phone. */
  color-scheme: normal;
  background: transparent;
}
.missing {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.missing h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.missing p {
  margin: 0;
  color: var(--muted);
}
code {
  color: var(--secondary-text);
  overflow-wrap: anywhere;
}

/* Present mode: only the phone, on the whole screen. */
.stage.presenting {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "phone";
}
.stage.presenting .bar,
.stage.presenting .guide {
  display: none;
}
.stage.presenting .phone {
  padding: 12px;
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--bar-h) auto minmax(640px, 1fr);
    grid-template-areas: "bar" "phone" "guide";
    height: auto;
  }
  .phone {
    height: 86vh;
    min-height: 640px;
  }
  .guide {
    border-right: 0;
    border-top: 1px solid var(--nav-border);
  }
  .env {
    display: none;
  }
}
@media (max-width: 480px) {
  .descriptor,
  #restart {
    display: none;
  }
}
