:root {
  --cottage-cream: #F5EFE0;
  --deep-earth: #2D2820;
  --garden-green: #4A6741;
  --garden-green-dark: #354D2F;
  --barn-red: #8B4B3A;
  --weathered-blue: #4A6B7A;
  --warm-amber: #C49A5A;
  --warm-stone: #7A7268;
  --parchment: #EDE4D0;
  --weathered-white: #FAF6EE;
  --dusty-rose: #C49090;
  --line: rgba(122, 114, 104, 0.32);
  --shadow: 0 1.5rem 3rem rgba(45, 40, 32, 0.12);
}

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

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(74, 103, 65, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 103, 65, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(196, 154, 90, 0.28), transparent 24rem),
    radial-gradient(circle at 88% 28%, rgba(139, 75, 58, 0.14), transparent 26rem),
    var(--cottage-cream);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  color: var(--deep-earth);
  font-family: 'Literata', Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3.4rem, 8vw, 7.5rem);
}

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

.page-shell {
  min-height: 100vh;
  padding: 1.25rem clamp(1rem, 3vw, 3rem) 2rem;
}

.page-shell--compact {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--garden-green-dark);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

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

.site-nav a {
  border-radius: 999px;
  color: var(--deep-earth);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(74, 103, 65, 0.1);
  outline: none;
}

.site-nav .nav-button {
  background: var(--garden-green-dark);
  color: var(--weathered-white);
}

.site-footer {
  max-width: 1180px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--warm-stone);
  font-size: 0.9rem;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.2rem;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.button--primary {
  background: var(--barn-red);
  color: var(--weathered-white);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: #743d30;
}

.button--secondary {
  background: rgba(250, 246, 238, 0.7);
  border-color: var(--line);
  color: var(--deep-earth);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--weathered-white);
  border-color: var(--warm-stone);
}

.button--full {
  width: 100%;
}

.quiet-link {
  color: var(--garden-green-dark);
  font-weight: 700;
  text-decoration-color: rgba(53, 77, 47, 0.4);
  text-underline-offset: 0.25em;
}

.quiet-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--garden-green-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(53, 77, 47, 0.4);
  text-underline-offset: 0.25em;
}

.quiet-button:focus-visible,
.quiet-button:hover {
  color: var(--barn-red);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.action-row--center {
  justify-content: center;
}

.eyebrow {
  color: var(--barn-red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.handwritten {
  color: var(--barn-red);
  font-family: 'Sacramento', cursive;
  font-size: 1.6rem;
}

.notice {
  background: rgba(74, 103, 65, 0.1);
  border: 1px solid rgba(74, 103, 65, 0.22);
  border-radius: 0.5rem;
  color: var(--garden-green-dark);
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
}

.notice--error {
  background: rgba(139, 75, 58, 0.11);
  border-color: rgba(139, 75, 58, 0.28);
  color: var(--barn-red);
}

.reveal {
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal--delay {
  animation-delay: 140ms;
}

.splash {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.wordmark-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wordmark-wrap::before,
.wordmark-wrap::after {
  background-color: var(--garden-green);
  content: '';
  display: block;
  height: 1px;
  opacity: 0.4;
  width: 4rem;
}

.wordmark {
  color: var(--garden-green-dark);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.tagline {
  color: var(--warm-stone);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-style: italic;
}

.coming-soon {
  color: var(--warm-stone);
  font-family: 'Sacramento', cursive;
  font-size: 1.25rem;
  opacity: 0.7;
}

.memory-workspace {
  max-width: 980px;
  margin: 0 auto;
}

.memory-form,
.memory-detail,
.memory-list {
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 1rem 2rem rgba(45, 40, 32, 0.08);
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.memory-form {
  display: grid;
  gap: 1.35rem;
}

.memory-form-intro,
.form-section {
  background: rgba(196, 154, 90, 0.14);
  border-radius: 0.5rem;
  color: var(--deep-earth);
  padding: 1rem;
}

.memory-form-intro {
  max-width: 34rem;
}

.form-section__title {
  color: var(--garden-green-dark);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

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

.field span,
.choice-panel legend {
  color: var(--garden-green-dark);
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  background: var(--weathered-white);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--deep-earth);
  min-height: 2.8rem;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.field textarea {
  resize: vertical;
}

.photo-upload {
  margin-top: 0;
}

.photo-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  margin: 0 0 1rem;
}

.photo-grid img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  display: block;
  object-fit: cover;
  width: 100%;
}

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

.choice-panel {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
}

.choice-panel label {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.field--inline {
  align-items: center;
  grid-template-columns: 8rem 1fr;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice-chip {
  display: inline-flex;
}

.choice-chip input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.choice-chip span {
  background: rgba(196, 154, 90, 0.16);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--warm-stone);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
}

.choice-chip input:checked + span {
  background: var(--garden-green);
  color: var(--weathered-white);
}

.choice-chip input:focus-visible + span {
  border-color: var(--deep-earth);
  outline: 2px solid rgba(74, 103, 65, 0.18);
}

.choice-panel--status {
  background: rgba(196, 154, 90, 0.14);
  border: 0;
}

.status-select {
  background: var(--weathered-white);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--deep-earth);
  min-height: 2.8rem;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.memory-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.memory-row:first-of-type {
  border-top: 0;
}

.memory-body {
  font-size: 1.3rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.memory-meta {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0 0;
}

.memory-meta div {
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.memory-meta dt {
  color: var(--warm-stone);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.memory-meta dd {
  margin: 0.2rem 0 0;
}

.timeline-workspace {
  max-width: 1040px;
  margin: 0 auto;
}

.timeline-filters {
  align-items: end;
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  margin-top: 1rem;
  padding: 1rem;
}

.timeline-view-switcher {
  align-items: center;
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0.25rem;
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.timeline-view-switcher a {
  border-radius: 0.35rem;
  color: var(--deep-earth);
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
}

.timeline-view-switcher a.is-active {
  background: var(--garden-green);
  color: var(--weathered-white);
}

.filter-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

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

.timeline-group {
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
}

.timeline-group--undated {
  border-style: dashed;
  opacity: 0.92;
}

.timeline-group__header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.75rem;
}

.timeline-group__header--drop {
  background: rgba(78, 109, 82, 0.12);
  border-radius: 0.45rem;
}

.timeline-group__header h2 {
  margin: 0;
}

.timeline-group__header > span {
  color: var(--warm-stone);
  font-weight: 700;
}

.timeline-rows {
  display: grid;
}

.timeline-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.timeline-row:first-child {
  border-top: 0;
}

.timeline-row a,
.timeline-row__text {
  align-items: center;
  color: var(--deep-earth);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  text-decoration: none;
  width: 100%;
}

.timeline-row__title {
  display: grid;
  gap: 0.15rem;
}

.timeline-row__location {
  color: var(--warm-stone);
  font-size: 0.88rem;
  font-weight: 600;
}

.timeline-row small,
.timeline-row__text small {
  color: var(--warm-stone);
  white-space: nowrap;
}

.inline-decade-form,
.era-row,
.era-row form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.inline-decade-form select,
.era-row input {
  background: var(--weathered-white);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.55rem;
}

.era-row {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  padding: 0.75rem 0;
}

.era-row:first-of-type {
  border-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .timeline-filters,
  .timeline-row,
  .settings-row,
  .era-row,
  .era-row form {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 760px;
}

.settings-section {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.settings-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.settings-section p {
  color: var(--warm-stone);
  margin-bottom: 1.25rem;
}

.profile-summary-card {
  align-items: center;
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
}

.profile-summary-card h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.profile-summary-card p {
  color: var(--warm-stone);
}

.profile-avatar {
  align-items: center;
  background: var(--garden-green);
  border-radius: 999px;
  color: var(--weathered-white);
  display: inline-flex;
  flex: 0 0 auto;
  height: 4rem;
  justify-content: center;
  width: 4rem;
}

.settings-overview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.settings-overview-card {
  background: rgba(250, 246, 238, 0.74);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--deep-earth);
  display: grid;
  gap: 0.55rem;
  min-height: 11rem;
  padding: 1.1rem;
  text-decoration: none;
}

.settings-overview-card span {
  align-items: center;
  background: rgba(74, 103, 65, 0.12);
  border-radius: 999px;
  color: var(--garden-green-dark);
  display: inline-flex;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.settings-overview-card strong {
  color: var(--garden-green-dark);
  font-size: 1.05rem;
}

.settings-overview-card small {
  color: var(--warm-stone);
  font-size: 0.9rem;
  line-height: 1.45;
}

.settings-overview-card:hover,
.settings-overview-card:focus-visible {
  background: var(--weathered-white);
  border-color: rgba(74, 103, 65, 0.4);
  outline: none;
}

.settings-table,
.settings-row {
  display: grid;
  gap: 1rem;
}

.settings-table {
  max-width: 760px;
}

.settings-row {
  align-items: center;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 1rem 0;
}

.settings-row:first-child {
  border-top: 0;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.form-note {
  color: var(--warm-stone);
  font-size: 0.9rem;
  margin: 0;
}

.copy-field {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 1rem 0;
  overflow-wrap: anywhere;
  padding: 0.85rem 1rem;
}

.notification-badge {
  background: var(--barn-red);
  border-radius: 999px;
  color: var(--weathered-white);
  display: inline-flex;
  font-size: 0.75rem;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0.1rem 0.4rem;
}

.notification-link {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.notification-preference-matrix {
  display: grid;
  gap: 0;
}

.preference-grid {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(10rem, 1fr) minmax(6rem, 8rem) minmax(6rem, 8rem);
  padding: 0.85rem 0;
}

.preference-grid:first-child {
  border-top: 0;
}

.preference-grid--head {
  color: var(--warm-stone);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding-top: 0;
  text-transform: uppercase;
}

.preference-toggle {
  appearance: none;
  background: rgba(250, 246, 238, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--warm-stone);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  width: 100%;
}

.preference-toggle--on {
  background: rgba(74, 103, 65, 0.12);
  border-color: rgba(74, 103, 65, 0.32);
  color: var(--garden-green-dark);
}

.preference-unavailable {
  color: var(--warm-stone);
  text-align: center;
}

@media (max-width: 640px) {
  .preference-grid {
    grid-template-columns: minmax(8rem, 1fr) minmax(4.75rem, 5.5rem) minmax(4.75rem, 5.5rem);
  }
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.photo-upload--drag {
  border-color: var(--garden-green);
  background: rgba(74, 103, 65, 0.06);
}
.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.photo-preview-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}

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