/* 로봄시 첫 화면: 잉크 무대(머리 · 첫 화면 · 하늘 배달 시연)와 밝은 작업대(실습실 카드). 색은 변수만. */

/* 첫 화면 */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding-top: 56px;
  padding-bottom: 48px;
}

.hero-text {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero h1 {
  margin: 0;
  font-size: var(--size-hero);
  line-height: 1.2;
  letter-spacing: var(--tracking-title);
  color: var(--white);
}

.hero-lead {
  margin: 0;
  max-width: 520px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--stage-text-sub);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  margin: 20px 0 0;
  border-top: 1px solid var(--stage-line);
}

.hero-stats div {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 16px 16px 0 0;
}

.hero-stats dt {
  font-size: var(--size-sub);
  color: var(--stage-text-sub);
}

.hero-stats dd {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--white);
}

.dim {
  color: var(--map-route);
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 34px;
  }
}

/* 도시 지도: 구역 열 칸(app/city/districts.yaml)과 배움터 건물 */
.hero-map {
  flex: 1 1 480px;
  min-width: 0;
}

.district-map {
  width: 100%;
  height: auto;
  display: block;
}

.district .tile-side { fill: var(--map-tile-side); }
.district .tile-top { fill: var(--map-tile); stroke: var(--map-tile-line); }
.district-label {
  font-family: var(--font-sans);
  text-anchor: middle;
  fill: var(--stage-text-dim);
}
.district.open .tile-side { fill: var(--map-open-side); }
.district.open .tile-top { fill: var(--map-open); stroke: var(--purple-light); stroke-width: 2; }
.district.open .district-label { fill: var(--white); font-weight: 700; }
.district-open {
  font-family: var(--font-mono);
  font-weight: 600;
  text-anchor: middle;
  fill: var(--purple-light);
}

/* 보안 센터: 점선 테두리 특별 칸 */
.district.special .tile-side { fill: var(--stage-deep); }
.district.special .tile-top { fill: var(--stage-card); stroke: var(--purple-light); stroke-width: 1.6; stroke-dasharray: 5 4; }
.district.special .district-label { fill: var(--white); font-weight: 700; }

/* 배움터: 구역 칸이 아니라 학교 건물 */
.school-body { fill: var(--stage-card); stroke: var(--stage-text); stroke-width: 1.4; }
.school-roof { fill: var(--stage-text); }
.school-label { font-family: var(--font-sans); text-anchor: middle; fill: var(--white); font-weight: 700; }

/* 칸은 링크다: 키보드로 가면 윗면 테두리가 밝아진다 */
.district-map a { cursor: pointer; }
.district-map a:focus { outline: none; }
.district-map a:hover .tile-top,
.district-map a:focus-visible .tile-top { stroke: var(--white); stroke-width: 2.4; }
.district-map a:hover .school-body,
.district-map a:focus-visible .school-body { stroke: var(--white); stroke-width: 2.4; }

/* 지도 읽는 법 */
.map-legend {
  list-style: none;
  margin: 8px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--stage-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--size-sub);
  color: var(--stage-text-sub);
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-open { background: var(--map-open); border: 2px solid var(--purple-light); }
.legend-special { background: var(--stage-card); border: 2px dashed var(--purple-light); }
.legend-school { background: var(--stage-text); border-radius: 50%; }

.map-flight { fill: none; stroke: var(--purple-light); stroke-width: 1.6; stroke-dasharray: 4 5; }
.map-ping { fill: none; stroke: var(--purple-light); stroke-width: 1.5; opacity: 0.5; }
.map-dot { fill: var(--purple-light); }
.map-topic { font-family: var(--font-mono); fill: var(--stage-text); }
.map-code { font-family: var(--font-mono); fill: var(--code-on-stage); }

/* 하늘 배달 시연: 무대 안 칸 둘 */
.city-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
  padding-bottom: 64px;
}

.stage-card {
  min-width: 0;
  background: var(--stage-card);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.city-map {
  flex: 999 1 560px;
}

.city-log {
  flex: 1 1 380px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stage-card h2 {
  margin: 0;
  font-size: 18px;
  color: var(--white);
}

.drone-status,
.log-zone {
  font-size: var(--size-tag);
  color: var(--stage-text-sub);
}

.log-zone {
  color: var(--stage-text-dim);
}

/* 지도 칸은 메시지 기록 칸과 높이를 맞추려고 남는 높이를 채운다. 지도는 가운데에 둔다. */
.map-frame {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  border-radius: var(--radius-inner);
  background: var(--stage-deep);
  overflow: hidden;
}

.city-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.grid { stroke: var(--map-grid); stroke-width: 0.2; fill: none; }
.road { stroke: var(--map-road); stroke-width: 3; fill: none; }
.building { fill: var(--map-building); }
.building.tall { fill: var(--map-building-tall); }
.route { stroke: var(--map-route); stroke-width: 0.35; stroke-dasharray: 1 1.2; fill: none; }
.place rect { fill: none; stroke-width: 0.4; }
.place.depot rect { stroke: var(--stage-text); }
.place.dropoff rect { stroke: var(--purple-light); stroke-width: 0.5; }
.place text {
  font-family: var(--font-sans);
  font-size: 2.6px;
  text-anchor: middle;
  fill: var(--stage-text-sub);
}
.place text.label-start { text-anchor: start; }

.drone .halo { fill: var(--purple-light); opacity: 0.15; }
.drone .body { fill: var(--purple-light); }
.drone[data-state="stopped"] .body { fill: var(--stage-text-dim); }
.drone[data-state="stopped"] .halo { fill: var(--stage-text-dim); }

.city-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.battery {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--size-sub);
  color: var(--stage-text-sub);
}

.battery-bar {
  width: 120px;
  height: 6px;
}

.battery-track { fill: var(--map-building-tall); }
.battery-fill { fill: var(--stage-text); }
.battery-value { color: var(--white); }

/* 메시지 기록 */
.log-help {
  margin: 0;
  font-size: var(--size-sub);
  line-height: 1.55;
  color: var(--stage-text-sub);
}

.log-help code {
  color: var(--code-on-stage);
}

.city-log h3 {
  margin: 4px 0 0;
  font-size: var(--size-sub);
  color: var(--stage-text-sub);
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry {
  border-radius: var(--radius-inner);
  background: var(--stage-deep);
  border: 1px solid var(--stage-line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry[data-testid="log-command"] {
  border-color: var(--purple-on-stage-line);
}

.log-head {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  font-size: var(--size-tag);
}

.log-head code {
  color: var(--white);
}

.log-time {
  order: 9;
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--stage-text-dim);
}

.log-type {
  font-family: var(--font-mono);
  color: var(--stage-text-dim);
}

.log-yaml {
  margin: 0;
  max-height: 130px;
  overflow: auto;
  font-size: var(--size-tag);
  line-height: 1.5;
  color: var(--stage-text);
}

.log-ros2 {
  display: block;
  border-top: 1px solid var(--stage-line);
  padding-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--code-on-stage);
  overflow-wrap: anywhere;
}

/* 작업대: 실습실 카드 */
.labs {
  padding-top: 48px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.labs > h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.lab-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.lab-card {
  flex: 1 1 360px;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

a.lab-card:hover {
  border-color: var(--purple-light);
}

.lab-card-later {
  border-style: dashed;
  border-color: var(--line-input);
}

.lab-card-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lab-card-text {
  font-size: 15px;
  line-height: var(--line-height-body);
  color: var(--text-muted);
}

.lab-card-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  font-weight: 700;
}

/* 구역 사이 길 · 「지금 여기」(F44) */
.map-way { stroke: var(--map-route); stroke-width: 4; stroke-linecap: round; fill: none; pointer-events: none; }
.map-here { pointer-events: none; }
.map-here rect { fill: var(--purple-light); }
.map-here text { fill: var(--ink); text-anchor: middle; font-weight: 700; }
/* 휴대폰 폭에서는 지도가 줄어 「지금 여기」 글이 7px 남짓이 된다(F44 판정). 키우면 이웃 이름을 가리므로(F45 판정),
   지도 위 표는 숨기고 그 칸에 흰 테두리를 두른 뒤 지도 아래 한 줄(본문 글 크기)로 「지금 여기 · 구역 이름」을 보인다(F46). */
.map-here-caption { display: none; }
@media (max-width: 560px) {
  .map-here { display: none; }
  .district.here .tile-top { stroke: var(--white); stroke-width: 3; }
  .map-here-caption { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: var(--size-sub); color: var(--white); font-weight: 700; }
  .map-here-chip { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--purple-light); color: var(--ink); }
}
