﻿@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --font-body: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-heading: "Manrope", "Poppins", "Segoe UI", sans-serif;
  --ink: #4a2f20;
  --faded-ink: #795a42;
  --paper: #d9b982;
  --paper-line: rgba(123, 78, 48, 0.2);
  --leather: #573321;
  --leather-dark: #2f1912;
  --wine: #803f35;
}
* {
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(
      circle at 10% 15%,
      rgba(246, 210, 145, 0.18),
      transparent 30%
    ),
    radial-gradient(circle at 90% 85%, rgba(12, 6, 3, 0.28), transparent 35%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0 1px,
      transparent 1px 5px
    ),
    #3c2419;
}

.site-navbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 940px;
  margin: 18px auto 0;
  padding: 13px 18px;
  border: 2px solid #26130d;
  border-radius: 6px;
  color: #f9e4bc;
  background: linear-gradient(110deg, #422216, #6f3b29 55%, #3a1d14);
  box-shadow: 0 5px 13px rgba(10, 5, 2, 0.35);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  color: #f9e4bc;
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.navbar-brand:hover,
.navbar-action:hover,
.navbar-logout:hover {
  color: #fff1d0;
  text-decoration: none;
}
.navbar-action,
.navbar-logout,
.navbar-user {
  text-decoration: none;
}
.navbar-toggle {
    display: none;
    margin-left: auto;
    /* padding: 6px 9px; */
    border: none;
    border-radius: 3px;
    font-size: 20px;
    color: #f9e4bc;
    background: transparent;
    font-weight: 100;
}
.navbar-menu {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  min-width: 0;
  flex: 1;
}
.navbar-user,
.navbar-action,
.navbar-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  color: #f9e4bc;
  font-family: var(--font-body);
  font-size: 1.12rem;
  white-space: nowrap;
}
.navbar-user {
  color: #edc993;
}
.memory-nav {
  min-width: 0;
  flex: 1;
  max-height: 205px;
  overflow-y: auto;
  padding: 0 7px 0 13px;
  border-left: 1px solid rgba(249, 228, 188, 0.35);
}
.memory-nav-title {
  margin: 4px 0 7px;
  color: #fff1d0;
  font-family: var(--font-body);
  font-size: 1.18rem;
  font-weight: 700;
}
.memory-nav-empty {
  margin: 0;
  color: #d5ae78;
  font-family: var(--font-body);
  font-size: 1.05rem;
}
.memory-nav-year-label,
.memory-nav-month-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 5px 0 2px;
  color: #edc993;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
  list-style: none;
}
.memory-nav-year-label::-webkit-details-marker,
.memory-nav-month-label::-webkit-details-marker {
  display: none;
}
.memory-nav-year-label::before,
.memory-nav-month-label::before {
  content: "\f054";
  color: #d5ae78;
  font-family: "Font Awesome 5 Free";
  font-size: 0.65rem;
  font-weight: 900;
  transition: transform 160ms ease;
}
.memory-nav-year[open] > .memory-nav-year-label::before,
.memory-nav-month[open] > .memory-nav-month-label::before {
  transform: rotate(90deg);
}
.memory-nav-year-label {
  font-size: 1.1rem;
}
.memory-nav-month {
  padding-left: 8px;
}
.memory-nav-month-label {
  font-size: 1rem;
}
.memory-nav-entry {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 3px 4px;
  border-radius: 3px;
  color: #f9e4bc;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.05;
}
.memory-nav-entry:hover {
  color: #fff1d0;
  background: rgba(255, 242, 207, 0.12);
  text-decoration: none;
}
.memory-nav-entry img,
.memory-nav-heart {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 3px;
  object-fit: cover;
  background: #d9b982;
}
.memory-nav-heart {
  color: var(--wine);
  background: #f4dfb7;
  font-size: 0.9rem;
}
.memory-nav-entry strong {
  display: inline-block;
  min-width: 24px;
  margin-right: 4px;
  color: #fff1d0;
}
.navbar-logout {
  margin-left: auto;
}

.book-shell {
  position: relative;
  max-width: 940px;
  min-height: calc(100vh - 56px);
  margin: 28px auto;
  padding: clamp(42px, 8vw, 82px) clamp(30px, 8vw, 95px) 72px;
  border: 13px solid var(--leather);
  border-radius: 8px 22px 22px 8px;
  box-shadow:
    0 2px 0 #9e6e43 inset,
    0 0 0 2px var(--leather-dark),
    0 25px 45px rgba(10, 5, 2, 0.55);
  background-color: var(--paper);
  background-image:
    radial-gradient(
      circle at 12% 18%,
      rgba(255, 245, 211, 0.3),
      transparent 23%
    ),
    radial-gradient(
      circle at 86% 78%,
      rgba(115, 68, 34, 0.16),
      transparent 34%
    ),
    repeating-radial-gradient(
      ellipse at center,
      rgba(101, 61, 31, 0.035) 0 1px,
      transparent 1px 5px
    );
}
.book-shell::before {
  content: "";
  position: absolute;
  top: -15px;
  bottom: -15px;
  left: 22px;
  width: 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, #25130d, #8d5634 42%, #3a1d12 78%);
  box-shadow: 4px 0 8px rgba(34, 16, 8, 0.5);
}
.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 38px;
  padding-left: 18px;
  text-align: center;
}
.page-kicker {
  margin: 0;
  color: var(--wine);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  color: var(--leather-dark);
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.06em;
}
.page-subtitle {
  margin: 8px auto 0;
  color: var(--faded-ink);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  line-height: 1.5;
}
.memory-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -14px 0 24px;
  padding-left: 18px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.memory-sort label {
  margin: 0;
}
.memory-sort-select {
  max-width: 265px;
  padding: 7px 10px 7px 2px;
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 15px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: rgba(255, 242, 207, 0.38);
}
.memory-sort-select:focus {
  border-color: var(--wine);
  outline: 0;
  box-shadow: 0 2px 0 rgba(128, 63, 53, 0.2);
}

.memory-book {
  position: relative;
  min-height: 610px;
  /* padding: 0 12px 62px 18px; */
  perspective: 1400px;
}
.memory-list {
  min-height: 520px;
  padding: 0 0 18px;
  transform-origin: left center;
}
.memory-list.turn-forward {
  animation: turn-page-forward 620ms cubic-bezier(0.2, 0.75, 0.3, 1);
}
.memory-list.turn-backward {
  animation: turn-page-backward 620ms cubic-bezier(0.2, 0.75, 0.3, 1);
  transform-origin: right center;
}
@keyframes turn-page-forward {
  0% {
    opacity: 0.72;
    transform: rotateY(0);
  }
  45% {
    opacity: 0.35;
    transform: rotateY(-78deg);
  }
  100% {
    opacity: 1;
    transform: rotateY(0);
  }
}
@keyframes turn-page-backward {
  0% {
    opacity: 0.72;
    transform: rotateY(0);
  }
  45% {
    opacity: 0.35;
    transform: rotateY(78deg);
  }
  100% {
    opacity: 1;
    transform: rotateY(0);
  }
}
.memory-card {
  position: relative;
  margin: 0 0 30px;
  padding-bottom: 20px;
  border: 0;
  border-bottom: 1px solid rgba(100, 60, 35, 0.22);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: rotate(-0.25deg);
}
.memory-card:nth-child(even) {
  transform: rotate(0.25deg);
}
.memory-card::before {
  content: "✦";
  position: absolute;
  left: 11px;
  top: 18px;
  color: var(--wine);
  font-size: 0.8rem;
}
.memory-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.memory-date {
  margin: 0 0 6px;
  color: var(--wine);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.memory-location {
  margin: -2px 0 8px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
}
.memory-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
.memory-text {
  margin: 0;
  color: #573928;
  font-family: var(--font-body);
  font-size: 1.08rem;
  text-align: justify;
  line-height: 1.45;
}
.polaroid {
  width: min(100%, 235px);
  margin: 18px 4px 4px auto;
  padding: 8px 8px 14px;
  background: #f8eed8;
  box-shadow: 3px 5px 9px rgba(61, 33, 16, 0.3);
  transform: rotate(2deg);
}
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.92;
  object-fit: cover;
  background: #ba9a70;
  filter: sepia(0.13) saturate(0.88);
}
.polaroid figcaption {
  min-height: 26px;
  padding-top: 10px;
  color: #5d4030;
  font-family: var(--font-body);
  font-size: 1.23rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}
.memory-extra-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  width: min(100%, 480px);
  margin: 18px 0 0 auto;
}
.memory-extra-photos img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 4px solid #f8eed8;
  object-fit: cover;
  box-shadow: 2px 3px 6px rgba(61, 33, 16, 0.22);
}
.memory-audio {
  display: block;
  width: min(100%, 420px);
  height: 48px;
  margin: 22px 0 0 auto;
  padding: 5px;
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 40px;
  color: var(--ink);
  background: rgba(248, 238, 216, 0.86);
  box-shadow:
    2px 3px 0 rgba(75, 40, 22, 0.16),
    inset 0 0 0 1px rgba(255, 242, 207, 0.5);
  accent-color: var(--wine);
}
.memory-audio:focus {
  border-color: #573321;
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(128, 63, 53, 0.16),
    2px 3px 0 rgba(75, 40, 22, 0.16);
}
.memory-audio::-webkit-media-controls-panel {
  background: rgba(248, 238, 216, 0.96);
}
.memory-audio::-webkit-media-controls-current-time-display,
.memory-audio::-webkit-media-controls-time-remaining-display {
  color: #573321;
  font-family: var(--font-body);
  font-size: 1rem;
}
.edit-memory-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0 0 6px;
  border-radius: 50%;
  color: var(--wine);
  font-size: 1rem;
}
.edit-memory-link:hover {
  color: var(--leather-dark);
  background: rgba(128, 63, 53, 0.12);
  text-decoration: none;
}
.empty-memory {
  margin: 45px 0;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.6rem;
  text-align: center;
}
.page-navigation {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 48px;
}
.page-turn {
  position: absolute;
  bottom: 0;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 50%;
  color: var(--wine);
  background: rgba(218, 184, 128, 0.5);
  box-shadow: 1px 2px 0 rgba(75, 40, 22, 0.2);
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}
.page-turn:hover:not(:disabled) {
  background: rgba(255, 242, 207, 0.7);
  transform: translateY(-2px);
}
.page-turn:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}
.page-turn-previous {
  left: 0;
}
.page-turn-next {
  right: 0;
}
.page-indicator {
  display: block;
  padding-top: 13px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.2rem;
  text-align: center;
}

.notebook-form {
  max-width: 660px;
  margin: 0 auto;
  padding-left: 18px;
}
.step-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(96, 54, 30, 0.28);
}
.step-progress-item {
  padding: 0 3px 9px;
  color: rgba(121, 90, 66, 0.65);
  font-family: var(--font-body);
  font-size: 1.08rem;
  text-align: center;
}
.step-progress-item.is-active,
.step-progress-item.is-complete {
  color: var(--wine);
  font-weight: 700;
}
.step-progress-item.is-active {
  border-bottom: 3px solid var(--wine);
}
.memory-step[hidden] {
  display: none;
}
.step-label {
  margin: 0 0 2px;
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.18rem;
  font-weight: 700;
}
.step-heading {
  margin: 0 0 26px;
  color: var(--leather-dark);
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}
.field-hint,
.field-description,
.summary-note {
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
}
.field-description {
  margin: -2px 0 8px;
}
.form-group {
  margin-bottom: 24px;
}
.notebook-form label {
  display: block;
  margin-bottom: 4px;
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 700;
}
.notebook-form .form-control {
  height: auto;
  padding: 8px 10px;
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.45rem;
  background: rgba(218, 184, 128, 0.25);
  box-shadow: none;
}
.notebook-form textarea.form-control {
  min-height: 180px;
  line-height: 1.35;
  resize: vertical;
}
.notebook-form .form-control:focus {
  border-color: var(--wine);
  outline: 0;
  box-shadow: 0 2px 0 rgba(128, 63, 53, 0.2);
  background-color: rgba(255, 242, 207, 0.18);
}
.notebook-form .form-control-file {
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.2rem;
}
.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-record,
.btn-stop {
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 3px;
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.2rem;
  background: rgba(218, 184, 128, 0.25);
}
.btn-record:hover,
.btn-stop:hover {
  color: var(--leather-dark);
  background: rgba(255, 242, 207, 0.35);
}
.btn-record:disabled,
.btn-stop:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.recording-visualizer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(128, 63, 53, 0.45);
  border-radius: 3px;
  color: var(--wine);
  background: rgba(128, 63, 53, 0.1);
}
.recording-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #a92f2f;
  box-shadow: 0 0 0 0 rgba(169, 47, 47, 0.45);
  animation: recording-pulse 1.4s infinite;
}
.recording-time {
  min-width: 46px;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
}
.recording-meter {
  position: relative;
  height: 26px;
  flex: 1;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    rgba(128, 63, 53, 0.16) 0 3px,
    transparent 3px 8px
  );
}
.recording-meter::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level, 0%);
  background: repeating-linear-gradient(
    90deg,
    var(--wine) 0 3px,
    transparent 3px 8px
  );
  transition: width 90ms linear;
}
@keyframes recording-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(169, 47, 47, 0);
  }
}
.recording-status {
  margin: 8px 0 10px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
}
.audio-preview {
  width: min(100%, 420px);
  margin: 12px 0;
}
.existing-media {
  margin: 4px 0 24px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
}
.existing-media img {
  display: block;
  width: min(100%, 180px);
  margin-top: 10px;
  border: 6px solid #f8eed8;
  box-shadow: 2px 3px 7px rgba(61, 33, 16, 0.25);
}
.existing-media audio {
  display: block;
  width: min(100%, 420px);
  margin-top: 12px;
  accent-color: var(--wine);
}
.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin: 14px 0 24px;
}
.photo-preview:empty {
  display: none;
}
.photo-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 4px solid #f8eed8;
  object-fit: cover;
  box-shadow: 2px 3px 6px rgba(61, 33, 16, 0.2);
}
.memory-summary {
  border-top: 1px solid rgba(96, 54, 30, 0.24);
  border-bottom: 1px solid rgba(96, 54, 30, 0.24);
}
.memory-summary-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(96, 54, 30, 0.2);
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.2;
}
.memory-summary-item:last-child {
  border-bottom: 0;
}
.memory-summary-item strong {
  color: var(--wine);
}
.memory-summary-item span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.summary-note {
  margin: 18px 0 0;
}
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
}
.btn-step-secondary {
  border: 1px solid rgba(96, 54, 30, 0.38);
  border-radius: 3px;
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.2rem;
  background: transparent;
}
.btn-step-secondary:hover {
  color: var(--leather-dark);
  background: rgba(255, 242, 207, 0.35);
}
.step-actions .btn-notebook {
  margin-left: auto;
}
.step-actions [hidden] {
  display: none;
}
.btn-notebook {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 24px;
    border: 0;
    border-radius: 30px;
    color: #f9e4bc;
    font-family: var(--font-body);
    font-size: 1.05rem;
    background: linear-gradient(135deg, #8a4936, #5f2e26);
    box-shadow: 0 3px 0 #3b1b16, 0 5px 10px rgba(44, 22, 14, 0.25);
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn-notebook:hover {
  color: #fff1d0;
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 #3b1b16,
    0 7px 11px rgba(44, 22, 14, 0.23);
}
.btn-notebook:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #3b1b16;
}
.fixed-bottom {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2;
}
.quick-actions {
  position: fixed;
  bottom: 10px;
  left: 50%;
  z-index: 15;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  transform: translateX(-50%);
}
.quick-actions-menu {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}
.quick-actions.is-open .quick-actions-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 172px;
  padding: 8px 14px;
  /* border: 1px solid rgba(74, 47, 32, 0.4); */
  border-radius: 20px;
  color: var(--leather-dark);
  font-family: var(--font-body);
  font-size: 1.15rem;
  background: #f8eed8;
  box-shadow: 0 3px 8px rgba(44, 22, 14, 0.28);
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.quick-action:hover,
.quick-action:focus-visible {
  color: #fff1d0;
  background: var(--wine);
  text-decoration: none;
  transform: translateY(-1px);
}
.quick-actions-toggle {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 0;
  border: 2px solid #f8eed8;
  border-radius: 50%;
  color: #f9e4bc;
  background: var(--wine);
  box-shadow: 0 4px 10px rgba(44, 22, 14, 0.38);
  font-size: 1.25rem;
  transition: background-color 160ms ease, transform 160ms ease;
}
.quick-actions-toggle:hover,
.quick-actions-toggle:focus-visible {
  background: var(--leather-dark);
  transform: translateY(-2px);
}
.quick-actions-toggle:focus-visible,
.quick-action:focus-visible {
  outline: 3px solid #fff1d0;
  outline-offset: 3px;
}
.quick-actions.is-open .quick-actions-toggle {
  background: var(--leather-dark);
  transform: rotate(45deg);
}
.back-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
}
.back-link:hover {
  color: var(--leather-dark);
  text-decoration: none;
}
.login-shell {
  max-width: 720px;
}
.login-form {
  max-width: 440px;
}
.login-error {
  margin: -8px 0 18px;
  color: #8b2f2f;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
}

.memory-detail-shell {
  min-height: calc(100vh - 150px);
}
.memory-detail-card {
  max-width: 700px;
  margin: 0 auto;
}

.album-shell {
  min-height: calc(100vh - 150px);
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 20px 18px;
}
.album-photo {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 4px solid #f8eed8;
  border-radius: 2px;
  background: #ba9a70;
  box-shadow: 2px 3px 7px rgba(61, 33, 16, 0.25);
  cursor: zoom-in;
  aspect-ratio: 1;
}
.album-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(40, 20, 12, 0.7));
  opacity: 0;
  transition: opacity 160ms ease;
}
.album-photo:hover::after,
.album-photo:focus-visible::after {
  opacity: 1;
}
.album-photo:focus-visible {
  outline: 3px solid #fff1d0;
  outline-offset: 2px;
}
.album-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.08) saturate(0.95);
  transition: transform 220ms ease;
}
.album-photo:hover img,
.album-photo:focus-visible img {
  transform: scale(1.04);
}
.album-photo-caption {
  position: absolute;
  right: 8px;
  bottom: 5px;
  left: 8px;
  z-index: 1;
  overflow: hidden;
  color: #fff1d0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 160ms ease;
}
.album-photo:hover .album-photo-caption,
.album-photo:focus-visible .album-photo-caption {
  opacity: 1;
}
.album-empty {
  margin-top: 90px;
}
.album-lightbox[hidden] {
  display: none;
}
.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px 70px;
  background: rgba(28, 14, 9, 0.94);
}
.album-lightbox-figure {
  display: flex;
  max-width: min(92vw, 980px);
  max-height: 90vh;
  margin: 0;
  flex-direction: column;
  align-items: center;
}
.album-lightbox-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(90vh - 55px);
  object-fit: contain;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}
.album-lightbox-figure img.album-lightbox-image--visible {
  opacity: 1;
  transform: scale(1);
}
.album-lightbox-figure figcaption {
  margin-top: 10px;
  color: #f9e4bc;
  font-family: var(--font-body);
  font-size: 1.35rem;
  text-align: center;
}
.album-lightbox-close,
.album-lightbox-arrow {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(249, 228, 188, 0.55);
  border-radius: 50%;
  color: #f9e4bc;
  background: rgba(74, 39, 27, 0.75);
  transition: background-color 160ms ease, transform 160ms ease;
}
.album-lightbox-close:hover,
.album-lightbox-arrow:hover {
  background: #803f35;
  transform: scale(1.06);
}
.album-lightbox-close {
  top: 18px;
  right: 22px;
}
.album-lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
}
.album-lightbox-arrow:hover {
  transform: translateY(-50%) scale(1.06);
}
.album-lightbox-previous {
  left: 22px;
}
.album-lightbox-next {
  right: 22px;
}
body.album-is-open {
  overflow: hidden;
}

.declarations-shell {
  min-height: calc(100vh - 150px);
}
.declaration-compose,
.declaration-lock,
.declaration-letter {
  max-width: 700px;
  margin: 0 auto 38px;
}
.declaration-hero {
  margin: 0 auto 28px;
  max-width: 760px;
  text-align: center;
}
.declaration-hero-kicker {
  margin: 0 0 10px;
  color: var(--wine);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.declaration-hero h2 {
  margin: 0 0 12px;
  color: var(--wine);
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.1;
}
.declaration-hero p {
  margin: 0;
  color: var(--faded-ink);
  font-size: 1.2rem;
}
.declaration-compose h2,
.declaration-lock h2,
.declaration-letter h2,
.declaration-list h2 {
  color: var(--wine);
  font-size: 1.45rem;
}
.declaration-compose h2 {
  margin-bottom: 22px;
  font-family: var(--font-body);
  font-size: 1.7rem;
}
.declaration-lock {
  text-align: center;
}
.declaration-lock-icon {
  color: var(--wine);
  font-size: 2.1rem;
}
.declaration-lock p {
  max-width: 480px;
  margin: 10px auto 22px;
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.25rem;
}
.declaration-auth-form {
  max-width: 420px;
  margin: auto;
  text-align: left;
}
.declaration-letter {
  padding: 30px clamp(22px, 6vw, 62px);
  border: 1px solid rgba(128, 63, 53, 0.3);
  border-radius: 3px;
  background: rgba(255, 242, 207, 0.3);
  box-shadow: 3px 5px 0 rgba(74, 47, 32, 0.08);
  transform: rotate(-0.4deg);
}
.declaration-eyebrow,
.declaration-expiry {
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 1.2rem;
}
.declaration-letter h2 {
  margin: 14px 0 18px;
  font-family: var(--font-body);
}
.declaration-text {
  margin: 0;
  white-space: pre-wrap;
  color: #573928;
  font-family: var(--font-body);
  font-size: 1.55rem;
  line-height: 1.35;
}
.declaration-expiry {
  margin: 28px 0 0;
  font-size: 1rem;
}
.declaration-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  padding-top: 25px;
  border-top: 1px solid rgba(100, 60, 35, 0.22);
}
.declaration-list h2 {
  margin: 0 0 12px;
  font-family: var(--font-body);
}
.declaration-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(100, 60, 35, 0.28);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.2rem;
}
.declaration-item:hover {
  color: var(--wine);
  background: rgba(255, 242, 207, 0.35);
  text-decoration: none;
}
.declaration-item span {
  min-width: 0;
}
.declaration-item strong,
.declaration-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.declaration-item small {
  color: var(--faded-ink);
  font-size: 1rem;
}
.declaration-item > i {
  flex: 0 0 auto;
  color: var(--wine);
}
.declaration-item-sent {
  cursor: default;
}
.declaration-item-sent:hover {
  color: var(--ink);
  background: transparent;
}
.declaration-empty {
  color: var(--faded-ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
}

@media (max-width: 700px) {
  body {
    line-height: 1.55;
  }
  .site-navbar {
    position: sticky;
    top: 0;
    align-items: center;
    margin: 0;
    border-width: 0 0 2px;
    border-radius: 0;
  }
  .navbar-brand {
    font-size: 1.2rem;
  }
  .navbar-toggle {
    display: block;
  }
  .navbar-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    gap: 7px;
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    padding: 14px 18px 18px;
    border-bottom: 2px solid #26130d;
    background: #4a271b;
    box-shadow: 0 8px 14px rgba(10, 5, 2, 0.35);
  }
  .site-navbar.menu-open .navbar-menu {
    display: flex;
  }
  .navbar-user,
  .navbar-action,
  .navbar-logout {
    width: 100%;
    font-size: 1rem;
  }
  .navbar-logout {
    margin-left: 0;
    border-top: 1px solid rgba(249, 228, 188, 0.28);
  }
  .memory-nav {
    width: 100%;
    max-height: none;
    padding: 5px 0 8px;
    border-top: 1px solid rgba(249, 228, 188, 0.28);
    border-left: 0;
  }
  .book-shell {
    min-height: 100vh;
    margin: 0;
    padding: 45px 24px 95px 40px;
    border-width: 8px;
    border-radius: 0;
  }
  .book-shell::before {
    left: 10px;
    width: 13px;
  }
  .page-header {
    gap: 8px;
    padding-left: 7px;
  }
  .page-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }
  h1 {
    font-size: clamp(1.8rem, 8vw, 2.7rem);
    letter-spacing: -0.04em;
  }
  .page-subtitle {
    font-size: 1rem;
  }
  .memory-sort {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin: -4px 0 24px;
    padding-left: 7px;
  }
  .memory-sort-select {
    width: 100%;
    max-width: none;
  }
  .memory-book,
  .notebook-form {
    padding-left: 7px;
  }
  .memory-book {
    min-height: 650px;
  }
  .memory-list {
    min-height: 560px;
  }
  .memory-card {
    margin-bottom: 22px;
  }
  .memory-card::before {
    left: 8px;
    top: 0px;
    font-size: 0.7rem;
  }
  .memory-date {
    font-size: 1.08rem;
  }
  .memory-location {
    font-size: 0.82rem;
  }
  .memory-title {
    font-size: 1.24rem;
  }
  .memory-text {
    font-size: 0.98rem;
    line-height: 1.25;
  }
  .polaroid figcaption {
    font-size: 1rem;
  }
  .edit-memory-link {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  .memory-detail-shell {
    min-height: 100vh;
  }
  .notebook-form label {
    font-size: 1.1rem;
  }
  .notebook-form .form-control {
    font-size: 1rem;
  }
  .step-progress-item,
  .step-label,
  .field-hint,
  .field-description,
  .summary-note,
  .btn-step-secondary,
  .btn-record,
  .btn-stop,
  .recording-status,
  .recording-time,
  .existing-media,
  .declaration-lock p,
  .declaration-item,
  .declaration-text,
  .back-link,
  .quick-action,
  .login-error {
    font-size: 0.95rem;
  }
  .step-heading {
    font-size: 1.5rem;
  }
  .btn-notebook {
    /* width: 100%; */
    font-size: 0.95rem;
  }
  .quick-actions {
    bottom: 8px;
  }
  .quick-action {
    min-width: 150px;
    font-size: 1rem;
  }
  .declaration-columns {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .declaration-text {
    font-size: 1.2rem;
  }
}
@media (max-width: 480px) {
  .site-navbar {
    padding: 10px 14px;
  }
  .navbar-brand {
    font-size: 1.08rem;
  }
  .book-shell {
    padding: 36px 18px 90px 28px;
  }
  .book-shell::before {
    left: 8px;
    width: 10px;
  }
  .page-kicker {
    letter-spacing: 0.12em;
  }
  .memory-card::before {
    left: 0px;
  }
  .memory-date,
  .memory-title {
    padding-left: 10px;
  }
  .memory-text {
    font-size: 0.94rem;
  }
  .notebook-form {
    padding-left: 0;
  }
  .audio-actions,
  .step-actions {
    flex-direction: column;
  }
  .step-actions .btn-notebook {
    margin-left: 0;
  }
  .btn-step-secondary,
  .btn-record,
  .btn-stop,
  .btn-notebook {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .memory-list.turn-forward,
  .memory-list.turn-backward,
  .recording-dot {
    animation-duration: 1ms;
  }
}

@media (max-width: 700px) {
  .album-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-left: 7px;
  }
  .album-photo {
    border-width: 2px;
  }
  .album-photo-caption {
    display: none;
  }
  .album-lightbox {
    padding: 35px 45px;
  }
  .album-lightbox-arrow {
    width: 36px;
    height: 36px;
  }
  .album-lightbox-previous {
    left: 7px;
  }
  .album-lightbox-next {
    right: 7px;
  }
}

