:root {
  --paper: #f6f0e5;
  --ink: #16110d;
  --muted: #61564e;
  --muted-strong: #302721;
  --panel: rgba(255, 249, 241, 0.72);
  --panel-strong: rgba(255, 251, 246, 0.82);
  --line: rgba(22, 17, 13, 0.14);
  --accent: #d45a2c;
  --accent-deep: #8f2f15;
  --accent-soft: #efc67d;
  --mint: #a6d7bf;
  --mint-deep: #295443;
  --shadow: 0 26px 80px rgba(57, 37, 18, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f0dfbe 0%, #f5efe2 46%, #e6d8c2 100%);
  font-family: "Space Grotesk", sans-serif;
  overflow-x: hidden;
}

body::selection {
  background: rgba(212, 90, 44, 0.18);
}

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

button,
input,
textarea {
  font: inherit;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.8;
  animation: drift 18s ease-in-out infinite;
}

.blob-a {
  top: -8rem;
  left: -4rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(239, 198, 125, 0.95), rgba(239, 198, 125, 0.08) 70%);
}

.blob-b {
  right: 6%;
  top: 12%;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(166, 215, 191, 0.6), rgba(166, 215, 191, 0.06) 72%);
  animation-delay: -6s;
}

.blob-c {
  right: -6rem;
  bottom: -5rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(212, 90, 44, 0.24), rgba(212, 90, 44, 0.05) 72%);
  animation-delay: -12s;
}

.grid-glow {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.hero,
.spotlight-grid,
.workspace,
.lower-grid,
.guestbook-grid {
  display: grid;
  gap: 22px;
}

.hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  align-items: end;
}

.spotlight-grid {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
}

.workspace {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  align-items: start;
}

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

.guestbook-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  margin-top: 20px;
}

.hero-copy {
  padding: 18px 0 8px;
}

.eyebrow,
.label,
.meta-key {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(212, 90, 44, 0.12);
}

h1,
h2,
h3,
h4 {
  position: relative;
  margin: 0;
  line-height: 1;
}

h1 {
  max-width: 10ch;
  font-family: "Instrument Serif", serif;
  font-size: clamp(3.4rem, 8vw, 7rem);
}

h2 {
  font-size: clamp(2.2rem, 5vw, 4.1rem);
}

h3 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.lede,
.panel-copy,
.artifact-copy,
.guestbook-copy,
.helper-copy,
.idea-card p,
.history-item span {
  line-height: 1.7;
}

.lede {
  max-width: 38rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(22, 17, 13, 0.12);
  border-radius: calc(var(--radius-xl) - 10px);
  pointer-events: none;
}

.hero-panel,
.daily-panel,
.systems-panel,
.stage,
.shelf,
.manifesto,
.ideas,
.guestbook-panel {
  padding: 26px;
}

.label {
  position: relative;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.panel-copy,
.guestbook-copy,
.helper-copy {
  position: relative;
  margin: 16px 0 0;
  color: var(--muted);
}

.guestbook-copy {
  max-width: 30rem;
}

.stat-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat,
.meta-item,
.history-item,
.history-empty,
.principles li,
.idea-card,
.guestbook-entry,
.field input,
.field textarea {
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 17, 13, 0.08);
  background: var(--panel-strong);
}

.stat,
.meta-item,
.history-item,
.history-empty,
.principles li,
.idea-card,
.guestbook-entry {
  padding: 16px;
}

.stat-value,
.stat-label,
.meta-key,
.meta-value,
.history-item strong,
.history-item span,
.history-item time,
.guestbook-entry strong,
.guestbook-entry span,
.guestbook-entry time,
.idea-title {
  display: block;
}

.stat-value {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
}

.stat-label,
.history-item time,
.history-empty,
.guestbook-entry time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.section-head,
.stage-head,
.shelf-head,
.wall-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.daily-actions,
.stage-actions,
.link-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212, 90, 44, 0.12);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-soft {
  background: rgba(166, 215, 191, 0.24);
  color: var(--mint-deep);
}

button,
.button-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

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

button:active,
.button-link:active {
  transform: translateY(0);
}

button:focus-visible,
.button-link:focus-visible,
.guestbook-entry a:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid rgba(143, 47, 21, 0.38);
  outline-offset: 3px;
}

#generate-button,
#guestbook-submit,
.button-link {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff7f0;
  box-shadow: 0 14px 28px rgba(170, 63, 37, 0.26);
}

.button-secondary,
.button-ghost,
.button-link-soft {
  color: var(--muted-strong);
  background: rgba(255, 252, 248, 0.82);
  border: 1px solid rgba(22, 17, 13, 0.1);
  box-shadow: none;
}

.button-link-soft {
  min-height: 48px;
}

.artifact-copy {
  position: relative;
  max-width: 42rem;
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 1.03rem;
}

.artifact-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 18px;
  margin-top: 24px;
}

.artifact-grid-daily {
  margin-top: 20px;
}

.artifact-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meta-key {
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-value {
  margin-top: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.sigil {
  display: grid;
  place-items: center;
  min-height: 100%;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(22, 17, 13, 0.08);
  background:
    radial-gradient(circle at top right, rgba(166, 215, 191, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.92), rgba(247, 239, 228, 0.7));
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.1;
  letter-spacing: 0.08em;
  white-space: pre;
}

.history-list,
.principles,
.idea-list,
.guestbook-list {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.idea-card {
  background: linear-gradient(135deg, rgba(255, 252, 248, 0.94), rgba(239, 198, 125, 0.22));
}

.idea-card p,
.history-item span,
.guestbook-entry span {
  margin: 8px 0 0;
  color: var(--muted);
}

.principles li {
  line-height: 1.7;
}

.guestbook-panel {
  margin-top: 22px;
}

.guestbook-form,
.guestbook-wall {
  position: relative;
}

.guestbook-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted-strong);
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  color: var(--ink);
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(212, 90, 44, 0.22);
  outline-offset: 2px;
}

.wall-head {
  align-items: center;
}

.guestbook-entry a {
  margin-top: 12px;
  color: var(--accent-deep);
  font-weight: 700;
}

.guestbook-entry strong {
  font-size: 1rem;
}

.guestbook-entry time {
  margin-top: 12px;
}

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

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, 18px, 0) scale(1.04);
  }
}

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

  .artifact-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  button:hover,
  .button-link:hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 28px;
  }

  .hero-panel,
  .daily-panel,
  .systems-panel,
  .stage,
  .shelf,
  .manifesto,
  .ideas,
  .guestbook-panel {
    padding: 20px;
  }

  .section-head,
  .stage-head,
  .shelf-head,
  .wall-head {
    flex-direction: column;
  }

  .stage-actions,
  .daily-actions,
  .link-row {
    width: 100%;
    justify-content: stretch;
  }

  .stage-actions button,
  .daily-actions button,
  .link-row a,
  .wall-head button,
  #guestbook-submit {
    width: 100%;
  }

  .stat-grid,
  .artifact-meta {
    grid-template-columns: 1fr;
  }
}
