:root {
  --bg: #f6f2ea;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1f1a17;
  --muted: #665b54;
  --line: rgba(31, 26, 23, 0.12);
  --accent: #1f5c4d;
  --accent-soft: #e2efe9;
  --shadow: 0 18px 45px rgba(49, 35, 20, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 92, 77, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(196, 146, 95, 0.14), transparent 25%),
    linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero,
.page-header,
.grid,
.form,
.stack {
  animation: fade-up 420ms ease both;
}

.hero,
.page-header,
.card {
  padding: 1.5rem;
}

.hero h1,
.page-header h1 {
  margin: 0.25rem 0 0.75rem;
  line-height: 1.05;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

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

.lede {
  max-width: 42rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.actions,
.nav,
.form-footer,
.meta-row,
.section-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.actions {
  margin-top: 1.5rem;
}

.actions-compact {
  margin-top: 1rem;
}

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

.button,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.page-section {
  margin-top: 1rem;
}

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

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

.nav a {
  text-decoration: none;
  color: var(--muted);
}

.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

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

label {
  display: grid;
  gap: 0.45rem;
}

label span {
  font-size: 0.92rem;
  color: var(--muted);
}

.section-intro {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 92, 77, 0.2);
  border-color: rgba(31, 92, 77, 0.35);
}

textarea {
  resize: vertical;
}

.full-width {
  grid-column: 1 / -1;
}

.form-footer {
  margin-top: 1rem;
  justify-content: space-between;
}

.status-message {
  margin: 0;
  min-height: 1.5rem;
  color: var(--muted);
}

.status-message.success {
  color: var(--accent);
}

.status-message.error {
  color: #9a2d2d;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.88);
}

.item h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.item p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.item .meta-row {
  margin-bottom: 0.55rem;
}

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

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge {
  background: #f5ead4;
  color: #7a5a18;
}

.auth-actions {
  visibility: hidden;
}

body.auth-ready .auth-actions {
  visibility: visible;
}

.auth-actions [data-auth] {
  display: none;
}

body.auth-ready.authenticated .auth-actions [data-auth="logged-in"] {
  display: inline-flex;
}

body.auth-ready:not(.authenticated) .auth-actions [data-auth="logged-out"] {
  display: inline-flex;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.1rem 0;
}

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

.checkbox-row span {
  color: var(--text);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(23, 18, 15, 0.45);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.auth-card {
  width: min(100%, 420px);
  padding: 1.5rem;
}

.auth-card h2 {
  margin-top: 0;
}

.auth-card form {
  display: grid;
  gap: 0.9rem;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .two-up,
  .curated-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    align-items: flex-start;
  }
}
