/* ========== Base ========== */
:root{
  --bg: #ffffff;
  --text: #0f172a;          /* slate-900 */
  --muted: #475569;         /* slate-600 */
  --border: #e2e8f0;        /* slate-200 */
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-soft: 0 8px 20px rgba(2, 6, 23, 0.06);
  --muted-bg: #f8fafc;      /* slate-50 */
  --accent-bg: #eef6ff;     /* subtle blue */
  --accent: #2563eb;        /* blue-600 */
  --accent-ink: #1e40af;    /* blue-800 */
  --radius: 16px;
  --max: 1100px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.55;
}

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

a{
  color: inherit;
  text-decoration: none;
}

.container{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.section{ padding: 64px 0; }
.section--muted{ background: var(--muted-bg); }

.section-head{
  margin-bottom: 22px;
  max-width: 78ch;
}
.section-head h2{
  margin: 0 0 8px 0;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.02em;
}
.section-head p{
  margin: 0;
  color: var(--muted);
}

h1{
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
}
h3{
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}
p{ margin: 0 0 12px 0; }

.lede{ font-size: 1.05rem; color: var(--muted); }
.fine{ font-size: 0.92rem; color: var(--muted); }
.tight{ margin-bottom: 0; }

.inline-link{
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
  color: var(--text);
  white-space: pre-wrap;
}

:focus-visible{
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ========== Header ========== */
.skip-link{
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus{ left: 12px; }

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}
.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: url("./favicon.png") center / cover no-repeat;
  border: 1px solid rgba(37,99,235,0.20);
  box-shadow: var(--shadow-soft);
}
.brand-name{
  display: block;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-sub{
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
}

.nav{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a{
  font-size: 0.95rem;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav a:hover{
  background: var(--muted-bg);
  color: var(--text);
}
.nav-cta{
  border: 1px solid rgba(37,99,235,0.25);
  background: rgba(37,99,235,0.08);
  color: var(--accent-ink) !important;
}

/* ========== Components ========== */
.card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.card--accent{
  background: var(--accent-bg);
  border-color: rgba(37,99,235,0.18);
}

.button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(37,99,235,0.25);
  background: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}
.button:hover{ filter: brightness(0.98); }
.button:active{ transform: translateY(1px); }

.button--ghost{
  background: transparent;
  color: var(--accent-ink);
  border: 1px solid var(--border);
}
.button--ghost:hover{ background: var(--muted-bg); }

.list{
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}
.list li{ margin: 8px 0; }

/* ========== Layouts ========== */
.grid-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ========== Hero ========== */
.hero{ padding-top: 40px; }
.hero-grid{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
}
.hero-copy .fine{ margin-top: 12px; }

.pill-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.pill{
  border: 1px solid var(--border);
  background: var(--muted-bg);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.92rem;
}

.cta-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 0 0;
}

.hero-media{ padding: 12px; }
.hero-media img{
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
}
.hero-media figcaption{
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ========== Examples ========== */
.examples-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.examples-grid figure{ padding: 12px; }
.examples-grid img{
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
}
.examples-grid figcaption{
  margin-top: 10px;
  color: var(--muted);
}
.examples-grid strong{ color: var(--text); }

/* time series */
.timeseries{ padding: 12px; }
.timeseries-controls{ margin-top: 10px; }
.timeseries-slider{ width: 100%; margin-top: 10px; }
.timeseries-meta{
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.timeseries-date{
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--muted-bg);
  padding: 6px 10px;
  border-radius: 999px;
}

/* ========== Lightbox ========== */
.enlargeable{
  cursor: zoom-in;
}
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.lightbox.is-open{ display: flex; }
.lightbox img{
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.5);
}
.lightbox-close{
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.95rem;
}
.lightbox-close:hover{ background: rgba(255,255,255,0.2); }
.lightbox-open{ overflow: hidden; }

/* ========== Steps / Callout ========== */
.steps{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.steps h3{ margin-bottom: 6px; }

.callout{
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ========== Contact / Footer ========== */
.contact{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.contact-card .mono{ margin: 0; }

.site-footer{
  border-top: 1px solid var(--border);
  padding: 22px 0;
  background: var(--bg);
}
.footer-inner{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer p{ margin: 0; }

/* ========== Responsive ========== */
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
  .examples-grid{ grid-template-columns: 1fr; }
  .steps{ grid-template-columns: 1fr; }
  .contact{ grid-template-columns: 1fr; }
  .brand{ min-width: auto; }
}

@media (max-width: 700px){
  .section{ padding: 46px 0; }
  .header-inner{
    flex-direction: column;
    align-items: flex-start;
  }
  .nav{
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .nav a{ padding: 6px 8px; }
  .hero{ padding-top: 24px; }
  .cta-row{ gap: 8px; }
  .callout{
    flex-direction: column;
    align-items: flex-start;
  }
}
