:root {
  --ink: #1c1915;
  --ink-soft: #4a453c;
  --paper: #f3efe6;
  --paper-2: #e7e1d4;
  --line: rgba(28, 25, 21, 0.12);
  --brass: #b08d57;
  --brass-deep: #8a6b3d;
  --white: #faf8f3;
  --ok: #2f5d4a;
  --err: #8a3b2f;
  --font: "Sora", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(176, 141, 87, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(74, 69, 60, 0.08), transparent 50%),
    linear-gradient(180deg, #f7f3eb 0%, var(--paper) 45%, #ebe4d7 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

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

code {
  font-size: 0.9em;
  background: rgba(28, 25, 21, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: drift 16s var(--ease) infinite alternate;
}

.orb-a {
  width: 42vw;
  height: 42vw;
  max-width: 480px;
  max-height: 480px;
  top: -8%;
  right: -8%;
  background: rgba(176, 141, 87, 0.18);
}

.orb-b {
  width: 30vw;
  height: 30vw;
  max-width: 320px;
  max-height: 320px;
  bottom: 10%;
  left: -6%;
  background: rgba(28, 25, 21, 0.06);
  animation-duration: 22s;
  animation-delay: -4s;
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}

.brand {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.top-note {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

main {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.hero {
  padding: clamp(2.5rem, 8vh, 5rem) 0 2.5rem;
  animation: rise 0.9s var(--ease) both;
}

.brand-hero {
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 1rem;
  color: var(--ink);
}

.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 400;
  color: var(--brass-deep);
  margin-bottom: 0.9rem;
  max-width: 22ch;
}

.lead {
  font-size: 1.02rem;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 38rem;
}

.panel {
  padding: 2.25rem 0 1.5rem;
  border-top: 1px solid var(--line);
  animation: rise 0.9s var(--ease) both;
  animation-delay: 0.12s;
}

.panel:nth-of-type(3) {
  animation-delay: 0.2s;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin-bottom: 0.55rem;
}

.panel h2 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-lead {
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  max-width: 34rem;
}

.thought-form textarea,
.option {
  width: 100%;
}

.thought-form textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 10rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.thought-form textarea:focus {
  border-color: rgba(176, 141, 87, 0.55);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  padding: 0.85rem 1.35rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--brass-deep);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  margin-top: 1rem;
}

.btn-quiet:hover {
  border-color: var(--brass);
  background: rgba(176, 141, 87, 0.08);
  color: var(--ink);
}

.form-status {
  min-height: 1.4em;
  margin-top: 0.85rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

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

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

.polls {
  display: grid;
  gap: 2rem;
}

.poll-q {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.options {
  display: grid;
  gap: 0.55rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.55);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.option:hover,
.option:has(input:checked) {
  border-color: rgba(176, 141, 87, 0.55);
  background: rgba(176, 141, 87, 0.08);
}

.option input {
  accent-color: var(--brass-deep);
}

.foot {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.muted {
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Admin */
body.admin {
  background:
    linear-gradient(180deg, #efe9dc 0%, var(--paper) 40%, #e4ddd0 100%);
}

.admin-main {
  width: min(860px, calc(100% - 2.5rem));
}

.hero-admin .meta-line {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--brass-deep);
}

.tally-grid {
  display: grid;
  gap: 1.75rem;
}

.tally-bars {
  list-style: none;
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.tally-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

.bar {
  height: 6px;
  background: rgba(28, 25, 21, 0.08);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass));
}

.inbox {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.thought-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.thought-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brass-deep);
}

.thought-item.status-archived {
  opacity: 0.55;
}

.thought-text {
  font-size: 1.02rem;
  white-space: pre-wrap;
}

.thought-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.thought-actions button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.thought-actions button:hover {
  border-color: var(--brass);
  color: var(--ink);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-18px, 22px);
  }
}

@media (max-width: 640px) {
  .hero h1 {
    max-width: none;
  }

  .row {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

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