.counter span {
  display: block;
}

body.night {
  background: #080d1d;
}

body.night .stars {
  opacity: 1;
  background-image:
    linear-gradient(180deg, rgba(4, 8, 22, 0.48), rgba(6, 10, 25, 0.72)),
    url("/assets/milky-way-mountains-a.webp");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

body.night #app {
  position: relative;
  z-index: 1;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 22px 16px 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
}

body.night .card {
  background: color-mix(in srgb, var(--paper2) 88%, transparent);
}

.brand {
  color: inherit;
  text-decoration: none;
}

.feature-hub {
  padding: 64px 0 36px;
}

.hub-heading {
  max-width: 680px;
  margin-bottom: 28px;
}

.hub-heading h2 {
  margin: 10px 0 8px;
  font: 600 clamp(30px, 4vw, 48px) var(--serif);
}

.hub-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--rose);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--rose) 18%, transparent);
  outline: none;
}

.feature-card h3 {
  margin: 24px 0 8px;
  font: 600 24px var(--serif);
}

.feature-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.75;
}

.feature-number {
  position: absolute;
  top: 24px;
  right: 26px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .16em;
}

.new-photo-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border-radius: 50%;
  background: #c97a5b;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper2) 88%, transparent), 0 2px 7px #7a3f2d3d;
  vertical-align: 0.18em;
}

.night .new-photo-dot {
  background: #e7c36a;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper2) 82%, transparent), 0 2px 9px #f0cf7a40;
}

@media (forced-colors: active) {
  .new-photo-dot {
    background: Highlight;
    border: 1px solid CanvasText;
    box-shadow: none;
  }
}

.feature-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--rose) 10%, var(--paper2));
  color: var(--rose);
  font: 600 22px var(--serif);
}

.feature-enter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--rose);
}

.feature-enter b {
  font-size: 22px;
}

.feature-screen {
  min-height: calc(100vh - 94px);
  padding: 26px 0 56px;
}

.feature-page-head {
  margin-bottom: 30px;
}

.back-home {
  display: inline-flex;
  margin-bottom: 30px;
  color: var(--muted);
  text-decoration: none;
}

.back-home:hover,
.back-home:focus-visible {
  color: var(--rose);
}

.feature-title {
  display: flex;
  align-items: center;
  gap: 20px;
}

.feature-title h1 {
  margin: 7px 0 5px;
  font: 600 clamp(34px, 5vw, 58px) var(--serif);
}

.feature-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.feature-screen .section-head {
  justify-content: flex-end;
  margin: 0 0 18px;
}

.feature-screen .section-head > div {
  display: none;
}

.feature-screen .section-head:not(:has(button)) {
  display: none;
}

.counter .duration-prefix {
  margin-bottom: 14px;
  font-size: 18px;
}

.counter .duration-values {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.counter .duration-values span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.counter .duration-values strong {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
}

.counter .anniversary-countdown {
  margin: 24px 0 0;
  color: var(--muted);
}

.counter .anniversary-countdown strong {
  font-size: 26px;
  line-height: 1;
}

.film {
  right: -20px;
  bottom: -25px;
  width: 300px;
  height: 185px;
  padding: 20px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.card-foot,
.row-actions,
.trash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-foot {
  margin-top: 16px;
}

.item-delete {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.trash-list {
  display: grid;
  gap: 10px;
  max-height: min(55vh, 520px);
  margin-top: 18px;
  overflow: auto;
}

.trash-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.trash-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.trash-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.letter-drafts {
  margin: 26px 0 34px;
  padding: 22px;
  border: 1px dashed color-mix(in srgb, var(--rose) 55%, var(--line));
  border-radius: 24px;
  background: color-mix(in srgb, var(--rose) 5%, transparent);
}

.letter-subhead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.letter-subhead.sent {
  margin-top: 26px;
}

.letter-subhead h3 {
  margin: 5px 0 0;
  font: 600 24px var(--serif);
}

.letter-subhead h3 span {
  color: var(--rose);
}

.letter-subhead p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.letter.draft {
  border-style: dashed;
  box-shadow: none;
}

.draft-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.letter-editor textarea {
  min-height: 210px;
}

.letter-actions {
  flex-wrap: wrap;
}

@media (max-width: 850px) {
  body.night .stars {
    background-position: 64% center;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions .icon-btn {
    white-space: nowrap;
  }

  .counter .duration-values {
    gap: 8px;
  }

  .counter .duration-values strong {
    font-size: 42px;
  }

  .feature-hub {
    padding-top: 46px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 220px;
  }

  .feature-screen {
    padding-top: 14px;
  }

  .feature-title {
    align-items: flex-start;
  }

  .feature-title .feature-icon {
    flex: 0 0 48px;
  }

  .film {
    right: -46px;
    bottom: -28px;
    width: 275px;
    font-size: 28px;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .item-delete,
  .trash-restore {
    min-height: 44px;
  }

  .letter-drafts {
    padding: 16px;
  }

  .letter-subhead {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .letter-actions > button {
    flex: 1 1 100%;
    min-height: 44px;
  }
}
