@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap");

/* ---------- tokens ---------- */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e9ecf1;
  --text: #0f1a2b;
  --muted: #5d6675;
  --faint: #8a93a1;
  --line: #e3e6ec;
  --accent: #1b365d;        /* overridden per event */
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --link: #1d4ed8;
  --danger: #c2341d;
  --danger-soft: #fdecea;
  --ok: #1f7a4d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 26, 43, .04), 0 8px 24px rgba(15, 26, 43, .05);
  --shadow-lg: 0 24px 64px rgba(15, 26, 43, .18);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #151b24; --surface-2: #1b2230; --surface-3: #232c3b;
    --text: #e9edf3; --muted: #a2abb9; --faint: #778196; --line: #283244;
    --link: #8fb3ff; --danger: #ff8a73; --danger-soft: #3a1d18; --ok: #6fd3a0;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151b24; --surface-2: #1b2230; --surface-3: #232c3b;
  --text: #e9edf3; --muted: #a2abb9; --faint: #778196; --line: #283244;
  --link: #8fb3ff; --danger: #ff8a73; --danger-soft: #3a1d18; --ok: #6fd3a0;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .35em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
code { font-family: var(--mono); font-size: .85em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 72px; }
.narrow { max-width: 480px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .8125rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.hidden { display: none !important; }

.eyebrow {
  font: 700 .6875rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--link); margin: 0;
}
.eyebrow.muted { color: var(--muted); }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 9px 16px; font: 600 .875rem/1.2 var(--sans);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  justify-content: center; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-big { width: 100%; padding: 17px; font-size: 1.0625rem; border-radius: 16px; }
.btn-icon { padding: 8px; border-radius: 999px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: 600 .8125rem var(--sans); color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.link-btn:hover { color: var(--text); }
.link-btn.danger { color: var(--danger); }
.link-btn svg { width: 15px; height: 15px; }

/* tool grid (icon over label) */
.tools { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 9px; font: 500 .6875rem/1.2 var(--sans); color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: center; }
.tool:hover { background: var(--surface); color: var(--text); }
.tool svg { width: 17px; height: 17px; }

/* ---------- forms ---------- */
label, .label { display: block; font-weight: 500; font-size: .8125rem; margin-bottom: 6px; color: var(--text); }
.hint { font-size: .75rem; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input:not([type]), textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 500 .9375rem/1.3 var(--sans);
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus-visible, textarea:focus-visible, .btn:focus-visible, .tool:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}
.field-icon { position: relative; }
.field-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.field-icon input { padding-left: 38px; }

.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; flex: none; }
.stepper button svg { width: 15px; height: 15px; }
.stepper input { border: 0; text-align: center; padding: 6px; background: transparent; -moz-appearance: textfield; min-width: 0; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 7px; background: var(--surface); }
.swatch { width: 34px; height: 34px; border-radius: 999px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.swatch svg { width: 15px; height: 15px; opacity: 0; }
.swatch[aria-pressed="true"] svg { opacity: 1; }
.swatches input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.swatches .hex { font: 500 .75rem var(--mono); color: var(--muted); margin-left: auto; padding-right: 4px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check b { font-weight: 600; }

/* ---------- pills, tabs ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill.plain::before { display: none; }
.pill.on { background: color-mix(in srgb, var(--link) 12%, var(--surface)); color: var(--link); }
.pill.live { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .75rem; font-weight: 500; color: var(--muted); background: var(--surface); }
.chip svg { width: 13px; height: 13px; }

.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font: 600 .8125rem var(--sans); color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tab svg { width: 14px; height: 14px; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .k { font-size: .6875rem; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-card .k svg { width: 16px; height: 16px; color: var(--accent); background: var(--accent-soft); padding: 7px; box-sizing: content-box; border-radius: 10px; }
.stat-card .v { font-family: var(--serif); font-size: 2.1rem; line-height: 1.1; margin-top: 8px; color: var(--text); }
.stat-card .v small { font: 600 .8125rem var(--sans); color: var(--muted); margin-left: 4px; }
.stat-card .s { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ---------- photo grid (guest) ---------- */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px;
  font-size: .75rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6));
  display: flex; justify-content: space-between; align-items: end; gap: 4px;
}
.tile .x { border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 999px; font: 600 .75rem var(--sans); padding: 4px 9px; cursor: pointer; }

/* ---------- photo cards (album) ---------- */
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 520px) { .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.photo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.photo-card .ph { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; display: block; width: 100%; border: 0; padding: 0; }
.photo-card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card.is-hidden .ph img { filter: blur(6px) grayscale(.6); opacity: .45; transform: scale(1.08); }
.photo-card .flag { position: absolute; inset: 0; display: grid; place-items: center; }
.photo-card .flag span { background: color-mix(in srgb, var(--danger) 14%, #fff); color: var(--danger); font: 700 .625rem var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; transform: rotate(-8deg); display: inline-flex; gap: 6px; align-items: center; }
.photo-card .flag svg { width: 13px; height: 13px; }
.photo-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 9px 4px 2px; }
.photo-card .meta > div { min-width: 0; }
.photo-card .who { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-card .when { font-size: .6875rem; color: var(--muted); }
.photo-card .acts { display: flex; gap: 4px; flex: none; }
.photo-card .acts button, .photo-card .acts a { width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.photo-card .acts button:hover, .photo-card .acts a:hover { color: var(--text); background: var(--surface-2); }
.photo-card .acts svg { width: 14px; height: 14px; }

/* ---------- overlays ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-size: .875rem; font-weight: 500; z-index: 100; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg);
}
.lightbox {
  position: fixed; inset: 0; background: rgba(8, 12, 20, .9); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: calc(100% - 64px); border-radius: 8px; }
.lightbox .bar { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }

dialog {
  border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text);
  padding: 0; box-shadow: var(--shadow-lg); max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgba(15, 26, 43, .45); backdrop-filter: blur(2px); }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; place-items: center; }
.qr-box img { width: 100%; display: block; }

/* ---------- sponsors, newsletter, credit ---------- */
.event-logo { max-width: 200px; max-height: 96px; object-fit: contain; display: block; margin: 0 auto 14px; }
.sponsors .sponsor-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.sponsor {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 16px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text); min-height: 108px;
}
a.sponsor:hover { border-color: var(--accent); }
.sponsor img { max-height: 44px; max-width: 100%; object-fit: contain; }
.sponsor .nm { font-weight: 600; font-size: .875rem; }
.sponsor .tg { font-size: .75rem; color: var(--muted); line-height: 1.35; }
.newsletter-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.newsletter-card .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.newsletter-card .ic svg { width: 22px; height: 22px; }
.credit { text-align: center; font-size: .75rem; color: var(--faint); padding-top: 4px; letter-spacing: .02em; margin: 0; }
.credit a { color: inherit; font-weight: 600; }
@media (max-width: 480px) { .newsletter-card .btn { display: none; } }

/* ---------- theme toggle ---------- */
.theme-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.theme-toggle button { width: 32px; height: 30px; border-radius: 999px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-toggle button svg { width: 15px; height: 15px; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.eyebrow svg { width: 13px; height: 13px; vertical-align: -2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
select {
  width: 100%; padding: 10px 36px 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6675' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text); font: 500 .9375rem/1.3 var(--sans); appearance: none; cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.tier-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font: 700 .625rem/1.6 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.tier-presenting { background: var(--accent); color: var(--accent-ink); }
.tier-gold { background: #f6e7b8; color: #6b4e00; }
.tier-silver { background: #e4e7ec; color: #3f4754; }
.tier-community { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* sponsor tiers */
.sponsor.presenting { min-height: 0; padding: 22px 16px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.sponsor.presenting img { max-height: 72px; }
.sponsor.presenting .nm { font: 500 1.25rem/1.2 var(--serif); }
.sponsor-strip.sm { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.sponsor.silver { min-height: 84px; padding: 12px 10px; }
.sponsor.silver img { max-height: 30px; }
.sponsor.silver .nm { font-size: .8125rem; }
.community-line { text-align: center; font-size: .8125rem; color: var(--muted); margin: 4px 0 0; line-height: 1.7; }
.community-line span { font-weight: 700; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; margin-right: 6px; }
.community-line a { color: var(--text); text-decoration: none; font-weight: 600; }
.community-line a:hover { text-decoration: underline; }
