:root {
  --paper: #f1ebdf;
  --ink: #2a2522;
  --teal: #1f8a8f;
  --red: #c8392c;
  --magenta: #7e1f4e;
  --blue: #2179d4;
  --indigo: #6f66e8;
  --navy: #003884;
  --blend-mode: multiply;
  --tape: rgba(245, 215, 120, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1814;
    --ink: #f1ebdf;
    --teal: #6cd3d8;
    --red: #f37569;
    --magenta: #d36da0;
    --blue: #6fb3ff;
    --indigo: #9c95ff;
    --navy: #7eaaff;
    --blend-mode: screen;
    --tape: rgba(220, 190, 110, 0.32);
  }
}

:root[data-theme="light"] {
  --paper: #f1ebdf;
  --ink: #2a2522;
  --teal: #1f8a8f;
  --red: #c8392c;
  --magenta: #7e1f4e;
  --blue: #2179d4;
  --indigo: #6f66e8;
  --navy: #003884;
  --blend-mode: multiply;
  --tape: rgba(245, 215, 120, 0.55);
}

:root[data-theme="dark"] {
  --paper: #1a1814;
  --ink: #f1ebdf;
  --teal: #6cd3d8;
  --red: #f37569;
  --magenta: #d36da0;
  --blue: #6fb3ff;
  --indigo: #9c95ff;
  --navy: #7eaaff;
  --blend-mode: screen;
  --tape: rgba(220, 190, 110, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Quicksand", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
}

main {
  width: 100%;
  max-width: 36rem;
  text-align: center;
}

.logo-btn {
  position: relative;
  display: block;
  width: min(72vw, 18rem);
  margin: 0 auto 1.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.logo-btn::before,
.logo-btn::after {
  content: "";
  position: absolute;
  width: 3.2rem;
  height: 1.05rem;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 2;
}

.logo-btn::before {
  top: -0.35rem;
  left: -0.6rem;
  transform: rotate(-12deg);
}

.logo-btn::after {
  bottom: -0.4rem;
  right: -0.55rem;
  transform: rotate(-8deg);
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  mix-blend-mode: var(--blend-mode);
  transform: rotate(-1deg);
}

h1 {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.025em;
}

.tag {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  opacity: 0.75;
}

.divider {
  display: block;
  width: 6rem;
  height: 0.75rem;
  margin: 0.75rem auto;
  color: var(--ink);
  opacity: 0.35;
}

.next-event-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0.5rem auto 1.5rem;
}

.next-event {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.15s ease, transform 0.12s ease;
  max-width: 100%;
}

.rsvp-stack {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rsvp-avatars {
  display: flex;
  align-items: center;
}

.rsvp-avatars a {
  display: inline-block;
  margin-left: -0.45rem;
  transition: transform 0.15s ease;
  position: relative;
}

.rsvp-avatars a:first-child {
  margin-left: 0;
}

.rsvp-avatars a:hover {
  transform: translateY(-2px) scale(1.12);
  z-index: 5;
}

.rsvp-avatars img {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--paper);
  object-fit: cover;
}

.rsvp-count {
  font-size: 0.85rem;
  opacity: 0.7;
  font-weight: 500;
  letter-spacing: 0.01em;
}


.next-event:hover {
  background: color-mix(in srgb, var(--red) 18%, transparent);
  transform: translateY(-1px);
}

.next-event strong {
  font-weight: 700;
  color: var(--red);
}

.next-event .pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.25); }
}

.next-event .arrow {
  opacity: 0.55;
  font-size: 0.9em;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.next-event:hover .arrow {
  transform: translate(2px, -2px);
  opacity: 1;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 16rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    max-width: none;
    gap: 0.75rem;
  }
}

.links > a,
.profile-toggle {
  --c: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 2px solid var(--c);
  background: transparent;
  color: var(--c);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.ic svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ic.at {
  font-size: 1.25em;
  line-height: 1;
  font-weight: 700;
  margin-top: -0.05em;
}

.ic.ext {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.65;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.links > a:hover,
.profile[open] .profile-toggle {
  background: color-mix(in srgb, var(--c) 13%, transparent);
  transform: translateY(-1px);
}

@media (hover: hover) {
  .profile:hover .profile-toggle {
    background: color-mix(in srgb, var(--c) 13%, transparent);
    transform: translateY(-1px);
  }
}

.links > a:hover .ic.ext {
  transform: translate(2px, -2px);
  opacity: 1;
}

.links > *:nth-child(1) { --c: var(--teal); }
.links > *:nth-child(2) { --c: var(--navy); }
.links > *:nth-child(3) { --c: var(--red); }

.profile {
  position: relative;
  outline: none;
}

.profile-toggle {
  width: 100%;
}

@media (min-width: 640px) {
  .profile-toggle {
    width: auto;
  }
}

.profile > summary {
  list-style: none;
}

.profile > summary::-webkit-details-marker {
  display: none;
}

.sublinks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
}

.profile[open] .sublinks {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
}

@media (hover: hover) {
  .profile:hover .sublinks {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.5rem;
  }
}

.sublinks a {
  --c: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px dashed var(--c);
  color: var(--c);
  background: transparent;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s ease;
}

.sublinks > a:nth-child(1) { --c: var(--blue); }
.sublinks > a:nth-child(2) { --c: var(--indigo); }

.sublinks a:hover {
  background: color-mix(in srgb, var(--c) 14%, transparent);
}

.sublinks a:hover .ic.ext {
  transform: translate(2px, -2px);
  opacity: 1;
}

@media (min-width: 640px) {
  .sublinks {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: -0.5rem;
    right: -0.5rem;
    padding: 0.5rem;
    margin-top: 0;
    z-index: 10;
    background: var(--paper);
    border-radius: 1.1rem;
    box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--ink) 22%, transparent);
  }
  .sublinks::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.4rem;
    height: 0.4rem;
  }
  .profile[open] .sublinks,
  .profile:hover .sublinks {
    margin-top: 0;
  }
}

.contact {
  margin: 1.25rem auto 0;
  max-width: 24rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.8;
}

.contact a {
  color: var(--red);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1.5px dashed currentColor;
  transition: opacity 0.15s ease;
}

.contact a:hover {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .logo,
  .logo:hover {
    transform: none;
    animation: none;
  }
  .next-event .pulse { animation: none; }
}
