:root {
  --bg: #f6f1df;
  --bg-soft: #fbf7ea;
  --paper: #fffaf0;
  --text: #2b2a26;
  --muted: #6d6657;
  --line: #d8cfb7;
  --accent: #d9b34d;
  --accent-strong: #cf9a1a;
  --highlight: #f2dd8f;
  --success: #1f7a4f;
  --error: #b14343;
  --shadow: 0 16px 36px rgba(53, 42, 16, 0.12);
  --radius: 8px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.55;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

main {
  min-height: 60vh;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.narrow {
  max-width: 780px;
}

.section,
.page-intro,
.hero {
  padding: 3.5rem 0;
}

.section--light {
  background: var(--bg-soft);
}

.section--muted {
  background: #efe5bf;
}

.stack > * + *,
.list-stack > * + * {
  margin-top: 1rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem;
  border: 2px solid var(--text);
  background: var(--highlight);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  font-family: "Caveat", "Manrope", cursive;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.7rem, 5vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  margin: 0;
}

.lede,
.hero__lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.muted,
.meta-date {
  color: var(--muted);
}

.button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.15rem;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 rgba(43, 42, 38, 0.9);
}

.button--primary {
  background: var(--accent);
}

.button--ghost,
.button-link {
  background: var(--paper);
}

.button--small {
  min-height: 2.4rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
}

.button-row,
.inline-actions,
.pill-row,
.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 241, 223, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(43, 42, 38, 0.12);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.75rem;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-brand__name {
  font-weight: 800;
  font-size: 1.05rem;
}

.site-brand__tagline {
  color: var(--muted);
  font-size: 0.86rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25rem;
}

.nav-toggle {
  display: none;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  background: var(--paper);
  font-weight: 700;
}

.hero {
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 2rem;
  align-items: center;
}

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

.hero__handwritten {
  font-family: "Caveat", cursive;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  color: var(--text);
  transform: rotate(-1.6deg);
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
}

.hero__badge {
  position: absolute;
  right: 1rem;
  bottom: 0;
  padding: 0.75rem 0.95rem;
  max-width: 230px;
  border: 2px solid var(--text);
  background: var(--highlight);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.stats-bar {
  padding: 1rem 0 2rem;
}

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

.stats-grid article {
  padding: 1.25rem;
  background: var(--paper);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  text-align: center;
}

.stats-grid strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: "Caveat", cursive;
  font-size: 2rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tag-cloud span,
.tag,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--text);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag {
  background: #fff3c9;
}

.status-badge[data-state="implemented"] {
  background: #d5f0df;
}

.status-badge[data-state="published"] {
  background: #dce9ff;
}

.status-badge[data-state="email_verified"],
.status-badge[data-state="in_review"],
.status-badge[data-state="approved"] {
  background: #f6e4c1;
}

.status-badge[data-state="rejected"] {
  background: #f3d7d7;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-card,
.surface-card,
.step-card,
.cta-panel,
.empty-state {
  border: 2px solid var(--text);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.note-card {
  position: relative;
  padding: 1.15rem;
  background: #fbf0be;
}

.note-card::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  width: 4.5rem;
  height: 1rem;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, 0.55);
  border-left: 1px dashed rgba(43, 42, 38, 0.18);
  border-right: 1px dashed rgba(43, 42, 38, 0.18);
}

.note-card__media,
.surface-card__thumb {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 6px;
}

.note-card__media img,
.surface-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.surface-card {
  padding: 1.2rem;
}

.surface-card--row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

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

.step-card {
  padding: 1.25rem;
}

.step-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.8rem;
  border: 2px solid var(--text);
  border-radius: 999px;
  background: var(--highlight);
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.4rem;
  align-items: start;
}

.split__main {
  min-width: 0;
}

.cta-panel {
  padding: 1.3rem;
  background: #f1d98f;
}

.filter-bar,
.filter-inline,
.grid-two {
  display: grid;
  gap: 1rem;
}

.filter-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
}

label span {
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf6;
  color: var(--text);
  padding: 0.8rem 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(217, 179, 77, 0.25);
  border-color: var(--accent-strong);
}

textarea {
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: start;
  flex-direction: row;
  gap: 0.8rem;
  font-weight: 600;
}

.checkbox-row input {
  width: auto;
  margin-top: 0.2rem;
}

.form-status {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.form-status.is-success {
  color: var(--success);
}

.form-status.is-error {
  color: var(--error);
}

.notice {
  padding: 0.9rem 1rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
}

.comment-list {
  display: grid;
  gap: 1rem;
}

.comment-item {
  padding: 1rem;
  border: 1px solid rgba(43, 42, 38, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.comment-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.comment-item--admin {
  padding: 0.9rem;
}

.detail-image {
  width: 100%;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-image--wide {
  max-height: 460px;
  object-fit: cover;
}

.prose,
.prose--compact {
  display: grid;
  gap: 1rem;
}

.prose p {
  color: #413d34;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.vote-stat {
  padding: 0.95rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.vote-stat strong {
  display: block;
  font-family: "Caveat", cursive;
  font-size: 2rem;
}

.poll-preview-grid,
.poll-options {
  display: grid;
  gap: 1rem;
}

.poll-result__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.poll-result__bar {
  height: 0.75rem;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfba;
}

.poll-result__bar span {
  display: block;
  height: 100%;
  background: var(--accent-strong);
}

.flash-stack {
  padding-top: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.flash--success {
  background: #d8efdf;
}

.flash--error {
  background: #f6dada;
}

.list-plain {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: #e8debb;
  border-top: 1px solid rgba(43, 42, 38, 0.12);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.2rem;
}

.footer-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.admin-body {
  background: #f4edd8;
}

.admin-header {
  background: #2f2d28;
  color: #fff9ef;
}

.admin-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.3rem;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.admin-main {
  padding: 2rem 0 3rem;
}

.admin-section {
  padding-top: 1rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.admin-grid--wide {
  grid-template-columns: 0.95fr 1.25fr;
}

.stats-grid--admin {
  margin-bottom: 1.2rem;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.admin-login__card {
  width: min(100%, 440px);
}

.table-like {
  display: grid;
  gap: 0.65rem;
}

.table-like__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(43, 42, 38, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.table-like__row strong {
  display: block;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .hero__grid,
  .split,
  .admin-grid,
  .admin-grid--wide,
  .surface-card--row,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar,
  .steps-grid,
  .card-grid,
  .card-grid--three,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-header__inner {
    flex-wrap: wrap;
    padding: 0.8rem 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: start;
    padding-bottom: 0.5rem;
  }

  .site-nav.is-open {
    display: flex;
  }
}

@media (max-width: 720px) {
  .section,
  .page-intro,
  .hero {
    padding: 2.6rem 0;
  }

  .filter-bar,
  .grid-two,
  .steps-grid,
  .card-grid,
  .card-grid--three,
  .stats-grid,
  .vote-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .inline-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head,
  .comment-item header,
  .admin-header__inner,
  .admin-nav {
    flex-direction: column;
    align-items: start;
  }

  .hero__badge {
    position: static;
    margin-top: 1rem;
    max-width: none;
  }
}

