/* Spermbook skin: silk background, chrome mascot, floating panels.
   Loaded after style.css and overrides its flat surfaces. */

:root {
  --bg: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e8eef7;
  --line: #e6ecf4;
  --line-2: #d3dbe7;
  --text: #121620;
  --text-2: #3d4554;
  --muted: #6d7686;
  --muted-2: #9aa3b2;
  --ink: #171c28;
  --steel: #8b95a6;
  --steel-deep: #515b6c;
  --radius: 20px;
  --radius-lg: 26px;
  --shadow-card: 0 1px 2px rgba(18, 26, 48, 0.04), 0 18px 40px -28px rgba(18, 26, 48, 0.35);
  --shadow-float: 0 30px 70px -36px rgba(18, 26, 48, 0.45);
  --strip-h: 72px;
  --rail-w: 252px;
  --script: 'Caveat', var(--font);
}

:root[data-theme='dark'] {
  --bg: #0e1118;
  --surface: rgba(24, 29, 40, 0.92);
  --surface-2: #1b2130;
  --surface-3: #232a3a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f6;
  --text-2: #c2c9d6;
  --muted: #8e97a7;
  --muted-2: #6d7686;
  --ink: #f2f5fa;
  --chrome: linear-gradient(180deg, #4c5568 0%, #39404f 45%, #2a3140 100%);
  --chrome-soft: linear-gradient(180deg, #232a39 0%, #1b2231 100%);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -28px rgba(0, 0, 0, 0.8);
}

/* ------------------------------------------------------------- backdrop */

body {
  background: var(--bg);
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 18% 12%, #ffffff 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 70% at 88% 18%, #f4f8ff 0%, rgba(244, 248, 255, 0) 60%),
    radial-gradient(120% 90% at 70% 95%, #dfe8f6 0%, rgba(223, 232, 246, 0) 60%),
    linear-gradient(155deg, #f8fbff 0%, #eaf0f9 45%, #e2eaf6 100%);
}

:root[data-theme='dark'] .backdrop {
  background:
    radial-gradient(120% 80% at 18% 12%, #1b2333 0%, rgba(27, 35, 51, 0) 55%),
    radial-gradient(90% 70% at 88% 18%, #161d2b 0%, rgba(22, 29, 43, 0) 60%),
    linear-gradient(155deg, #10141d 0%, #0d1119 60%, #0b0e15 100%);
}

/* silk folds */
.backdrop::before,
.backdrop::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.85;
}

.backdrop::before {
  width: 780px; height: 520px;
  left: -140px; top: -120px;
  background: radial-gradient(closest-side, #ffffff, rgba(255, 255, 255, 0));
}

.backdrop::after {
  width: 900px; height: 600px;
  right: -180px; bottom: -220px;
  background: radial-gradient(closest-side, #ffffff, rgba(255, 255, 255, 0));
  opacity: 0.6;
}

:root[data-theme='dark'] .backdrop::before,
:root[data-theme='dark'] .backdrop::after { opacity: 0.12; }

/* floating chrome beads */
.bead {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, #e8ecf2 22%, #aab3c1 55%, #767f8d 78%, #d7dde5 100%);
  box-shadow: 0 10px 20px -10px rgba(20, 30, 55, 0.5), inset 0 -2px 6px rgba(255, 255, 255, 0.6);
  animation: drift 9s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-14px) }
}

.mascot-layer {
  position: fixed;
  left: calc(var(--rail-w) + 40px);
  top: 92px;
  width: 340px;
  height: 560px;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.mascot {
  width: 300px;
  height: auto;
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 40px 40px rgba(30, 45, 80, 0.18));
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg) }
  50% { transform: translateY(-16px) rotate(-1.5deg) }
}

.note {
  position: absolute;
  font-family: var(--script);
  font-size: 30px;
  line-height: 1.05;
  color: var(--steel-deep);
  transform: rotate(-4deg);
  white-space: pre-line;
}

:root[data-theme='dark'] .note { color: #aab4c6; }

.note-bubble {
  position: absolute;
  left: 214px;
  top: 30px;
  padding: 16px 22px 18px;
  background: var(--surface);
  border-radius: 22px 22px 22px 4px;
  box-shadow: var(--shadow-card);
  transform: rotate(-3deg);
}

.note-bubble .note { position: static; transform: none; }

.note-side {
  position: fixed;
  right: 48px;
  top: 300px;
  z-index: 1;
  text-align: center;
  transform: rotate(-6deg);
  display: none;
  pointer-events: none;
}

@media (min-width: 1500px) {
  .mascot-layer, .note-side { display: block; }
}

/* --------------------------------------------------------------- top row */

.strip {
  background: none;
  border: 0;
  justify-content: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 60;
}

.strip-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(760px, 100%);
  padding: 9px 14px 9px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: 12.5px;
  color: var(--text-2);
}

.strip-pill .strip-dot {
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fe;
  box-shadow: none;
  color: #3b7de0;
  font-size: 11px;
  font-weight: 700;
}

:root[data-theme='dark'] .strip-pill .strip-dot { background: #1d2941; }

.strip-link {
  border: 0;
  color: #3b7de0;
  font-weight: 600;
}

.strip-link::after { content: ' →'; }
.strip-link:hover { color: #2b64bd; }

.top-tools {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 61;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--muted);
  cursor: pointer;
}

.tool-btn:hover { color: var(--text); }
.tool-btn svg { width: 17px; height: 17px; }

.tool-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--steel-deep);
  background: var(--chrome);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-card);
}

/* ----------------------------------------------------------- app shell */

.shell {
  inset: var(--strip-h) 0 0 0;
  padding: 0 18px 18px;
  gap: 18px;
  background: none;
  z-index: 2;
}

.rail {
  width: var(--rail-w);
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

:root[data-theme='dark'] .rail { border-color: var(--line); }

.rail-head { border-bottom: 0; height: 64px; padding: 0 18px; }
.wordmark { font-size: 19px; }
.rail-nav { padding: 4px 12px 18px; }

.nav-item, .nav-channel { height: 38px; border-radius: 12px; font-size: 14px; }
.nav-item.is-on { background: #eaf1fe; color: #1f4fa6; }
:root[data-theme='dark'] .nav-item.is-on { background: #1c2740; color: #9dc0ff; }
.nav-item.is-on .ico { color: #3b7de0; }

.nav-primary {
  background: var(--chrome);
  box-shadow: inset 0 1px 0 #fff;
}

.nav-channel { font-size: 13.5px; }
.nav-channel em {
  min-width: 18px;
  text-align: right;
}

.nav-foot { border-top: 1px solid var(--line); margin: 0 4px; }

.scroller { z-index: 2; }

.column { padding-top: 26px; }

/* -------------------------------------------------------------- header */

.topbar {
  left: calc(var(--rail-w) + 36px);
  right: 18px;
  top: var(--strip-h);
  height: 64px;
  background: none;
  border: 0;
  backdrop-filter: none;
  justify-content: flex-end;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }
.topbar-title { display: none; }

.topbar .btn-ghost {
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.topbar .icon-btn {
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------- hero */

.hero { padding: 34px 0 20px; }
.hero h1 { font-size: 46px; line-height: 52px; letter-spacing: -1.6px; }
.hero-sub { font-size: 16px; line-height: 25px; max-width: 600px; }

.page-head h1 { font-size: 38px; line-height: 44px; letter-spacing: -1.2px; }

/* -------------------------------------------------------------- ask box */

.askbox form {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  padding: 18px 18px 12px;
}

:root[data-theme='dark'] .askbox form { border-color: var(--line); }

.askbox textarea { font-size: 15.5px; min-height: 58px; }
.askbox-foot { border-top: 1px solid var(--line); padding-top: 12px; }

.btn-primary {
  background: var(--ink);
  color: #f7f9fc;
  border-color: var(--ink);
  box-shadow: 0 10px 24px -14px rgba(18, 26, 48, 0.9);
  height: 40px;
  padding: 0 18px;
  border-radius: 14px;
}

.btn-primary:hover { filter: brightness(1.12); }
.btn-primary::after { content: ' →'; }
.btn-primary .btn-ico { color: currentColor; }

:root[data-theme='dark'] .btn-primary { background: #f0f3f8; color: #12161f; border-color: #f0f3f8; }

.chip {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  color: var(--text-2);
}

.chip:hover { border-color: var(--line-2); }
.chip.is-on { background: #eaf1fe; border-color: #cddefa; color: #1f4fa6; }
:root[data-theme='dark'] .chip.is-on { background: #1c2740; border-color: #2b3a5a; color: #9dc0ff; }

.chip-scroll { gap: 10px; margin-top: 14px; }
.chip-row .chip { height: auto; padding: 6px 14px; box-shadow: none; }

/* --------------------------------------------------------------- faces */

.faces { gap: 18px; padding: 10px 2px 14px; }
.face { width: 78px; font-size: 11.5px; }
.avatar {
  background:
    radial-gradient(circle at 34% 26%, #ffffff 0%, #eef1f6 26%, #c4cbd6 58%, #98a1af 82%, #e3e7ed 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px -14px rgba(20, 30, 55, 0.7), inset 0 -2px 5px rgba(255, 255, 255, 0.7);
  color: #3f485a;
}

.avatar-md { width: 46px; height: 46px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; }

/* --------------------------------------------------------------- blocks */

.stats {
  border: 0;
  background: none;
  padding: 10px 0 22px;
  gap: 0;
}

.stat + .stat { border-left: 1px solid var(--line); }
.stat-n { font-size: 32px; line-height: 38px; letter-spacing: -1px; }
.stat-l { font-size: 12.5px; color: var(--muted); }

.promo, .card, .note-card, .faq details, .empty {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

:root[data-theme='dark'] .promo,
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .note-card,
:root[data-theme='dark'] .faq details { border-color: var(--line); }

.promo { padding: 18px 20px; }
.promo strong { font-size: 15px; }

.section-head { margin: 34px 0 14px; }
.section-head h2 { font-size: 24px; letter-spacing: -0.7px; }
.section-action::after { content: ' →'; }

.feed-controls { background: none; backdrop-filter: blur(6px); padding: 12px 4px; }
.tabs { gap: 6px; }
.tab { height: 36px; padding: 0 16px; }
.tab.is-on { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-card); }

.card { padding: 20px; margin-bottom: 14px; }
.card-title { font-size: 17px; line-height: 24px; }
.react { height: 30px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.react.is-on { background: #eaf1fe; color: #1f4fa6; border-color: #cddefa; }
:root[data-theme='dark'] .react.is-on { background: #1c2740; color: #9dc0ff; }
.tag { background: var(--surface-2); border-color: transparent; }

.btn-ghost { border-radius: 14px; height: 40px; }
.field input[type='number'] { height: 42px; border-radius: 12px; }
.opener, .takeaway, .derived, .notes li { border-radius: 16px; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 1100px) {
  .topbar { left: calc(var(--rail-w) + 30px); }
}

@media (max-width: 860px) {
  .shell { padding: 0 12px 12px; }
  .rail { position: fixed; inset: var(--strip-h) auto 12px 12px; height: auto; }
  .topbar { left: 12px; right: 12px; justify-content: space-between; }
  .topbar-mark { display: flex; }
  .hero h1 { font-size: 34px; line-height: 40px; }
  .page-head h1 { font-size: 30px; line-height: 36px; }
  .column { padding-top: 76px; }
  .top-tools { top: 16px; right: 12px; }
  .strip { justify-content: flex-start; padding: 0 12px; }
  .strip-pill { font-size: 11.5px; padding: 8px 12px; max-width: calc(100% - 96px); }
}

@media (max-width: 560px) {
  .strip-pill .strip-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .stats { gap: 12px; }
}

/* Wide screens: leave the mascot its own column so it never sits under the text */
@media (min-width: 1500px) {
  .scroller { padding-left: 300px; }
  .topbar { left: calc(var(--rail-w) + 336px); }
}

@media (min-width: 1800px) {
  .note-side { right: 120px; }
}

/* The loose beads are decoration for wide screens only */
@media (max-width: 1100px) {
  .backdrop .bead { display: none; }
}

/* The top pill carries the contract address */
.strip-pill { gap: 12px; padding: 7px 8px 7px 16px; }
.ca-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.strip-pill .ca-pill {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  height: auto;
  gap: 10px;
}
.strip-pill .ca-sym { display: none; }
.strip-pill .ca-pill code { font-size: 12.5px; color: var(--text); letter-spacing: -0.1px; }
.strip-pill .ca-pill em {
  background: var(--ink);
  color: #f7f9fc;
  border: 0;
  padding: 5px 11px;
}
:root[data-theme='dark'] .strip-pill .ca-pill em { background: #f0f3f8; color: #12161f; }
.strip-pill .ca-pill.is-copied em { background: #2f7d5f; color: #fff; }
.ca-chart {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: #3b7de0;
  padding-right: 8px;
}
.ca-chart::after { content: ' →'; }
.ca-soon {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--muted-2);
  padding-right: 10px;
}
@media (max-width: 860px) {
  .strip.has-ca { justify-content: center; }
  .ca-word { display: none; }
  .strip-pill { padding-left: 14px; }
  .strip-pill .ca-pill code { font-size: 11.5px; max-width: 42vw; }
}
