:root {
  --bg: #f5efe5;
  --paper: #fbf7f0;
  --ink: #1f241f;
  --muted: #6f6f67;
  --accent: #d77a2f;
  --accent-deep: #9a4f13;
  --forest: #21443c;
  --line: rgba(33, 68, 60, 0.12);
  --shadow: 0 20px 60px rgba(31, 36, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(215, 122, 47, 0.2), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(33, 68, 60, 0.18), transparent 24%),
    radial-gradient(circle at 55% 35%, rgba(255, 255, 255, 0.45), transparent 32%),
    linear-gradient(180deg, #fbf7f0 0%, #f5efe5 44%, #ece5d7 100%);
  overflow-x: hidden;
}

.ambient-orb,
.ambient-grid {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.35;
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-one {
  top: 4rem;
  right: -6rem;
  background: rgba(215, 122, 47, 0.22);
}

.orb-two {
  left: -7rem;
  bottom: 8rem;
  background: rgba(33, 68, 60, 0.16);
  animation-duration: 18s;
}

.ambient-grid {
  inset: 0;
  background-image: linear-gradient(rgba(33, 68, 60, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 68, 60, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  opacity: 0.4;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(1240px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 1rem 1.2rem;
  backdrop-filter: blur(18px);
  background: rgba(251, 247, 240, 0.82);
  border: 1px solid rgba(33, 68, 60, 0.08);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(31, 36, 31, 0.08);
  position: sticky;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
}

.brand-kicker {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-meta,
.site-nav a,
.lede,
.supporting-copy,
.section-copy p,
.panel-label,
.summary-label,
.form-note {
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 700;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(33, 68, 60, 0.08);
}

main {
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.hero,
.content-grid,
.assistant-section,
.share-section,
.phone-section,
.legacy-section {
  max-width: 1240px;
  margin: 0 auto;
}

.hero {
  min-height: calc(100svh - 140px);
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2.25rem;
  align-items: start;
  padding: 2.6rem 0 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-deep);
}

h1,
h2 {
  font-family: "Fraunces", serif;
  line-height: 0.95;
  margin: 0;
}

h1 {
  font-size: clamp(3.4rem, 8vw, 7rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  max-width: 12ch;
}

.lede {
  font-size: 1.1rem;
  max-width: 42rem;
}

.supporting-copy {
  font-size: 1rem;
  max-width: 42rem;
}

.hero-actions,
.field-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(33, 68, 60, 0.1);
  margin-bottom: 1rem;
  color: var(--forest);
  font-weight: 700;
  font-size: 0.9rem;
}

.signal-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #3dbf76;
  box-shadow: 0 0 0 0 rgba(61, 191, 118, 0.4);
  animation: pulse 1.8s infinite;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 999px;
  padding: 0 1.25rem;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: var(--forest);
  color: #f9f7f0;
}

.button-secondary {
  color: var(--forest);
  border-color: rgba(33, 68, 60, 0.18);
  background: rgba(255, 255, 255, 0.5);
}

.button-call {
  background: var(--accent);
  color: #fffaf4;
}

.button-large {
  min-height: 3.5rem;
  padding-inline: 1.6rem;
}

.callout-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 20px;
  background: rgba(251, 247, 240, 0.88);
  border: 1px solid rgba(33, 68, 60, 0.12);
  box-shadow: var(--shadow);
}

.callout-label {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 700;
}

.callout-number {
  color: var(--forest);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.memory-sparks,
.assistant-suggestions,
.memory-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.memory-sparks {
  margin-top: 1rem;
}

.assistant-suggestions,
.memory-starters {
  margin-bottom: 0.5rem;
}

.spark-chip,
.assistant-chip,
.starter-chip {
  appearance: none;
  border: 1px solid rgba(33, 68, 60, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--forest);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.spark-chip:hover,
.assistant-chip:hover,
.starter-chip:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(33, 68, 60, 0.24);
}

.hero-panels,
.memory-list,
.legacy-section {
  display: grid;
  gap: 1rem;
}

.hero-panels {
  align-self: start;
  align-content: start;
  grid-template-rows: auto auto auto;
}

.quote-panel,
.story-panel,
.memory-card,
.assistant-shell,
.memory-form,
.legacy-card {
  background: rgba(251, 247, 240, 0.76);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(31, 36, 31, 0.08);
  backdrop-filter: blur(16px);
}

.quote-panel,
.story-panel,
.assistant-shell,
.memory-form,
.legacy-card {
  padding: 1.5rem;
}

.quote-panel,
.story-panel {
  height: fit-content;
}

.quote-panel {
  background:
    linear-gradient(180deg, rgba(32, 65, 57, 0.96), rgba(21, 45, 39, 0.95)),
    radial-gradient(circle at top right, rgba(215, 122, 47, 0.22), transparent 38%);
  color: #f5efe5;
}

.photo-panel {
  padding: 0;
  overflow: hidden;
  background: rgba(251, 247, 240, 0.92);
  min-height: 280px;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 11;
}

.quote-panel .panel-label,
.quote-panel .quote-text,
.story-panel .panel-label {
  color: inherit;
}

.panel-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.9rem;
  font-family: "Fraunces", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.quote-text {
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 2vw, 2.05rem);
  line-height: 1.18;
  margin: 0 0 0.85rem;
  max-width: 16ch;
}

.quote-credit {
  margin: 0;
  color: rgba(245, 239, 229, 0.82);
  font-size: 0.92rem;
}

.story-panel p:last-child {
  margin-bottom: 0;
}

.theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.micro-timeline {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.timeline-step {
  display: grid;
  grid-template-columns: 0.8rem 1fr;
  gap: 0.8rem;
  align-items: start;
}

.timeline-step p {
  margin: 0.2rem 0 0;
}

.timeline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(33, 68, 60, 0.12);
}

.timeline-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  margin-top: 0.35rem;
}

.theme-pill {
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: rgba(33, 68, 60, 0.08);
  border: 1px solid rgba(33, 68, 60, 0.1);
  color: var(--forest);
  font-weight: 700;
  font-size: 0.88rem;
}

.content-grid,
.assistant-section,
.share-section {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 2rem;
  margin-bottom: 4rem;
  align-items: start;
}

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

.memory-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: default;
}

.memory-card[data-expandable="true"] {
  cursor: pointer;
}

.memory-card:hover,
.legacy-card:hover,
.assistant-shell:hover,
.story-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 80px rgba(31, 36, 31, 0.12);
}

.memory-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(33, 68, 60, 0.08);
}

.memory-media-link {
  display: block;
  position: relative;
  text-decoration: none;
}

.memory-media-link::after {
  content: "Open photo";
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: rgba(31, 36, 31, 0.72);
  color: #fbf7f0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.memory-media-link:hover .memory-media {
  filter: saturate(1.04) contrast(1.02);
}

.memory-body {
  padding: 1.2rem;
}

.memory-meta {
  font-size: 0.86rem;
  color: var(--accent-deep);
  font-weight: 800;
}

.memory-title {
  font-family: "Fraunces", serif;
  font-size: 1.45rem;
  margin: 0.35rem 0 0.7rem;
}

.memory-text {
  margin: 0;
  color: var(--muted);
}

.memory-full {
  display: block;
  margin-top: 0.75rem;
}

.memory-card.is-collapsed .memory-full {
  display: none;
}

.memory-card.is-collapsed .memory-preview {
  display: block;
}

.memory-card:not(.is-collapsed) .memory-preview {
  display: none;
}

.memory-toggle {
  margin-top: 1rem;
  align-self: flex-start;
  border: 1px solid rgba(33, 68, 60, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--forest);
  border-radius: 999px;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.memory-wall-note {
  font-size: 0.95rem;
  color: var(--accent-deep);
  font-weight: 700;
}

.registry-note {
  font-size: 1rem;
  color: var(--accent-deep);
  font-weight: 700;
}

.assistant-shell {
  display: grid;
  gap: 1rem;
}

.assistant-form,
.memory-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.optional-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: rgba(33, 68, 60, 0.08);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.voice-field {
  display: grid;
  gap: 0.55rem;
}

.voice-button {
  justify-self: start;
  min-height: 2.35rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(33, 68, 60, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.voice-button.is-recording {
  background: var(--accent);
  color: #fffaf4;
  border-color: var(--accent);
}

.voice-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(33, 68, 60, 0.16);
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.8);
}

.assistant-response {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(33, 68, 60, 0.06), rgba(33, 68, 60, 0.03));
  padding: 1rem;
  min-height: 10rem;
  white-space: pre-wrap;
  line-height: 1.6;
}

.legacy-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.phone-section {
  margin-bottom: 4rem;
}

.phone-card h2 {
  max-width: none;
  margin-bottom: 0.8rem;
}

.obituary-dates {
  margin: 0 0 0.7rem;
  color: var(--accent-deep);
  font-weight: 800;
}

.legacy-card p:last-child {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .assistant-section,
  .share-section,
  .legacy-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 1.4rem;
  }

  .memory-list {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 11ch;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    top: 0.5rem;
    width: calc(100% - 1rem);
  }

  main {
    padding-inline: 1rem;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .site-nav a {
    text-align: center;
  }

  .field-row {
    flex-direction: column;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(1.5rem, -1rem, 0) scale(1.08);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 191, 118, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(61, 191, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 191, 118, 0);
  }
}
