/* DreamGIS Demo Gallery — design tokens from desing/DESIGN.md */
:root {
  --primary: #006aff;
  --primary-hover: #0058d4;
  --primary-subtle: #CCE1FF;
  --navy-1: #0b0721;
  --navy-2: #000062;
  --navy-4: #14152c;
  --canvas: #ffffff;
  --surface-soft: #f2f2f2;
  --on-dark: #ffffff;
  --on-canvas: #0b0721;
  --body-text: #14152c;
  --muted: #666882;
  --muted-soft: #999BAB;
  --hairline: #CCCDD5;
  --hairline-soft: #e8e8ed;
  --blue-700: #99C3FF;

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-card: 0 2px 8px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 16px rgba(0,106,255,.12), 0 12px 32px rgba(0,0,0,.10);

  --max-width: 1280px;
  --font: 'Montserrat', -apple-system, system-ui, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--body-text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ---------- Top nav ---------- */
.top-nav {
  height: 72px;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 40px; width: auto; }
.version-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.version-tag:empty { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy-1) 0%, var(--navy-2) 50%, var(--primary) 100%);
  color: var(--on-dark);
  padding: clamp(56px, 10vw, 120px) 0;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
}
.eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-700);
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.19;
  letter-spacing: -0.84px;
  margin: 0 0 16px;
}
.hero-sub {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.85);
}

/* ---------- Content ---------- */
.content {
  background: var(--surface-soft);
  padding: clamp(48px, 8vw, 80px) 0;
  min-height: 40vh;
}
.content-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
}

/* ---------- Status / states ---------- */
.status {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}
.status.error { color: #d93025; font-weight: 500; }
.status:empty { display: none; padding: 0; }

.spinner {
  width: 32px; height: 32px;
  margin: 0 auto 16px;
  border: 3px solid var(--hairline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Gallery grid ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ---------- Demo card ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover, .card:focus-visible {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  outline: none;
}
.card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.card-media {
  aspect-ratio: 16 / 9;
  background: var(--navy-4);
  position: relative;
  overflow: hidden;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-1), var(--navy-2));
}
.card-media.is-fallback::after {
  content: "DreamGIS";
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue-700);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.33;
  margin: 0;
  color: var(--on-canvas);
}
.card-feature {
  font-size: 14px;
  line-height: 1.43;
  color: var(--muted);
  background: var(--surface-soft);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.card-cta {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14px;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card:hover .card-cta { color: var(--primary-hover); }
.card-cta::after { content: "↗"; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-1);
  color: var(--on-dark);
  padding: 48px 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo { height: 36px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.legal {
  font-size: 12px;
  color: var(--muted-soft);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
