/* =====================================================================
   Glöd — Editorial, after dark.  Rules: /DESIGN.md
   Tokens → base → primitives → layouts → views → motion
   ===================================================================== */
:root {
  --ground: #120B0D;
  --ground-2: #1C1114;
  --ink: #F4E9E4;
  --ink-2: #CDB8B3;
  --ink-3: #8E7A78;
  --rule: rgba(244, 233, 228, .14);
  --rule-strong: rgba(244, 233, 228, .28);

  --primary: #C9182B;
  --primary-ink: #FF5A66;
  --primary-glow: #FF4D6D;
  --accent: #E0B04A;
  --ok: #3BB273;
  --danger: var(--primary);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "Fragment Mono", "SF Mono", Menlo, monospace;

  --t-meta: 12px;
  --t-body: 16px;
  --t-display: 48px;
  --t-hero: clamp(72px, 10vw, 144px);

  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-6: 48px; --s-8: 64px; --s-12: 96px; --s-16: 128px;
  --r-sm: 8px; --r-md: 16px; --r-pill: 999px;

  --shadow-float: 0 24px 48px -24px rgba(0, 0, 0, .7);
  --glass: rgba(28, 17, 20, .72);
  --nav-w: 232px;
  --tabbar-h: 64px;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--ground); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-body); line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--primary); color: #fff; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* atmosphere: two washes + grain, never animated */
.atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 8% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    radial-gradient(45% 40% at 100% 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    var(--ground);
}
.atmosphere::after { content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-size: var(--t-display); font-weight: 200; line-height: 1.05; letter-spacing: -.02em; font-variation-settings: "opsz" 72, "SOFT" 30; }
.display b, .display strong, .display.loud { font-weight: 800; }
.hero-type { font-family: var(--font-display); font-size: var(--t-hero); font-weight: 200; line-height: .95; letter-spacing: -.03em; font-variation-settings: "opsz" 144, "SOFT" 40; margin: 0; }
.hero-type em { font-style: italic; font-weight: 800; color: var(--primary-ink); font-variation-settings: "opsz" 144, "WONK" 1; }
.meta { font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.meta.ink { color: var(--ink); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lead { color: var(--ink-2); max-width: 36em; }
b, strong { font-weight: 700; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.measure { max-width: 68ch; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1); padding: 0 var(--s-3); height: 48px;
  border-radius: var(--r-pill); font-weight: 700; white-space: nowrap; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .12s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-glow); }
.btn-outline { border: 1px solid var(--ink-3); color: var(--ink); background: transparent; }  /* ink-3 keeps the boundary ≥ 3:1 on ground */
.btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--ground-2); }
.btn-accent { background: var(--accent); color: var(--ground); }
.btn-sm { height: 32px; padding: 0 var(--s-2); font-size: var(--t-body); }
.btn-lg { height: 56px; padding: 0 var(--s-4); }
.btn-block { width: 100%; }
.btn-icon { width: 48px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-3); }
.field label, .label { font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea {
  width: 100%; height: 48px; padding: 0 var(--s-2); background: transparent; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; outline: none; transition: border-color .2s; -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; min-height: 96px; padding: var(--s-2) 0; resize: vertical; line-height: 1.5; }
.field input, .field select { padding-inline: 0; }
.field select { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238E7A78' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0 center; padding-right: var(--s-3); }
.field select option { background: var(--ground-2); color: var(--ink); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--primary-ink); }
::placeholder { color: var(--ink-3); opacity: 1; }
.field .invalid { border-bottom-color: var(--primary-ink) !important; }
.field .hint { color: var(--ink-3); }
.error-msg { color: var(--primary-ink); min-height: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-3); }
.grid3 { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--s-2); }
.check { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--ink-2); margin: var(--s-1) 0 var(--s-3); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check a, .link { color: var(--primary-ink); text-decoration: none; font-weight: 700; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--ground-2); border: 1px solid var(--rule-strong); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); transition: transform .25s, background .2s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
input[type=range] { width: 100%; accent-color: var(--primary); }
.range-row { display: flex; gap: var(--s-2); align-items: center; }
.range-row output { min-width: 72px; text-align: right; font-family: var(--font-mono); }

/* segmented (nav-less tabs) */
.segmented { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--rule); }
.segmented button { position: relative; height: 48px; font-weight: 700; color: var(--ink-3); transition: color .2s; }
.segmented button[aria-selected="true"] { color: var(--ink); }
.segmented .thumb { position: absolute; bottom: -1px; left: 0; height: 2px; background: var(--primary); transition: transform .3s cubic-bezier(.2,.8,.2,1), width .2s; }

/* chips & tags */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.chip { height: 32px; padding: 0 var(--s-2); border-radius: var(--r-pill); border: 1px solid var(--rule-strong); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; transition: all .2s; }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip.static { cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--s-1); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.tag-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-accent { background: var(--accent); color: var(--ground); border-color: var(--accent); }
.tag-host { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.tag-demo { color: var(--ink-3); }

/* avatar, badge, dot */
.avatar { position: relative; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--ground-2); color: #fff; font-family: var(--font-display); font-weight: 800; }
.avatar img, .avatar svg { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; } .avatar.md { width: 48px; height: 48px; } .avatar.lg { width: 64px; height: 64px; } .avatar.xl { width: 96px; height: 96px; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--ground); }
.badge { min-width: 24px; height: 24px; padding: 0 var(--s-1); border-radius: var(--r-pill); background: var(--primary); color: #fff; font-family: var(--font-mono); font-size: var(--t-meta); display: inline-grid; place-items: center; }
.badge.accent { background: var(--accent); color: var(--ground); }
.badge.quiet { background: var(--ground-2); color: var(--ink-2); border: 1px solid var(--rule); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot.on { background: var(--ok); }

/* toasts & sheets (floating layers: glass + the one shadow) */
.toasts { position: fixed; left: 50%; bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: var(--s-1); align-items: center; width: min(92vw, 480px); pointer-events: none; }
.toast { pointer-events: auto; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--rule); box-shadow: var(--shadow-float); font-weight: 700; animation: toastIn .4s cubic-bezier(.2,.8,.2,1); }
.toast.err { color: var(--primary-ink); } .toast.ok { color: var(--ok); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateY(24px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(12px); opacity: 0; } }
.sheet-backdrop { position: fixed; inset: 0; z-index: 900; background: color-mix(in srgb, var(--ground) 60%, transparent); display: grid; place-items: end center; animation: fade .2s; }
.sheet { width: min(100vw, 560px); max-height: 92dvh; overflow: auto; background: var(--glass); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); border: 1px solid var(--rule); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: var(--shadow-float); padding: var(--s-2) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); animation: sheetIn .35s cubic-bezier(.2,.8,.2,1); }
.sheet .grabber { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--rule-strong); margin: 0 auto var(--s-2); }
.sheet h3 { margin: 0 0 var(--s-1); font-family: var(--font-display); font-weight: 800; font-size: var(--t-body); letter-spacing: 0; }
.sheet h3.display { font-size: var(--t-display); font-weight: 200; }
.sheet p { color: var(--ink-2); margin-bottom: var(--s-2); }
.sheet .actions { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: flex-end; margin-top: var(--s-2); }
@media (min-width: 640px) { .sheet-backdrop { place-items: center; } .sheet { border-radius: var(--r-md); border-bottom: 1px solid var(--rule); padding: var(--s-3); animation: popIn .3s cubic-bezier(.2,.8,.2,1); } .sheet .grabber { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(48px); opacity: 0; } }
@keyframes popIn { from { transform: translateY(16px); opacity: 0; } }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; text-align: center; transition: opacity .4s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-word { font-family: var(--font-display); font-size: var(--t-display); font-weight: 200; letter-spacing: -.02em; animation: breathe 1.6s ease-in-out infinite; }
.splash-sub { font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-top: var(--s-1); }
@keyframes breathe { 50% { opacity: .5; } }
.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; padding: var(--s-3); text-align: center; background: var(--ground); }

/* ---------- ruled lists & tables (instead of cards) ---------- */
.ruled > li, .ruled > .row-item { display: grid; grid-template-columns: minmax(96px, 200px) 1fr auto; gap: var(--s-3); align-items: baseline; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.ruled > li:last-child, .ruled > .row-item:last-child { border-bottom: 1px solid var(--rule); }
.ruled .n { font-family: var(--font-display); font-size: var(--t-display); font-weight: 200; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.ruled .n.num { font-family: var(--font-mono); font-size: var(--t-body); align-self: center; }
.ruled > li.popular .n { color: var(--primary-ink); font-weight: 800; }
.ruled h3 { margin: 0 0 4px; font-size: var(--t-body); font-weight: 700; }
.ruled p { color: var(--ink-2); }
.price-table { width: 100%; border-collapse: collapse; }
.price-table td { padding: var(--s-2) 0; border-top: 1px solid var(--rule); vertical-align: top; }
.price-table tr:last-child td { border-bottom: 1px solid var(--rule); }
.price-table td:last-child { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.price-table td small { display: block; color: var(--ink-3); }
/* Stats: one dominant number, the rest as a quiet ruled list — weight extremes, not four equal tiles. */
.stat-row { display: grid; grid-template-columns: minmax(96px, 200px) auto 1fr; gap: var(--s-3) var(--s-6); align-items: end; padding: var(--s-4) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat-row > .meta { padding-top: 14px; align-self: start; }
.stat-lead .n { font-family: var(--font-display); font-size: clamp(64px, 8vw, 112px); font-weight: 200; line-height: .9; letter-spacing: -.03em; font-variation-settings: "opsz" 144; }
.stat-lead .meta { margin-top: var(--s-1); }
.stat-list { align-self: end; max-width: 520px; justify-self: end; width: 100%; }
.stat-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: var(--s-1) 0; border-top: 1px solid var(--rule); }
.stat-list li:first-child { border-top: 0; }
.stat-list .num { font-family: var(--font-mono); }
.stat-list .num.accent { color: var(--accent); }
@media (max-width: 760px) { .stat-row { grid-template-columns: 1fr; gap: var(--s-2); } .stat-list { justify-self: stretch; max-width: none; } .stat-row > .meta { padding-top: 0; } }
.hairline { border: 0; border-top: 1px solid var(--rule); margin: 0; }
@media (max-width: 640px) { .ruled > li, .ruled > .row-item { grid-template-columns: 1fr; gap: var(--s-1); } }

/* ---------- public layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--s-3); }
.topnav { position: sticky; top: 0; z-index: 50; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding-inline: var(--s-3);
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid var(--rule); }
.topnav nav { display: flex; align-items: center; gap: var(--s-3); }
.topnav nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.topnav nav a:not(.btn):hover { color: var(--ink); }
.topnav .btn { height: 40px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: var(--t-body); letter-spacing: 0; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s-1); }
.logo i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.age-gate { font-family: var(--font-mono); font-size: var(--t-meta); color: var(--ink-3); letter-spacing: .08em; }
.lang-switch { display: inline-flex; gap: 4px; }
.lang-switch .chip { height: 32px; min-width: 40px; padding: 0 var(--s-1); font-family: var(--font-mono); font-size: var(--t-meta); letter-spacing: .06em; }
@media (pointer: coarse) { .lang-switch .chip { height: 44px; min-width: 44px; } }
.topnav nav .lang-switch { display: inline-flex; }
@media (max-width: 760px) { .topnav nav a:not(.btn) { display: none; } }

.hero { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8); align-items: start; padding-block: var(--s-12) var(--s-8); }
.hero .lead { margin-top: var(--s-4); }
.hero .facts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.hero .facts span { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--ink-2); }
.hero .facts .icon { color: var(--primary-ink); }
.hero-actions { display: none; gap: var(--s-1); flex-wrap: wrap; margin-top: var(--s-4); }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-6); padding-block: var(--s-6) var(--s-6); }
  .hero-actions { display: flex; }   /* the register panel sits below the fold on phones – give the first action up top */
}

section.block { padding-block: var(--s-12); }
/* Section heads share the ruled list's grid so headlines sit on the same vertical as list copy. */
.section-head { display: grid; grid-template-columns: minmax(96px, 200px) 1fr; gap: var(--s-3); align-items: start; margin-bottom: var(--s-6); }
.section-head > .meta { padding-top: 14px; }
.section-head > :not(.meta) { grid-column: 2; }   /* headline and intro share the copy column; the kicker keeps the label column */
.section-head .display { margin: 0; }
.section-head p { color: var(--ink-2); max-width: 36em; margin-top: var(--s-1); }
@media (max-width: 640px) { .section-head { grid-template-columns: 1fr; gap: var(--s-1); } section.block { padding-block: var(--s-8); } }

/* members strip on landing */
.strip-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: var(--s-2); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: var(--s-1); }
.strip::-webkit-scrollbar { display: none; }

/* member tile (grid + strip) */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s-2); }
.member { position: relative; display: block; text-decoration: none; color: inherit; scroll-snap-align: start; }
.member .photo { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-sm); background: var(--ground-2); }
.member .photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--ground) 55%, transparent)); }
.member .photo img, .member .photo svg { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.member:hover .photo img, .member:hover .photo svg { transform: scale(1.03); }
.member .name { display: flex; align-items: baseline; gap: var(--s-1); margin-top: var(--s-1); font-weight: 700; }
.member .name .age { font-weight: 400; color: var(--ink-2); font-family: var(--font-mono); }
.member .where { display: flex; align-items: center; gap: var(--s-1); color: var(--ink-3); font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .06em; }
.member .tags { position: absolute; top: var(--s-1); left: var(--s-1); display: flex; gap: 4px; }
.member .tags .tag { background: var(--ground); color: var(--ink-2); border-color: transparent; }
.member .tags .tag-host { background: var(--ink); color: var(--ground); }
.member.blurred .photo img, .member.blurred .photo svg { filter: blur(16px) saturate(130%); transform: scale(1.15); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-1); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-3); }
.filters .spacer { flex: 1; }
.pager { display: flex; justify-content: center; gap: var(--s-2); align-items: center; padding: var(--s-4) 0; font-family: var(--font-mono); }

/* ---------- auth panel ---------- */
.auth-panel { border-top: 1px solid var(--rule); padding-top: var(--s-2); }
.auth-panel .segmented { margin-bottom: var(--s-3); }
.auth-panel h2 { margin: 0 0 var(--s-1); font-family: var(--font-display); font-size: var(--t-display); font-weight: 200; line-height: 1.05; letter-spacing: -.02em; }
.auth-panel .sub { color: var(--ink-2); margin-bottom: var(--s-3); }
.auth-panel .alt { color: var(--ink-2); margin-top: var(--s-2); }
.auth-page { min-height: calc(100dvh - 64px); display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: start; padding-block: var(--s-8); }
.auth-page .side-copy { position: sticky; top: calc(64px + var(--s-4)); }
@media (max-width: 960px) { .auth-page { grid-template-columns: 1fr; } .auth-page .side-copy { position: static; } }
.progress { display: flex; gap: var(--s-1); margin-bottom: var(--s-3); }
.progress i { flex: 1; height: 2px; background: var(--rule); }
.progress i.done, .progress i.cur { background: var(--primary); }
.step-view { animation: stepIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes stepIn { from { opacity: 0; transform: translateX(8px); } }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-1); margin-bottom: var(--s-3); }
.option { height: 48px; border: 1px solid var(--rule-strong); border-radius: var(--r-pill); font-weight: 700; color: var(--ink-2); transition: all .2s; }
.option[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.sidenav { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: var(--s-3) var(--s-2); border-right: 1px solid var(--rule); }
.sidenav .logo { padding: var(--s-1) var(--s-2) var(--s-4); }
.navitem { display: flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--s-2); border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 700; transition: color .2s, background .2s; }
.navitem:hover { color: var(--ink); }
.navitem.active { color: var(--ink); background: var(--ground-2); }
.navitem .badge { margin-left: auto; }
.sidenav .me { margin-top: auto; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); border-top: 1px solid var(--rule); text-decoration: none; }
.sidenav .me b { display: block; }
.sidenav .me .meta { display: block; }
.main { min-width: 0; padding: var(--s-4) clamp(var(--s-3), 4vw, var(--s-8)) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.page-head .display { margin: 0; }
.page-head p { color: var(--ink-2); margin-top: var(--s-1); }
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { display: none; }
  .main { padding: var(--s-3) var(--s-2) calc(var(--tabbar-h) + var(--s-3) + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 80;
    background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: 1px solid var(--rule); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--ink-3); font-family: var(--font-mono); font-size: var(--t-meta); text-transform: uppercase; letter-spacing: .04em; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active::before { content: ""; position: absolute; top: 0; width: 24px; height: 2px; background: var(--primary); }
  .tabbar .badge { position: absolute; top: var(--s-1); right: calc(50% - 28px); }
  .toasts { bottom: calc(var(--tabbar-h) + var(--s-2) + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- profile page ---------- */
.profile-hero { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-6); align-items: start; }
.profile-photos { display: grid; gap: var(--s-1); }
.profile-photos .main-photo { aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; background: var(--ground-2); }
.profile-photos .main-photo img, .profile-photos .main-photo svg { width: 100%; height: 100%; object-fit: cover; }
.profile-photos .thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-1); }
.profile-photos .thumbs button { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; opacity: .6; transition: opacity .2s; }
.profile-photos .thumbs button.on, .profile-photos .thumbs button:hover { opacity: 1; }
.profile-photos .thumbs img, .profile-photos .thumbs svg { width: 100%; height: 100%; object-fit: cover; }
.profile-body .name { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.profile-body .status { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-2); }
.profile-body .bio { margin-top: var(--s-4); max-width: 60ch; }
.profile-actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.host-notice { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2); align-items: start; padding: var(--s-2) 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); color: var(--ink-2); margin-top: var(--s-4); }
.host-notice .tag { margin-top: 2px; }
@media (max-width: 900px) { .profile-hero { grid-template-columns: 1fr; gap: var(--s-4); } }

/* ---------- conversations & chat ---------- */
.chat-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--s-4); height: calc(100dvh - var(--s-8)); min-height: 520px; }
.conv-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule); padding-right: var(--s-3); }
.conv-pane .display { margin: 0 0 var(--s-3); }
.conv-list { overflow-y: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 48px 1fr auto; gap: var(--s-2); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.conv:last-child { border-bottom: 1px solid var(--rule); }
.conv .body { min-width: 0; }
.conv .top { display: flex; justify-content: space-between; gap: var(--s-1); align-items: baseline; }
.conv time { font-family: var(--font-mono); font-size: var(--t-meta); color: var(--ink-3); white-space: nowrap; }
.conv p { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread p { color: var(--ink); font-weight: 700; }
.conv.active { background: linear-gradient(90deg, var(--ground-2), transparent); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: var(--s-2); padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule); }
.chat-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: inherit; }
.chat-head b { display: block; }
.chat-head .meta { display: block; }
.chat-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: var(--s-3) 0 var(--s-1); display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.day-sep { text-align: center; margin: var(--s-2) 0 var(--s-1); }
.bubble { max-width: min(78%, 560px); padding: var(--s-1) var(--s-2); border-radius: var(--r-md); white-space: pre-wrap; word-wrap: break-word; animation: bubbleIn .25s cubic-bezier(.2,.8,.2,1); }
.bubble.in { align-self: flex-start; background: var(--ground-2); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble .stamp { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: var(--t-meta); opacity: .7; text-align: right; }
.linkish { font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.bubble.pending { opacity: .6; }
.bubble.gift { background: transparent; border: 1px solid var(--accent); color: var(--ink); text-align: center; padding: var(--s-2) var(--s-3); }
.bubble.gift .glyph { font-size: var(--t-display); line-height: 1; display: block; }
.bubble.gift.out { color: var(--ink); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: var(--s-2); border-radius: var(--r-md); background: var(--ground-2); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.chat-intro { padding: var(--s-3) 0; color: var(--ink-2); display: grid; gap: var(--s-2); justify-items: start; }
.composer { display: flex; gap: var(--s-1); align-items: flex-end; padding: var(--s-2) 0 calc(var(--s-1) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule);
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.composer textarea { flex: 1; resize: none; min-height: 48px; max-height: 160px; padding: 12px var(--s-2); background: var(--ground-2); border: 1px solid var(--rule); border-radius: var(--r-md); outline: none; line-height: 1.5; }
.composer textarea:focus { border-color: var(--rule-strong); }
.composer .cost { font-family: var(--font-mono); font-size: var(--t-meta); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; align-self: center; white-space: nowrap; }
.composer .cost b { color: var(--accent); }
.chat-empty { flex: 1; display: grid; place-content: start; padding-top: var(--s-8); color: var(--ink-2); }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100dvh - var(--tabbar-h) - var(--s-6)); }
  .conv-pane { border-right: 0; padding-right: 0; }
  .chat-layout.show-chat .conv-pane { display: none; }
  .chat-layout:not(.show-chat) .chat-pane { display: none; }
  .chat-head .back { display: inline-flex; }
}

/* ---------- editor (own profile) ---------- */
.profile-layout { display: grid; grid-template-columns: minmax(0, 7fr) 5fr; gap: var(--s-6); align-items: start; }
.card-section { padding: var(--s-4) 0; border-top: 1px solid var(--rule); }
.card-section h2 { margin: 0 0 var(--s-3); font-size: var(--t-body); font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); }
.photo-slot { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; background: var(--ground-2); border: 1px dashed var(--rule-strong); display: grid; place-items: center; color: var(--ink-3); transition: border-color .2s; }
.photo-slot:hover { border-color: var(--ink); color: var(--ink); }
.photo-slot.filled { border: 0; cursor: default; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .ops { position: absolute; left: var(--s-1); right: var(--s-1); bottom: var(--s-1); display: flex; justify-content: space-between; gap: 4px; }
.photo-slot .ops .btn { height: 32px; padding: 0 var(--s-1); background: var(--ground); color: var(--ink); }
.photo-slot .primary-tag { position: absolute; top: var(--s-1); left: var(--s-1); }
.preview { position: sticky; top: var(--s-4); }
.sticky-save { position: sticky; bottom: calc(var(--s-2) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: var(--s-1); padding: var(--s-2); border-radius: var(--r-md); margin-top: var(--s-3); z-index: 5;
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--rule); box-shadow: var(--shadow-float); }
@media (max-width: 1100px) { .profile-layout { grid-template-columns: 1fr; } .preview { position: static; order: -1; } }
@media (max-width: 900px) { .sticky-save { bottom: calc(var(--tabbar-h) + var(--s-2) + env(safe-area-inset-bottom, 0px)); } }

/* ---------- credits ---------- */
.balance { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: end; padding: var(--s-4) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.balance .big { font-family: var(--font-display); font-size: var(--t-hero); font-weight: 200; line-height: .9; letter-spacing: -.03em; color: var(--accent); }
.tx { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); padding: var(--s-2) 0; border-top: 1px solid var(--rule); }
.tx:last-child { border-bottom: 1px solid var(--rule); }
.tx .meta { display: block; margin-top: 4px; }
.tx .delta { font-family: var(--font-mono); } .tx .delta.plus { color: var(--ok); }
.demo-note { display: flex; gap: var(--s-1); align-items: flex-start; padding: var(--s-2) 0; color: var(--ink-2); border-top: 1px solid var(--rule); }
.demo-note .icon { color: var(--accent); margin-top: 2px; }

/* ---------- settings ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--rule); }
.setting-row:last-child { border-bottom: 1px solid var(--rule); }
.setting-row b { display: block; }
.setting-row span.d { display: block; color: var(--ink-2); }
.danger-zone h2 { color: var(--primary-ink); }

/* ---------- moderator console ---------- */
.mod-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: var(--s-4); height: calc(100dvh - var(--s-8)); min-height: 520px; }
.queue { overflow-y: auto; min-height: 0; border-right: 1px solid var(--rule); padding-right: var(--s-3); }
.queue-item { display: grid; grid-template-columns: 48px 1fr auto; gap: var(--s-2); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.queue-item .pair { display: flex; align-items: center; gap: 4px; }
.queue-item.waiting .wait { color: var(--accent); font-family: var(--font-mono); font-size: var(--t-meta); }
.queue-item.active { background: linear-gradient(90deg, var(--ground-2), transparent); }
.mod-thread { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.mod-context { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule); }
.mod-context .who { display: flex; gap: var(--s-2); align-items: center; }
.mod-context .who b { display: block; }
.notes { width: 100%; min-height: 64px; padding: var(--s-1) 0; background: transparent; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); resize: vertical; outline: none; }
@media (max-width: 1000px) { .mod-layout { grid-template-columns: 1fr; height: auto; } .queue { border-right: 0; padding-right: 0; max-height: 40dvh; } .mod-layout.show-thread .queue { display: none; } .mod-layout:not(.show-thread) .mod-thread { display: none; } }

/* ---------- legal ---------- */
.legal { max-width: 68ch; padding-block: var(--s-8) var(--s-12); }
.legal h1 { margin: 0 0 var(--s-1); }
.legal h2 { font-size: var(--t-body); font-weight: 700; margin: var(--s-4) 0 var(--s-1); }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { list-style: disc; padding-left: var(--s-3); display: grid; gap: var(--s-1); }
.legal .notice { padding: var(--s-2) 0; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); color: var(--accent); margin: var(--s-3) 0; }

/* ---------- faq & band ---------- */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-3); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding-bottom: var(--s-3); max-width: 60ch; }
.band { background: linear-gradient(135deg, var(--primary), var(--primary-glow)); color: #fff; padding: var(--s-8) 0; margin-block: var(--s-8); }
.band .inner { display: grid; grid-template-columns: 1fr auto; gap: var(--s-4); align-items: end; }
.band .display { color: #fff; margin: 0; }
.band .btn-primary { background: #fff; color: var(--primary); }
.band .meta { color: rgba(255,255,255,.75); }
@media (max-width: 760px) { .band .inner { grid-template-columns: 1fr; align-items: start; } }

/* ---------- empty / skeleton / util ---------- */
.empty { padding: var(--s-6) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: var(--s-2); justify-items: start; }
.empty .display { margin: 0; }
.empty p { color: var(--ink-2); max-width: 36em; }
.skeleton { background: linear-gradient(90deg, var(--ground-2) 25%, rgba(244,233,228,.06) 50%, var(--ground-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.row { display: flex; align-items: center; gap: var(--s-1); }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.mt { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mb { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
footer.site { padding-block: var(--s-8) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); color: var(--ink-3); }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-4); }
footer.site a { text-decoration: none; color: var(--ink-2); display: block; }
footer.site a:hover { color: var(--ink); }
@media (max-width: 640px) { footer.site .cols { grid-template-columns: 1fr; } }

/* ---------- motion: one entrance per view ---------- */
.rise { opacity: 0; transform: translateY(12px); animation: rise .5s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rise { opacity: 1; transform: none; }
}
