:root {
  --ink: #16120f;
  --ink-2: #251e19;
  --ivory: #f8f3ea;
  --paper: #fffdf8;
  --line: #e4d9c3;
  --gold: #b08d4a;
  --gold-2: #d4b373;
  --wine: #5c1a2b;
  --wine-2: #7a2a40;
  --muted: #7a6f63;
  --danger: #9b2c2c;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 68px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 9vw, 4.6rem); }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--wine); }
em { font-style: italic; color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; }
.eyebrow { font-size: .75rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.2rem; }
.mark { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: .02em; text-decoration: none; color: inherit; }
.mark em { color: var(--gold); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 1.7rem; border-radius: 999px; border: 1px solid transparent; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.btn-primary { background: var(--wine); color: var(--ivory); border-color: var(--wine); }
.btn-primary:hover { background: var(--wine-2); }
.btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(176,141,74,.14); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-link { background: none; border: 0; color: var(--wine); text-decoration: underline; padding: 0; font-size: .9rem; }
.btn-block { width: 100%; }

/* public pages */
.public { min-height: 100dvh; display: flex; flex-direction: column; }
.pub-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; }
.pub-head nav { display: flex; gap: 1rem; align-items: center; }
.pub-foot { margin-top: auto; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); text-align: center; font-size: .82rem; color: var(--muted); }
.pub-foot a { color: inherit; margin: 0 .6rem; }
.dark { background: var(--ink); color: var(--ivory); }
.dark .btn-link { color: var(--gold-2); }
.dark .pub-foot, .dark .pub-foot a { color: rgba(248,243,234,.6); }
.hero { padding: 7vh 22px 8vh; max-width: 980px; margin: 0 auto; text-align: center; }
.hero p.lead { font-size: 1.15rem; font-weight: 300; max-width: 34em; margin: 0 auto 2rem; color: rgba(248,243,234,.82); }
.hero .cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.rule { width: 64px; height: 1px; background: var(--gold); margin: 0 auto 1.6rem; }
.features { display: grid; gap: 1px; background: var(--line); max-width: 1040px; margin: 0 auto; border: 1px solid var(--line); }
.features > div { background: var(--paper); padding: 28px 24px; }
.features h3 { color: var(--wine); }
.features p { color: var(--muted); margin: 0; font-size: .95rem; }
.section { padding: 56px 22px; }
@media (min-width: 760px) { .features { grid-template-columns: repeat(4, 1fr); } .hero { padding-top: 12vh; } }

/* forms */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; width: min(100%, 460px); margin: 24px auto; box-shadow: 0 18px 50px -30px rgba(22,18,15,.4); }
.panel h2 { text-align: center; }
.field { margin-bottom: 1.2rem; }
.field > label, .field > .lbl { display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea { width: 100%; min-height: 48px; padding: .7rem .95rem; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,74,.2); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; margin-bottom: .9rem; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--wine); flex: none; }
.err { color: var(--danger); font-size: .92rem; min-height: 1.3em; margin: .2rem 0 .8rem; }
.swap { text-align: center; font-size: .92rem; color: var(--muted); }

/* choice controls */
.seg { display: flex; flex-wrap: wrap; gap: .5rem; }
.segbtn { min-height: 44px; padding: 0 1.1rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .92rem; transition: all .15s; }
.segbtn.on { background: var(--wine); border-color: var(--wine); color: var(--ivory); }
.seg.cards { flex-direction: column; }
.seg.cards .segbtn { border-radius: 16px; text-align: left; padding: .9rem 1.1rem; min-height: 0; display: flex; flex-direction: column; gap: .15rem; }
.seg.cards .segbtn b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.seg.cards .segbtn span { font-size: .86rem; opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 .8rem; border-radius: 999px; font-size: .82rem; background: transparent; border: 1px solid var(--line); color: var(--muted); }
button.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.chip.gold { border-color: var(--gold); color: var(--ink); background: rgba(176,141,74,.14); }
.tags .chips { margin-bottom: .5rem; }
.tags .sugg { margin-top: .6rem; }
.steps { display: flex; gap: .4rem; justify-content: center; margin-bottom: 1.2rem; }
.steps i { width: 28px; height: 3px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--gold); }
.row { display: flex; gap: .7rem; }
.row > * { flex: 1; }
.sub-title { font-family: var(--serif); font-size: 1.2rem; margin: 1.6rem 0 .8rem; color: var(--wine); }

/* app shell */
.app { min-height: 100dvh; }
.rail { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--ink); border-top: 1px solid rgba(212,179,115,.3); }
.rail .mark { display: none; }
.rail a.nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: rgba(248,243,234,.6); text-decoration: none; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.rail a.nav.on { color: var(--gold-2); }
.rail a.nav .ico { font-size: 1.25rem; font-family: var(--serif); line-height: 1; }
.main { padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.page-title { text-align: center; margin: 8px 0 18px; }
@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  .rail { top: 0; right: auto; bottom: 0; width: 250px; height: auto; flex-direction: column; padding: 34px 20px; border-top: 0; border-right: 1px solid rgba(212,179,115,.3); }
  .rail .mark { display: block; color: var(--ivory); margin-bottom: 2.4rem; font-size: 1.9rem; }
  .rail a.nav { flex: none; flex-direction: row; justify-content: flex-start; gap: .9rem; padding: .85rem 1rem; border-radius: 12px; font-size: .8rem; }
  .rail a.nav.on { background: rgba(212,179,115,.12); }
  .main { margin: 0 0 0 250px; max-width: none; padding: 32px 40px 48px; }
  .main > * { max-width: 560px; margin-left: auto; margin-right: auto; }
  .main > .wide { max-width: 760px; }
}

/* discover */
.discover { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - env(safe-area-inset-bottom) - 40px); min-height: 520px; }
.deck { position: relative; flex: 1; min-height: 0; }
.card { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px -34px rgba(22,18,15,.55); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.card.back { transform: scale(.95) translateY(12px); opacity: .7; pointer-events: none; }
.card .body { flex: 1; overflow-y: auto; padding: 18px 20px 22px; }
.card h2 { margin: 0; font-size: 2.1rem; }
.card h2 small { font-family: var(--sans); font-size: 1rem; font-weight: 300; color: var(--muted); margin-left: .3rem; }
.card .where { color: var(--muted); font-size: .9rem; margin-bottom: .9rem; }
.card .bio { font-size: .98rem; margin: 1rem 0; }
.card .grp { margin: .9rem 0 .35rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.stamp { position: absolute; top: 90px; padding: .25rem .9rem; border: 3px solid; border-radius: 10px; font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: .1em; opacity: 0; pointer-events: none; z-index: 2; background: rgba(255,253,248,.7); }
.stamp.like { left: 18px; color: #2f6b4f; transform: rotate(-12deg); }
.stamp.pass { right: 18px; color: var(--danger); transform: rotate(12deg); }
.actions { display: flex; justify-content: center; gap: 30px; padding: 16px 0 4px; }
.actions[hidden] { display: none; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-family: var(--serif); font-size: 2rem; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px -14px rgba(22,18,15,.6); transition: transform .15s; }
.round:hover { transform: translateY(-2px); }
.round.like { background: var(--wine); color: var(--gold-2); border-color: var(--wine); }
.round.pass { color: var(--muted); }
.empty { text-align: center; padding: 14vh 20px 0; color: var(--muted); }
.empty h2 { color: var(--ink); }
.av0 { background: linear-gradient(145deg, #5c1a2b, #2a0f18); }
.av1 { background: linear-gradient(145deg, #1f4d3d, #0f2a22); }
.av2 { background: linear-gradient(145deg, #243a5e, #121e33); }
.av3 { background: linear-gradient(145deg, #4b2a5c, #261433); }
.av4 { background: linear-gradient(145deg, #7a5a24, #3d2c10); }
.av5 { background: linear-gradient(145deg, #3a3a3a, #161616); }
.av6 { background: linear-gradient(145deg, #6b2d1f, #34150e); }
.av7 { background: linear-gradient(145deg, #1d4b57, #0e2630); }

/* matches + chat */
.list { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--ivory); }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold-2); font-family: var(--serif); font-size: 1.6rem; font-style: italic; }
.item b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.item .prev { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - env(safe-area-inset-bottom) - 40px); min-height: 480px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head h3 { margin: 0; flex: 1; }
.back-link { font-size: 1.6rem; text-decoration: none; color: var(--ink); font-family: var(--serif); }
.notice { font-size: .8rem; color: var(--muted); background: rgba(176,141,74,.12); border-radius: 12px; padding: .6rem .8rem; margin: 10px 0; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 2px; }
.bubble { max-width: 80%; padding: .6rem .9rem; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--wine); color: var(--ivory); border-color: var(--wine); }
.bubble time { display: block; font-size: .68rem; opacity: .6; margin-top: 2px; }
.composer { display: flex; gap: 8px; padding-top: 10px; }
.composer input { flex: 1; border-radius: 999px; }
.composer .btn { min-height: 48px; }
.menu-btn { background: none; border: 1px solid var(--line); border-radius: 999px; min-height: 36px; padding: 0 .9rem; font-size: .8rem; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(22,18,15,.82); display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { background: var(--ink); color: var(--ivory); border: 1px solid var(--gold); border-radius: 24px; padding: 34px 26px; text-align: center; width: min(100%, 380px); }
.modal h2 { font-size: 2.6rem; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--ivory); padding: .7rem 1.2rem; border-radius: 999px; font-size: .9rem; border: 1px solid var(--gold); max-width: 90vw; }
.legal { max-width: 680px; margin: 0 auto; padding: 8px 22px 40px; }
.legal h3 { margin-top: 1.6em; color: var(--wine); }
.legal li { margin-bottom: .4em; }

/* photos + public profile view */
.hero-wrap { position: relative; flex: none; height: 46%; min-height: 200px; }
.hero-wrap.tall { height: min(52dvh, 440px); }
.gal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: rgba(248,243,234,.9); }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gal .initial { font-family: var(--serif); font-size: 5.5rem; font-style: italic; }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 5px; justify-content: center; pointer-events: none; }
.dots i { width: 22px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.45); }
.dots i.on { background: #fff; }
.hero-wrap .score { position: absolute; z-index: 2; top: 14px; right: 14px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding: .35rem .8rem; border-radius: 999px; background: rgba(22,18,15,.62); color: var(--gold-2); border: 1px solid rgba(212,179,115,.5); }
.round.info { width: 48px; height: 48px; align-self: center; font-style: italic; font-size: 1.4rem; color: var(--gold); }
.sheet-o { align-items: center; justify-content: center; padding: 20px; }
.sheet { background: var(--paper); width: min(100%, 480px); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.sheet .body { padding: 18px 22px calc(28px + env(safe-area-inset-bottom)); }
.sheet .body h2 { margin: 0; font-size: 2.1rem; }
.sheet .body h2 small { font-family: var(--sans); font-size: 1rem; font-weight: 300; color: var(--muted); margin-left: .3rem; }
.sheet .body .bio { margin: 1rem 0; }
.sheet .body .where { color: var(--muted); font-size: .9rem; margin-bottom: .9rem; }
.sheet .body .grp { margin: .9rem 0 .35rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sheet-close, .gal-nav { position: absolute; z-index: 3; border: 0; border-radius: 50%; background: rgba(22,18,15,.55); color: #fff; width: 40px; height: 40px; font-size: 1.6rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.sheet-close { top: 12px; left: 12px; }
.gal-nav.prev { left: 12px; top: 50%; }
.gal-nav.next { right: 12px; top: 50%; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: .6rem; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.slot { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--ivory); border: 1px solid var(--line); }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-style: dashed; border-color: var(--gold); color: var(--gold); cursor: pointer; }
.slot.empty span { font-family: var(--serif); font-size: 2.6rem; line-height: 1; }
.slot.empty small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.main-tag { position: absolute; top: 8px; left: 8px; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; background: rgba(22,18,15,.65); color: var(--gold-2); padding: .2rem .55rem; border-radius: 999px; }
.slot-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; padding: 8px; background: linear-gradient(transparent, rgba(22,18,15,.75)); }
.slot-actions button { flex: 1; min-height: 32px; border-radius: 999px; border: 0; background: rgba(255,253,248,.92); font-size: .72rem; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; font-style: normal; }
.title-btn { flex: 1; text-align: left; background: none; border: 0; padding: 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
