:root {
  --bg: #faf8f4;
  --paper: #ffffff;
  --ink: #16130f;
  --ink-soft: #3b352e;
  --muted: #9a9087;
  --muted-2: #b8afa4;
  --line: #e8e2d8;
  --line-strong: #d9d1c4;
  --shadow: 0 1px 2px rgba(20, 17, 13, .04), 0 8px 30px rgba(20, 17, 13, .06);
  --radius: 16px;
  --maxw: 600px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 120px; }

/* ---------- header ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 44px 16px 26px;
  overflow: hidden;
}
.hero .branch {
  position: absolute;
  opacity: .5;
  color: var(--ink-soft);
  pointer-events: none;
}
.hero .branch.tl { top: -10px; left: -28px; width: 190px; transform: scaleX(-1); }
.hero .branch.tr { top: -10px; right: -28px; width: 190px; }
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
  padding-left: .32em;
}
.names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 12vw, 64px);
  line-height: .98;
  margin: 0;
  letter-spacing: .005em;
}
.names .amp { font-style: italic; font-weight: 400; display: inline-block; margin: 0 .12em; color: var(--ink-soft); }
.subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  margin: 12px 0 0;
}
.counters {
  display: flex; gap: 22px; justify-content: center; align-items: center;
  margin: 18px 0 0; color: var(--muted); font-size: 13px;
}
.counters b { color: var(--ink); font-weight: 600; }
.counters .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

.rule {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 22px auto 4px; color: var(--line-strong); max-width: 320px;
}
.rule::before, .rule::after { content: ""; height: 1px; background: var(--line-strong); flex: 1; }
.rule svg { width: 26px; height: 26px; color: var(--muted-2); }

/* ---------- composer ---------- */
.composer {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 18px 0 28px;
}
.composer h2 {
  font-family: var(--serif); font-weight: 600; font-size: 24px;
  margin: 0 0 4px; display: flex; align-items: center; gap: 9px;
}
.composer p.hint { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 12px 13px; font-size: 16px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, textarea.input:focus { outline: none; border-color: var(--ink-soft); box-shadow: 0 0 0 3px rgba(22,19,15,.06); }
textarea.input { resize: vertical; min-height: 46px; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  transition: border-color .15s, background .15s, color .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--ink-soft); color: var(--ink-soft); background: #fcfaf6; }
.dropzone svg { width: 30px; height: 30px; margin-bottom: 6px; }
.dropzone b { color: var(--ink); font-weight: 600; }
.dropzone small { display: block; margin-top: 8px; font-size: 12px; color: var(--muted-2); }
.dz-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dz-btn { padding: 11px 16px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.dz-btn svg { width: 18px; height: 18px; margin: 0; }
@media (max-width: 420px) { .dz-btn { flex: 1 1 100%; justify-content: center; } }

.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-top: 12px; }
.previews .pv { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #eee; }
.previews .pv img, .previews .pv video { width: 100%; height: 100%; object-fit: cover; }
.previews .pv .play-badge svg { width: 24px; height: 24px; }
.previews .pv button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(22,19,15,.72); color: #fff; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}

.btn {
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 999px; padding: 12px 22px; font-size: 15px; font-weight: 600;
  letter-spacing: .01em; transition: transform .08s, opacity .15s, background .15s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }

.composer-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.progress { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; display: none; }
.progress.on { display: block; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 22px; }
.post {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.post-head { display: flex; align-items: center; gap: 12px; padding: 15px 16px 12px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 18px;
  background: #1b1712; color: #fff; letter-spacing: .02em;
  border: 1px solid rgba(0,0,0,.1);
}
.post-head .who { line-height: 1.2; min-width: 0; }
.post-head .who .nm { font-weight: 600; font-size: 15px; }
.post-head .who .tm { color: var(--muted); font-size: 12.5px; }
.post-caption { padding: 0 16px 12px; font-size: 15.5px; color: var(--ink-soft); }
.post-caption.serif { font-family: var(--serif); font-size: 20px; font-style: italic; }

/* photo grid */
.gallery { display: grid; gap: 3px; background: var(--line); }
.gallery.n1 { grid-template-columns: 1fr; }
.gallery.n2 { grid-template-columns: 1fr 1fr; }
.gallery.n3 { grid-template-columns: 1fr 1fr; }
.gallery.n3 .ph:first-child { grid-column: 1 / -1; }
.gallery.ngrid { grid-template-columns: 1fr 1fr; } /* 4+ => clean 2x2, no empty cells */
.ph { position: relative; overflow: hidden; background: #efeae2; cursor: zoom-in; }
.gallery.n1 .ph { aspect-ratio: auto; max-height: 78vh; }
.gallery.n1 .ph .ph-media { width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: #f3efe8; }
.gallery:not(.n1) .ph { aspect-ratio: 1; }
.gallery:not(.n1) .ph .ph-media { width: 100%; height: 100%; object-fit: cover; }
.ph .more { position: absolute; inset: 0; background: rgba(20,17,13,.5); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 600; font-family: var(--serif); z-index: 2; }
.ph .ph-media { transition: transform .4s ease; }
.ph:hover .ph-media { transform: scale(1.03); }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.play-badge svg { width: 46px; height: 46px; color: #fff; filter: drop-shadow(0 1px 4px rgba(0,0,0,.5)); opacity: .92; }

/* reactions + counts */
.post-foot { padding: 10px 12px 6px; }
.react-summary { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; min-height: 18px; padding: 0 4px 8px; }
.react-summary .ic { width: 14px; height: 14px; color: var(--ink); }
.react-bar { display: flex; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; flex-wrap: wrap; }
.react {
  flex: 1; min-width: 0;
  border: none; background: transparent; color: var(--muted);
  border-radius: 10px; padding: 8px 4px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; transition: background .12s, color .12s, transform .1s;
}
.react svg { width: 21px; height: 21px; }
.react .cnt { font-variant-numeric: tabular-nums; font-weight: 600; min-height: 13px; }
.react:hover { background: #f4f0ea; color: var(--ink); }
.react:active { transform: scale(.92); }
.react.on { color: var(--ink); }
.react.on svg { fill: var(--ink); }

/* comments */
.comments { border-top: 1px solid var(--line); padding: 12px 16px; display: none; }
.comments.open { display: block; }
.comment { display: flex; gap: 9px; margin-bottom: 10px; align-items: flex-start; }
.comment .av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #efeae2; color: var(--ink-soft); font-size: 12px; font-weight: 600; font-family: var(--serif); }
.comment .bubble { background: #f5f1ea; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.comment .bubble .nm { font-weight: 600; font-size: 12.5px; margin-bottom: 1px; }
.comment-form { display: flex; gap: 8px; margin-top: 4px; }
.comment-form input { flex: 1; border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 14px; font-size: 14px; }
.comment-form input:focus { outline: none; border-color: var(--ink-soft); }
.comment-form button { border: none; background: var(--ink); color: #fff; border-radius: 999px; width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.toggle-comments { background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px 4px 2px; display: inline-flex; align-items: center; gap: 6px; }
.toggle-comments:hover { color: var(--ink); }

/* empty / loading */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 60px; height: 60px; color: var(--line-strong); margin-bottom: 14px; }
.empty h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink-soft); margin: 0 0 6px; }
.skeleton { height: 360px; border-radius: var(--radius); background: linear-gradient(100deg, #f0ece5 30%, #f7f4ee 50%, #f0ece5 70%); background-size: 200% 100%; animation: sh 1.3s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.load-more { text-align: center; margin-top: 22px; }

/* floating upload button (mobile) */
.fab {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  padding: 14px 24px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(20,17,13,.28);
  display: inline-flex; align-items: center; gap: 9px; z-index: 40;
  transition: transform .2s, opacity .2s;
}
.fab svg { width: 19px; height: 19px; }
.fab:active { transform: translateX(-50%) scale(.96); }
.fab.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(12px); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(15,12,9,.96); z-index: 100;
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-stage { max-width: 96vw; max-height: 84vh; display: grid; place-items: center; }
.lb-el { max-width: 96vw; max-height: 84vh; object-fit: contain; border-radius: 4px; }
video.lb-el { width: auto; height: auto; background: #000; }
.lightbox .lb-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px;
  background: rgba(255,255,255,.16); border: none; color: #fff; width: 44px; height: 44px;
  border-radius: 50%; font-size: 24px; line-height: 1; z-index: 3; backdrop-filter: blur(4px);
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.25); color: #fff;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  z-index: 3; backdrop-filter: blur(4px); transition: background .15s, transform .1s;
}
.lightbox .lb-nav svg { width: 26px; height: 26px; display: block; }
.lightbox .lb-nav:hover { background: rgba(0,0,0,.65); }
.lightbox .lb-nav:active { transform: translateY(-50%) scale(.9); }
.lightbox .lb-prev { left: max(10px, env(safe-area-inset-left, 0px)); }
.lightbox .lb-next { right: max(10px, env(safe-area-inset-right, 0px)); }
.lb-stage.slide-r { animation: lbSlideR .28s ease; }
.lb-stage.slide-l { animation: lbSlideL .28s ease; }
@keyframes lbSlideR { from { opacity: .2; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes lbSlideL { from { opacity: .2; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.lightbox .lb-meta { color: rgba(255,255,255,.8); margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 16px; }

/* toast */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 200; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* footer */
.foot { text-align: center; color: var(--muted-2); font-size: 12px; padding: 40px 16px 0; }
.foot .branch { width: 120px; color: var(--line-strong); margin: 0 auto 10px; opacity: .9; }
.foot a { color: var(--muted); text-decoration: none; }

@media (min-width: 640px) {
  .fab { display: none; }
}

/* ---------- entrance animations ---------- */
html, body { overflow-x: hidden; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroBranchL { from { opacity: 0; transform: translateX(-46px) scaleX(-1); } to { opacity: .5; transform: translateX(0) scaleX(-1); } }
@keyframes heroBranchR { from { opacity: 0; transform: translateX(46px); } to { opacity: .5; transform: translateX(0); } }

.eyebrow   { animation: fadeUp .7s ease .10s both; }
.names     { animation: fadeUp .8s ease .22s both; }
.subtitle  { animation: fadeUp .8s ease .42s both; }
.counters  { animation: fadeUp .7s ease .60s both; }
.hero .rule { animation: fadeUp .7s ease .78s both; }
.hero .branch.tl { animation: heroBranchL 1.3s cubic-bezier(.22,.61,.36,1) .15s both; }
.hero .branch.tr { animation: heroBranchR 1.3s cubic-bezier(.22,.61,.36,1) .15s both; }

/* composer: branches open from the sides, then the form fades in */
.composer-stage { position: relative; }
.stage-branch {
  position: absolute; top: 50%; width: 200px; color: var(--line-strong);
  opacity: .4; pointer-events: none; z-index: 0;
}
.stage-branch.l { left: -78px; transform: translateY(-50%); animation: stageL 1.7s cubic-bezier(.16,.84,.36,1) .2s both; }
.stage-branch.r { right: -78px; transform: translateY(-50%) scaleX(-1); animation: stageR 1.7s cubic-bezier(.16,.84,.36,1) .2s both; }
/* branches emerge from behind the card and open out to the sides, introducing the form */
@keyframes stageL { 0% { opacity: 0; transform: translate(150px, -50%) scale(.9); } 100% { opacity: .46; transform: translate(0, -50%) scale(1); } }
@keyframes stageR { 0% { opacity: 0; transform: translate(-150px, -50%) scaleX(-1) scale(.9); } 100% { opacity: .46; transform: translate(0, -50%) scaleX(-1) scale(1); } }
.composer-stage .composer { position: relative; z-index: 1; animation: fadeUp 1s ease .65s both; }

@media (prefers-reduced-motion: reduce) {
  .eyebrow, .names, .subtitle, .counters, .hero .rule,
  .hero .branch.tl, .hero .branch.tr,
  .stage-branch.l, .stage-branch.r, .composer-stage .composer { animation: none; }
}

/* ---------- responsive tuning ---------- */
/* On narrow screens the title goes nearly full-width, so the corner branches
   are lifted into the empty band ABOVE the title (extra top padding) instead of
   sitting beside the letters. Their lowest leaf stays above the names. */
@media (max-width: 900px) {
  .hero { padding-top: 50px; }
  .hero .branch.tl, .hero .branch.tr { width: 120px; top: -18px; }
  .hero .branch.tl { left: -46px; }
  .hero .branch.tr { right: -46px; }
}
@media (max-width: 680px) {
  .hero { padding: 30px 16px 24px; }
  /* on phones the branches drop down to the height of the .rule divider
     (anchored to the hero bottom, since .rule is the last element) */
  .hero .branch.tl, .hero .branch.tr { width: 92px; top: auto; bottom: 11px; }
  .hero .branch.tl { left: -30px; }
  .hero .branch.tr { right: -30px; }
  .names { font-size: clamp(34px, 11.5vw, 50px); }
  .stage-branch { width: 116px; }
  .stage-branch.l { left: -40px; }
  .stage-branch.r { right: -40px; }
}
@media (max-width: 470px) {
  .hero { padding: 26px 14px 22px; }
  .hero .branch.tl, .hero .branch.tr { width: 80px; bottom: 13px; }
  .hero .branch.tl { left: -26px; }
  .hero .branch.tr { right: -26px; }
  .names { font-size: clamp(32px, 12vw, 46px); }
}
@media (min-width: 760px) {
  .stage-branch { width: 230px; }
  .stage-branch.l { left: -150px; }
  .stage-branch.r { right: -150px; }
}
