:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #102f4b;
  background: #ede7dc;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, #a8eee5 0, transparent 34rem),
    linear-gradient(145deg, #f8f4ec 0%, #e9e1d5 100%);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: #527083;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.9rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 680px;
  margin: 18px 0 0;
  color: #4b6575;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.55;
}

.engine-badge {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border: 1px solid rgb(16 47 75 / 14%);
  border-radius: 999px;
  background: rgb(255 255 255 / 60%);
  box-shadow: 0 10px 35px rgb(16 47 75 / 8%);
  color: #37566c;
  font-size: 0.83rem;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.engine-badge span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #35cbbd;
  box-shadow: 0 0 0 5px rgb(53 203 189 / 16%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr);
  gap: 20px;
}

.stage-card,
.controls-card {
  overflow: hidden;
  border: 1px solid rgb(16 47 75 / 11%);
  border-radius: 28px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 24px 80px rgb(40 58 69 / 12%);
  backdrop-filter: blur(20px);
}

.stage-card {
  position: relative;
  min-height: 650px;
}

#auri-stage {
  display: block;
  width: 100%;
  height: 650px;
}

.stage-status {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 11px;
  border: 1px solid rgb(255 255 255 / 66%);
  border-radius: 18px;
  background: rgb(255 255 255 / 70%);
  box-shadow: 0 12px 30px rgb(16 47 75 / 10%);
  backdrop-filter: blur(14px);
}

.stage-status div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
}

.stage-status span {
  color: #6d8290;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-status strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-card {
  display: flex;
  flex-direction: column;
  gap: 27px;
  padding: 25px;
}

button {
  min-height: 46px;
  border: 1px solid rgb(16 47 75 / 12%);
  border-radius: 14px;
  background: #f7f5f0;
  color: #173a55;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button:hover {
  border-color: rgb(21 129 142 / 35%);
  background: #ffffff;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  background: linear-gradient(135deg, #143d5c, #146b78);
  box-shadow: 0 14px 28px rgb(20 90 105 / 20%);
  color: #ffffff;
}

.primary-button:hover {
  background: linear-gradient(135deg, #173f5e, #177888);
}

.control-group {
  display: grid;
  gap: 11px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  color: #38586e;
  font-size: 0.88rem;
  font-weight: 750;
}

.control-group output {
  color: #188c92;
}

input[type="range"] {
  width: 100%;
  accent-color: #20bfb3;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

#activity-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
}

#activity-grid button {
  min-height: 40px;
  font-size: 0.82rem;
}

#activity-grid button.is-active {
  border-color: #20bfb3;
  background: linear-gradient(135deg, #e6faf7, #d3f4ef);
  color: #0f5f66;
}

.hint {
  margin: 10px 0 0;
  color: #6a8296;
  font-size: 0.78rem;
  line-height: 1.45;
}

select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgb(16 47 75 / 12%);
  border-radius: 14px;
  background: #f7f5f0;
  color: #173a55;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

select:hover {
  border-color: rgb(21 129 142 / 35%);
  background: #ffffff;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid rgb(16 47 75 / 10%);
  border-radius: 16px;
  background: #f8f6f2;
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row strong {
  font-size: 0.85rem;
}

.toggle-row small {
  color: #728690;
  font-size: 0.72rem;
  line-height: 1.35;
}

.toggle-row input {
  width: 42px;
  height: 22px;
  accent-color: #20bfb3;
}

.event-panel {
  min-height: 148px;
}

.event-panel ol {
  display: grid;
  gap: 6px;
  max-height: 142px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.event-panel li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgb(20 61 92 / 5%);
  color: #547080;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.event-panel time {
  color: #1d9d99;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding-top: 28px;
  }

  .intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .stage-card,
  #auri-stage {
    min-height: 540px;
    height: 540px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}
