/* Hallmark: app / family album / peach paper, plum / photo-sticker growth calendar */
/* Critique: keep the calendar readable at phone width and leave images at original proportions. */
:root {
  --paper: #fff8f2;
  --surface: #fffdfb;
  --ink: #382c42;
  --muted: #69576e;
  --line: #ebdce9;
  --olive: #6d4081;
  --hover: #805194;
  --disabled: #eee5ed;
  --leaf: #f4e7fb;
  --error: #9a3e58;
  --overlay: rgb(56 44 66 / .44);
  --font: system-ui, -apple-system, sans-serif;
  --round: 16px;
  --rose: #fce7e9;
  --berry: #843956;
  --sun: #fff0ca;
  --frame: #24182d;
  --light: #fffdfb;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font); }
[hidden] { display: none !important; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar, main { width: min(100% - 2rem, 42rem); margin-inline: auto; }
.bar, .heading, .toolbar, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar { min-height: 72px; }
.wordmark { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.wordmark img { border-radius: 8px; }
main { padding-block: 20px max(48px, env(safe-area-inset-bottom)); }
.welcome { max-width: 28rem; padding-block: 48px; }
h1, h2, h3 { margin: 0; line-height: 1.25; min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: 30px; letter-spacing: -.04em; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
p { margin: 8px 0 16px; overflow-wrap: anywhere; }
button, input, textarea { font: inherit; }
button { background: var(--olive); color: var(--surface); border: 1px solid var(--olive); min-height: 44px; padding: 8px 12px; border-radius: var(--round); cursor: pointer; font-size: 14px; font-weight: 650; }
button:enabled:hover { background: var(--hover); color: var(--surface); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { background: var(--disabled); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.quiet { background: var(--surface); color: var(--olive); border-color: var(--line); }
.toolbar { padding-block: 0 8px; }
.week, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week { color: var(--muted); font-size: 14px; text-align: center; padding-block: 8px; }
.calendar button {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 2px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  padding: 4px 2px 2px;
  min-height: 64px;
}
.calendar button::before { content: ''; grid-row: 1; grid-column: 1; }
.calendar button:hover { background: var(--leaf); }
.calendar button.has-record { color: var(--olive); }
.calendar button[aria-current="date"] { background: var(--sun); }
.calendar button[aria-pressed="true"] { border-color: var(--olive); background: var(--leaf); }
.day-number { grid-row: 2; }
.day-photo, .day-video {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  width: min(100%, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
}
.day-photo { object-fit: cover; object-position: center 38%; border: 2px solid var(--surface); box-shadow: 0 2px 5px var(--overlay); }
.day-video { display: grid; place-items: center; background: var(--rose); color: var(--berry); }
.week span:first-child { color: var(--berry); }
.calendar-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 12px; margin-top: 16px; }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px; background: var(--leaf); border-radius: 16px; margin-bottom: 20px; }
.views button { color: var(--olive); display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; border-color: transparent; border-radius: 12px; }
.views button[aria-pressed="true"] { background: var(--surface); border-color: var(--line); }
.views svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.video-feed { max-height: 70dvh; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-type: y proximity; margin: 16px auto 0; max-width: 27rem; }
.reel { scroll-snap-align: start; padding: 0 0 20px; }
.reel + .reel { margin-top: 16px; }
.reel .cover { width: 100%; aspect-ratio: 9 / 16; max-height: min(58dvh, 640px); background: var(--frame); }
.reel .actions { padding-inline: 2px; }
@media (min-width: 520px) {
  .calendar-sheet { padding: 20px; }
  .calendar button { min-height: 82px; }
}
@media (max-width: 360px) {
  h1 { font-size: 24px; }
  .calendar-sheet { padding: 8px; }
  .calendar, .week { gap: 2px; }
  .calendar button { min-height: 58px; }
}
.records { margin-top: 32px; padding-block: 12px; border-bottom: 1px solid var(--line); min-height: 68px; }
.feedback { color: var(--muted); font-size: 14px; }
.feedback:empty { display: none; }
#video-feedback:not(:empty) { padding: 16px; background: var(--rose); border-radius: var(--round); margin-top: 16px; }
.cover { width: 100%; max-height: 38rem; object-fit: contain; display: block; background: var(--leaf); border-radius: var(--round); }
.post { padding: 16px 0; border-bottom: 1px solid var(--line); }
.post p { margin-block: 12px; white-space: pre-wrap; }
.byline { font-size: 14px; color: var(--muted); margin-block: 12px 8px; }
.actions { justify-content: flex-start; }
.actions button[aria-pressed="true"] { background: var(--rose); color: var(--berry); border-color: var(--berry); }
.day { margin: 24px 0 0; }
dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--round); padding: 20px; width: min(100% - 2rem, 32rem); max-height: 85dvh; }
dialog::backdrop { background: var(--overlay); }
form, label { display: grid; gap: 8px; }
form { margin-block: 16px; gap: 16px; }
form > button { justify-self: start; }
input, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border-radius: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
textarea { resize: vertical; }
ul { padding: 0; list-style: none; }
li { padding-block: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
li p { margin: 4px 0; }
#members li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#members li span { margin-right: auto; }
#invite-result { margin-block: 16px; }
#invite-result button { margin-top: 8px; }

.character-banner { display: flex; justify-content: center; margin-bottom: 12px; }
.character-banner img { width: min(100%, 23rem); height: auto; object-fit: contain; }
.photo-feed {
  max-height: min(75dvh, 50rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  padding-inline: 4px;
}
.photo-page { scroll-snap-align: start; min-height: min(70dvh, 44rem); }
.photo-page .cover { height: min(53dvh, 33rem); background: var(--leaf); }
.media-frame { position: relative; }
.photo-page img.cover { touch-action: manipulation; user-select: none; }
.photo-heart {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  line-height: 1;
  color: var(--berry);
  text-shadow: 0 2px 8px var(--surface);
  pointer-events: none;
}
.slide-control { display: block; margin: 8px auto 0; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 22px; min-height: 22px; accent-color: var(--olive); flex: none; }
.check span { overflow-wrap: anywhere; }
#photo-picker { padding: 12px; background: var(--leaf); border-radius: var(--round); }
#photo-picker summary { cursor: pointer; font-weight: 650; padding-block: 8px; }
#photo-picker label { margin-block: 8px; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 12px; margin-block: 8px; }
.scan-preview { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; }

.js .day-photo-fade { opacity: 0; transition: opacity 420ms cubic-bezier(.2, .65, .3, 1); }
.js .day-photo-fade.is-visible { opacity: 1; }
.file-picker { background: var(--leaf); border-color: var(--line); padding: 4px; }
.file-picker::file-selector-button {
  min-height: 36px;
  padding: 4px 12px;
  margin-inline-end: 8px;
  border: 1px solid var(--olive);
  border-radius: 12px;
  background: var(--olive);
  color: var(--surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.file-picker:enabled:hover::file-selector-button { background: var(--hover); }
@media (prefers-reduced-motion: reduce) {
  .day-photo-fade { transition: none; }
}
#mobile-invite { margin-bottom: 16px; }

#invite-paste { margin-top: 16px; }
#invite-paste summary { cursor: pointer; color: var(--olive); }
#install { margin-bottom: 16px; }
