:root {
  --ink: #1d2922;
  --muted: #66726a;
  --paper: #f6f1e8;
  --card: #fffdf9;
  --line: #ded8cd;
  --green: #1f5b43;
  --green-dark: #164331;
  --peach: #e99f79;
  --yellow: #f2d36c;
  --danger: #a33d35;
  --shadow: 0 18px 50px rgb(37 50 41 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.center-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 15% 15%, rgb(242 211 108 / 55%) 0 6rem, transparent 6.1rem),
    radial-gradient(circle at 88% 86%, rgb(233 159 121 / 45%) 0 9rem, transparent 9.1rem),
    var(--paper);
}

.center-shell.warm { background: radial-gradient(circle at 95% 8%, rgb(233 159 121 / 45%) 0 11rem, transparent 11.1rem), var(--paper); }
.entry-card { width: calc(100vw - 36px); max-width: 470px; min-width: 0; justify-self: center; padding: clamp(28px, 7vw, 52px); background: rgb(255 253 249 / 92%); border: 1px solid rgb(222 216 205 / 75%); box-shadow: var(--shadow); border-radius: 3px 34px 3px 34px; }
.mark { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; text-decoration: none; border-radius: 50% 50% 50% 10%; color: white; background: var(--green); }
.mark span { font: italic 700 24px/1 Georgia, serif; transform: translateY(-1px); }
.eyebrow { margin: 26px 0 8px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.entry-card h1 { max-width: 9em; margin: 0; overflow-wrap: anywhere; font: 500 clamp(2.7rem, 12vw, 4.5rem)/.93 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.entry-card .event-title { max-width: 100%; font-size: clamp(2.25rem, 10.5vw, 4.2rem); }
.lede { margin: 24px 0 30px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.stack { display: grid; gap: 10px; }
.stack label { font-size: .8rem; font-weight: 750; letter-spacing: .02em; }
.stack input { width: 100%; min-height: 54px; border: 1px solid #cbc5ba; border-radius: 2px 14px 2px 14px; padding: 0 16px; color: var(--ink); background: white; font-size: 1rem; outline: none; }
.stack input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(31 91 67 / 13%); }
.primary { min-height: 56px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 2px 15px 2px 15px; padding: 0 19px; color: white; background: var(--green); font-weight: 750; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.primary:hover { background: var(--green-dark); }
.primary:active { transform: scale(.985); }
.primary:disabled { cursor: wait; opacity: .65; }
.button-link { text-decoration: none; }
.password-field { position: relative; }
.password-field input { padding-right: 66px; }
.reveal { position: absolute; inset: 7px 7px 7px auto; border: 0; padding: 0 10px; color: var(--green); background: transparent; font-size: .76rem; font-weight: 800; cursor: pointer; }
.privacy-note { margin: 24px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.privacy-note span { margin-right: 6px; color: var(--green); font-size: .55rem; }
.form-error { margin: 2px 0 0; color: var(--danger); font-size: .83rem; }

.app-shell { min-height: 100vh; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; z-index: 20; top: 0; min-width: 0; min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); border-bottom: 1px solid rgb(222 216 205 / 85%); background: rgb(246 241 232 / 88%); backdrop-filter: blur(18px); }
.brand-row { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-row > div { min-width: 0; }
.brand-row .mark { width: 44px; height: 44px; }
.brand-row .eyebrow { margin: 0 0 3px; font-size: .62rem; }
.brand-row h1 { overflow: hidden; margin: 0; font: 600 1.2rem/1.1 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.quiet-button, .icon-button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.quiet-button { min-width: auto; flex: 0 0 auto; border-radius: 30px; padding: 0 16px; font-size: .78rem; font-weight: 750; }

.hero { position: relative; overflow: hidden; min-height: 360px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 52px max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left)); color: #fffdf9; background: var(--green); }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; bottom: -60px; border: 62px solid rgb(242 211 108 / 84%); border-radius: 50% 50% 15% 50%; transform: rotate(18deg); }
.hero-kicker { position: relative; z-index: 1; margin: 0 0 14px; color: #dfebdf; font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h2 { position: relative; z-index: 1; max-width: 650px; margin: 0 0 30px; font: 500 clamp(3.2rem, 14vw, 7rem)/.86 Georgia, serif; letter-spacing: -.055em; }
.upload-hero { position: relative; z-index: 2; min-height: 54px; border: 0; border-radius: 2px 16px 2px 16px; padding: 0 20px; color: var(--ink); background: var(--yellow); font-weight: 800; cursor: pointer; }

.gallery-section { width: min(1240px, 100%); margin: 0 auto; padding: 42px 16px 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading .eyebrow { margin: 0 0 5px; }
.section-heading h2 { margin: 0; font: 500 clamp(1.8rem, 7vw, 2.7rem)/1 Georgia, serif; letter-spacing: -.035em; }
.section-heading > span { color: var(--muted); font-size: .8rem; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.media-card { min-width: 0; overflow: hidden; contain: layout paint style; content-visibility: auto; contain-intrinsic-size: auto 330px; background: var(--card); border: 1px solid var(--line); border-radius: 2px 17px 2px 17px; }
.media-preview { position: relative; width: 100%; aspect-ratio: 1 / 1.12; display: block; overflow: hidden; border: 0; padding: 0; background: #d8dbd3; cursor: zoom-in; }
.media-preview img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .18s ease; }
.media-preview img.is-loaded { opacity: 1; }
.video-play-overlay { position: absolute; z-index: 2; left: 50%; top: 50%; width: 52px; height: 52px; display: grid; place-items: center; transform: translate(-50%, -50%); padding-left: 3px; border: 1px solid rgb(255 255 255 / 72%); border-radius: 50%; color: white; background: rgb(13 18 16 / 68%); box-shadow: 0 5px 18px rgb(0 0 0 / 22%); }
.video-tile { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #f9f4eb; background: linear-gradient(145deg, #334c3f, #172f24); font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.play-mark { width: 48px; height: 48px; display: grid; place-items: center; padding-left: 3px; border: 1px solid rgb(255 255 255 / 60%); border-radius: 50%; font-size: .9rem; }
.media-footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 8px 9px 11px; }
.media-footer-actions { justify-content: flex-end; }
.media-footer > div { min-width: 0; }
.media-footer strong, .media-footer span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-footer strong { font-size: .72rem; }
.media-footer span { color: var(--muted); font-size: .64rem; }
.card-download { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--green); text-decoration: none; font-size: 1.15rem; font-weight: 800; }
.media-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.card-delete { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgb(163 61 53 / 35%); border-radius: 50%; color: var(--danger); background: transparent; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.card-delete:disabled { cursor: wait; opacity: .5; }
.gallery-state { min-height: 220px; display: grid; place-items: center; align-content: center; padding: 30px; text-align: center; color: var(--muted); }
.gallery-state h3 { margin: 12px 0 5px; color: var(--ink); font: 500 1.6rem/1 Georgia, serif; }
.gallery-state p { margin: 5px 0; font-size: .85rem; }
.empty-mark { font-size: 2rem; color: var(--peach); }
.spinner { width: 25px; height: 25px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more { min-height: 50px; display: block; margin: 25px auto; border: 1px solid var(--green); border-radius: 2px 14px 2px 14px; padding: 0 25px; color: var(--green); background: transparent; font-weight: 800; cursor: pointer; }

.upload-dialog { width: min(520px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 28px); overflow: auto; border: 0; border-radius: 3px 28px 3px 28px; padding: 0; color: var(--ink); background: var(--card); box-shadow: 0 28px 90px rgb(13 25 18 / 35%); }
.upload-dialog::backdrop { background: rgb(13 18 16 / 72%); backdrop-filter: blur(5px); }
.upload-dialog-card { padding: clamp(27px, 7vw, 44px); }
.upload-dialog-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50% 50% 50% 10%; color: white; background: var(--green); font-size: 1.35rem; font-weight: 800; }
.upload-dialog .eyebrow { margin: 24px 0 7px; }
.upload-dialog h2 { margin: 0; font: 500 clamp(2rem, 8vw, 3rem)/.98 Georgia, serif; letter-spacing: -.04em; }
.upload-summary { min-height: 1.4em; margin: 16px 0 24px; color: var(--muted); font-size: .86rem; }
.upload-total-progress { height: 11px; overflow: hidden; border-radius: 7px; background: #e5e0d7; }
.upload-total-progress > span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.upload-progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 11px; }
.upload-progress-copy strong { color: var(--green); font-size: 1.1rem; }
.upload-progress-copy span { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.upload-eta { margin: 25px 0 0; font-weight: 750; font-size: .87rem; }
.upload-stay-note, .upload-error-summary { margin: 17px 0 0; border-radius: 2px 12px 2px 12px; padding: 13px 14px; font-size: .76rem; line-height: 1.5; }
.upload-stay-note { color: #574714; background: rgb(242 211 108 / 32%); }
.upload-stay-note span { margin-right: 6px; color: #9b7410; font-size: .55rem; }
.upload-error-summary { color: var(--danger); background: rgb(163 61 53 / 9%); }
.upload-close { width: 100%; margin-top: 22px; }

.mobile-add { position: fixed; z-index: 15; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 64px; height: 64px; display: grid; place-items: center; border: 0; border-radius: 50% 50% 50% 14%; color: white; background: var(--green); box-shadow: 0 12px 30px rgb(22 67 49 / 30%); font-size: 1.6rem; cursor: pointer; }
.mobile-add span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.viewer { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; padding: 0; color: white; background: #0d1210; }
.viewer::backdrop { background: rgb(0 0 0 / 85%); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.viewer-bar { z-index: 2; min-height: 72px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); background: #111714; }
.viewer-close { width: 42px; height: 42px; border: 1px solid #3c443f; border-radius: 50%; color: white; background: transparent; font-size: 1.7rem; cursor: pointer; }
.viewer-copy { min-width: 0; }
.viewer-copy strong, .viewer-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-copy strong { font-size: .77rem; }
.viewer-copy span { margin-top: 4px; color: #aeb8b1; font-size: .65rem; }
.viewer-download { min-height: 42px; display: flex; align-items: center; border: 1px solid #536159; border-radius: 22px; padding: 0 13px; color: white; text-decoration: none; font-size: .73rem; font-weight: 750; }
html.viewer-open { overflow: hidden; overscroll-behavior: none; }
html.viewer-open body { position: fixed; right: 0; left: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
.viewer-stage { position: relative; min-height: 0; display: grid; place-items: stretch; overflow: hidden; overscroll-behavior: contain; touch-action: pinch-zoom; }
.viewer-media { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.viewer-media img, .viewer-media video { width: 100%; height: 100%; display: block; object-fit: contain; }
.viewer-nav { position: absolute; z-index: 3; top: 50%; width: 46px; height: 54px; display: grid; place-items: center; transform: translateY(-50%); border: 1px solid rgb(255 255 255 / 22%); color: white; background: rgb(13 18 16 / 52%); backdrop-filter: blur(8px); font-size: 2rem; line-height: 1; cursor: pointer; }
.viewer-previous { left: max(8px, env(safe-area-inset-left)); border-radius: 4px 16px 4px 16px; }
.viewer-next { right: max(8px, env(safe-area-inset-right)); border-radius: 16px 4px 16px 4px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 36px); transform: translateX(-50%); border-radius: 2px 13px 2px 13px; padding: 13px 17px; color: white; background: #17231c; box-shadow: var(--shadow); font-size: .78rem; text-align: center; }

@media (min-width: 700px) {
  .topbar { padding-inline: 30px; }
  .hero { min-height: 470px; padding-inline: max(7vw, 45px); }
  .gallery-section { padding-inline: 28px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .media-footer { padding-inline: 13px 10px; }
  .mobile-add { display: none; }
  .app-shell { padding-bottom: 35px; }
}

@media (min-width: 1050px) {
  .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 19px; }
  .hero h2 { font-size: 7.1rem; }
}

@media (hover: hover) and (pointer: fine) {
  .media-preview img { transition: opacity .18s ease, transform .35s ease; }
  .media-preview:hover img { transform: scale(1.025); }
}

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