:root {
  --bg: #f5efe6;
  --bg-strong: #e7d6bb;
  --surface: rgba(255, 250, 242, 0.86);
  --surface-strong: #fffaf2;
  --ink: #182028;
  --muted: #5a6170;
  --line: rgba(24, 32, 40, 0.12);
  --line-strong: rgba(24, 32, 40, 0.2);
  --accent: #17624d;
  --accent-strong: #0d3d31;
  --accent-soft: rgba(23, 98, 77, 0.1);
  --danger: #8d2f2a;
  --danger-soft: rgba(141, 47, 42, 0.1);
  --warning: #7a5912;
  --warning-soft: rgba(122, 89, 18, 0.12);
  --shadow: 0 24px 80px rgba(24, 32, 40, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(231, 214, 187, 0.9), transparent 34%),
    radial-gradient(circle at top right, rgba(173, 208, 211, 0.42), transparent 28%),
    linear-gradient(180deg, #f9f4eb 0%, #efe5d3 52%, #ecf2f2 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.hero,
.main-grid,
.lower-grid {
  display: grid;
  gap: 1.25rem;
}

.hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  align-items: stretch;
  margin-top: 1rem;
}

.hero-copy,
.hero-panel,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  padding: 2.25rem;
}

.hero-copy::after,
.hero-panel::after,
.card::after {
  content: "";
  position: absolute;
  inset: auto auto -80px -80px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(23, 98, 77, 0.08);
  pointer-events: none;
}

.hero-panel {
  padding: 2rem;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(23, 98, 77, 0.94), rgba(13, 61, 49, 0.96));
  color: #f4fbf8;
}

.eyebrow,
.section-kicker,
.post-category {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
}

.hero h1,
.section-head h2,
.info-card h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 8vw, 6.1rem);
}

.hero-text,
.hero-panel p,
.hero-panel li,
.info-card p,
.post-message,
.post-expiry,
.post-age,
.hint,
.counter {
  color: var(--muted);
  line-height: 1.6;
}

.hero-text {
  max-width: 58ch;
  margin: 1.25rem 0 1.5rem;
  font-size: 1.08rem;
}

.hero-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.8rem;
  color: #f7fffb;
}

.hero-panel li {
  color: rgba(244, 251, 248, 0.88);
}

.panel-list {
  margin: 0;
  padding-left: 1.1rem;
}

.panel-list li + li {
  margin-top: 0.65rem;
}

.hero-actions,
.form-actions,
.section-head-row,
.post-footer,
.feed-toolbar,
.field-row,
.post-badges,
.tag-filters,
.tag-toolbar {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

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

.button:focus-visible {
  outline: 3px solid rgba(23, 98, 77, 0.18);
  outline-offset: 2px;
}

.button-primary {
  background: var(--accent);
  color: #f5f8f7;
  box-shadow: 0 12px 28px rgba(23, 98, 77, 0.24);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-strong);
}

.button-secondary {
  background: rgba(24, 32, 40, 0.04);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.button[disabled] {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.main-grid {
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.2fr);
  margin-top: 1.25rem;
}

.lower-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.25rem;
}

.card {
  padding: 1.6rem;
}

.section-head {
  margin-bottom: 1.2rem;
}

.section-head-row {
  justify-content: space-between;
}

.post-form,
.feed-list,
.pinned-list {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field span {
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.92rem 1rem;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(23, 98, 77, 0.42);
  box-shadow: 0 0 0 4px rgba(23, 98, 77, 0.12);
}

.locked-field {
  width: 100%;
  display: grid;
  gap: 0.2rem;
  text-align: left;
  padding: 0.92rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 32, 40, 0.09);
  background: rgba(24, 32, 40, 0.06);
  color: rgba(24, 32, 40, 0.82);
  cursor: not-allowed;
  box-shadow: none;
}

.locked-field:hover,
.locked-field:focus-visible {
  transform: none;
  background: rgba(24, 32, 40, 0.08);
  border-color: rgba(24, 32, 40, 0.14);
}

.locked-field:focus-visible {
  outline: 3px solid rgba(24, 32, 40, 0.08);
  outline-offset: 2px;
}

.locked-field-value {
  font-weight: 700;
}

.locked-field-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

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

.field-row {
  align-items: stretch;
}

.field-row .field {
  flex: 1;
}

.field-inline {
  min-width: 220px;
}

.form-meta,
.feed-toolbar {
  justify-content: space-between;
}

.tag-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pinned-section {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 98, 77, 0.16);
  background: rgba(23, 98, 77, 0.07);
}

.pinned-section-hidden {
  display: none;
}

.pinned-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.pinned-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.tag-toolbar-label {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
}

.tag-filters {
  flex-wrap: wrap;
}

.tag-filter {
  padding: 0.62rem 0.92rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
}

.tag-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #f5f8f7;
  box-shadow: 0 10px 22px rgba(23, 98, 77, 0.18);
}

.counter,
.hint,
.feed-stats,
.post-age,
.post-expiry {
  margin: 0;
  font-size: 0.94rem;
}

.lock-note {
  margin: -0.3rem 0 0;
}

.banner {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
}

.pin-card,
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
}

.pin-card {
  background:
    linear-gradient(180deg, rgba(23, 98, 77, 0.1), rgba(255, 255, 255, 0.86));
  border-color: rgba(23, 98, 77, 0.18);
}

.pin-head-row,
.post-head,
.post-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pin-message,
.post-message {
  margin: 0.85rem 0 0;
  font-size: 1rem;
}

.badge-pinned {
  background: var(--accent);
  border-color: var(--accent);
  color: #f5f8f7;
}

.banner-hidden {
  display: none;
}

.banner-warning {
  background: var(--warning-soft);
  border-color: rgba(122, 89, 18, 0.18);
  color: var(--warning);
}

.banner-success {
  background: var(--accent-soft);
  border-color: rgba(23, 98, 77, 0.18);
  color: var(--accent-strong);
}

.banner-error {
  background: var(--danger-soft);
  border-color: rgba(141, 47, 42, 0.18);
  color: var(--danger);
}

.post-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.62);
  animation: fade-up 280ms ease both;
}

.post-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.post-id-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.post-category {
  color: var(--accent);
}

.post-badges {
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.badge {
  margin: 0;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 98, 77, 0.16);
  background: rgba(23, 98, 77, 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.post-tag {
  border-color: rgba(24, 32, 40, 0.12);
  background: rgba(24, 32, 40, 0.05);
  color: var(--ink);
}

.badge-hidden {
  display: none;
}

.post-id {
  margin: 0;
  font-size: 1.02rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
}

.copy-session-button {
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  white-space: nowrap;
}

.post-message {
  margin: 1rem 0;
  white-space: pre-wrap;
  color: var(--ink);
}

.post-footer {
  justify-content: space-between;
}

.feed-empty {
  padding: 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .main-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .section-head-row,
  .feed-toolbar,
  .tag-toolbar,
  .field-row,
  .hero-actions,
  .form-actions,
  .post-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell {
    width: min(100vw - 1rem, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .card {
    padding: 1.25rem;
  }

  .hero h1 {
    max-width: none;
  }
}
