@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --bg: #f2f6fa;
  --paper: rgba(255, 255, 255, 0.84);
  --paper-strong: rgba(255, 255, 255, 0.95);
  --stroke: #dce7f0;
  --text: #0f2a3e;
  --subtle: #4f6477;
  --accent-cyan: #00bbe6;
  --accent-green: #11ce74;
  --accent-dark: #083d56;
  --shadow: 0 14px 36px -20px rgba(8, 28, 48, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 187, 230, 0.17), transparent 35%),
    radial-gradient(circle at 86% 26%, rgba(17, 206, 116, 0.16), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #edf3f8 60%, #eef4fa 100%);
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 20px -24px rgba(15, 42, 62, 0.9);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e5eef6;
  box-shadow: var(--shadow);
}

.brand-copy h1 {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.brand-copy p {
  margin: 2px 0 0;
  color: var(--subtle);
  font-size: 0.77rem;
  font-weight: 600;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #446078;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid #e2ecf4;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: 160ms ease;
}

.top-link:hover {
  color: #0c3b54;
  border-color: #c8dfec;
  background: var(--paper-strong);
  transform: translateY(-1px);
}

.top-link img {
  width: 15px;
  height: 15px;
}

.content {
  flex: 1;
  width: min(1400px, 96%);
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}

.control-card,
.viz-card {
  background: var(--paper);
  border: 1px solid #d7e4ef;
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.control-card {
  padding: 12px;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-button {
  border: 1px solid #d6e2ed;
  background: rgba(255, 255, 255, 0.85);
  color: #4d6276;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: 170ms ease;
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: #bfdae9;
}

.tab-button.active {
  color: #073a53;
  background: linear-gradient(90deg, rgba(17, 206, 116, 0.25), rgba(0, 187, 230, 0.22));
  border-color: rgba(17, 206, 116, 0.45);
}

.control-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 10px;
}

.control-grid-2col {
  grid-template-columns: 1.2fr 1fr;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #deebf4;
  min-height: 76px;
}

.control span {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5f7488;
  font-weight: 700;
}

.control select,
.control input[type="range"] {
  width: 100%;
}

.control select {
  border: 1px solid #cfe0ec;
  background: #fff;
  border-radius: 9px;
  padding: 8px;
  font-size: 0.82rem;
  color: #244257;
  font-family: inherit;
}

.control strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  color: #12374f;
}

.pill-button {
  border: 1px solid #b5d9ea;
  color: #18506c;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 9px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.pill-button:hover {
  border-color: #8cc7e1;
  transform: translateY(-1px);
}

.pill-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent-cyan), #18a7dc, var(--accent-green));
}

.viz-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
}

.viz-card {
  padding: 10px 12px 8px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.card-header h2 {
  margin: 0;
  font-size: 0.98rem;
  font-family: "Space Grotesk", sans-serif;
  flex-shrink: 0;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card-header p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}

.dl-buttons {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.dl-btn {
  border: 1px solid #c8dcea;
  background: rgba(255, 255, 255, 0.85);
  color: #3a6278;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  transition: 140ms ease;
}

.dl-btn:hover {
  border-color: #8ec5df;
  background: var(--paper-strong);
  color: #0d3a54;
  transform: translateY(-1px);
}


.plot {
  width: 100%;
  height: 500px;
}

.detail-plot {
  height: 520px;
}

.detail-message {
  margin: 8px 2px 0;
  color: #3b5a70;
  font-size: 0.8rem;
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  font-size: 0.74rem;
  color: #63788c;
  border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
}

.divider {
  color: #b1bfcc;
}

.hidden {
  display: none;
}

.reveal {
  animation: fade-in 360ms ease-out both;
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1160px) {
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .top-link {
    width: 100%;
    justify-content: center;
  }

  .content {
    width: 97%;
  }

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

  .plot {
    height: 430px;
  }

  .detail-plot {
    height: 440px;
  }
}