:root {
  font-family: "Helvetica Neue", "Arial", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  background: #f6f6f4;
  color: #191a17;
  --accent: #ac3127;
  --muted: #5f6059;
  --line: #cecfca;
  --page-edge: clamp(20px, 4.2vw, 66px);
}

[hidden] { display: none !important; }
main { max-width: 1520px; padding-inline: var(--page-edge); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.masthead { max-width: 1520px; margin-inline: auto; padding: 21px var(--page-edge); border: 0; }
.identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; }
.identity .brand { font-size: 38px; line-height: 1; letter-spacing: -.075em; font-weight: 700; }
.identity > span { color: var(--muted); font-size: 14px; }
.views { display: flex; gap: clamp(9px, 2.6vw, 34px); align-items: center; }
.views button {
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
  padding: 9px 0 8px;
  text-align: left;
  border-bottom: 2px solid transparent;
}
.views button[aria-pressed="true"], .views button:hover:not(:disabled) {
  background: transparent;
  color: #191a17;
  border-bottom-color: var(--accent);
}

.presentation { padding-bottom: 26px; border-top: 1px solid #272823; }
.presentation-toolbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.event-context { font-size: 13px; margin: 0; color: var(--muted); }
.presentation-toolbar .text-button {
  color: var(--accent);
  min-height: 44px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}
.presentation-stage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(10px, 1.7vw, 26px);
  align-items: stretch;
}
.event-story {
  grid-column: 1 / span 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(300px, 29vw, 440px);
  padding: 32px clamp(0px, 1.1vw, 18px) 32px 0;
  align-items: flex-start;
}
.event-state {
  position: relative;
  margin: 0 0 20px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  padding-left: 16px;
}
.event-state::before {
  content: "";
  position: absolute;
  left: 0;
  top: .43em;
  width: 7px;
  height: 7px;
  background: currentColor;
}
.event-story h1 {
  font-size: clamp(37px, 5.6vw, 82px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.12;
  margin: 0;
  overflow-wrap: anywhere;
}
.event-description { color: #44463e; font-size: 16px; line-height: 1.7; margin: 18px 0 26px; max-width: 30ch; }
.event-story button {
  min-height: 46px;
  border-radius: 2px;
  border: 1px solid #22231e;
  background: #22231e;
  color: #fff;
  padding-inline: 18px;
}
.event-story button:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.event-story button.quiet-action { background: transparent; border-color: #a7a8a0; color: #292b25; }
.event-story button.quiet-action:hover:not(:disabled) { background: #e5e5e1; border-color: #73766b; }
.setup-notice { color: var(--accent); font-size: 13px; margin: 14px 0 0; line-height: 1.55; }
.device-figure {
  grid-column: 6 / -1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  position: relative;
  background: #fff;
  margin: 0;
}
.device-figure img {
  display: block;
  width: 100%;
  height: auto;
  align-self: center;
}
.device-figure figcaption {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-self: end;
  color: var(--muted);
  border-top: 1px solid #e5e5e0;
  padding: 11px 14px;
  font-size: 12px;
}
.device-figure figcaption span:first-child { color: #272823; }
.presentation-stage[data-state="acknowledged"] .event-state { color: #315746; }

.event-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 25px 0 0;
  border-block: 1px solid #272823;
}
.event-steps li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: clamp(9px, 1.65vw, 24px);
  padding: 17px clamp(12px, 2.15vw, 30px);
  min-height: 80px;
}
.event-steps li:first-child { padding-left: 0; }
.event-steps li + li { border-left: 1px solid var(--line); }
.event-steps li[data-state="active"]::after,
.event-steps li[data-state="done"]::after {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 3px;
  background: #315746;
}
.event-steps li[data-state="active"]::after { background: var(--accent); }
.step-index { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.event-steps h2 { font-weight: 700; font-size: 16px; margin: 0 0 7px; }
.event-steps p { color: var(--muted); margin: 0; line-height: 1.45; font-size: 14px; font-variant-numeric: tabular-nums; }
.event-steps li[data-state="active"] p { color: var(--accent); }
.event-steps li[data-state="done"] p { color: #315746; }
.connection-state { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.connection-state span { display: inline-flex; align-items: center; gap: 8px; }
.connection-state span::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; }
.connection-state span[data-ready="true"] { color: #315746; }
.connection-state span[data-ready="true"]::before { background: currentColor; }

#debugView { border-top: 1px solid #272823; }
#debugView .intro { padding: 22px 0 18px; }
#debugView .intro h1 { font-weight: 700; margin: 0; font-size: clamp(28px, 3vw, 44px); }
#debugView .setup article, #debugView .workspace article { border-radius: 2px; }
#debugView .setup p { min-height: 44px; }

@media (max-width: 760px) {
  .masthead { padding: 16px var(--page-edge); }
  .identity .brand { font-size: 33px; }
  .identity > span { display: none; }
  .presentation-toolbar { min-height: 54px; }
  .presentation-stage { grid-template-columns: 1fr; }
  .event-story, .device-figure { grid-column: 1; }
  .event-story { min-height: 0; padding: 12px 0 25px; }
  .event-state { margin-bottom: 10px; }
  .event-description { margin: 12px 0 15px; }
  .device-figure img { max-height: 250px; object-fit: contain; }
  .event-steps { margin-top: 19px; }
  .event-steps li { grid-template-columns: 1fr; gap: 5px; padding: 13px 8px; }
  .event-steps h2 { font-size: 14px; }
  .event-steps p { font-size: 12px; }
}
