/*
 * Shared base theme for eartigau's tools.
 * See DESIGN_SYSTEM.md in this folder for the rationale behind each piece.
 * Copy this whole file as a starting point for a new tool's stylesheet,
 * then add page-specific rules after it. Pairs with banner-snippet.html
 * (markup) and lightbox.js (click-to-enlarge behavior).
 *
 * Proven in production at https://eartigau.github.io/vroommisator/
 * (source: github.com/eartigau/vroommisator, docs/styles.css).
 */

:root {
  --bg: #08111f;
  --bg2: #111f36;
  --card: rgba(14, 24, 42, 0.82);
  --text: #e8eef8;
  --muted: #a8b4ca;
  --accent: #62c2ff;
  --line: rgba(200, 220, 255, 0.16);
}

* {
  box-sizing: border-box;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1200px 600px at 8% 0%, #14325f 0%, var(--bg) 45%),
              linear-gradient(160deg, #0a1424 0%, var(--bg2) 100%);
  font-family: "Space Grotesk", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.25;
  z-index: -1;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #26a1ff; /* keep this one blue across all tools */
  top: -60px;
  left: -80px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: #6ce2ad; /* ok to retint per-tool for a bit of identity */
  right: -140px;
  bottom: -140px;
}

/* ── Banner ─────────────────────────────────────────────────────────── */

.site-banner {
  background: linear-gradient(135deg, #0d1a2e 0%, #1c3a5e 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  position: relative;
}

.site-banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo-chip {
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.site-logo-chip img {
  height: 32px;
  width: auto;
  display: block;
}

.site-banner-text {
  flex: 1;
  min-width: 0;
}

.site-banner-text h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}

.site-banner-text p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: rgba(232, 238, 248, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-link {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(232, 238, 248, 0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 238, 248, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.home-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 20px 22px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 1;
}

.subtitle {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Layout / cards ─────────────────────────────────────────────────── */

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
}

.feature-list li {
  margin: 0 0 8px;
  color: #d3dff2;
}

/* ── Code blocks ────────────────────────────────────────────────────── */

.codeblock {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(4, 8, 16, 0.9);
  border: 1px solid rgba(130, 180, 240, 0.25);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.87rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

/* ── Images, galleries, lightbox ────────────────────────────────────── */

.image-frame {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 8, 15, 0.8);
  overflow: hidden;
}

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

.image-frame img,
.gallery-item img,
.lecture-figure img {
  cursor: zoom-in;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.image-frame img:hover,
.gallery-item img:hover,
.lecture-figure img:hover {
  opacity: 0.88;
}

.gallery-item img:hover {
  transform: scale(1.03);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gallery-item {
  margin: 0;
  border: 1px solid rgba(143, 176, 220, 0.2);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(6, 13, 24, 0.72);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lecture-figure {
  margin: 0;
}

.lecture-figure img {
  display: block;
  width: min(100%, 980px);
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(143, 176, 220, 0.2);
  background: rgba(6, 13, 24, 0.72);
}

.lecture-figure figcaption {
  margin-top: 7px;
  color: #a9c0df;
  font-size: 0.86rem;
  max-width: 95ch;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  background: rgba(4, 8, 16, 0.92);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(143, 176, 220, 0.3);
  cursor: default;
}

.lightbox-figure figcaption {
  color: #d9e6fa;
  font-size: 0.9rem;
  text-align: center;
  max-width: 80ch;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 24, 42, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(24, 38, 62, 0.95);
}

/* ── Stat tiles ─────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  border: 1px solid rgba(143, 176, 220, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: rgba(6, 13, 24, 0.72);
}

.stat .label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat .value {
  font-size: 0.98rem;
  font-family: "IBM Plex Mono", monospace;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 20px 24px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

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

  .span-2 {
    grid-column: span 2;
  }

  .span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: span 1;
  }

  .span-3 {
    grid-column: span 1;
  }

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

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

  .lecture-figure img {
    width: 100%;
  }

  .site-banner-text p {
    display: none;
  }
}
