:root {
  --ink: #102a32;
  --ink-soft: #3a5560;
  --paper: #f2f6f4;
  --paper-2: #e6efec;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(16, 42, 50, 0.12);
  --teal: #0f8f8a;
  --teal-deep: #0a6c69;
  --amber: #d98a1c;
  --coral: #c45c4a;
  --good: #1f8f5f;
  --warn: #c98912;
  --bad: #c2443a;
  --shadow: 0 18px 50px rgba(16, 42, 50, 0.08);
  --radius: 18px;
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "Manrope", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 143, 138, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(217, 138, 28, 0.14), transparent 50%),
    linear-gradient(180deg, #f7faf8 0%, var(--paper) 45%, #eef4f1 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 42, 50, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 50, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  z-index: 0;
}

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background:
    linear-gradient(145deg, var(--teal) 0%, #147a9a 55%, var(--amber) 120%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 35% 20% auto;
  height: 2px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 6px 0 rgba(255,255,255,0.45), 0 12px 0 rgba(255,255,255,0.25);
}
.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.nav-links a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.86rem;
  transition: 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: rgba(255,255,255,0.7);
  border-color: var(--line);
  text-decoration: none;
}

.hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: rise 0.8s ease 0.05s both;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero p {
  margin: 0;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.chip .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 143, 138, 0.15);
  animation: pulse 2s ease infinite;
}

.page-head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
  animation: rise 0.7s ease both;
}
.page-head .kicker {
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 44rem;
  line-height: 1.6;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.span-2 { grid-column: span 2; }

.demo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 1.35rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: rise 0.8s ease both;
}
.demo-card:nth-child(2) { animation-delay: 0.08s; }
.demo-card:nth-child(3) { animation-delay: 0.16s; }
.demo-card:nth-child(4) { animation-delay: 0.24s; }
.demo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 143, 138, 0.35);
  box-shadow: 0 24px 60px rgba(16, 42, 50, 0.12);
  text-decoration: none;
}
.demo-card .tag {
  width: fit-content;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 143, 138, 0.1);
  color: var(--teal-deep);
  font-size: 0.75rem;
  font-weight: 700;
}
.demo-card h2 {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.demo-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}
.demo-card .go {
  margin-top: 1.1rem;
  font-weight: 700;
  color: var(--teal-deep);
}
.demo-card .glow {
  position: absolute;
  right: -20%;
  bottom: -35%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(8px);
}
.demo-card.city .glow { background: #0f8f8a; }
.demo-card.fin .glow { background: #d98a1c; }
.demo-card.prop .glow { background: #3d7ea6; }
.demo-card.traf .glow { background: #c45c4a; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  animation: rise 0.75s ease both;
}
.panel h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.panel-head h3 { margin: 0; }

.kpi {
  display: grid;
  gap: 0.25rem;
}
.kpi .label {
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi .sub {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
input, select, button {
  font: inherit;
}
input, select {
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  color: var(--ink);
}
button, .btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
button:hover, .btn:hover { opacity: 0.92; }
button:active { transform: scale(0.98); }
button.ghost {
  background: rgba(255,255,255,0.8);
  color: var(--ink);
  border: 1px solid var(--line);
}

.table-wrap { overflow: auto; max-height: 420px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: rgba(242, 246, 244, 0.95);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:hover td { background: rgba(15, 143, 138, 0.05); }

.bars { display: grid; gap: 0.55rem; }
.bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.5rem;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.85rem;
}
.bar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #34b8a8);
  width: 0;
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
}
.bar-fill.warn { background: linear-gradient(90deg, var(--amber), #efb24a); }
.bar-fill.bad { background: linear-gradient(90deg, var(--coral), #e07a6a); }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(196, 92, 74, 0.1);
  border: 1px solid rgba(196, 92, 74, 0.25);
  color: #8d3a30;
  line-height: 1.5;
}
.alert.ok {
  background: rgba(31, 143, 95, 0.1);
  border-color: rgba(31, 143, 95, 0.25);
  color: #1d6d49;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: 0.4rem 0 1rem;
}
.status-line .ok { color: var(--good); }
.status-line .err { color: var(--bad); }

.list {
  display: grid;
  gap: 0.55rem;
  max-height: 460px;
  overflow: auto;
}
.list-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: 0.15s ease;
}
.list-item:hover,
.list-item.active {
  border-color: rgba(15, 143, 138, 0.4);
  background: rgba(15, 143, 138, 0.08);
}
.list-item strong { font-size: 0.95rem; }
.list-item span { color: var(--ink-soft); font-size: 0.82rem; }

.eta-board {
  display: grid;
  gap: 0.7rem;
}
.eta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15,143,138,0.12), rgba(255,255,255,0.7));
  border: 1px solid var(--line);
}
.eta-card .mins {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
}
.eta-card .mins small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-family: var(--font-body);
  letter-spacing: 0;
}

.chart {
  width: 100%;
  height: 220px;
}
.chart svg { width: 100%; height: 100%; display: block; }
.chart path.line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart path.area {
  fill: url(#areaFill);
  opacity: 0.9;
}
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--ink-soft); font-size: 11px; font-family: var(--font-body); }

.footer-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}
.footer-note a { font-weight: 600; }

.skeleton {
  height: 1.1rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #e4ece9, #f7faf8, #e4ece9);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15, 143, 138, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(15, 143, 138, 0.05); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .bar-row { grid-template-columns: 4.2rem 1fr 2.2rem; }
}
