:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: rgba(17, 20, 29, 0.86);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f2f4f8;
  --muted: #9299a8;
  --green: #9ef7c4;
  --green-bright: #43e58e;
  --blue: #67a8ff;
  --mono: "SFMono-Regular", "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(80, 125, 255, 0.16), transparent 42%),
    linear-gradient(145deg, #080a0f 0%, #0c1018 52%, #080a0f 100%);
  font-family: var(--sans);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  opacity: 0.16;
  filter: blur(100px);
  pointer-events: none;
}

.ambient-one {
  top: 5%;
  left: -14rem;
  background: #3c78ff;
}

.ambient-two {
  right: -12rem;
  bottom: -8rem;
  background: #36da91;
}

.page-shell {
  display: flex;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(32px, 8vh, 88px) 0 28px;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: flex;
  margin: 0 0 18px 6px;
  align-items: center;
  gap: 10px;
  color: #bec4cf;
  font: 600 0.7rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 14px var(--green-bright);
}

.terminal {
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.52),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  backdrop-filter: blur(28px) saturate(125%);
}

.terminal-bar {
  display: grid;
  min-height: 54px;
  padding: 0 19px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.light {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.red { background: #ff5f57; }
.yellow { background: #febc2e; }
.green { background: #28c840; }

.terminal-title {
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  margin: 0;
  color: #8e95a3;
  background: transparent;
  font: 500 0.72rem/1 var(--mono);
  cursor: default;
  transition: color 180ms ease, background 180ms ease;
}

.terminal-title:hover,
.terminal-title:focus-visible {
  color: #c7ccd5;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.terminal-body {
  padding: clamp(28px, 6vw, 68px);
}

.command-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 12px;
}

.prompt,
.directory {
  font: 700 clamp(1.05rem, 2vw, 1.3rem)/1.4 var(--mono);
}

.prompt { color: var(--green-bright); }
.directory { color: var(--blue); }

.typed-title {
  min-height: 2.7em;
  margin: 0;
  color: #f7f8fa;
  font: 650 clamp(1.5rem, 4.4vw, 3.55rem)/1.22 var(--mono);
  letter-spacing: -0.055em;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.13em;
  vertical-align: -0.13em;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

.lead {
  max-width: 710px;
  margin: clamp(24px, 4vw, 40px) 0 0 55px;
  color: #abb1bd;
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.75;
}

.secret-status {
  width: fit-content;
  margin: 18px 0 0 55px;
  padding: 9px 12px;
  border: 1px dashed rgba(254, 188, 46, 0.3);
  border-radius: 8px;
  color: #aeb4bf;
  background: rgba(254, 188, 46, 0.035);
  font: 0.72rem/1.45 var(--mono);
}

.secret-status span {
  color: #febc2e;
}

.event-grid {
  display: grid;
  margin: clamp(30px, 5vw, 52px) 0 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.event-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.event-card:hover {
  border-color: rgba(158, 247, 196, 0.2);
  background: rgba(158, 247, 196, 0.035);
  transform: translateY(-2px);
}

.event-card dt {
  margin-bottom: 13px;
  overflow: hidden;
  color: var(--green);
  font: 500 0.68rem/1.3 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card dd {
  margin: 0;
  color: #eef0f4;
  font: 600 clamp(0.95rem, 1.6vw, 1.08rem)/1.45 var(--mono);
}

.event-card dd span {
  display: block;
  margin-top: 4px;
  color: #747c8c;
  font-size: 0.72rem;
  font-weight: 400;
}

.ops-log {
  display: flex;
  margin-top: 16px;
  padding: 14px 17px;
  flex-wrap: wrap;
  gap: 8px 22px;
  border-left: 2px solid rgba(103, 168, 255, 0.35);
  color: #747c8c;
  background: rgba(103, 168, 255, 0.025);
  font: 0.68rem/1.5 var(--mono);
}

.ops-log p {
  margin: 0;
}

.log-ok {
  color: var(--green-bright);
}

.log-warn {
  color: #febc2e;
}

.log-info {
  color: var(--blue);
}

.visitor-counter strong {
  color: #eef0f4;
  font-weight: 700;
}

.actions {
  display: flex;
  margin-top: clamp(28px, 5vw, 46px);
  align-items: flex-end;
  gap: 20px;
}

.map-picker {
  display: grid;
  gap: 10px;
}

.map-picker-label {
  margin: 0;
  color: var(--green);
  font: 500 0.68rem/1.3 var(--mono);
}

.map-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-button {
  display: inline-flex;
  min-height: 50px;
  padding: 0 19px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(158, 247, 196, 0.35);
  border-radius: 10px;
  color: #07120c;
  background: var(--green);
  box-shadow: 0 12px 30px rgba(67, 229, 142, 0.12);
  font: 700 0.84rem/1 var(--mono);
  text-decoration: none;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.map-button-secondary {
  border-color: rgba(103, 168, 255, 0.38);
  color: #eaf2ff;
  background: rgba(103, 168, 255, 0.11);
  box-shadow: none;
}

.map-button:focus-visible {
  outline: 3px solid rgba(103, 168, 255, 0.75);
  outline-offset: 4px;
}

.arrow {
  margin-left: 6px;
  font-size: 1rem;
}

.hint {
  margin: 0;
  color: #697181;
  font: 0.72rem/1.5 var(--mono);
}

footer {
  display: flex;
  padding: 19px 6px 0;
  justify-content: space-between;
  gap: 20px;
  color: #596170;
  font: 500 0.68rem/1.5 var(--mono);
}

footer p {
  margin: 0;
}

@keyframes blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (hover: hover) and (pointer: fine) {
  .map-button:hover {
    background: #b9ffd7;
    box-shadow: 0 16px 38px rgba(67, 229, 142, 0.2);
    transform: translateY(-2px);
  }

  .map-button-secondary:hover {
    color: #eaf2ff;
    background: rgba(103, 168, 255, 0.2);
    box-shadow: 0 16px 38px rgba(103, 168, 255, 0.1);
  }
}

@media (max-width: 760px) {
  .terminal-title {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .terminal-body {
    padding: 28px 20px 30px;
  }

  .command-line {
    gap: 8px;
  }

  .typed-title {
    min-height: 4.5em;
    letter-spacing: -0.04em;
  }

  .lead {
    margin-left: 0;
  }

  .secret-status {
    margin-left: 0;
  }

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

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

  .map-picker {
    width: 100%;
  }

  .map-buttons {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .map-button {
    width: 100%;
    min-height: 58px;
    justify-content: center;
    transform: none;
  }

  .map-button-secondary {
    color: #eaf2ff;
    background: rgba(103, 168, 255, 0.11);
    box-shadow: none;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 430px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .terminal {
    border-radius: 16px;
  }

  .terminal-bar {
    padding: 0 14px;
  }

  .terminal-title {
    max-width: 135px;
    font-size: 0.62rem;
  }

  .light {
    width: 10px;
    height: 10px;
  }

  .typed-title {
    font-size: 1.35rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
