@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap");

:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --paper-light: #fbfaf6;
  --ink: #262a24;
  --muted: #77796e;
  --line: #deddd2;
  --terra: #bb654c;
  --olive: #697254;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-header {
  min-height: 76px;
  padding: 0 clamp(24px, 7vw, 108px);
  border-bottom: 1px solid rgb(38 42 36 / 10%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.account-email {
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions .button {
  min-height: 35px;
  padding: 0 10px;
  font-size: 11px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.04em;
}

.wordmark-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--terra);
  color: white;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.header-note,
.section-kicker {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.access-panel {
  width: min(540px, calc(100% - 48px));
  margin: 95px auto 120px;
}

.access-panel h1 {
  margin-bottom: 17px;
}

.access-panel code {
  color: var(--ink);
  font-size: 0.9em;
}

.access-note,
.preview-notice {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.app-status {
  width: min(1120px, calc(100% - 48px));
  margin: 14px auto;
  padding: 11px 14px;
  border-left: 3px solid var(--olive);
  background: rgb(255 255 255 / 55%);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.preview-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 25px 0 0;
  padding: 12px 15px;
  border-left: 3px solid var(--terra);
  background: rgb(255 255 255 / 35%);
}

.sign-in-form {
  display: grid;
  gap: 15px;
  margin: 27px 0 17px;
}

.sign-in-form label,
.trip-dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.sign-in-form input {
  width: 100%;
  min-height: 43px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}

.sign-in-form input:focus {
  outline: 2px solid rgb(187 101 76 / 35%);
  border-color: var(--terra);
}

.sign-in-form .button {
  justify-self: start;
  margin-top: 3px;
}

.intro {
  padding: 79px 0 37px;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--terra);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

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

h1 {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 70px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

h1 em {
  color: var(--terra);
  font-weight: 500;
}

.intro-copy {
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 14px;
}

.intro-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trip-count {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  transition: background 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-dark {
  background: var(--ink);
  color: white;
}

.button-dark:hover {
  background: #41463b;
}

.button-dark span {
  margin-right: 7px;
  color: #d6a28e;
}

.button-quiet {
  background: transparent;
  color: var(--muted);
}

.travel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(32px, 7vw, 90px);
  align-items: start;
  padding: 33px 0 80px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.heading-rule {
  width: 32px;
  height: 1px;
  background: var(--terra);
}

.section-kicker {
  font-size: 9px;
  white-space: nowrap;
}

.trip-list {
  display: grid;
  gap: 12px;
}

.trip-card {
  position: relative;
  width: 100%;
  min-height: 112px;
  padding: 19px 20px 18px 23px;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgb(255 255 255 / 34%);
  color: var(--ink);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.trip-card:hover {
  transform: translateX(3px);
  background: rgb(255 255 255 / 65%);
}

.trip-card[aria-current="true"] {
  border-color: #d3c8b7;
  background: var(--paper-light);
}

.trip-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--olive);
  content: "";
}

.trip-card:nth-child(even)::before {
  background: var(--terra);
}

.trip-period {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.trip-destination {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.trip-arrow {
  color: var(--terra);
  font-family: var(--sans);
  font-size: 15px;
}

.trip-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.detail-panel {
  min-height: 318px;
  padding: 25px;
  background: var(--paper-light);
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.detail-period {
  color: var(--terra);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-number {
  color: #a7a596;
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.detail-panel h2 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.detail-lede {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.memory-edit-tools {
  display: flex;
  justify-content: flex-end;
  margin: -12px 0 12px;
}

.memory-edit-tools .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.memory-list {
  display: grid;
  gap: 0;
}

.memory {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.memory-label {
  display: block;
  margin-bottom: 6px;
  color: var(--olive);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.memory.special .memory-label {
  color: var(--terra);
}

.memory h3 {
  margin-bottom: 5px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.memory p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-line;
}

.memory-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.memory-photo-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  aspect-ratio: 1;
  background: #e8e5dc;
}

.memory-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.memory-photo-link:hover .memory-photo,
.memory-photo-link:focus-visible .memory-photo {
  transform: scale(1.04);
}

.memory-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.button-delete {
  min-height: 35px;
  padding: 0 13px;
  background: #8b3b32;
  color: white;
  font-size: 11px;
}

.button-delete:hover:not(:disabled) {
  background: #6f2b25;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.memory-form {
  display: grid;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.form-hint {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
}

.trip-dialog input[type="file"] {
  min-height: 44px;
  padding: 8px;
}

.memory-form input,
.trip-dialog input,
.trip-dialog textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}

.memory-form input:focus,
.trip-dialog input:focus,
.trip-dialog textarea:focus {
  outline: 2px solid rgb(187 101 76 / 35%);
  border-color: var(--terra);
}

.trip-dialog textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
}

.memory-form .button {
  justify-self: start;
  min-height: 35px;
  padding: 0 13px;
  font-size: 11px;
}

.empty-memories {
  padding: 16px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.trip-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 27px;
  border: 1px solid var(--line);
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 20px 70px rgb(38 42 36 / 18%);
}

.photo-viewer {
  width: min(1100px, calc(100% - 32px));
  max-width: 1100px;
  max-height: 92dvh;
  padding: 18px 22px 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: #262a24;
  color: #fbfaf6;
}

.photo-viewer::backdrop {
  background: rgb(18 20 18 / 82%);
  backdrop-filter: blur(4px);
}

.photo-viewer-header {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.photo-viewer-caption,
.photo-viewer-count {
  margin: 0;
  color: rgb(251 250 246 / 78%);
  font-size: 12px;
}

.photo-viewer-close {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fbfaf6;
  font-size: 30px;
  line-height: 1;
}

.photo-viewer-stage {
  display: grid;
  min-height: 180px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  justify-items: center;
  gap: 12px;
}

.photo-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(92dvh - 112px);
  object-fit: contain;
}

.photo-viewer-nav {
  width: 40px;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 3px;
  background: rgb(255 255 255 / 8%);
  color: #fbfaf6;
  font-size: 32px;
  line-height: 1;
}

.photo-viewer-nav:disabled {
  cursor: default;
  opacity: 0.3;
}

.photo-viewer-count {
  padding-top: 8px;
  text-align: center;
}

.trip-dialog::backdrop {
  background: rgb(38 42 36 / 42%);
  backdrop-filter: blur(2px);
}

.dialog-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 23px;
}

.dialog-top .eyebrow {
  margin-bottom: 8px;
}

.dialog-top h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.trip-dialog label {
  margin-bottom: 15px;
}

.delete-warning {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.delete-warning strong {
  color: var(--ink);
}

.delete-dialog .dialog-actions .button-delete {
  min-height: 42px;
  padding: 0 17px;
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

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

@media (max-width: 760px) {
  .intro {
    padding-top: 58px;
  }

  .travel-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 55px;
  }

  .detail-panel {
    min-height: auto;
  }

  .section-kicker {
    display: none;
  }
}

@media (max-width: 440px) {
  .site-header {
    min-height: 64px;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-note {
    max-width: 120px;
    font-size: 9px;
    text-align: right;
  }

  .account-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .account-email {
    margin-right: auto;
  }

  .preview-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    width: calc(100% - 36px);
  }

  .intro {
    padding-top: 48px;
  }

  .intro-copy {
    max-width: 280px;
    line-height: 1.6;
  }

  .trip-card {
    min-height: 103px;
    padding: 16px 15px 15px 19px;
  }

  .detail-panel {
    padding: 20px;
  }

  .photo-viewer {
    width: calc(100% - 16px);
    padding: 10px;
  }

  .photo-viewer-stage {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 5px;
  }

  .photo-viewer-nav {
    width: 32px;
    height: 42px;
  }
}

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