/* Shared by the public site and the panel. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #5b6475;
  --border: #e2e5ee;
  --accent: #3b6fd8;
  --accent-text: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.05), 0 4px 16px rgba(20, 30, 60, 0.05);
  color-scheme: light;
}

/* Shape palette: stroke + pastel fill of the same hue. */
.c-blue   { --stroke: #3b6fd8; --fill: #dfe8fb; }
.c-green  { --stroke: #2f9e6e; --fill: #dcf3e8; }
.c-coral  { --stroke: #e0664f; --fill: #fbe3dd; }
.c-violet { --stroke: #7c5cd6; --fill: #ebe4fb; }
.c-amber  { --stroke: #d4930f; --fill: #fbf0d4; }
.c-teal   { --stroke: #1f9aa6; --fill: #d9f1f3; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c;
    --surface: #1a1e27;
    --text: #e6e9f0;
    --muted: #9aa3b5;
    --border: #2a303c;
    --accent: #7aa2f7;
    --accent-text: #10131a;
    --shadow: none;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .c-blue   { --stroke: #7aa2f7; --fill: #1f2b45; }
  :root:not([data-theme="light"]) .c-green  { --stroke: #5fcf9c; --fill: #18332a; }
  :root:not([data-theme="light"]) .c-coral  { --stroke: #f08a76; --fill: #3a2420; }
  :root:not([data-theme="light"]) .c-violet { --stroke: #a48af0; --fill: #2a2343; }
  :root:not([data-theme="light"]) .c-amber  { --stroke: #f0b941; --fill: #3a2f15; }
  :root:not([data-theme="light"]) .c-teal   { --stroke: #4fc6d1; --fill: #15323a; }
}

:root[data-theme="dark"] {
  --bg: #12151c;
  --surface: #1a1e27;
  --text: #e6e9f0;
  --muted: #9aa3b5;
  --border: #2a303c;
  --accent: #7aa2f7;
  --accent-text: #10131a;
  --shadow: none;
  color-scheme: dark;
}
:root[data-theme="dark"] .c-blue   { --stroke: #7aa2f7; --fill: #1f2b45; }
:root[data-theme="dark"] .c-green  { --stroke: #5fcf9c; --fill: #18332a; }
:root[data-theme="dark"] .c-coral  { --stroke: #f08a76; --fill: #3a2420; }
:root[data-theme="dark"] .c-violet { --stroke: #a48af0; --fill: #2a2343; }
:root[data-theme="dark"] .c-amber  { --stroke: #f0b941; --fill: #3a2f15; }
:root[data-theme="dark"] .c-teal   { --stroke: #4fc6d1; --fill: #15323a; }

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

html { -webkit-text-size-adjust: 100%; }

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

a { color: var(--accent); }

main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 48px;
  flex: 1;
}

/* Shapes (for diagrams, not decoration) */
.shape { width: 40px; height: 40px; flex: none; }
.shape * {
  fill: var(--fill);
  stroke: var(--stroke);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

/* Top bar */
.topbar {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle circle { fill: none; stroke: currentColor; stroke-width: 2; }
.theme-toggle path { fill: currentColor; }
.theme-toggle:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hero */
.hero {
  padding: 56px 0 40px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 40rem;
}
.intro { max-width: 40rem; }
.hero-small { text-align: center; }
.hero-small .tagline { margin-left: auto; margin-right: auto; }

/* Sections */
.block { padding-top: 24px; }
.block h2 {
  font-size: 1.4rem;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.group-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 12px;
}

/* Cards */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--stroke); }
.card-with-image { flex-direction: column; align-items: stretch; }
.card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
}
.card-body { min-width: 0; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
/* Admin bar: only shown (by admin.js) to someone logged into the panel. */
.admin-bar[hidden] { display: none; }
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
}
.admin-bar a { color: var(--bg); }
.admin-bar-label { font-weight: 600; margin-right: 8px; }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }

/* Buttons */
.button {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button-ghost { background: transparent; color: var(--accent); }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 32px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
