:root {
  --ink: #071018;
  --ink-soft: #3a5266;
  --slate: #0c1c28;
  --teal: #1a9b8e;
  --teal-bright: #2ec4b6;
  --amber: #e8a03a;
  --amber-soft: #f0c078;
  --paper: #e8eef2;
  --paper-deep: #d5dee6;
  --danger: #e05555;
  --warn: #e8a03a;
  --ok: #2ec4b6;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, #c5d8e0 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #b8d4ce 0%, transparent 45%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: #fff;
  padding: 0.5rem 1rem;
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  color: #fff;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.85rem;
}

.header-links a {
  text-decoration: none;
  opacity: 0.9;
}

.header-links a:hover {
  opacity: 1;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(7, 16, 24, 0.55) 0%, rgba(12, 28, 40, 0.78) 55%, rgba(7, 16, 24, 0.92) 100%),
    url("/portfolio/gridsight/images/GridSight_Image.png") center / cover no-repeat;
  transform: scale(1.02);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.06) translateY(-1.5%); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  padding: 0 1.5rem 4.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 1rem;
}

.hero-lede {
  font-size: 1.1rem;
  line-height: 1.55;
  max-width: 34rem;
  opacity: 0.92;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal-bright);
  color: var(--ink);
}

.btn-primary:hover {
  background: #45d4c6;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.animate-rise {
  animation: rise 0.7s ease both;
}

.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0 0 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.feature h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.feature p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Interactive demo */
.demo-section {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(46, 196, 182, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #0a1620 0%, #0d1e2a 100%);
  color: #e8f0f4;
  padding: 4rem 1.5rem 5rem;
}

.demo-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.demo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.demo-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.demo-header .lead {
  color: rgba(232, 240, 244, 0.7);
  margin: 0;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.mode-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(232, 240, 244, 0.65);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.mode-toggle button[aria-pressed="true"] {
  background: var(--teal);
  color: #fff;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}

.demo-panel {
  background: rgba(8, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  min-height: 0;
}

.demo-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.demo-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.demo-panel-head span {
  font-size: 0.75rem;
  color: rgba(232, 240, 244, 0.5);
  font-family: var(--font-mono);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition: border-color 0.3s ease;
}

.kpi-card .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(232, 240, 244, 0.5);
  margin: 0 0 0.35rem;
}

.kpi-card .value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.kpi-card .hint {
  font-size: 0.72rem;
  color: rgba(232, 240, 244, 0.45);
  margin: 0.25rem 0 0;
}

.kpi-card.danger .value { color: #ff8a8a; }
.kpi-card.warn .value { color: var(--amber-soft); }
.kpi-card.ok .value { color: var(--teal-bright); }

.grid-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 45%, #1a3a4a 0%, #0c1c28 55%, #08141c 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hex-zone {
  cursor: pointer;
  transition: fill 0.35s ease, stroke 0.35s ease, filter 0.35s ease;
  stroke-width: 1.5;
}

.hex-zone:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 2px;
}

.hex-label {
  fill: #e8f0f4;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.zone-tooltip {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 0.75rem 0.9rem;
  background: rgba(6, 14, 22, 0.94);
  border: 1px solid rgba(46, 196, 182, 0.35);
  border-radius: 8px;
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.zone-tooltip.visible {
  opacity: 1;
}

.zone-tooltip strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.zone-tooltip dl {
  margin: 0;
  display: grid;
  gap: 0.2rem;
}

.zone-tooltip dt {
  display: inline;
  color: rgba(232, 240, 244, 0.5);
}

.zone-tooltip dd {
  display: inline;
  margin: 0 0 0 0.35rem;
}

/* Notification pipeline */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.pipeline-step {
  flex: 1 1 auto;
  min-width: 4.5rem;
  text-align: center;
  padding: 0.45rem 0.35rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 240, 244, 0.4);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.pipeline-step.active {
  background: rgba(46, 196, 182, 0.18);
  border-color: rgba(46, 196, 182, 0.45);
  color: var(--teal-bright);
}

.pipeline-step.dim {
  opacity: 0.35;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 340px;
  overflow-y: auto;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: feed-in 0.4s ease both;
}

@keyframes feed-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-channel {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(46, 196, 182, 0.15);
  color: var(--teal-bright);
}

.feed-channel.sms { background: rgba(232, 160, 58, 0.18); color: var(--amber-soft); }
.feed-channel.teams { background: rgba(74, 144, 226, 0.2); color: #8ec0ff; }
.feed-channel.pd { background: rgba(224, 85, 85, 0.2); color: #ff9a9a; }
.feed-channel.ticket { background: rgba(255, 255, 255, 0.08); color: rgba(232, 240, 244, 0.6); }

.feed-body strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.feed-body p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(232, 240, 244, 0.55);
  line-height: 1.4;
}

.feed-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(232, 240, 244, 0.35);
  margin-top: 0.25rem;
}

.demo-footnote {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(232, 240, 244, 0.55);
}

.demo-footnote a {
  color: var(--teal-bright);
  text-decoration: none;
  font-weight: 500;
}

.demo-footnote a:hover {
  text-decoration: underline;
}

body[data-mode="baseline"] .kpi-card.ok {
  opacity: 0.45;
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .feature-grid,
  .demo-grid,
  .kpi-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .feature-grid,
  .demo-grid,
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 1rem;
  }

  .hero-inner {
    padding-bottom: 3rem;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-toggle button {
    flex: 1;
  }
}
