/* ---------------------------------------------------------------
   Link-in-bio — theme tokens
   Change the accent colour in config.js, not here.
   --------------------------------------------------------------- */

:root {
  --accent: #8ab4ff;
  --bg: #08090a;
  --text: #f4f5f7;
  --text-dim: #9ba1ac;
  --text-faint: #6b7280;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --icon-bg: rgba(255, 255, 255, 0.06);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --on-accent: #08090a;
  --radius: 16px;
  --maxw: 520px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="light"] {
  --bg: #f6f6f4;
  --text: #111214;
  --text-dim: #565b64;
  --text-faint: #7c828c;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-hover: #ffffff;
  --border: rgba(17, 18, 20, 0.1);
  --border-strong: rgba(17, 18, 20, 0.2);
  --icon-bg: rgba(17, 18, 20, 0.055);
  --shadow: 0 18px 50px rgba(20, 22, 28, 0.1);
  --on-accent: #0d0f10;
}

* { box-sizing: border-box; }

/* Author display rules would otherwise beat the [hidden] attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(28px, 7vw, 64px) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Soft light behind the page — pure CSS, no image. */
.glow {
  position: fixed;
  inset: -30% -20% auto -20%;
  height: 70vh;
  pointer-events: none;
  background:
    radial-gradient(50% 50% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%),
    radial-gradient(40% 40% at 80% 10%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 70%);
  filter: blur(20px);
  opacity: 0.9;
  z-index: 0;
}

html[data-theme="light"] .glow { opacity: 0.55; }

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  gap: 26px;
  /* Centres the block on tall screens; collapses to 0 when it overflows,
     so a long link list never gets clipped at the top. */
  margin-block: auto;
}

/* ---------------------------------------------------------------
   Profile
   --------------------------------------------------------------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.avatar-ring {
  padding: 3px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 15%, transparent) 55%, var(--border-strong));
  box-shadow: 0 0 0 1px var(--border), 0 10px 40px color-mix(in srgb, var(--accent) 18%, transparent);
}

.avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 3px solid var(--bg);
}

.name {
  margin: 0;
  font-size: clamp(1.45rem, 5.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.handle {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}

.bio {
  margin: 8px 0 0;
  max-width: 38ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-dim);
  text-wrap: pretty;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.socials:empty { display: none; }

.social {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.social svg { width: 17px; height: 17px; }

.social:hover,
.social:focus-visible {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------
   Link buttons
   --------------------------------------------------------------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link {
  --i: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  min-height: 60px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.25s ease;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(90ms + var(--i) * 55ms);
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 14%, transparent);
}

.link:active { transform: translateY(0) scale(0.995); }

.link-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--icon-bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.link-icon svg { width: 18px; height: 18px; }

.link-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--text-faint);
  margin-top: 1px;
}

.link-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  color: var(--text-faint);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.link-arrow svg { width: 16px; height: 16px; }

.link:hover .link-arrow,
.link:focus-visible .link-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

/* Featured / primary button */
.link.is-featured {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 10px 34px color-mix(in srgb, var(--accent) 26%, transparent);
}

.link.is-featured .link-icon {
  background: color-mix(in srgb, var(--on-accent) 12%, transparent);
  color: var(--on-accent);
}

.link.is-featured .link-sub { color: color-mix(in srgb, var(--on-accent) 62%, transparent); }

.link.is-featured:hover,
.link.is-featured:focus-visible {
  background: color-mix(in srgb, var(--accent) 88%, white);
  border-color: transparent;
  box-shadow: 0 16px 44px color-mix(in srgb, var(--accent) 34%, transparent);
}

.link.is-featured .link-arrow { color: color-mix(in srgb, var(--on-accent) 55%, transparent); }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.footer {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  padding-top: 4px;
}

.footer p { margin: 0; }

.footer a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------
   Theme toggle
   --------------------------------------------------------------- */

.theme-toggle {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle svg { width: 16px; height: 16px; }

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

/* Moon shown in light mode, sun in dark mode — handled in app.js */

/* ---------------------------------------------------------------
   Focus, motion, print
   --------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.link:focus-visible { outline-offset: 3px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .link:hover, .link:focus-visible, .social:hover, .social:focus-visible { transform: none; }
}

@media (max-width: 380px) {
  body { padding-left: 16px; padding-right: 16px; }
  .avatar { width: 82px; height: 82px; }
  .link { padding: 12px 13px; min-height: 56px; }
  .link-icon { width: 32px; height: 32px; }
}

@media print {
  .glow, .theme-toggle { display: none; }
  body { background: #fff; color: #000; padding: 0; }
  .link { break-inside: avoid; }
}

/* ---------------------------------------------------------------
   Sections — events and partners
   --------------------------------------------------------------- */

.section-title {
  margin: 0 0 12px 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.event.is-full { opacity: 0.72; }

.event-date {
  flex: 0 0 auto;
  width: 54px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 9px 0 8px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}

.event-day {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
}

.event-month {
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.event-body { min-width: 0; flex: 1 1 auto; }

.event-title {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.event-meta {
  margin: 3px 0 0;
  font-size: 0.8125rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.event-desc {
  margin: 9px 0 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.55;
  text-wrap: pretty;
}

.event-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.event-spots {
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.event-spots strong { color: var(--text); font-weight: 600; }
.event-spots.is-full { color: #ff9d9d; }

.btn-rsvp {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-rsvp:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  transform: translateY(-1px);
}

.btn-rsvp:disabled { opacity: 0.45; cursor: default; }

/* ---------------- partners ---------------- */

.sponsors {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sponsor .badge { flex: 0 0 auto; }

.badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-sponsor {
  border-color: var(--border-strong);
  background: var(--icon-bg);
  color: var(--text-dim);
}

.disclosure {
  margin: 10px 2px 0;
  font-size: 0.6875rem;
  line-height: 1.55;
  color: var(--text-faint);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------
   RSVP dialog
   --------------------------------------------------------------- */

dialog.rsvp {
  position: relative;
  width: min(440px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 26px 24px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

dialog.rsvp::backdrop {
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

dialog.rsvp[open] { animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

.rsvp-close-form { position: absolute; top: 12px; right: 12px; margin: 0; }

.rsvp-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.rsvp-close:hover { color: var(--text); border-color: var(--border-strong); }
.rsvp-close svg { width: 13px; height: 13px; }

.rsvp-kicker {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.rsvp-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.25;
  padding-right: 28px;
}

.rsvp-meta {
  margin: 7px 0 20px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dim);
}

.field .opt { color: var(--text-faint); font-weight: 400; }

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  background: var(--surface-hover);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 12px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: scale(0.995); }
.btn-primary:disabled { opacity: 0.65; cursor: default; }

.form-note {
  margin: 11px 0 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-faint);
  text-align: center;
}

.form-error {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #ff8f8f;
}

@media (max-width: 380px) {
  .event { gap: 12px; padding: 14px; }
  .event-date { width: 46px; }
  .event-day { font-size: 1.2rem; }
  .field-row { grid-template-columns: 1fr 80px; }
}
