:root {
  --bg: #eef5ff;
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(96, 125, 157, 0.26);
  --text: #203246;
  --muted: #5a6f84;
  --accent: #2d85ff;
  --accent-soft: #d9e9ff;
  --panel-height: clamp(560px, 72vh, 920px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.7), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(156, 205, 255, 0.34), transparent 30%),
    linear-gradient(180deg, #dcecff 0%, #eff4fa 38%, #e8edf2 100%);
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.7) 0%, transparent 36%),
    radial-gradient(circle at 88% 6%, rgba(180, 214, 255, 0.5) 0%, transparent 34%);
}

.shell {
  width: min(1400px, calc(100% - clamp(0.75rem, 2vw, 1.5rem)));
  margin: 0 auto;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 500ms ease forwards;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 170ms;
}

.delay-3 {
  animation-delay: 250ms;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: block;
  padding: 0.95rem clamp(0.85rem, 2.6vw, 1.8rem) 0.8rem;
  background: linear-gradient(180deg, rgba(233, 244, 255, 0.95) 0%, rgba(226, 239, 252, 0.7) 100%);
}

.hero.shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

.hero-copy {
  max-width: 100%;
  display: grid;
  gap: 0.6rem;
}

.hero-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: #376cae;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.9vw, 3rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.35vw, 1.02rem);
  line-height: 1.45;
  max-width: min(1080px, 100%);
  overflow-wrap: anywhere;
}

.resume-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0;
}

.meta-row div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem 0.62rem;
  background: linear-gradient(145deg, var(--panel), rgba(255, 255, 255, 0.42));
  box-shadow: 0 8px 18px rgba(118, 144, 175, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  min-width: min(180px, 100%);
  flex: 1 1 180px;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.btn {
  border: 1px solid #2d85ff;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.5rem 0.74rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 14px rgba(36, 98, 168, 0.2);
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-alt {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
}

.file-label input {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 0.72rem;
  align-items: start;
  padding-bottom: 0.9rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--panel), rgba(255, 255, 255, 0.42));
  box-shadow: 0 14px 34px rgba(118, 144, 175, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

.map-card,
.timeline-card,
.editor {
  padding: 0.72rem;
}

.map-card,
.timeline-card {
  min-height: var(--panel-height);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.card-head.compact {
  align-items: flex-start;
}

h2 {
  margin: 0;
  font-size: 1.06rem;
}

.visualizer-head {
  align-items: flex-start;
}

.visualizer-title-group {
  display: grid;
  gap: 0.45rem;
  flex: 1 1 520px;
}

.visualizer-metrics {
  width: 100%;
}

.visualizer-metrics div {
  min-width: 120px;
  flex: 1 1 120px;
}

.tools {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.25rem 0.5rem;
}

.filter-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  list-style: none;
}

.filter-panel[open] .tools {
  margin-top: 0.5rem;
}

body.is-mobile .hero {
  padding-top: 1rem;
  padding-bottom: 0.95rem;
}

body.is-mobile .subtitle {
  font-size: 0.92rem;
}

body.is-mobile .meta-row {
  gap: 0.55rem;
}

body.is-mobile .map {
  height: clamp(280px, 45vh, 420px);
}

body.is-mobile .timeline-card {
  min-height: 320px;
}

body.is-mobile .timeline {
  max-height: 44vh;
}

body.is-mobile .playback {
  grid-template-columns: 1fr;
}

.tools label,
.playback label {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 0.75rem;
  gap: 0.24rem;
}

.tools label {
  min-width: 130px;
}

select,
input,
textarea {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.47rem 0.55rem;
}

.map {
  margin-top: 0.9rem;
  height: clamp(330px, 54vh, 680px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.legend {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.76rem;
  color: var(--muted);
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.legend-chip span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.playback {
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem;
  display: grid;
  grid-template-columns: repeat(3, max-content) minmax(180px, 1fr);
  gap: 0.5rem;
  align-items: end;
  background: rgba(255, 255, 255, 0.54);
}

.playback-inline {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.54);
}

#progressRange {
  width: 100%;
}

.map-note {
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
}

.step-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #142c45;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 16px rgba(66, 99, 129, 0.28);
}

.step-icon.active {
  outline: 2px solid rgba(45, 133, 255, 0.58);
  transform: scale(1.08);
}

.timeline-card {
  display: flex;
  flex-direction: column;
  min-height: var(--panel-height);
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.journey-nav {
  display: flex;
  gap: 0.42rem;
}

.focus-card {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.detail-drawer {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.7rem;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.focus-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.focus-pill {
  color: #102035;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
}

.focus-step,
.focus-meta,
.focus-overlap {
  color: var(--muted);
  font-size: 0.82rem;
}

.focus-card h3 {
  margin: 0;
}

.focus-card p {
  margin: 0.28rem 0 0;
}

.timeline {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  overflow-y: auto;
  max-height: clamp(320px, 56vh, 760px);
}

.timeline-item {
  border-top: 1px solid rgba(96, 125, 157, 0.22);
}

.timeline-link {
  width: 100%;
  text-align: left;
  color: var(--text);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.76rem 0.1rem;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.6rem;
}

.timeline-link .dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  margin-top: 0.26rem;
  border: 2px solid #fff;
}

.timeline-link strong {
  display: block;
  font-size: 0.94rem;
}

.timeline-link span {
  color: var(--muted);
  font-size: 0.81rem;
  overflow-wrap: anywhere;
}

.overlap-tag {
  margin-top: 0.2rem;
  display: inline-block;
  font-size: 0.73rem;
  color: #3f5d80;
  font-style: normal;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 133, 255, 0.24);
  border-radius: 999px;
  padding: 0.1rem 0.38rem;
}

.timeline-item.active .timeline-link {
  background: rgba(45, 133, 255, 0.1);
}

.editor {
  margin: 0 auto 1rem;
}

.data-tools {
  margin: 0.75rem 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hidden {
  display: none;
}

.entry-form {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.entry-form label {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.entry-form .wide {
  grid-column: 1 / -1;
}

.location-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 0.45rem;
}

.place-status {
  margin-top: 0.24rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-actions {
  display: flex;
  gap: 0.55rem;
}

.editor-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.editor-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-top: 1px solid rgba(96, 125, 157, 0.2);
  padding: 0.7rem 0;
}

.editor-list small {
  color: var(--muted);
}

.inline-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 0.35rem;
}

.editor-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
    padding-bottom: 0.8rem;
  }

  .map-card,
  .timeline-card {
    min-height: auto;
  }

}

@media (max-width: 820px) {
  .hero-topline {
    align-items: stretch;
  }

  .visualizer-title-group {
    flex: 1 1 auto;
  }

  .location-tools {
    grid-template-columns: 1fr;
  }

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