/* ======================================================================
   UNFAZED — unfz.org
   Soft watercolour, frosted glass, deep plum ink. Calm and unbothered.
   ====================================================================== */

@property --glow { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  color-scheme: light;

  --ink:   #2a1e48;
  --ink-2: #4a3c70;
  --ink-3: #7a6c9e;
  --ink-4: #a79cc4;

  --glass:   rgba(255, 255, 255, .40);
  --glass-2: rgba(255, 255, 255, .62);
  --glass-3: rgba(255, 255, 255, .80);
  --edge:    rgba(255, 255, 255, .58);
  --edge-2:  rgba(255, 255, 255, .85);
  --shadow:  0 1px 0 rgba(255,255,255,.7) inset, 0 20px 50px -24px rgba(58, 34, 110, .55);

  --violet: #7a5cc8;
  --violet-2: #9b7fe0;
  --pink:   #e39fd1;
  --pink-2: #f4c9e7;

  --r-owner: #e9b43c;
  --r-admin: #f06c8f;
  --r-helper: #3fbfae;
  --r-mvp: #f39a2b;
  --r-member: #9a86de;

  --s-online: #2fb97e;
  --s-idle: #eaa92a;
  --s-dnd: #e8505f;
  --s-offline: #9c93b6;

  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --soft: cubic-bezier(.4, 0, .2, 1);

  --pad: clamp(16px, 4.5vw, 44px);
  --maxw: 1180px;
  --mascot-w: clamp(250px, 22vw, 360px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ================================================================= base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  font: 500 15.5px/1.55 var(--sans);
  color: var(--ink);
  background: #9a7fc9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--pink); color: var(--ink); }

/* =============================================================== ground */
.ground { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.wash {
  position: absolute; inset: -6%;
  background: url("/assets/bg.webp") center / cover no-repeat;
  transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px), 0) scale(1.04);
  animation: settle 2.2s var(--ease) both, drift 60s ease-in-out 2.2s infinite alternate;
  will-change: transform;
}
@keyframes settle { from { opacity: 0; filter: blur(18px) saturate(.6); transform: scale(1.12); } }
@keyframes drift { to { background-position: 54% 46%; } }
@media (max-width: 760px) { .wash { background-image: url("/assets/bg-m.webp"); } }

.bloom { position: absolute; border-radius: 50%; mix-blend-mode: soft-light; filter: blur(60px); }
.b1 {
  width: 55vmax; height: 55vmax; left: 30%; top: -18%;
  background: radial-gradient(closest-side, rgba(255, 220, 245, .95), transparent);
  animation: breathe 14s ease-in-out infinite;
}
.b2 {
  width: 45vmax; height: 45vmax; right: -12%; bottom: -20%;
  background: radial-gradient(closest-side, rgba(90, 60, 170, .9), transparent);
  animation: breathe 18s ease-in-out 3s infinite reverse;
}
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.12); } }

.drops { position: absolute; inset: 0; width: 100%; height: 100%; }
.paper {
  position: absolute; inset: 0; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .7 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

/* ============================================================ glass kit */
.glass-panel, .nav, .card, .tool, .sheet, .viewer, .bubble, .toast {
  background: var(--glass);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px;
  font: 700 15px/1 var(--sans); letter-spacing: .01em; white-space: nowrap;
  transition: transform .5s var(--ease), box-shadow .4s var(--soft), background .3s var(--soft);
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #8a6be0 0%, #b56ed1 55%, #e493c7 100%);
  box-shadow: 0 14px 30px -12px rgba(110, 60, 190, .8), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary::after {                                        /* light sweep */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn.primary:hover::after { transform: translateX(120%); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 20px 38px -12px rgba(110, 60, 190, .9), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.glass { background: var(--glass-2); border: 1px solid var(--edge-2); color: var(--ink); backdrop-filter: blur(16px); }
.btn.glass:hover { background: var(--glass-3); transform: translateY(-2px); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.95);
  text-shadow: 0 1px 12px rgba(60, 30, 120, .45);
}
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.28), 0 0 14px #fff; }

/* ================================================================== nav */
.nav {
  position: fixed; z-index: 60; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 28px), 1240px); height: 62px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 10px 0 16px; border-radius: 22px;
  animation: drop-in 1.1s var(--ease) .15s both;
}
@keyframes drop-in { from { opacity: 0; transform: translate(-50%, -24px); } }
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  font: 800 16px/1 var(--display); color: #fff;
  background: linear-gradient(135deg, #e7b3e0, #7f64c4);
  box-shadow: 0 6px 16px -6px rgba(110, 60, 190, .8), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .6s var(--spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text { font: 800 16px/1 var(--display); letter-spacing: .08em; }

.tabs { position: relative; display: flex; gap: 2px; padding: 5px; border-radius: 16px; background: rgba(255,255,255,.28); }
.tabs a {
  position: relative; z-index: 1; padding: 9px 18px; border-radius: 12px;
  font-weight: 700; font-size: 14.5px; color: var(--ink-2); transition: color .3s var(--soft);
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tab-ink {
  position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: 12px;
  width: var(--w, 0); transform: translateX(var(--x, 0));
  background: var(--glass-3); box-shadow: 0 4px 14px -4px rgba(80, 40, 150, .35), inset 0 1px 0 #fff;
  transition: transform .65s var(--spring), width .65s var(--spring);
}
.tab-ink.snap { transition: none; }

.nav-r { justify-self: end; display: flex; align-items: center; gap: 10px; }
.visits { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; height: 38px; border-radius: 12px; font: 600 13px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.visits svg { width: 17px; height: 17px; fill: currentColor; opacity: .75; }
.me { display: flex; align-items: center; gap: 8px; }
.me .btn { height: 42px; }
.me-chip { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 6px 0 5px; border-radius: 14px; background: rgba(255,255,255,.35); transition: background .3s; }
.me-chip:hover { background: rgba(255,255,255,.6); }
.me-chip img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }
.me-chip b { font-weight: 700; font-size: 13.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip .rank-ico { width: 16px; height: 16px; }
.me-menu { position: absolute; top: 70px; right: 10px; min-width: 190px; padding: 6px; border-radius: 16px; background: var(--glass-3); border: 1px solid var(--edge-2); box-shadow: var(--shadow); backdrop-filter: blur(22px); animation: pop .35s var(--ease); }
.me-menu a, .me-menu button { display: flex; width: 100%; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; text-align: left; }
.me-menu a:hover, .me-menu button:hover { background: rgba(122, 92, 200, .12); }

/* ================================================================ pages */
main { position: relative; z-index: 2; }
.page { min-height: 100dvh; }
.page:not([hidden]) { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(page) { animation: vt-out .35s var(--soft) both; }
::view-transition-new(page) { animation: vt-in .8s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; filter: blur(8px); transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; filter: blur(12px); transform: translateY(14px) scale(1.01); } }

.js [data-in] { opacity: 0; }
.page.in [data-in] { opacity: 1; animation: rise 1.1s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
.page.done [data-in] { animation: none; opacity: 1; }
[data-in="1"]{--i:1} [data-in="2"]{--i:2} [data-in="3"]{--i:3} [data-in="4"]{--i:4} [data-in="5"]{--i:5} [data-in="6"]{--i:6}
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(8px); } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 120px var(--pad) 140px; }
.head { margin-bottom: 30px; }
.title {
  margin-top: 14px; font: 800 clamp(2.6rem, 7vw, 4.6rem)/.95 var(--display); letter-spacing: -.035em;
  color: #fff; text-shadow: 0 2px 30px rgba(60, 30, 120, .35);
}
.sub { margin-top: 12px; font: italic 400 clamp(1.15rem, 2.4vw, 1.45rem)/1.35 var(--serif); color: rgba(255,255,255,.95); text-shadow: 0 1px 14px rgba(60, 30, 120, .45); }

/* ================================================================= home */
.page-home { display: grid; align-items: center; }
/* The hero takes everything to the right of the mascot. */
.hero {
  width: 100%;
  padding: 130px var(--pad) 120px calc(var(--mascot-w) + clamp(24px, 4vw, 64px));
  container-type: inline-size;
}
/* "UNFAZED" measures 5.87em wide in Unbounded 800, so sizing the type to the
   space it has (÷ 6.1) makes it fit exactly at every width. */
.word {
  margin-top: 18px; display: flex; flex-wrap: nowrap;
  font: 800 min(8.4rem, calc(100cqi / 6.1))/.9 var(--display); letter-spacing: -.045em;
}
.word .l {
  display: inline-block; position: relative;
  background: linear-gradient(180deg, #ffffff 30%, #f2e3fb 70%, #e0c6f5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(70, 35, 140, .35));
}
.js .word .l { opacity: 0; }
.page.in .word .l { opacity: 1; animation: ink 1.5s var(--ease) backwards; animation-delay: calc(var(--k) * 85ms + 250ms); }
.page.done .word .l { animation: none; opacity: 1; }
@keyframes ink {                                                /* letters develop like ink on wet paper */
  0% { opacity: 0; transform: translateY(.3em) scale(.92); filter: blur(22px) drop-shadow(0 4px 24px rgba(70,35,140,0)); }
  55% { opacity: 1; filter: blur(2px) drop-shadow(0 4px 24px rgba(70,35,140,.35)); }
}
.stroke { display: block; width: min(100%, 560px); height: 18px; margin-top: 8px; overflow: visible; }
.stroke path { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 700; filter: drop-shadow(0 2px 8px rgba(70,35,140,.4)); }
.page.in .stroke path { animation: draw 1.6s var(--ease) 1.05s forwards; }
.page.done .stroke path { stroke-dashoffset: 0; animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.tagline { margin-top: 22px; max-width: 30ch; font: italic 400 clamp(1.35rem, 2.8vw, 1.9rem)/1.3 var(--serif); color: #fff; text-shadow: 0 1px 18px rgba(60, 30, 120, .5); }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.stats { margin-top: 44px; display: flex; gap: clamp(20px, 5vw, 46px); }
.stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.stats dt { font: 600 11px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.stats dd { font: 800 clamp(1.7rem, 3.4vw, 2.3rem)/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 18px rgba(60, 30, 120, .4); }

/* ============================================================== members */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.legend span {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 9px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge); font-weight: 700; font-size: 13px; backdrop-filter: blur(14px);
}
.rank-ico { width: 18px; height: 18px; flex: none; }

.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 14px; }
.card {
  position: relative; border-radius: 22px; overflow: hidden;
  transition: transform .6s var(--ease), box-shadow .5s var(--soft), background .4s var(--soft);
}
.card:hover { transform: translateY(-5px); background: var(--glass-2); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 28px 60px -24px rgba(58, 34, 110, .7); }
.js .members .card, .js .grid .post { opacity: 0; }
.members .card.show, .grid .post.show { opacity: 1; animation: card-in .9s var(--ease) backwards; animation-delay: calc(var(--n, 0) * 55ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.97); filter: blur(6px); } }

.member { display: flex; align-items: center; gap: 14px; padding: 16px; }
.member::before {                                              /* rank-tinted wash */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in oklab, var(--rc) 28%, transparent), transparent 60%);
}
.av { position: relative; flex: none; width: 58px; height: 58px; }
.av img { width: 58px; height: 58px; border-radius: 18px; object-fit: cover; background: rgba(255,255,255,.5); box-shadow: 0 6px 16px -6px rgba(40, 20, 90, .5); }
.st {
  position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%;
  border: 3.5px solid #efe6fa; background: var(--s-offline);
}
.st[data-s="online"] { background: var(--s-online); }
.st[data-s="online"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--s-online); animation: ping 2.4s var(--soft) infinite; }
@keyframes ping { from { opacity: .8; transform: scale(.7); } to { opacity: 0; transform: scale(2); } }
.st[data-s="idle"] { background: var(--s-idle); }
.st[data-s="dnd"] { background: var(--s-dnd); }
.m-text { position: relative; min-width: 0; }
.m-name { display: flex; align-items: center; gap: 6px; font: 700 16.5px/1.2 var(--sans); }
.m-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-meta { margin-top: 4px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.m-rank { padding: 2px 8px; border-radius: 999px; font: 600 10px/1.6 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--rc); }
.m-arrow { position: absolute; top: 14px; right: 14px; font-size: 16px; color: var(--ink-3); opacity: 0; transform: translate(-4px, 4px); transition: .4s var(--ease); }
.card:hover .m-arrow { opacity: 1; transform: none; }

.empty {
  grid-column: 1 / -1; padding: 60px 24px; border-radius: 24px; text-align: center;
  background: var(--glass); border: 1px dashed var(--edge-2); backdrop-filter: blur(16px);
}
.empty b { display: block; font: 700 18px/1.3 var(--display); margin-bottom: 6px; }
.empty p { color: var(--ink-2); }

/* ================================================================ board */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.tool { display: flex; align-items: center; border-radius: 16px; }
.search { flex: 1 1 240px; height: 48px; padding: 0 16px; gap: 10px; }
.search svg { width: 18px; height: 18px; fill: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-weight: 600; }
.search input::placeholder { color: var(--ink-3); }
.sort { padding: 5px; gap: 2px; height: 48px; }
.sort button { height: 38px; padding: 0 13px; border-radius: 12px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); transition: background .3s, color .3s; }
.sort button[aria-pressed="true"] { background: var(--glass-3); color: var(--ink); box-shadow: 0 4px 12px -5px rgba(80, 40, 150, .4); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge); font-weight: 700; font-size: 13px; color: var(--ink-2);
  backdrop-filter: blur(14px); transition: transform .35s var(--spring), background .3s, color .3s, border-color .3s;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--violet)); }
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-pressed="true"] i { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.post { cursor: pointer; }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #cdb8ef, #e9c6e6); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .6s; }
.post:hover .thumb img { transform: scale(1.06); }
.play {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.85); box-shadow: 0 10px 30px -8px rgba(40, 20, 90, .6);
  backdrop-filter: blur(8px); transition: transform .55s var(--spring);
}
.play svg { width: 22px; height: 22px; fill: var(--violet); margin-left: 3px; }
.post:hover .play { transform: scale(1.14); }
.prov { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px; font: 600 10px/1.5 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(30, 18, 60, .55); backdrop-filter: blur(8px); }
.p-body { padding: 13px 15px 15px; }
.p-title { font: 700 16px/1.3 var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-by { margin-top: 3px; font: italic 400 15px/1.3 var(--serif); color: var(--ink-2); }
.p-meta { margin-top: 10px; display: flex; align-items: center; gap: 12px; font: 600 12.5px/1 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.p-meta span { display: inline-flex; align-items: center; gap: 4px; }
.p-meta svg { width: 14px; height: 14px; fill: currentColor; }
.p-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.p-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.55); color: var(--ink-2); }
.p-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.more { display: flex; justify-content: center; margin-top: 26px; }
.skel { border-radius: 22px; aspect-ratio: 16 / 13; background: linear-gradient(100deg, rgba(255,255,255,.3) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,.3) 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================================================================ modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.scrim { position: absolute; inset: 0; background: rgba(40, 22, 80, .45); backdrop-filter: blur(10px); animation: fade .45s var(--soft) both; }
.modal.closing .scrim { animation: fade .3s var(--soft) reverse both; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(6px); } }
.x {
  position: absolute; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px -8px rgba(40, 20, 90, .6); transition: transform .5s var(--spring), background .3s;
}
.x svg { width: 18px; height: 18px; fill: var(--ink); }
.x:hover { transform: rotate(90deg); background: #fff; }

.viewer {
  position: relative; width: min(1180px, 100%); max-height: calc(100dvh - 48px);
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; border-radius: 28px; overflow: hidden;
  background: var(--glass-2); animation: pop .6s var(--ease) both;
}
.modal.closing .viewer, .modal.closing .sheet { animation: pop .28s var(--soft) reverse both; }
.v-media { position: relative; background: #140d26; display: grid; place-items: center; min-height: 320px; }
.v-media img, .v-media video { width: 100%; height: 100%; max-height: calc(100dvh - 48px); object-fit: contain; }
.v-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.v-media .tall { aspect-ratio: 9 / 16; width: auto; height: min(78dvh, 720px); }
.v-side { display: flex; flex-direction: column; padding: 22px 22px 18px; overflow-y: auto; max-height: calc(100dvh - 48px); }
.v-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.v-title { margin-top: 10px; padding-right: 44px; font: 800 22px/1.2 var(--display); letter-spacing: -.02em; }
.v-by { margin-top: 6px; font: italic 400 17px/1.3 var(--serif); color: var(--ink-2); }
.v-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.6); }
.vote {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 13px;
  background: rgba(255,255,255,.6); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums;
  transition: transform .45s var(--spring), background .3s, color .3s;
}
.vote svg { width: 18px; height: 18px; fill: currentColor; }
.vote:hover { transform: translateY(-2px); background: #fff; }
.vote:active { transform: scale(.94); }
.vote.up[aria-pressed="true"] { background: #2fb97e; color: #fff; }
.vote.down[aria-pressed="true"] { background: #e8505f; color: #fff; }
.burst { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; animation: burst .7s var(--ease) forwards; }
@keyframes burst { to { transform: translate(var(--bx), var(--by)) scale(0); opacity: 0; } }
.v-views { font-weight: 700; font-size: 13.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.v-views svg { width: 16px; height: 16px; fill: currentColor; }
.v-source { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--violet); }
.v-admin { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.6); }

.comments { margin-top: 16px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.comments h4 { font: 700 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.comments h4 span { color: var(--ink-3); }
.c-list { list-style: none; margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.c { display: flex; gap: 10px; animation: rise .6s var(--ease) backwards; }
.c img { width: 32px; height: 32px; border-radius: 10px; flex: none; object-fit: cover; background: rgba(255,255,255,.6); }
.c-b { min-width: 0; flex: 1; }
.c-h { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.c-h b { font-weight: 800; }
.c-h time { font-size: 12px; color: var(--ink-3); }
.c-h button { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.c-h button:hover { color: #d33c55; }
.c-t { margin-top: 2px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.c-none { color: var(--ink-3); font-size: 14px; }
.c-form { display: flex; gap: 8px; align-items: flex-end; margin-top: auto; }
.c-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--edge); background: rgba(255,255,255,.72); outline: none; font-weight: 500; }
.c-form textarea:focus { border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(155, 127, 224, .2); }
.c-gate { margin-top: auto; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.55); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.c-gate a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }

/* ================================================================ sheet */
.sheet {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: 28px; border-radius: 28px; background: var(--glass-3);
  display: flex; flex-direction: column; gap: 16px; animation: pop .6s var(--ease) both;
}
.sheet h3 { font: 800 24px/1.1 var(--display); letter-spacing: -.02em; padding-right: 40px; }
.k-sub { margin-top: -8px; font: italic 400 17px/1.35 var(--serif); color: var(--ink-2); }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 16px; background: rgba(122, 92, 200, .12); }
.seg button { height: 42px; border-radius: 12px; font-weight: 800; font-size: 14.5px; color: var(--ink-2); transition: background .35s var(--ease), color .3s, box-shadow .3s; }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 6px 16px -8px rgba(80, 40, 150, .6); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font: 600 11.5px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.field input { height: 48px; padding: 0 15px; border-radius: 14px; border: 1px solid rgba(122, 92, 200, .22); background: rgba(255,255,255,.85); outline: none; font-weight: 600; transition: border-color .25s, box-shadow .25s; }
.field input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(155, 127, 224, .2); }
.k-hint { margin-top: -4px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(122, 92, 200, .2); }
.k-src { display: flex; flex-direction: column; gap: 12px; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px; border-radius: 18px; cursor: pointer; text-align: center;
  border: 2px dashed rgba(122, 92, 200, .3); background: rgba(255,255,255,.5); transition: border-color .3s, background .3s, transform .4s var(--spring);
}
.drop:hover, .drop.over { border-color: var(--violet); background: rgba(255,255,255,.85); transform: scale(1.01); }
.drop b { font-weight: 800; }
.drop span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.k-preview { position: relative; border-radius: 16px; overflow: hidden; background: #140d26; aspect-ratio: 16 / 9; }
.k-preview img, .k-preview video, .k-preview iframe { width: 100%; height: 100%; object-fit: contain; border: 0; }
.k-preview .clear { position: absolute; top: 8px; right: 8px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.9); font-weight: 800; font-size: 12.5px; }
.k-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.k-tags .chip { height: 32px; }
.k-tags .none { font-size: 13.5px; color: var(--ink-3); }
.k-msg { min-height: 0; font-weight: 700; font-size: 14px; color: #c9344d; }
.k-msg:empty { display: none; }
.k-msg.ok { color: #1f9a66; }
.k-bar { height: 5px; border-radius: 5px; background: rgba(122, 92, 200, .15); overflow: hidden; }
.k-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--pink)); transition: width .2s; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ================================================================ mascot */
.mascot {
  position: fixed; left: 0; bottom: 0; z-index: 40; width: var(--mascot-w); pointer-events: none;
  transform-origin: 0 100%; transition: transform 1s var(--ease);
}
/* Off the landing page she tucks down to a peek — just her head over the
   corner — so she never covers a card. Talking to her brings her back up.
   Her head is the top ~35% of the art: at half size, drop by 50% - 17.5%. */
body:not([data-page="home"]) .mascot:not(.up) { transform: translateY(33%) scale(.5); }
body:not([data-page="home"]) .mascot-hint { display: none; }
body:not([data-page="home"]) .mascot:not(.up) .mascot-btn:hover { transform: translateY(-6px) !important; transition: transform .45s var(--spring); }
.mascot-btn { display: block; width: 100%; pointer-events: auto; cursor: pointer; transform-origin: 40% 100%; }
.mascot-img {
  width: 100%; height: auto; transform-origin: 45% 100%;
  filter: drop-shadow(0 18px 30px rgba(50, 25, 110, .45));
  animation: enter 1.6s var(--ease) .5s backwards, idle 6s ease-in-out 2.1s infinite;
  transition: filter .5s var(--soft);
}
.mascot-btn:hover .mascot-img { filter: drop-shadow(0 18px 34px rgba(50, 25, 110, .55)) brightness(1.04); }
@keyframes enter { from { opacity: 0; transform: translate(-40px, 60px) rotate(-4deg); filter: blur(10px); } }
@keyframes idle {                                              /* breathing, plus a slow weight shift */
  0%, 100% { transform: translateY(0) rotate(0) scaleY(1); }
  25% { transform: translateY(-3px) rotate(-.6deg) scaleY(1.008); }
  50% { transform: translateY(0) rotate(0) scaleY(1); }
  75% { transform: translateY(-2px) rotate(.5deg) scaleY(1.006); }
}
.mascot.poke .mascot-img { animation: poke .7s var(--spring); }
@keyframes poke { 30% { transform: translateY(-14px) rotate(-2deg) scale(1.02); } 60% { transform: translateY(2px); } }

.mascot-hint {
  position: absolute; left: 68%; top: 9%; z-index: 2; white-space: nowrap;
  padding: 8px 13px; border-radius: 14px 14px 14px 4px; background: #fff; color: var(--ink);
  font: italic 400 17px/1 var(--serif); box-shadow: 0 10px 24px -10px rgba(50, 25, 110, .6);
  animation: hint 1s var(--spring) 3.2s backwards, bob 3s ease-in-out 4.2s infinite;
}
@keyframes hint { from { opacity: 0; transform: translateY(8px) scale(.8); } }
@keyframes bob { 50% { transform: translateY(-5px); } }

.bubble {
  position: absolute; left: 70%; bottom: 72%; z-index: 3; width: min(340px, 42vw); pointer-events: auto;
  padding: 18px 18px 16px; border-radius: 22px 22px 22px 6px; background: rgba(255,255,255,.88);
  transform-origin: 0% 100%; animation: speak .55s var(--spring) both;
}
@keyframes speak { from { opacity: 0; transform: scale(.6) translateY(20px); } }
.bubble.leaving { animation: speak .25s var(--soft) reverse both; }
.bubble-name { font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--violet); margin-bottom: 8px; }
.bubble-name:empty { display: none; }
.bubble-text { font: 500 15.5px/1.5 var(--sans); min-height: 3em; padding-right: 18px; }
.bubble-text .caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--violet); animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bubble-opts { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.bubble-opts button, .bubble-opts a {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 13px; text-align: left;
  font-weight: 700; font-size: 14px; background: rgba(122, 92, 200, .1); color: var(--ink);
  transition: background .25s, transform .35s var(--spring); animation: rise .5s var(--ease) backwards;
}
.bubble-opts button:hover, .bubble-opts a:hover { background: rgba(122, 92, 200, .2); transform: translateX(4px); }
.bubble-opts .go { background: linear-gradient(135deg, #8a6be0, #d17fc8); color: #fff; }
.bubble-opts .go:hover { background: linear-gradient(135deg, #7a5bd0, #c46fb8); }
.bubble-opts svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.bubble-x { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; color: var(--ink-3); }
.bubble-x:hover { background: rgba(122, 92, 200, .12); color: var(--ink); }

.dc-fab {
  position: fixed; left: 14px; bottom: calc(86px + var(--safe-b)); z-index: 45;
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px;
  font-weight: 800; font-size: 14.5px; color: #fff;
  background: linear-gradient(135deg, #5865f2, #8a6be0);
  box-shadow: 0 14px 30px -12px rgba(60, 50, 180, .85), inset 0 1px 0 rgba(255,255,255,.35);
  animation: enter 1s var(--ease) .8s backwards;
}
.dc-fab svg { width: 22px; height: 22px; fill: #fff; }
/* Off the home page it shrinks to a round icon on the right, clear of card titles. */
body:not([data-page="home"]) .dc-fab { left: auto; right: 14px; width: 48px; padding: 0; justify-content: center; }
body:not([data-page="home"]) .dc-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ================================================================ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); z-index: 200; transform: translate(-50%, 30px);
  padding: 12px 18px; border-radius: 16px; background: rgba(255,255,255,.9); font-weight: 700; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--soft), transform .55s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { color: #b8243e; }

/* ================================================================ mobile */
@media (max-width: 1080px) {
  :root { --mascot-w: clamp(210px, 24vw, 280px); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  /* The tab bar below is position: fixed inside the nav. A transform or a
     backdrop-filter on the nav would make it the bar's containing block and
     pin the bar to the nav instead of the screen, so on phones the nav's
     glass lives on a pseudo-element and it animates with opacity only. */
  .nav {
    top: 10px; left: 10px; right: 10px; width: auto; height: 56px; transform: none;
    grid-template-columns: 1fr auto; padding: 0 8px 0 12px; border-radius: 18px;
    background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    animation: nav-fade .9s var(--ease) .15s both;
  }
  .nav::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  }
  .tabs {                                                       /* thumb-reach tab bar */
    position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
    width: min(calc(100% - 24px), 440px); justify-content: space-between; padding: 5px; border-radius: 20px;
    background: rgba(255,255,255,.55); border: 1px solid var(--edge); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(160%);
  }
  .tabs a { flex: 1; text-align: center; padding: 11px 6px; font-size: 13.5px; }
  .visits { padding: 0 8px; }
  .me-chip b { display: none; }
  .hero { padding: 108px var(--pad) 170px; }
  .stats { margin-top: 34px; }
  .wrap { padding: 96px var(--pad) 170px; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .sort { flex: 1; }
  .toolbar .sort button { flex: 1; padding: 0 6px; }
  .grid { grid-template-columns: 1fr; }
  .members { grid-template-columns: 1fr; }
  .modal { padding: 0; place-items: end stretch; }
  .viewer { grid-template-columns: 1fr; max-height: 100dvh; border-radius: 26px 26px 0 0; overflow-y: auto; }
  .v-side { max-height: none; overflow: visible; padding-bottom: calc(22px + var(--safe-b)); }
  .v-media img, .v-media video { max-height: 58dvh; }
  .v-media .tall { height: 64dvh; }
  .sheet { width: 100%; border-radius: 26px 26px 0 0; padding: 24px 20px calc(24px + var(--safe-b)); max-height: 94dvh; }
}
@keyframes nav-fade { from { opacity: 0; } }
@media (min-width: 761px) { .dc-fab { display: none !important; } }
@media (max-width: 760px) { .mascot { display: none !important; } }

@media (hover: none) { .card:hover, .post:hover .thumb img { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-in], .js .word .l, .js .members .card, .js .grid .post { opacity: 1; }
  .stroke path { stroke-dashoffset: 0; }
}
