/* OakDrop — Starbucks-inspired design system.
   Warm cream canvas, four-tier green brand system, gold reserved for premium
   "membership" moments only, universal 50px full-pill buttons, whisper-soft
   layered shadows, color-block surfaces (no gradients). Class hooks are kept
   stable so the vanilla JS keeps rendering — only the skin changed. */
:root {
  /* OakDrop brand palette (from the brand sheet) mapped to surface roles */
  --sb-green: #1F3F32;      /* deep forest — headings + wordmark */
  --accent:   #2E6B4E;      /* primary CTA fill / focus */
  --accent-hi:#285f45;      /* CTA hover */
  --house:    #1F3F32;      /* deep feature bands + footer */
  --uplift:   #2b5148;      /* decorative mid green */
  --sage:     #A9B9A7;      /* soft sage — borders, quiet accents */
  --green-light: #e2ebe4;   /* pale sage-mint utility tint */

  /* gold — premium / membership ceremony ONLY, never a general accent */
  --gold:      #C8A15A;
  --gold-soft: #dcc08a;
  --gold-wash: #f7f0e2;

  /* warm-neutral surfaces (references the artwork's cream canvas) */
  --canvas:  #F2EDE4;       /* primary page canvas */
  --ceramic: #e9e3d6;       /* zone separators / tile backs */
  --white:   #ffffff;       /* card + modal surface */
  --cool:    #f7f4ec;       /* quiet utility surface */

  /* ink — never pure black on the warm canvas */
  --ink:        rgba(0, 0, 0, .87);
  --ink-soft:   rgba(0, 0, 0, .58);
  --white-soft: rgba(255, 255, 255, .70);
  --line:       #e7e7e7;    /* hairlines */
  --field:      #d6dbde;    /* input borders */
  --danger:     #c82014;

  /* geometry + elevation */
  --radius: 12px;           /* cards, modals, tiles */
  --pill: 50px;             /* every button */
  --shadow-card: 0 0 .5px rgba(0, 0, 0, .14), 0 1px 1px rgba(0, 0, 0, .24);
  --shadow-lift: 0 2px 8px rgba(0, 0, 0, .12);
  --shadow-nav:  0 1px 3px rgba(0, 0, 0, .1), 0 2px 2px rgba(0, 0, 0, .06), 0 0 2px rgba(0, 0, 0, .07);

  /* SoDoSans is proprietary — use its documented Helvetica fallback stack,
     honoring the no-CDN rule. Tight negative tracking is the brand voice. */
  --sans:  'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, sans-serif;
  --serif: 'Iowan Old Style', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--canvas); color: var(--ink);
  font: 16px/1.5 var(--sans); letter-spacing: -.01em;
}
h1, h2, h3 {
  font-family: var(--sans); font-weight: 600; line-height: 1.2;
  letter-spacing: -.016em; color: var(--sb-green); margin: 0 0 .5rem;
}
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* top bar — fixed café signage with a quiet triple-layer lift */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  background: var(--white); box-shadow: var(--shadow-nav);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--house); }
.brand svg { width: 30px; height: 30px; }
.brand img { height: 30px; width: auto; display: block; }
.brand b { font-family: var(--sans); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; color: var(--house); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-soft); font-size: .85rem; }

/* buttons — universal full-pill, scale(0.95) active is the signature press */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 11px 22px; border-radius: var(--pill);
  font: 600 15px/1.2 var(--sans); letter-spacing: -.01em; white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: all .2s ease;
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn:active { transform: scale(.95); }
.btn.acorn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.acorn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.ghost:hover { background: rgba(46, 107, 78, .08); border-color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(200, 32, 20, .06); }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* inputs — outlined rectangles, 4px radius, green focus ring */
input, textarea, select {
  width: 100%; background: var(--white); color: var(--ink);
  border: 1px solid var(--field); border-radius: 4px; padding: 11px 12px;
  font: 15px var(--sans); letter-spacing: -.01em;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 4px; letter-spacing: -.01em; }

/* content card — white on cream, whisper-soft dual shadow, no border */
.card {
  background: var(--white); border: none; border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-card);
}
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }
.pill {
  display: inline-block; padding: 4px 12px; border-radius: var(--pill); font-size: 12px;
  font-weight: 600; letter-spacing: -.01em; background: var(--ceramic);
  border: 1px solid transparent; color: var(--ink-soft);
}
.pill.on { background: var(--green-light); color: var(--house); }
.pill.off { background: transparent; border-color: var(--field); color: var(--ink-soft); }
[hidden] { display: none !important; }

/* landing — cream hero → white cards → espresso-dark price band → dark footer */
.hero { text-align: center; padding: 76px 20px 44px; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--sb-green); line-height: 1.14; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { color: var(--ink-soft); max-width: 560px; margin: 16px auto 30px; font-size: 1.15rem; line-height: 1.6; }
.hero .btn { margin: 6px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 24px 0 12px; }
.features .card h3 { color: var(--sb-green); font-size: 1.1rem; }
.features .card p { color: var(--ink-soft); font-size: .95rem; margin: 0; line-height: 1.6; }
/* price — House Green feature band, gold reserved for the membership figure */
.price {
  text-align: center; background: var(--house); color: #fff;
  border-radius: var(--radius); padding: 52px 24px; margin: 44px 0 64px; box-shadow: var(--shadow-card);
}
.price h2 { color: #fff; }
.price .amount { font-size: 3.2rem; font-weight: 700; color: var(--gold); letter-spacing: -.02em; }
.price .amount span { font-size: 1rem; color: var(--white-soft); font-weight: 400; }
.price .muted { color: var(--white-soft); }
.price .btn { background: #fff; color: var(--accent); border-color: #fff; margin-top: 10px; }
.price .btn:hover { background: var(--canvas); border-color: var(--canvas); }
footer { background: var(--house); color: var(--white-soft); font-size: .85rem; text-align: center; padding: 28px 20px; }
footer a { color: var(--gold); }

/* dashboard */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.eventrow {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-card);
  margin-bottom: 12px; cursor: pointer; transition: box-shadow .15s;
}
.eventrow:hover { box-shadow: var(--shadow-lift); }
.eventrow .t { flex: 1; min-width: 0; }
.eventrow .t b { display: block; font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.eventrow .t span { color: var(--ink-soft); font-size: .82rem; }
.tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.tabs .btn[aria-current="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.sharebox { display: flex; gap: 8px; align-items: center; }
.sharebox input { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9rem; }
.qrimg { width: 200px; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 6px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.gallery .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ceramic); cursor: pointer; box-shadow: var(--shadow-card); }
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .ph .vid {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); pointer-events: none;
}
.gallery .ph .noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--ceramic); color: var(--ink-soft);
}
.gallery .ph .del {
  position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .9);
  border: 1px solid var(--danger); color: var(--danger); border-radius: 8px;
  width: 26px; height: 26px; cursor: pointer; font-size: .9rem; line-height: 1;
}
.gallery .ph .cover {
  position: absolute; top: 6px; left: 6px; background: rgba(255, 255, 255, .9);
  border: 1px solid var(--gold); color: var(--gold); border-radius: 8px;
  width: 26px; height: 26px; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
}
.gallery .ph .who {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 8px; font-size: .7rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* storage-health banner — warm gold wash, a membership-toned warning */
.banner {
  border: 1px solid var(--gold); background: var(--gold-wash);
  color: var(--ink); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 16px; font-size: .9rem; display: flex; gap: 12px; align-items: center;
}
.banner b { color: #9a7223; }
.banner .spacer { flex: 1; }

/* Google sign-in button + "or" divider */
.gbtn { width: 100%; margin-top: 10px; gap: 10px; background: #fff; color: var(--ink); border: 1px solid var(--field); }
.gbtn:hover { background: var(--cool); border-color: var(--ink-soft); }
.gbtn .gicon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 3px; background: #fff;
  color: #4285f4; font: 900 14px Georgia, serif; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.or-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--ink-soft); font-size: .8rem; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* lightbox — dark overlay so photos read; controls stay on-brand pills */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .9); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.lightbox img, .lightbox video { max-width: 94vw; max-height: 78vh; border-radius: 8px; }
.lightbox .lbbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lightbox .muted { color: var(--white-soft); }

/* guest page */
.guest-hero { text-align: center; padding: 48px 20px 12px; }
.guest-hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--sb-green); }
.guest-hero .date { color: var(--sb-green); font-weight: 600; font-size: .95rem; }
.guest-hero .welcome { color: var(--ink-soft); max-width: 520px; margin: 12px auto; }
.guest-hero .guest-note { color: var(--ink-soft); max-width: 540px; margin: 4px auto 0; font-size: .9rem; font-style: italic; }
.dropzone {
  border: 2px dashed var(--field); border-radius: var(--radius); padding: 36px 20px;
  text-align: center; color: var(--ink-soft); cursor: pointer; background: var(--cool);
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: var(--green-light); }
.dropzone .big { font-size: 2.4rem; }
.dropzone b { color: var(--ink); }
.progress { margin-top: 12px; }
.progress .bar { height: 8px; border-radius: 6px; background: var(--ceramic); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* toast — House Green pill */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--house); border: none; color: #fff;
  padding: 11px 18px; border-radius: var(--pill); font-size: .9rem; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .25s; box-shadow: var(--shadow-lift);
}
#toast.show { opacity: 1; }

/* per-album storage-tier picker (create form) */
.tierpick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
@media (max-width: 620px) { .tierpick { grid-template-columns: 1fr; } }
.tieropt {
  display: block; margin: 0; padding: 14px 16px; border: 1px solid var(--field);
  border-radius: var(--radius); cursor: pointer; background: var(--white);
  font-weight: 400; transition: border-color .15s, box-shadow .15s, background .15s;
}
.tieropt:hover { border-color: var(--accent); }
.tieropt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--green-light); }
.tieropt input { width: auto; margin-right: 8px; }
.tieropt .tier-b { font-weight: 600; color: var(--ink); }
.tieropt .tier-b b { color: var(--accent); }
.tieropt .tier-s { display: block; margin-top: 4px; font-size: .82rem; color: var(--ink-soft); }

/* checkbox rows (album options, guest caption opt-in) */
.checkrow { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: .9rem;
  color: var(--ink); font-weight: 400; cursor: pointer; }
.checkrow input { width: auto; margin-top: 2px; flex: none; }
.checkrow b { color: var(--ink); }
h4 { color: var(--sb-green); font-size: .95rem; margin: 0; }

/* Collapsible option sections (host album settings) — collapsed by default so the
   panel stays simple; power users open what they need. */
.optsec { border-top: 1px solid rgba(0, 0, 0, .08); margin-top: 4px; }
.optsec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 14px 2px 12px; color: var(--sb-green); font-size: .95rem; font-weight: 700;
  user-select: none;
}
.optsec > summary::-webkit-details-marker { display: none; }
.optsec > summary .hint { font-weight: 400; font-size: .78rem; opacity: .6; }
.optsec > summary .chev { margin-left: auto; opacity: .5; font-weight: 400; transition: transform .18s ease; }
.optsec[open] > summary .chev { transform: rotate(180deg); }
.optsec > summary:hover { opacity: .82; }
.optsec-body { padding-bottom: 6px; }

/* caption line on a gallery tile (sits above the uploader gradient) */
.gallery .ph .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 8px 4px; font-size: .68rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72)); color: #fff; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

/* guest single-photo caption prompt */
.cap-prompt { margin-top: 14px; }
.cap-prompt textarea { min-height: 64px; resize: vertical; }
.cap-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.lightbox .cap-text { color: #fff; max-width: 70ch; text-align: center; font-size: 1rem; }

/* ---------- dashboard "app shell": cinematic hero bg + liquid glass ---------- */
/* Carries the home page's frosted-glass look onto the album/settings dashboard.
   A fixed hero image sits behind a soft cream wash; cards/rows/topbar frost over
   it (backdrop-filter) while inputs stay solid white so forms read clearly. */
body.appshell { background: var(--canvas); }
body.appshell::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background: #eae3d4 url('/img/hero.webp?v=25') no-repeat center right / cover;
}
body.appshell::after {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(242, 237, 228, .60) 0%, rgba(242, 237, 228, .74) 60%, rgba(242, 237, 228, .82) 100%);
}
body.appshell .topbar {
  background: rgba(242, 237, 228, .72);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 rgba(31, 63, 50, .07), 0 8px 24px rgba(31, 63, 50, .06);
}
body.appshell .card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .80), rgba(255, 255, 255, .60));
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 14px 44px rgba(31, 63, 50, .16), inset 0 1px 0 rgba(255, 255, 255, .75);
  border-radius: 20px;
}
body.appshell .eventrow {
  background: linear-gradient(135deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .50));
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 10px 30px rgba(31, 63, 50, .12), inset 0 1px 0 rgba(255, 255, 255, .6);
  border-radius: 16px;
}
body.appshell .banner {
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
}
/* the storage-tile rows inside a glass card shouldn't double-frost — keep them flat */
body.appshell .card .eventrow {
  background: rgba(255, 255, 255, .42); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none; border: 1px solid rgba(255, 255, 255, .5);
}
/* guest upload dropzone: translucent so the frosted card shows through */
body.appshell .dropzone { background: rgba(255, 255, 255, .34); border-color: rgba(31, 63, 50, .28); }
body.appshell .dropzone.drag { background: var(--green-light); border-color: var(--accent); }
/* progressive enhancement: if backdrop-filter is unsupported, fall back to solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.appshell .card { background: rgba(255, 255, 255, .96); }
  body.appshell .eventrow { background: rgba(255, 255, 255, .96); }
  body.appshell .topbar { background: var(--canvas); }
}

/* ---------- small screens ---------- */
/* Keep the brand + "Sign in" + "Start an album" on ONE row (they were wrapping
   to two lines): buttons never wrap their own text, and the bar tightens up. */
@media (max-width: 480px) {
  .topbar { gap: 7px; padding: 12px 14px; }
  .topbar .brand { gap: 7px; }
  .brand b { font-size: 1.08rem; }
  .topbar .btn.small { padding: 7px 13px; font-size: 12.5px; }
}
@media (max-width: 360px) {
  .brand b { display: none; }        /* logo mark alone frees room for both CTAs */
  .topbar .btn.small { padding: 7px 11px; }
}
