/* Kaggle Stats — fixed 5-color palette, no alpha/transparency anywhere.
   Shadows are solid offsets; separation comes from borders and spacing. */

:root {
  --primary:      #FFFBDE; /* cream — cards, surfaces, button text */
  --accent-light: #91C8E4; /* sky — hovers, chips, focus rings, code blocks */
  --bg:           #749BC2; /* steel blue — page background */
  --accent-dark:  #4682A9; /* ocean — buttons, borders, shadows, data bars */
  --ink:          #0A0909; /* near-black — all text */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header / footer ─────────────────────────────────────────── */

.site-header { padding: 1.1rem 0; }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  font-size: 1.50rem;
  color: var(--ink);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 6px;
  background-image: url("/img/shoore.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--accent-dark);
}

.site-header nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid var(--accent-light);
  padding-bottom: 2px;
  transition: border-color 150ms ease;
}

.site-header nav a:hover { border-bottom-color: var(--ink); }

.site-footer {
  margin-top: auto;
  padding: 2.5rem 0 2rem;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-footer a { color: var(--ink); font-weight: 600; }

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

.hero { padding: 2.25rem 0 0.5rem; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 34rem;
  margin: 0;
  font-size: 1.05rem;
}

/* ── Cards ───────────────────────────────────────────────────── */

.card {
  background: var(--primary);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--accent-dark);
  padding: 1.5rem;
  margin: 1.75rem 0;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

/* ── Form ────────────────────────────────────────────────────── */

.generator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.field label { font-weight: 700; font-size: 0.9rem; }

.field .hint { font-size: 0.8rem; }

input[type="text"], select {
  font: inherit;
  color: var(--ink);
  background: var(--primary);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  transition: box-shadow 150ms ease;
}

input[type="text"]:hover, select:hover { box-shadow: 3px 3px 0 var(--accent-light); }

input[type="text"]:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; }

.form-error { font-weight: 600; margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  background: var(--accent-dark);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

.btn-secondary { color: var(--ink); background: var(--accent-light); font-size: 0.95rem; padding: 0.45rem 1rem; }

/* ── Preview ─────────────────────────────────────────────────── */

.preview-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
  background: var(--primary);
}

.preview-stage img { max-width: 100%; height: auto; }

.skeleton {
  width: 320px;
  max-width: 100%;
  height: 90px;
  border-radius: 10px;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { background-color: var(--accent-light); }
  to   { background-color: var(--bg); }
}

.preview-note { font-size: 0.9rem; margin: 0.75rem 0 0; }

.hidden { display: none !important; }

/* ── Examples ────────────────────────────────────────────────── */

.examples-group + .examples-group { margin-top: 1.5rem; }

.examples-subheading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.examples-grid a {
  display: inline-flex;
  border-radius: 10px;
  transition: transform 150ms ease;
}

.examples-grid a:hover { transform: translateY(-3px); }

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

/* ── Badge page ──────────────────────────────────────────────── */

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--ink);
  font-weight: 600;
}

.item-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.item-title-row h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.chip {
  display: inline-block;
  background: var(--accent-light);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.7rem;
}

.item-meta { margin: 0.35rem 0 0; font-size: 0.95rem; }

.item-meta a { color: var(--ink); font-weight: 600; }

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

/* Stat tiles — label + compact value, ink on cream */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.stat-tile {
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--primary);
}

.stat-tile .stat-label { font-size: 0.85rem; font-weight: 600; }

.stat-tile .stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 0.1rem;
}

/* Bar comparison — single ocean hue, ink labels, value at the tip */

.viz-rows { display: flex; flex-direction: column; gap: 0.9rem; }

.viz-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  align-items: center;
  gap: 0.75rem;
}

.viz-row .viz-label { font-size: 0.9rem; font-weight: 600; }

.viz-track { display: flex; align-items: center; gap: 0.6rem; }

.viz-bar {
  height: 20px;
  background: var(--accent-dark);
  border-radius: 0 4px 4px 0; /* rounded data-end, square at the baseline */
  width: 0;
  transition: width 500ms ease;
}

.viz-value { font-size: 0.9rem; font-weight: 700; white-space: nowrap; }

/* ── Embed snippets ──────────────────────────────────────────── */

.snippet-list { display: flex; flex-direction: column; gap: 1rem; }

.snippet .snippet-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; }

.snippet-box {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.snippet-box code {
  flex: 1;
  display: block;
  background: var(--accent-light);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--primary);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 0.9rem;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.copy-btn:hover { background: var(--accent-light); transform: translateY(-1px); }

.copy-btn.copied { background: var(--accent-dark); color: var(--primary); }

/* ── Error panel ─────────────────────────────────────────────── */

.error-panel { text-align: center; padding: 2.25rem 1.5rem; }

.error-panel h2 { margin: 0 0 0.5rem; }

.error-panel p { margin: 0 0 1.25rem; overflow-wrap: anywhere; }

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

@media (max-width: 620px) {
  .generator-form { grid-template-columns: 1fr; }
  .viz-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .card { padding: 1.15rem; box-shadow: 6px 6px 0 var(--accent-dark); }
}
