/* ============================================================================
   MyParty base layer
   Design tokens, page shell (background + scrim), nav, theme toggle, buttons,
   hero typography, footer note, night theme. Shared by index/games/plinko/
   horseracing. The invite page is a standalone design and does not use this.
   ============================================================================ */

:root {
  --purple: #7b5cf0;
  --purple-deep: #5a3fd6;
  --cream: #ece5d3;
  --ink: #2a2233;
  --ink-soft: rgba(42, 34, 51, 0.75);
}

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

html, body { min-height: 100%; }

body {
  font-family: "Inter", sans-serif;
  color: var(--ink);
  background: var(--purple);
}

/* ---- Page shell: purple wash over the shared background image ---- */
.page {
  position: relative;
  min-height: 100vh;
  background: #6f55e0 url("../assets/bg.jpg") 0% 0% / cover no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

/* ---- Decorative scrim: purple wash, strongest at top & left where text lives ---- */
.page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(101, 74, 222, 0.62) 0%, rgba(101, 74, 222, 0.34) 40%, rgba(101, 74, 222, 0) 68%),
    linear-gradient(90deg, rgba(101, 74, 222, 0.72) 0%, rgba(101, 74, 222, 0.52) 25%, rgba(101, 74, 222, 0.24) 50%, rgba(101, 74, 222, 0) 72%),
    linear-gradient(180deg, rgba(101, 74, 222, 0.55) 0%, rgba(101, 74, 222, 0.28) 20%, rgba(101, 74, 222, 0) 42%);
}

/* ---- Nav ---- */
nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1.5rem 3.5rem;
}

nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(101, 74, 222, 0.45) 0%, rgba(101, 74, 222, 0.28) 45%, rgba(101, 74, 222, 0) 100%);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--cream);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2.6rem;
  margin: 0 auto;
  list-style: none;
}

.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover { text-decoration: underline; }
.nav-links a[aria-current] { text-decoration: underline; text-underline-offset: 0.4em; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
}

/* ---- Theme toggle: day shows sun + moon knob, night flips them ---- */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(236, 229, 211, 0.8);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.theme-toggle .knob {
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
  display: flex;
  align-items: center;
}

.theme-toggle .icon-sun-sm,
.theme-toggle .knob-night { display: none; }

body.night .theme-toggle .icon-sun,
body.night .theme-toggle .icon-moon { display: none; }
body.night .theme-toggle .icon-sun-sm,
body.night .theme-toggle .knob-night { display: flex; }
body.night .theme-toggle .knob-night { background: var(--cream); color: var(--purple-deep); }

/* ---- Buttons ---- */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.7rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(236, 229, 211, 0.8);
  color: var(--cream);
}

.btn-outline:hover { background: rgba(236, 229, 211, 0.12); }

.btn-solid {
  background: var(--cream);
  border: 1px solid var(--cream);
  color: var(--ink);
  font-weight: 600;
}

.btn-solid:hover { background: #fff; }

/* ---- Hero typography ---- */
h1 {
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-size: clamp(3.6rem, 9vw, 7.5rem);
  line-height: 0.93;
  text-transform: uppercase;
  color: var(--cream);
  letter-spacing: 0;
  white-space: nowrap;
  /* design face is ultra-condensed: squeeze Anton to match */
  transform: scaleX(0.75);
  transform-origin: left top;
  /* distressed print texture: hard-edged speck holes, crisp letters */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1 1 1 1 1 1 1 1 1 1 1 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 1 1 1 1 1 1 1 1 1 1 1 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 200px;
  mask-size: 200px;
}

.hero p {
  margin-top: 1.4rem;
  color: #f4eede;
  font-family: "Space Mono", monospace;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  line-height: 1.55;
  max-width: 30rem;
  text-shadow: 0 1px 8px rgba(42, 34, 51, 0.55);
}

/* ---- Footer note ---- */
.footer-note {
  padding: 0 3.5rem 2.2rem;
  color: rgba(244, 238, 222, 0.85);
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  text-shadow: 0 1px 8px rgba(42, 34, 51, 0.55);
}

.footer-note a { color: var(--cream); }

/* ---- Night theme: same background image, multiplied by deep indigo ---- */
body.night .page {
  background:
    linear-gradient(180deg,
      rgba(10, 8, 36, 0.60) 0%,
      rgba(10, 8, 36, 0.30) 35%,
      rgba(6, 5, 26, 0.35) 70%,
      rgba(4, 3, 18, 0.55) 100%),
    radial-gradient(90% 70% at 46% 42%,
      rgba(20, 16, 60, 0.00) 0%,
      rgba(20, 16, 60, 0.38) 62%,
      rgba(8, 6, 30, 0.45) 100%),
    #44378c url("../assets/bg.jpg")
      0% 0% / cover no-repeat fixed;
  background-blend-mode: normal, normal, multiply;
}

body.night .page::before {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(23, 16, 64, 0.72) 0%, rgba(23, 16, 64, 0.42) 40%, rgba(23, 16, 64, 0) 68%),
    linear-gradient(90deg, rgba(23, 16, 64, 0.80) 0%, rgba(23, 16, 64, 0.58) 25%, rgba(23, 16, 64, 0.26) 50%, rgba(23, 16, 64, 0) 72%),
    linear-gradient(180deg, rgba(23, 16, 64, 0.62) 0%, rgba(23, 16, 64, 0.32) 20%, rgba(23, 16, 64, 0) 42%);
}

body.night nav::before {
  background: linear-gradient(180deg, rgba(23, 16, 64, 0.55) 0%, rgba(23, 16, 64, 0.34) 45%, rgba(23, 16, 64, 0) 100%);
}

body.night .logo,
body.night .nav-links a,
body.night .hero h1,
body.night .hero p {
  text-shadow: 0 1px 2px rgba(4, 3, 18, 0.55), 0 0 28px rgba(4, 3, 18, 0.35);
}

.logo img { display: block; }
