:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #1f1d1b;
  --muted: #746d66;
  --line: #bcb8b3;
  --accent: #76654f;
  --sans: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", "Trebuchet MS", cursive;
  --serif: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", "Trebuchet MS", cursive;
  --mono: "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.page-shell { width: 100%; margin: 0 auto; }

.topbar { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 32px; }
.brand { font-variant: small-caps; font-size: 30px; font-weight: 600; letter-spacing: .015em; line-height: 1; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: clamp(20px, 3.2vw, 46px); }
.top-nav a { color: #6d6258; font-size: 16px; transition: color .16s ease; white-space: nowrap; }
.top-nav a:hover { color: var(--ink); }
.top-nav a:last-child { color: var(--ink); font-weight: 700; }

.intro { width: min(810px, calc(100% - 40px)); min-height: 310px; display: grid; grid-template-columns: 194px minmax(0, 1fr); align-items: center; gap: 20px; margin: 0 auto; padding: 28px 0 53px; }
.portrait { width: 194px; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #b28a56; }
.portrait svg { display: block; width: 100%; height: 100%; }
.intro-copy { max-width: 590px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0 0 9px; font-size: 17px; font-weight: 400; line-height: 1.5; }
.intro-text { margin: 0 0 13px; color: #34302c; font-size: 16px; line-height: 1.55; }
.intro-text a { text-decoration: underline; text-underline-offset: 2px; }
.intro-note { margin: 18px 0 0; color: #8a7d70; font-style: italic; }

.portfolio { padding: 0 0 46px; }
.gallery-tools { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; }
.photo-count { color: #77716b; font-family: var(--mono); font-size: 9px; letter-spacing: .04em; white-space: nowrap; }
.upload-access { display: flex; align-items: center; gap: 11px; color: #81796f; font-family: var(--sans); font-size: 10px; }
.sign-in-button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #d0cbc5; border-radius: 2px; color: #554c43; font-size: 10px; transition: background .15s ease; }
.sign-in-button:hover { background: #f6f4f1; color: #28231f; }
.sign-in-button span { color: var(--accent); }
.upload-access[hidden], .upload-zone[hidden], .gallery-grid[hidden] { display: none; }
.upload-zone { display: flex; align-items: center; gap: 14px; margin: 0 32px 24px; padding: 13px 15px; border: 1px dashed #bdb7b0; background: #fcfbfa; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.upload-zone.dragover { border-color: var(--accent); background: #f4f0eb; }
.upload-copy { flex: 1; }
.upload-title { margin: 0 0 5px; font-family: var(--sans); font-size: 12px; font-weight: 600; }
.upload-hint { margin: 0; color: var(--muted); font-family: var(--sans); font-size: 10px; line-height: 1.55; }
.text-button { padding: 0; border: 0; border-bottom: 1px solid #aaa; background: none; color: var(--ink); cursor: pointer; }

.gallery-grid { display: block; }
.month-section { padding-top: 1px; }
.month-heading { display: flex; align-items: center; gap: 15px; margin: 0 0 42px; color: #261f19; font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1; text-align: center; }
.month-heading::before, .month-heading::after { height: 0; flex: 1; border-top: 1px dashed #b9b5b0; content: ""; }
.month-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; align-items: start; }
.photo-card { position: relative; overflow: hidden; background: #f3f2ef; animation: appear .24s ease both; }
.photo-image-wrap { aspect-ratio: 3 / 4; overflow: hidden; background: #f0efec; }
.photo-image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo-card:hover .photo-image { transform: scale(1.025); }
.photo-caption { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; gap: 8px; padding: 22px 9px 9px; background: linear-gradient(transparent, rgba(0,0,0,.58)); color: white; font-family: var(--sans); font-size: 10px; opacity: 0; transition: opacity .18s ease; }
.photo-card:hover .photo-caption, .photo-card:focus-within .photo-caption { opacity: 1; }
.photo-caption-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-date { flex: 0 0 auto; font-family: var(--mono); font-size: 8px; }
.remove-photo { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #292522; cursor: pointer; opacity: 0; transition: opacity .14s; }
.photo-card:hover .remove-photo, .remove-photo:focus-visible { opacity: 1; }
.empty-state { padding: 0 32px 26px; }
.empty-state[hidden] { display: none; }
.empty-title { margin: 0 0 7px; font-size: 18px; font-weight: 400; }
.empty-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.about-page { width: min(810px, calc(100% - 40px)); min-height: 65vh; margin: 0 auto; padding: 62px 0 90px; }
.about-page h1 { margin-bottom: 12px; font-size: 28px; }
.about-lede { color: #4e4944; font-size: 16px; line-height: 1.6; }
.about-note { display: flex; gap: 13px; align-items: flex-start; margin: 25px 0 22px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-note-mark { color: var(--accent); font-size: 17px; }
.about-note p { margin: 0; color: #5d554d; font-size: 13px; line-height: 1.65; }
.about-gallery-link { display: inline-flex; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid #c1bbb4; font-size: 12px; }
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; padding: 60px 32px; border-top: 1px solid var(--line); }
.about-number { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.about-copy h2 { margin: 0 0 13px; font-size: 29px; font-weight: 400; }
.about-copy p { max-width: 420px; margin: 0; color: #555; font-size: 13px; line-height: 1.7; }
.about-flower { display: none; }

.footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 32px; border-top: 1px solid var(--line); }
.footer-brand { font-size: 19px; }
.back-top { color: #716b65; font-family: var(--sans); font-size: 10px; }
.back-top:hover { color: var(--ink); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: calc(100vw - 40px); padding: 11px 14px; border: 1px solid #444; background: #222; color: white; font-family: var(--sans); font-size: 11px; opacity: 0; transform: translateY(7px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1100px) {
  .month-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { min-height: 61px; padding: 0 20px; }
  .brand { font-size: 25px; }
  .top-nav { gap: 16px; }
  .top-nav a { font-size: 13px; }
  .intro { min-height: 260px; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 25px 0 40px; }
  .portrait { width: 150px; }
  .intro-text { font-size: 14px; }
  .gallery-tools { padding: 0 20px; }
  .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .upload-zone { margin-right: 20px; margin-left: 20px; }
  .empty-state { margin-right: 20px; margin-left: 20px; }
  .footer { padding: 0 20px; }
}
@media (max-width: 520px) {
  .topbar { min-height: 58px; gap: 12px; padding: 0 14px; }
  .brand { font-size: 21px; }
  .top-nav { gap: 11px; }
  .top-nav a { font-size: 10px; }
  .intro { width: calc(100% - 34px); min-height: 225px; grid-template-columns: 105px minmax(0, 1fr); gap: 15px; padding: 20px 0 31px; }
  .portrait { width: 105px; }
  h1 { margin-bottom: 6px; font-size: 14px; }
  .intro-text { margin-bottom: 8px; font-size: 12px; line-height: 1.48; }
  .intro-note { margin-top: 10px; }
  .gallery-tools { min-height: 46px; padding: 0 14px; }
  .photo-count { font-size: 8px; }
  .upload-access { gap: 7px; }
  .upload-access > span { display: none; }
  .sign-in-button { padding: 5px 7px; font-size: 9px; }
  .month-heading { gap: 10px; margin-bottom: 24px; font-size: 20px; }
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-caption { display: none; }
  .remove-photo { opacity: 1; }
  .upload-zone { margin-right: 14px; margin-left: 14px; }
  .empty-state { margin-right: 14px; margin-left: 14px; }
  .footer { min-height: 56px; padding: 0 14px; }
}
@media (max-width: 360px) {
  .brand { font-size: 19px; }
  .top-nav { gap: 8px; }
  .top-nav a { font-size: 9px; }
  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
