:root {
  color-scheme: light;
  --cream: #fbf7ee;
  --paper: #fffdf8;
  --sage: #7d9276;
  --sage-dark: #4d604b;
  --terracotta: #b76f52;
  --clay: #d9a48b;
  --ink: #2f322d;
  --muted: #6f7169;
  --line: #e4d9ca;
  --shadow: 0 18px 45px rgba(69, 62, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(251, 247, 238, 0.82), rgba(251, 247, 238, 0.92)),
    url("assets/welcome-journal-neutral.png") center / cover;
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.05;
}

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

.auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--terracotta);
  font-weight: 700;
}

.app-shell.locked {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  font-family: Georgia, serif;
  font-size: 24px;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.sign-out {
  width: 100%;
  margin-top: 18px;
  color: var(--terracotta);
}

.nav-link,
.text-action,
.filter,
.quiet-link-card {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.nav-link {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}

.nav-link:hover,
.nav-link.active {
  background: #eef1e8;
  color: var(--sage-dark);
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.screen {
  display: none;
  animation: rise 220ms ease-out;
}

.screen.active {
  display: block;
}

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

.welcome-screen {
  min-height: calc(100vh - 64px);
  display: none;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 36px;
}

.welcome-screen.active {
  display: grid;
}

.welcome-copy h1,
.page-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.05;
}

.welcome-copy h1 {
  font-size: clamp(48px, 8vw, 96px);
}

.lede {
  max-width: 590px;
  font-size: 22px;
  line-height: 1.5;
  color: var(--sage-dark);
}

.welcome-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--terracotta);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.subtle {
  color: var(--muted);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: clamp(36px, 5vw, 64px);
}

.primary-action {
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--sage-dark);
  color: white;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(77, 96, 75, 0.2);
}

.primary-action:hover {
  background: #3f523f;
}

.text-action {
  padding: 0;
  color: var(--terracotta);
  font-weight: 750;
}

.memory-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.week-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.4fr);
  gap: 22px;
  align-items: center;
  background: #eef1e8;
}

.week-card h2 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
}

.week-card p {
  margin: 0;
  color: var(--sage-dark);
  font-size: 17px;
  line-height: 1.55;
}

.week-stats {
  display: grid;
  gap: 10px;
}

.week-stats span,
.count-card {
  color: var(--muted);
}

.week-stats strong {
  display: block;
  color: var(--sage-dark);
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.count-card strong {
  display: block;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.count-card p {
  margin: 8px 0 0;
}

.feature-panel,
.quiet-panel,
.profile-panel,
.prep-column,
.week-card,
.count-card,
.gallery-card,
.inline-form,
.reflection-form,
.prep-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(69, 62, 49, 0.07);
}

.feature-panel,
.quiet-panel,
.profile-panel,
.prep-column,
.week-card,
.count-card,
.gallery-card,
.prep-strip {
  padding: 22px;
}

.feature-panel.warm {
  background: #f7e9df;
}

.panel-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.feature-panel h2,
.quiet-panel h2 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}

.featured-photo {
  position: relative;
  height: 320px;
  min-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef1e8;
}

.featured-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-photo span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--sage-dark);
  font-family: Georgia, serif;
  font-size: 22px;
}

.photo-placeholder {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(rgba(47, 50, 45, 0.05), rgba(47, 50, 45, 0.05)),
    radial-gradient(circle at 24% 22%, #f4c9af 0 12%, transparent 13%),
    linear-gradient(135deg, #dfe8d9, #f9eadf 55%, #efe3c8);
  color: var(--sage-dark);
  font-family: Georgia, serif;
  font-size: 30px;
}

.home-grid,
.profile-grid,
.prep-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.prep-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.prep-strip h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: 500;
}

.progress-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-list span,
.type-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef1e8;
  color: var(--sage-dark);
  font-size: 14px;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.filter.active {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: white;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.memory-card {
  position: relative;
  margin-left: 48px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(69, 62, 49, 0.07);
}

.memory-card::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 24px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 1px var(--line);
}

.memory-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.memory-card h2 {
  margin: 8px 0;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}

.favourite-toggle {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--terracotta);
  font-size: 20px;
}

.favourite-toggle.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: white;
}

.memory-list {
  display: grid;
  gap: 16px;
}

.inline-form,
.reflection-form {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-bottom: 22px;
}

.hidden {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--sage-dark);
  font-weight: 750;
}

label span {
  color: var(--muted);
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

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

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0d5c6;
  color: var(--terracotta);
  font-family: Georgia, serif;
  font-size: 38px;
}

.profile-panel h2 {
  margin: 14px 0;
  font-family: Georgia, serif;
  font-weight: 500;
}

.profile-panel h2 span {
  color: var(--muted);
  font-family: inherit;
  font-size: 18px;
}

.prep-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-card h2 {
  margin: 14px 0 8px;
  font-family: Georgia, serif;
  font-weight: 500;
}

.gallery-image {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, #f0d5c6 0 16%, transparent 17%),
    linear-gradient(135deg, #eef1e8, #f8eee5);
  color: var(--sage-dark);
  font-family: Georgia, serif;
  font-size: 26px;
}

.gallery-photo,
.memory-image {
  width: 100%;
  max-height: 360px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 14px;
}

.gallery-photo {
  aspect-ratio: 4 / 3;
  max-height: none;
}

.food-note {
  padding: 16px;
  border-radius: 8px;
  background: #eef1e8;
  color: var(--sage-dark);
}

.food-note p {
  margin: 0;
}

.support-links {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.quiet-link-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1e8;
  text-align: left;
  box-shadow: 0 10px 28px rgba(69, 62, 49, 0.07);
}

.quiet-link-card strong {
  color: var(--sage-dark);
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}

.quiet-link-card small {
  color: var(--muted);
  font-size: 15px;
}

.prep-column h2 {
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-weight: 500;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.check-item input {
  width: 20px;
  height: 20px;
}

.bottom-nav {
  display: none;
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
    padding-bottom: 76px;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 20px;
  }

  .welcome-screen,
  .welcome-screen.active,
  .memory-hero,
  .home-grid,
  .profile-grid,
  .prep-board,
  .week-card,
  .gallery-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .countdown-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .count-card {
    padding: 14px 10px;
  }

  .count-card .panel-label {
    min-height: 30px;
    margin-bottom: 8px;
    font-size: 11px;
  }

  .count-card strong {
    font-size: 34px;
  }

  .count-card p {
    font-size: 13px;
  }

  .welcome-screen {
    min-height: auto;
  }

  .page-header,
  .prep-strip {
    display: grid;
  }

  .featured-photo,
  .photo-placeholder {
    height: 220px;
    min-height: 220px;
  }

  .featured-photo span,
  .photo-placeholder {
    font-size: 24px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(16px);
  }

  .bottom-nav .nav-link {
    min-height: 52px;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 16px;
  }

  .welcome-copy h1 {
    font-size: 48px;
  }

  .lede {
    font-size: 18px;
  }

  .page-header h1 {
    font-size: 38px;
  }

  .memory-card {
    margin-left: 34px;
    padding: 16px;
  }

  .timeline::before {
    left: 14px;
  }

  .memory-card::before {
    left: -27px;
  }
}
