/* chibster.com — shared styles. No build step, no external requests. */

:root {
  --bg: #fbfaf8;
  --bg-card: #ffffff;
  --fg: #1a1917;
  --fg-muted: #6b675f;
  --border: #e5e1da;
  --accent: #b4531f;
  --accent-soft: #f6ece4;
  --shadow: 0 1px 2px rgba(26, 25, 23, 0.05), 0 4px 12px rgba(26, 25, 23, 0.04);
  --radius: 12px;
  --maxw: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --bg-card: #201e1b;
    --fg: #ece9e3;
    --fg-muted: #9a948a;
    --border: #322f2a;
    --accent: #e8895a;
    --accent-soft: #2b211a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  }
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.25rem 5rem;
}

/* ---- header ---- */

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.mark svg { display: block; }

h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0;
}

.tagline {
  color: var(--fg-muted);
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  max-width: 34rem;
}

/* ---- chibi rotator ---- */

.chibi { margin: 2rem 0 0; }

.chibi-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chibi-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.chibi-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.chibi-slide.is-active { opacity: 1; }

/* Blurred copy filling the letterbox bars behind a portrait photo. */
.chibi-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(1.15);
  transform: scale(1.15);
  opacity: 0.55;
}

/* The photo itself — contained, so nothing is ever cropped off. */
.chibi-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .chibi-slide { transition: none; }
}

.chibi-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.chibi-empty code {
  font-size: 0.85em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.chibi-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.chibi-frame:hover .chibi-nav,
.chibi-nav:focus-visible { opacity: 1; }

.chibi-nav:hover { background: rgba(0, 0, 0, 0.65); }
.chibi-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.chibi-prev { left: 0.6rem; }
.chibi-next { right: 0.6rem; }

/* Touch devices get no hover, so keep the arrows permanently visible. */
@media (hover: none) {
  .chibi-nav { opacity: 1; }
}

.chibi-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  min-height: 0.5rem;
}

.chibi-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chibi-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.chibi-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- sections ---- */

h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-muted);
  font-weight: 600;
  margin: 3.25rem 0 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.875rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* Non-link card — same shell, no hover affordance. */
.card-static { cursor: default; }
.card-static:hover { border-color: var(--border); transform: none; }

/* status / scope pills */
.pill {
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.pill-quiet {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.note {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

/* ---- form ---- */

.form { margin: 2rem 0 0; }

.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.optional {
  font-weight: 400;
  color: var(--fg-muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

.field textarea { resize: vertical; min-height: 4.5rem; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.turnstile { margin: 0 0 1rem; min-height: 65px; }

.btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.3rem;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:hover:not(:disabled) { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.form-status {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border-left: 3px solid var(--fg-muted);
  background: var(--bg-card);
}

.form-status.is-error { border-left-color: #d0453b; }
.form-status.is-ok    { border-left-color: #3f9a52; }
.form-status.is-info  { border-left-color: var(--accent); }

/* ---- prose links ---- */

a { color: var(--accent); }
a:focus-visible,
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- footer ---- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

footer a { color: var(--fg-muted); }

/* ---- 404 ---- */

.center {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 30rem) {
  .wrap { padding-top: 2.5rem; }
  h1 { font-size: 1.6rem; }
}
