/* styles.css — tavern.host one-pager. Dark "programmer-romantic" system
   borrowed from the Miko Tavern mini app: near-black canvas, cream type,
   vermilion + gold accents, serif / sans / mono trio, Torii brand mark.
   Implemented from the Claude Design handoff (site/Tavern Host.html). */

:root {
  --bg: #0A0A0F;
  --bg-2: #0E0F15;
  --bg-3: #14151D;
  --bg-4: #1A1B25;

  --fg: #EDE6D3;
  --fg-2: #B8B5A8;
  --fg-3: #6E6C66;
  --fg-4: #44443E;

  --line: rgba(237, 230, 211, 0.10);
  --line-2: rgba(237, 230, 211, 0.18);
  --line-strong: rgba(237, 230, 211, 0.32);

  --accent: #E5484D;
  --accent-dim: rgba(229, 72, 77, 0.20);
  --gold: #E8B752;
  --gold-dim: rgba(232, 183, 82, 0.18);

  --green: #4FCB76;
  --blue: #6C9FFF;

  --tg: #2AABEE;            /* Telegram brand blue */
  --tg-text: #FFFFFF;

  /* CTA text colour — light on the vermilion default */
  --btn-text: #FFFFFF;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --maxw: 1320px;
  --gut: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bg-4); }
*::-webkit-scrollbar-track { background: transparent; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }

.site {
  position: relative;
  min-height: 100vh;
  --cols-desktop: 4;       /* desktop column count for the waterfall */
  --cols: var(--cols-desktop);
  background:
    radial-gradient(1100px 620px at 100% -8%, rgba(232,183,82,0.05), transparent 60%),
    radial-gradient(1200px 760px at -8% 12%, rgba(229,72,77,0.05), transparent 62%),
    var(--bg);
  overflow-x: hidden;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

/* ── Top nav ───────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,15,0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .torii { color: var(--accent); display: inline-flex; }
.brand .name {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--fg);
}
.brand .dom { font-family: var(--mono); font-size: 13px; color: var(--fg-2); }
.brand .cn {
  font-family: var(--mono); font-size: 13px; color: var(--gold);
  letter-spacing: 0.1em; padding-left: 10px; border-left: 1px solid var(--line-2);
}
.nav-right { display: flex; align-items: center; gap: 12px; }

/* language toggle */
.lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); height: 38px; }
.lang-toggle button {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  min-width: 42px; padding: 0 12px; height: 100%;
  font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--fg-2);
  letter-spacing: 0.04em; transition: color 140ms ease, background 140ms ease;
}
.lang-toggle button + button { border-left: 1px solid var(--line-strong); }
.lang-toggle button:hover { color: var(--fg); }
.lang-toggle button.on { color: var(--bg); background: var(--fg); }

/* Primary CTA — tied to the accent (vermilion by default), not stock TG blue */
.btn-tg {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 19px;
  background: var(--accent); color: var(--btn-text, #fff);
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  border: 0; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset;
  transition: filter 140ms ease, transform 120ms ease;
}
.btn-tg:hover { filter: brightness(1.08); }
.btn-tg:active { transform: scale(0.98); }
.btn-tg.lg { height: 56px; padding: 0 28px; font-size: 17px; }

/* ── Gallery ───────────────────────────────────────────────────────────── */
.gallery { padding: 0 0 clamp(48px, 6vw, 80px); }

/* mini hero — a 2-line statement, nothing more */
.byline { padding: clamp(40px, 5.5vw, 68px) 0 clamp(22px, 3vw, 38px); max-width: 880px; }
.byline h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 8vw, 84px); line-height: 0.98;
  letter-spacing: -0.015em; margin: 0; text-wrap: balance;
}
/* keep the lead + accent ("满足你的一切幻想。" / "Follow your fantasy.") on one line */
.byline h1 .l1 { white-space: nowrap; }
.byline h1 em { display: block; white-space: normal; font-style: italic; color: var(--fg-2); font-size: clamp(22px, 2.9vw, 36px); line-height: 1.1; margin-top: 12px; }
.byline h1 .accent { color: var(--accent); font-style: italic; }

/* divider above waterfall */
.gal-divider {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 0 0 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13.5px; color: var(--fg-2); letter-spacing: 0.04em;
}
.gal-divider .lbl::before { content: "// "; color: var(--accent); }

/* Waterfall via CSS columns. Desktop count is 4; breakpoints clamp it down. */
.waterfall { column-count: var(--cols); column-gap: 16px; }
@media (max-width: 1180px) { .site { --cols: 3; } }
@media (max-width: 760px)  { .site { --cols: 2; } }
@media (max-width: 420px)  { .site { --cols: 1; } }

.card {
  break-inside: avoid; margin-bottom: 16px;
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer; overflow: hidden;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  border-color: var(--line-2); transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}

.card .portrait { position: relative; overflow: hidden; background: #050507; border-bottom: 1px solid var(--line); }
.card .portrait svg, .card .portrait img { width: 100%; height: 100%; display: block; }

.card .ptop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 8px;
}
.badge-mp4 {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(10,10,15,0.7); border: 1px solid var(--line-2); color: var(--fg-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge-mp4 .tri { width: 0; height: 0; border-left: 6px solid var(--accent); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }

/* usage chip over bottom-left of portrait */
.card .uses {
  position: absolute; left: 8px; bottom: 8px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; white-space: nowrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--fg);
  background: rgba(10,10,15,0.66); border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-feature-settings: "tnum"; letter-spacing: 0.02em;
}
.card .uses .ico { color: var(--accent); display: inline-flex; }

.card .body { padding: 12px 13px 4px; display: flex; flex-direction: column; gap: 7px; }
.card .name {
  font-family: var(--serif); font-size: 26px; line-height: 1.04; color: var(--fg);
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}

.card .uploader {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--fg-3);
}
.card .uploader .av {
  width: 16px; height: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 11px; color: var(--fg);
  background: var(--bg-4); border: 1px solid var(--line-2);
}
.card .uploader .at { color: var(--fg-2); }

.card .summary {
  font-family: var(--serif); font-style: italic; font-size: 15.5px; line-height: 1.42;
  color: var(--fg-2); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.card .tag {
  font-family: var(--mono); font-size: 10.5px; padding: 2px 6px;
  border: 1px solid var(--line); color: var(--fg-3); letter-spacing: 0.04em;
}

.card .foot {
  margin-top: 10px; border-top: 1px solid var(--line);
  padding: 9px 13px; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-3);
  letter-spacing: 0.02em; font-feature-settings: "tnum";
}
.card .foot .size { color: var(--fg-2); display: inline-flex; align-items: center; gap: 5px; }
.card .foot .size .ic { color: var(--fg-3); display: inline-flex; }
.card .foot .get {
  color: var(--fg-2); display: inline-flex; align-items: center; gap: 5px;
  transition: gap 140ms ease, color 140ms ease;
}
.card:hover .foot .get { gap: 8px; color: var(--accent); }

/* animated (mp4) portrait — subtle drift to imply a loop */
@media (prefers-reduced-motion: no-preference) {
  .card.is-animated .portrait svg { animation: drift 9s ease-in-out infinite alternate; transform-origin: 50% 45%; }
}
@keyframes drift { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.10) translateY(-2%); } }

/* ── CTA band ──────────────────────────────────────────────────────────── */
.cta {
  position: relative; margin-top: 8px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(720px 380px at 50% 120%, rgba(229,72,77,0.10), transparent 60%),
    radial-gradient(640px 320px at 50% -20%, rgba(232,183,82,0.07), transparent 60%),
    var(--bg-2);
}
.cta .wrap { padding: clamp(56px, 8vw, 110px) var(--gut); text-align: center; }
.cta .eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.cta h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 6vw, 76px);
  line-height: 1.0; letter-spacing: -0.015em; margin: 0 auto; max-width: 16em; text-wrap: balance;
}
.cta h2 em { font-style: italic; color: var(--fg-2); }
.cta p {
  font-family: var(--serif); font-size: clamp(18px, 2.1vw, 23px); color: var(--fg-2);
  margin: 22px auto 0; max-width: 32em; line-height: 1.5; text-wrap: pretty;
}
.cta .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.cta-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.cta-meta span {
  font-family: var(--mono); font-size: 12px; color: var(--fg-2);
  border: 1px solid var(--line-2); padding: 6px 11px; letter-spacing: 0.04em;
}
.cta .bothandle {
  font-family: var(--mono); font-size: 13.5px; color: var(--fg-3);
  margin-top: 22px; letter-spacing: 0.04em;
}
.cta .bothandle b { color: var(--accent); font-weight: 500; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.foot-site { border-top: 1px solid var(--line); }
.foot-site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 28px var(--gut); flex-wrap: wrap;
}
.foot-site .l { display: flex; align-items: center; gap: 12px; }
.foot-site .torii { color: var(--accent); display: inline-flex; }
.foot-site .copy { font-family: var(--mono); font-size: 13.5px; color: var(--fg-2); letter-spacing: 0.04em; }
.foot-site .links { display: flex; align-items: center; gap: 20px; }
.foot-site .links a { font-family: var(--mono); font-size: 13.5px; color: var(--fg-2); transition: color 140ms ease; }
.foot-site .links a:hover { color: var(--fg); }
.foot-site .lang-toggle { height: 32px; }
.foot-site .lang-toggle button { min-width: 38px; font-size: 13px; }
.foot-ascii { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.2em; text-align: center; padding: 8px 0 30px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .nav .brand .dom { display: none; }
}
