*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── TOKENS ─────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #141217;
  --bg2: #1c1920;
  --border: #26222c;
  --ink: #d4aaee;
  --dim: #a89db8;
  --faint: #685f7a;
  --pop: #f0f0f8;
  --pop2: #e8c5a0;
  --green: #7abf8e;
}

[data-theme="light"] {
  --bg: #f8f5f2;
  --bg2: #f0ece8;
  --border: #e4ddd8;
  --ink: #8b3fc0;
  --dim: #5a5068;
  --faint: #d8d0d8;
  --pop: #1a1520;
  --pop2: #b07840;
  --green: #3a9a5c;
}

/* ── BASE ────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  /* overflow-x: hidden; */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  min-height: 100vh;
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
}

/* ── TOP BAR ─────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 2.5rem;
  margin-bottom: 3rem;
  margin-left: -2.5rem;
  margin-right: -2.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

[data-theme="light"] .topbar {
  background: rgba(248, 245, 242, 0.6);
}

.topbar-site {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.topbar-site:hover {
  color: var(--pop);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-nav {
  display: flex;
  gap: 1.5rem;
}

.topbar-nav a {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  color: var(--ink);
}

.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
  color: var(--dim);
  cursor: pointer;
  letter-spacing: 0.05em;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: inline-block;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s, color 0.15s;
}

.theme-btn:hover {
  border-color: var(--pop);
  color: var(--pop);
  transform: scale(1.06) rotate(-1deg);
}

.theme-btn:active {
  transform: scale(0.97);
}

/* ── SHARED ELEMENTS ─────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.75rem 0;
}

.label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  margin-bottom: 3rem;
}

.back-link:hover {
  color: var(--pop);
}

/* ── FOOTER ──────────────────────────────────────── */
.foot {
  margin-top: 4rem;
  font-size: 0.6rem;
  color: var(--faint);
  letter-spacing: 0.08em;
}

/* ── LIVE DOT ────────────────────────────────────── */
.live {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
  animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.15;
  }
}

/* ── MOBILE BOTTOM BAR ───────────────────────────── */
.bottom-bar {
  display: none;
}

/* ── MOBILE ──────────────────────────────────────── */
@media (max-width: 650px) {
  body {
    padding: 2rem 1.25rem 5rem;
  }

  .topbar {
    margin-bottom: 3rem;
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.25rem;
  }

  .topbar-nav {
    display: none;
  }

  .bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: rgba(20, 18, 23, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 0.6rem 1rem;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
  }

  [data-theme="light"] .bottom-bar {
    background: rgba(248, 245, 242, 0.85);
  }

  .bottom-bar a,
  .bottom-bar button {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dim);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s;
    letter-spacing: 0.02em;
  }

  .bottom-bar a:hover,
  .bottom-bar a.active,
  .bottom-bar button:hover {
    color: var(--ink);
  }
}