/* NextLevel Archive — follows branding.nextlevelhub.nl:
   Forest #122529 anchors, Cyan #C2F6FF is the single accent,
   Light Green #DBE5E6 / Off White #F7F7F7 for light sections,
   Aeonik for type (Geist as the open fallback), DM Mono for labels.

   Pages alternate a dark Forest band (titles) with a light band (content).
   Components read the theme tokens below, so they adapt to either band. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* brand */
  --forest: #122529;
  --cyan: #c2f6ff;
  --lightgreen: #dbe5e6;
  --offwhite: #f7f7f7;
  --black: #0a0a0a;

  /* dark theme (default) */
  --bg: var(--forest);
  --text: #f7f7f7;
  --muted: rgba(219, 229, 230, 0.7);
  --faint: rgba(219, 229, 230, 0.45);
  --line: rgba(219, 229, 230, 0.11);
  --line-strong: rgba(219, 229, 230, 0.24);
  --surface: #162d32;
  --raised: #1c363c;
  --well: #183136;
  --input-bg: #162d32;
  --accent: var(--cyan);
  --icon-bg: rgba(194, 246, 255, 0.1);
  --icon-fg: var(--cyan);
  --btn-bg: #fff;
  --btn-fg: var(--forest);
  --btn-hover-bg: var(--cyan);
  --btn-hover-fg: var(--forest);
  --pressed-bg: var(--cyan);
  --pressed-fg: var(--forest);
  --ok: #9ef0c5;
  --ok-soft: rgba(158, 240, 197, 0.1);
  --danger: #ff9b8f;
  --danger-soft: rgba(255, 155, 143, 0.1);
  --focus: var(--cyan);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

  --radius: 4px;
  --radius-lg: 10px;
  --sans: "Aeonik", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 32px;
  --overlap: 72px;      /* how far the content sheet slides over the header */
  --sheet-radius: 28px;
  color-scheme: dark;
}

.light {
  --bg: var(--offwhite);
  --text: var(--forest);
  --muted: rgba(18, 37, 41, 0.7);
  --faint: rgba(18, 37, 41, 0.5);
  --line: rgba(18, 37, 41, 0.1);
  --line-strong: rgba(18, 37, 41, 0.2);
  --surface: #fff;
  --raised: var(--lightgreen);
  --well: #eef3f3;
  --input-bg: var(--offwhite);
  --accent: #17707d;
  --icon-bg: var(--cyan);
  --icon-fg: var(--forest);
  --btn-bg: var(--forest);
  --btn-fg: #fff;
  --btn-hover-bg: #23464d;
  --btn-hover-fg: #fff;
  --pressed-bg: var(--forest);
  --pressed-fg: #fff;
  --ok: #1d7a52;
  --ok-soft: #dcf3e7;
  --danger: #b93a2c;
  --danger-soft: #fbe9e6;
  --focus: var(--forest);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--forest);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
main { flex: 1; display: flex; flex-direction: column; }
main:focus { outline: none; }

/* Faint vertical grid like the brand site (shows through dark bands only) */
.gridlines {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
}
.gridlines span { border-left: 1px solid rgba(219, 229, 230, 0.07); }
.gridlines span:last-child { border-right: 1px solid rgba(219, 229, 230, 0.07); }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- bands ----------
   The dark header holds the page title; the light content "sheet" has rounded
   top corners and slides up over the header's lower edge, so the two read as
   layers instead of a hard cut. */
.band { color: var(--text); }
.band.dark {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 100%, rgba(194, 246, 255, 0.07), transparent 60%);
}
.band.dark > .page { position: relative; z-index: 1; }
.band.light:first-child { margin-top: 0; border-radius: 0; }
.band.light {
  position: relative; z-index: 2; flex: 1;
  margin-top: calc(-1 * var(--overlap));
  background: var(--bg);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  box-shadow: 0 -1px 0 rgba(219, 229, 230, 0.12), 0 -30px 60px -30px rgba(0, 0, 0, 0.55);
}
.page { max-width: 1280px; margin: 0 auto; padding: 48px var(--gutter) 52px; }
.band.dark .page { padding-bottom: calc(56px + var(--overlap)); }
.band.dark .page-tight { padding-top: 36px; padding-bottom: calc(44px + var(--overlap)); }
.band.light .page { padding-top: 44px; padding-bottom: 96px; }

/* Signature: the NL symbol drawn in hairlines, tucked behind the sheet */
.hero-mark {
  position: absolute; z-index: 0; pointer-events: none;
  right: max(-120px, calc(50% - 780px)); bottom: calc(var(--overlap) - 150px);
  width: min(760px, 62vw); height: auto;
  color: var(--cyan); opacity: 0.22;
}
.hero-mark path {
  fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}

/* Entrance — only when arriving on a page (see playEntrance in app.js) */
h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
h1 .line > span { display: inline-block; }
.enter h1 .line > span { animation: line-up 0.9s var(--ease) both; animation-delay: calc(60ms + var(--l, 0) * 90ms); }
.enter .rise { animation: rise 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.enter .hero-mark path { animation: draw 2.2s cubic-bezier(0.6, 0, 0.2, 1) both; }
.enter .hero-mark path + path { animation-delay: 0.25s; }
.enter .band.light { animation: sheet-up 0.9s var(--ease) 0.2s both; }
@keyframes line-up { from { transform: translateY(105%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(48px); } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 var(--gutter);
  background: rgba(18, 37, 41, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 22px; width: auto; }
.brand-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line-strong);
}
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Language switch — same pill as on branding.nextlevelhub.nl */
.lang { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 8px; flex: none; }
.lang button {
  min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--muted);
  transition: background .15s, color .15s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--cyan); color: var(--forest); }

.whoami {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 10px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.whoami::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(194,246,255,.15); }
.whoami:hover { border-color: var(--cyan); }
.whoami-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.whoami-name { font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- headings ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: 36px; }
.eyebrow { color: var(--faint); margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
.eyebrow a { text-decoration: none; color: var(--muted); }
.eyebrow a:hover { color: var(--accent); }
h1 { font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -0.03em; margin: 0; }
h1 .accent { color: var(--cyan); }
.lede { color: var(--muted); max-width: 560px; margin: 18px 0 0; font-size: 16px; }
h2 { font-weight: 400; font-size: 24px; letter-spacing: -0.01em; margin: 0; }

.stats { display: flex; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.stat { flex: 1; padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .mono { color: var(--faint); }
.stat b { display: block; font-weight: 400; font-size: 28px; letter-spacing: -0.02em; margin-top: 4px; }

/* ---------- panels (content containers) ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 26px 26px;
  box-shadow: 0 1px 2px rgba(18, 37, 41, 0.04), 0 10px 30px -12px rgba(18, 37, 41, 0.08);
}
.panel + .panel { margin-top: 24px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.panel-head .mono { color: var(--faint); }
.panel-head h2 { display: flex; align-items: center; gap: 12px; }
.section-icon {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 8px; background: var(--icon-bg); color: var(--icon-fg);
}
.section-icon svg { width: 17px; height: 17px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 2px; border: 1px solid transparent;
  font-weight: 500; font-size: 14.5px; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 2px;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- toolbar & inputs ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.input, .search input {
  width: 100%; height: 42px; padding: 0 14px; background: var(--input-bg);
  border: 1px solid var(--line-strong); border-radius: 2px; transition: border-color .15s;
}
.search input { padding-left: 42px; }
textarea.input { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; }
.input:focus, .search input:focus { outline: none; border-color: var(--accent); }
.input::placeholder, .search input::placeholder { color: var(--faint); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 2px; overflow: hidden; }
.segmented button { height: 40px; padding: 0 14px; background: transparent; border: 0; border-left: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 13.5px; }
.segmented button:first-child { border-left: 0; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--pressed-bg); color: var(--pressed-fg); font-weight: 500; }

/* ---------- event cards ---------- */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.card:hover { border-color: var(--text); transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(18, 37, 41, 0.35); }
.card-cover { aspect-ratio: 16 / 10; background: var(--raised); position: relative; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card-cover img { transform: scale(1.03); }
.card-cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.card-cover .placeholder img { width: 64px; height: auto; opacity: .22; object-fit: contain; }
.type-chip {
  position: absolute; top: 12px; left: 12px; padding: 4px 9px; border-radius: 2px;
  background: rgba(18,37,41,.85); backdrop-filter: blur(6px); color: var(--cyan);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-date { color: var(--faint); }
.card-title { font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-meta svg { width: 15px; height: 15px; opacity: .8; }
.card-meta .ok { color: var(--ok); }

.new-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 280px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--well); color: var(--muted);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.new-card:hover { border-color: var(--text); color: var(--text); }
.new-card svg { width: 28px; height: 28px; }

.empty {
  text-align: center; padding: 64px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--well); color: var(--muted);
}
.empty img { width: 56px; margin: 0 auto 18px; opacity: .5; }
.empty h3 { color: var(--text); font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.empty p { margin: 0 auto 22px; max-width: 420px; }

/* ---------- event page ---------- */
.event-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.event-head h1 { font-size: clamp(34px, 5vw, 60px); }
.event-facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin-top: 16px; }
.event-facts span { display: inline-flex; gap: 7px; align-items: center; }
.event-facts svg { width: 16px; height: 16px; opacity: .8; }
.event-desc { color: var(--muted); max-width: 720px; margin: 14px 0 0; white-space: pre-wrap; }
.event-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- folders panel ---------- */
.panel-sub { margin: 6px 0 0 44px; color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.upload-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-lg);
  background: var(--well); color: var(--muted); font-size: 14px;
}
.upload-note b { color: var(--text); font-weight: 500; }
.upload-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.upload-note .drag-hint { margin-left: auto; color: var(--faint); font-size: 13px; }
.link-btn {
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--accent);
  font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }

.you { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; border: 1px solid currentColor; opacity: .8; }

/* Each person's folder is a card that opens and closes */
.folder-list { display: flex; flex-direction: column; gap: 10px; }
.folder {
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.folder:hover { border-color: var(--text); }
.folder.open { box-shadow: 0 12px 30px -18px rgba(18, 37, 41, 0.35); }
.folder-head { display: flex; align-items: center; gap: 6px; padding-right: 10px; }
.folder.open .folder-head { background: var(--well); border-bottom: 1px solid var(--line); }
.folder-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px;
  padding: 14px 8px 14px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text);
}
.chev { display: grid; place-items: center; color: var(--faint); transition: transform .25s var(--ease); }
.chev svg { width: 16px; height: 16px; }
.folder.open .chev { transform: rotate(90deg); color: var(--text); }
.folder-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--icon-bg); color: var(--icon-fg); }
.folder-ico svg { width: 19px; height: 19px; }
.folder-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.folder-name { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-meta { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.peek { margin-left: auto; display: flex; gap: 4px; flex: none; }
.peek img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--raised); }
.folder-head .tools { display: flex; gap: 2px; align-items: center; flex: none; }
.folder-body { padding: 12px 0 2px; }
.folder.opening .folder-body { animation: rise .4s var(--ease) both; }
.folder-body .sheet { margin: 0 12px 4px; }
.folder-empty { margin: 4px 16px 14px; color: var(--faint); font-size: 14px; }

/* Folder picker */
.choose { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.choose-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--text);
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.choose-item svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }
.choose-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choose-item:hover, .choose-item:focus-visible { border-color: var(--cyan); background: rgba(194, 246, 255, .06); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }

.sheet {
  display: flex; align-items: center; gap: 18px; padding: 14px 16px;
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-lg); flex-wrap: wrap;
}
.sheet-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); }
.sheet-icon svg { width: 22px; height: 22px; }
.sheet-info { flex: 1; min-width: 180px; }
.sheet-name { font-size: 15.5px; word-break: break-all; }
.sheet-sub { color: var(--muted); font-size: 13.5px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 12px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--raised);
  border: 0; padding: 0; cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .4s var(--ease); }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile .noprev { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; color: var(--muted); padding: 10px; }
.tile .noprev b { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500; letter-spacing: .08em; }
.tile .noprev small { font-size: 12px; word-break: break-all; line-height: 1.3; }
.tile .tile-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 6px; font-size: 11.5px; text-align: left;
  background: linear-gradient(transparent, rgba(10,10,10,.75)); color: #fff; opacity: 0; transition: opacity .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile:hover .tile-name, .tile:focus-visible .tile-name { opacity: 1; }
.more { display: flex; justify-content: center; padding: 0 12px 14px; }

/* ---------- footer ---------- */
.footer { background: var(--forest); border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 26px var(--gutter);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted);
}
.footer-inner img { width: 34px; height: auto; opacity: .9; }
.footer-inner span:first-of-type { color: var(--text); }
.footer-inner .mono { margin-left: auto; color: var(--faint); }

/* ---------- modal (dark) ---------- */
.modal {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(6, 14, 16, .72); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal form, .modal .modal-inner { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.modal h2 { font-size: 26px; }
.modal p { margin: 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 13px; color: var(--faint); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; color: var(--muted); }
.pick button:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- upload tray (dark) ---------- */
.tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(380px, calc(100vw - 32px));
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; animation: pop .25s var(--ease);
}
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 18px; }
.tray-title { font-weight: 500; }
.tray-sub { color: var(--muted); font-size: 13px; }
.tray-toggle-open svg { transform: rotate(180deg); }
.bar { height: 3px; background: var(--line); margin: 0 18px 14px; border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .25s; }
.tray-list { list-style: none; margin: 0; padding: 0 8px; max-height: 0; overflow: auto; transition: max-height .25s var(--ease); }
.tray.open .tray-list { max-height: 260px; padding-bottom: 8px; }
.tray-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 7px 10px; border-radius: var(--radius); font-size: 13px; }
.tray-list li .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-list li .st { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.tray-list li.done .st { color: var(--ok); }
.tray-list li.error .st { color: var(--danger); }
.tray-list li .err { grid-column: 1 / -1; color: var(--danger); font-size: 12px; }
.tray-list li .mini { grid-column: 1 / -1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tray-list li .mini span { display: block; height: 100%; background: var(--cyan); }
.tray-actions { display: flex; gap: 8px; padding: 0 18px 14px; }
.tray-actions:empty { display: none; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: var(--radius); background: var(--forest); color: #fff; border: 1px solid rgba(219,229,230,.2);
  font-weight: 500; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: pop .2s var(--ease); max-width: calc(100vw - 32px);
}
.toast::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); margin-right: 10px; vertical-align: 1px; }
.toast.error::before { background: var(--danger); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6, 12, 14, .96); display: flex; flex-direction: column; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--muted); }
.lb-top .lb-title { min-width: 0; }
.lb-top .lb-title div { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .lb-title small { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.lb-top .lb-tools { display: flex; gap: 6px; flex: none; }
.lb-stage { flex: 1; position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px 24px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.lb-stage .noprev { text-align: center; color: var(--muted); }
.lb-stage .noprev b { display: block; font-family: var(--mono); color: var(--cyan); font-size: 28px; margin-bottom: 8px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(18,37,41,.6); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { border-color: var(--cyan); color: var(--cyan); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }

.dropveil {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none;
  background: rgba(18,37,41,.85); border: 2px dashed var(--cyan);
}
.dropveil div { font-size: 28px; color: var(--cyan); }

/* ---------- skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 760px) {
  :root { --gutter: 16px; --overlap: 36px; --sheet-radius: 20px; }
  .hero-mark { width: 115vw; right: -40vw; opacity: 0.14; }
  .gridlines { grid-template-columns: repeat(2, 1fr); }
  .gridlines span:nth-child(n+3) { display: none; }
  .gridlines span:nth-child(2) { border-right: 1px solid rgba(219, 229, 230, 0.07); }
  .page { padding-top: 32px; padding-bottom: 36px; }
  .band.light .page { padding-top: 24px; padding-bottom: 64px; }
  .band.dark .page { padding-bottom: calc(36px + var(--overlap)); }
  .hero { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  .whoami-label { display: none; }
  /* the event page shows the linked folder itself; keep the bar for logo + language */
  .whoami { display: none; }
  .brand img { height: 19px; }
  .topbar-right { gap: 8px; }
  .lang button { min-width: 30px; padding: 0 6px; }
  .stats { flex-wrap: wrap; }
  .stat { flex: 1 1 50%; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat b { font-size: 22px; }
  .panel { padding: 16px 14px 18px; border-radius: 8px; }
  .panel + .panel { margin-top: 16px; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; }
  .dropzone { flex-direction: column; text-align: center; }
  .row { grid-template-columns: 1fr; }
  .lb-stage { padding: 0 0 16px; }
  .lb-nav { width: 40px; height: 40px; background: rgba(18,37,41,.8); }
  .event-actions { width: 100%; }
  .event-actions .btn { flex: 1; }
  .footer-inner .mono { margin-left: 0; width: 100%; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { flex: 1; }
  .panel-sub { margin-left: 0; }
  .upload-note .drag-hint { display: none; }
  .peek { display: none; }
  .folder-head { flex-wrap: wrap; padding-right: 0; gap: 0; }
  .folder-toggle { flex: 1 1 100%; padding-bottom: 4px; }
  .folder-head .tools { width: 100%; justify-content: flex-end; padding: 0 8px 6px; }
  .folder-toggle { gap: 10px; padding-left: 12px; }
  .folder-ico { display: none; }
  .inline-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
