:root {
    color-scheme: light;
    --paper: #fff8fb;
    --ink: #56364b;
    --muted: #826477;
    --line: #edcfde;
    --accent: #a43e70;
    --rose: #f4b9cf;
    --lilac: #eee3f5;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background-color: var(--paper);
    background-image: radial-gradient(circle, #eac8da 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #8756a8; outline-offset: 4px; }
::selection { background: #f3c6dc; color: #56364b; }
.shell { max-width: 1320px; margin: auto; padding: 0 48px; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 27px 0; border-bottom: 1px dashed #dba9c2; gap: 20px; }
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-style: italic; font-weight: 600; letter-spacing: -2px; text-decoration: none; color: var(--accent); }
.brand::before { content: "\2661"; display: inline-block; margin-right: 10px; font-size: 27px; vertical-align: 2px; }
.brand span { margin-left: 14px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 12px; font-style: normal; font-weight: 400; letter-spacing: .04em; color: var(--muted); }
.archive-count { font-size: 12px; border: 1px solid var(--line); padding: 9px 16px; border-radius: 30px; background: #fffdfef0; box-shadow: 0 3px 10px #a43e7008; white-space: nowrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.page-link { display: inline-block; border: 1px solid var(--line); border-radius: 24px; padding: 10px 16px; background: #fff0f6; color: var(--accent); font-size: 13px; text-decoration: none; }
.page-link:hover { background: #fbe4ef; border-color: #c784a6; }
.upload-panel + .messages { margin-bottom: 42px; }
.intro { position: relative; text-align: center; padding: 48px 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 600; color: var(--accent); line-height: 1.8; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 6vw, 72px); font-weight: 400; line-height: 1.12; letter-spacing: -2px; margin: 17px 0; }
.intro > p:last-child { font-size: 15px; color: var(--muted); line-height: 1.7; }
.keepsake-bow { position: relative; width: 84px; height: 60px; margin: 0 auto 18px; }
.keepsake-bow::before, .keepsake-bow::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 36px;
    height: 27px;
    border: 2px solid #ce82a3;
    background: linear-gradient(135deg, #ffe4ee, #f2b5ce);
    box-shadow: inset 0 0 0 4px #ffffff4d;
}
.keepsake-bow::before { left: 3px; border-radius: 9px 23px 5px 20px; transform: rotate(13deg); }
.keepsake-bow::after { right: 3px; border-radius: 23px 9px 20px 5px; transform: rotate(-13deg); }
.keepsake-bow span { position: absolute; z-index: 1; top: 17px; left: 35px; width: 14px; height: 16px; border: 2px solid #ce82a3; background: #f5c2d6; border-radius: 5px; }
.keepsake-bow span::before, .keepsake-bow span::after { content: ""; position: absolute; z-index: -1; top: 9px; width: 12px; height: 29px; background: #efb0c9; border: 1px solid #ce82a3; border-radius: 2px 2px 6px 2px; transform-origin: top; }
.keepsake-bow span::before { left: -2px; transform: rotate(25deg); }
.keepsake-bow span::after { right: -2px; transform: rotate(-25deg); }
.upload-panel { padding: 29px; border: 1px solid #e8c8dd; border-radius: 24px; background: linear-gradient(120deg, #fff0f6, #f4edf9); box-shadow: 0 8px 30px #a43e7008, inset 0 0 0 5px #ffffff70; }
h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.upload-panel h2::before { content: "\2661"; margin-right: 9px; color: var(--accent); font-size: 23px; }
.upload-panel p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.upload-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 21px; }
.file-label { font-size: 13px; font-weight: 600; }
input[type="file"] { max-width: 100%; flex: 1; min-width: 200px; font-size: 13px; color: var(--ink); }
input::file-selector-button { padding: 11px 15px; margin-right: 12px; border: 1px solid #dcb6cc; border-radius: 20px; background: #fffafb; color: var(--ink); cursor: pointer; }
input::file-selector-button:hover { background: #fbe4ef; }
button { border: 1px solid #983461; border-radius: 24px; padding: 13px 22px; color: white; background: var(--accent); box-shadow: 0 4px 12px #a43e7024; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .2s ease, box-shadow .2s ease; }
button:hover { background: #87305a; box-shadow: 0 5px 16px #a43e7033; }
button:disabled { opacity: .65; cursor: wait; }
button span { padding-left: 14px; }
.selection { margin-bottom: 0; }
.metadata-note { border-top: 1px dashed #ddbbd3; margin: 18px 0 0; padding-top: 14px; }
.message { padding: 14px 18px; border-radius: 16px; font-size: 14px; overflow-wrap: anywhere; }
.message.error { background: #fff0ed; color: #913d37; border: 1px solid #e7c3bb; }
.message.success { background: #f3edf9; color: #694781; border: 1px solid #d9c7e8; }
.gallery { padding: 42px 0 64px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 400; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.month-tabs { display: flex; gap: 9px; overflow-x: auto; padding: 23px 4px 18px; scrollbar-width: thin; scrollbar-color: #dbadc5 transparent; }
.month-tabs a { flex-shrink: 0; padding: 11px 17px; border: 1px solid var(--line); border-radius: 24px; background: #fffdfae6; text-decoration: none; font-size: 13px; transition: background .2s ease, border-color .2s ease; }
.month-tabs a:hover { border-color: #c784a6; background: #fce7f1; }
.month-tabs a[aria-current] { color: white; background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 10px #a43e701c; }
.month-tabs a span { font-size: 11px; margin-left: 8px; padding: 2px 6px; background: #f6e6ef; color: #735467; border-radius: 12px; }
.month-tabs a[aria-current] span { background: #ffffff24; color: white; }
.month-heading { margin: 18px 0 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 26px; }
.month-heading span { font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 12px; color: var(--muted); margin-left: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: start; }
.photo-card { position: relative; border: 1px solid #ded6d8; border-radius: 1px; padding: 12px 12px 0; background: #fffdfb; min-width: 0; box-shadow: 0 3px 9px #56364b26; }
.timeline-grid > .photo-card { isolation: isolate; margin: 32px 26px 38px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.timeline-grid .pile-front, .pile-print { border: 1px solid #ded6d8; border-radius: 1px; background: #fffdfb; box-shadow: 0 3px 9px #56364b26; padding: 12px 12px 0; }
.timeline-grid .pile-front { position: relative; z-index: 2; }
.photo-pile .pile-front { transform: rotate(-7deg); }
.pile-front::before, .day-grid > .photo-card::before { content: ""; position: absolute; z-index: 3; pointer-events: none; top: -9px; left: calc(50% - 30px); width: 60px; height: 22px; background: #f7cedbe0; border-left: 1px dashed #d9a4b9; border-right: 1px dashed #d9a4b9; transform: rotate(-5deg); }
.photo-card:nth-child(even) > .pile-front::before, .day-grid > .photo-card:nth-child(even)::before { transform: rotate(5deg); }
.pile-print { position: absolute; inset: 0; z-index: 1; pointer-events: none; transform: translate(8px, -3px) rotate(5deg); }
.pile-print:nth-child(2) { z-index: 0; transform: translate(6px, 3px) rotate(15deg); }
.pile-print img { display: block; width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; }
.timeline-grid .photo-link { aspect-ratio: 1; border-radius: 0; }
.photo-card .photo-details { min-height: 90px; padding: 22px 0 24px; }
.photo-card .photo-details h4 { font-size: 18px; }
.pile-link { position: relative; }
.pile-link[aria-busy="true"] { cursor: progress; opacity: .7; }
.pile-count { position: absolute; z-index: 1; right: 10px; bottom: 10px; border: 1px solid #edcfde; border-radius: 20px; padding: 7px 12px; background: #fff8fbf2; color: var(--ink); font-size: 12px; box-shadow: 0 2px 9px #56364b14; }
.day-open { overflow: hidden; }
#day-dialog { width: min(1120px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #edcfde; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 80px #56364b40; }
#day-dialog::backdrop { background: #56364b80; backdrop-filter: blur(5px); }
.dialog-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
#day-title { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(22px, 4vw, 30px); line-height: 1.4; margin: 16px 0 8px; }
.day-count { font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.back-to-month { font-size: 13px; color: var(--accent); display: inline-block; margin-top: 10px; }
#day-dialog .back-to-month { display: none; }
.day-grid { padding: 8px 0; }
.day-grid .photo-link { aspect-ratio: auto; background: transparent; }
.day-grid .photo-link img { height: auto; max-height: 70vh; object-fit: contain; }
.photo-link { display: block; aspect-ratio: 4 / 3; border-radius: 0; background: #f7e6ee; overflow: hidden; }
.photo-link img { display: block; width: 100%; height: 100%; object-fit: cover; image-orientation: from-image; transition: transform .25s ease; }
.photo-link:hover img { transform: scale(1.025); }
.photo-details { padding: 18px 7px 20px; text-align: center; }
.photo-details h4 { overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; line-height: 1.4; color: #8d3f67; margin: 0 0 7px; }
.photo-details h4::after { content: "\2661"; display: inline-block; margin-left: 7px; font-size: 17px; color: #b25780; }
.photo-details time, .photo-details > span { font-size: 12px; color: var(--muted); }
.empty-state { text-align: center; padding: 58px 20px; margin-top: 23px; border: 1px dashed #dba9c2; border-radius: 24px; background: linear-gradient(135deg, #fffdfbe6, #fff0f6e6); }
.empty-mark { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #f7e1ee; font-size: 28px; color: var(--accent); }
.empty-state h3 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; margin-bottom: 12px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.7; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 23px 0 30px; border-top: 1px dashed #dba9c2; color: var(--muted); font-size: 11px; line-height: 1.7; }
footer::before { content: "\2661"; font-size: 15px; color: var(--accent); }
footer span { margin-left: auto; }
@media (max-width: 900px) {
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
    .shell { padding: 0 28px; }
    .brand span { display: none; }
}
@media (max-width: 540px) {
    .timeline-grid > .photo-card { margin: 36px 36px 42px; }
    #day-dialog { padding: 16px; width: calc(100% - 20px); border-radius: 18px; }
    .shell { padding: 0 18px; }
    .masthead { padding: 21px 0; }
    .intro { padding-top: 33px; }
    .eyebrow { font-size: 10px; letter-spacing: .13em; }
    h1 { letter-spacing: -1.5px; }
    .upload-panel { padding: 23px; border-radius: 20px; }
    .upload-controls { align-items: stretch; flex-direction: column; }
    input[type="file"] { min-width: 0; width: 100%; }
    .photo-grid { grid-template-columns: minmax(0, 1fr); gap: 27px; }
    footer { flex-wrap: wrap; gap: 8px; }
    footer span { flex-basis: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .photo-link img, button, .month-tabs a { transition: none; }
}
