/*
 * spark.css — Spark Image Library shared stylesheet
 * ====================================================
 * Single source of truth for all shared UI across library pages.
 * Served from /assets/spark.css on every deployment.
 *
 * HOW TO INCLUDE (new pages)
 * --------------------------
 *   1. In <head>, add: <?php require_once __DIR__ . '/_theme.php'; ?>
 *      (adjust the path depth as needed — see path examples below)
 *   2. _theme.php outputs:
 *        <link rel="stylesheet" href="/assets/spark.css">
 *        <style>:root { --bg: ...; --accent: ...; ... }</style>
 *      The :root block overrides the fallback tokens below with values
 *      from settings.local.json (or settings.json). Never hardcode
 *      palette colors in this file or in page <style> blocks — use
 *      var(--token) everywhere.
 *   3. Add <body data-theme="<?= $palette_name ?>"> to activate theme overrides.
 *   4. Put page-specific styles in the page's own <style> block, after _theme.php.
 *
 * PATH EXAMPLES
 * -------------
 *   Root-level page  (login.php, ingest.php):
 *     require_once __DIR__ . '/_theme.php';
 *   Subdirectory page (image-library/index.php, session.php):
 *     require_once __DIR__ . '/../_theme.php';
 *
 * TOKEN REFERENCE
 * ---------------
 *   --bg            Page background
 *   --surface       Card / panel background (elevated 1)
 *   --surface2      Subtle tinted background (elevated 2, tags, chips)
 *   --border        All border strokes
 *   --accent        Primary brand color (buttons, active states, links)
 *   --accent-dim    Transparent tint of accent (hover fills, badges)
 *   --text          Primary body text
 *   --text-muted    Secondary / placeholder text
 *   --text-dim      Mid-tone text (sub-labels, meta)
 *   --success       Positive state (toast, family tag)
 *   --danger        Destructive action / error state
 *   --portfolio     Portfolio accent (blue-slate)
 *   --portfolio-dim Transparent tint of portfolio
 *   --radius        Global border-radius (5px default)
 *
 * COMPONENT INVENTORY
 * -------------------
 *   Reset & base       *, body, scrollbar
 *   Header             .header, .header-brand, .header-logo, .header-right,
 *                      .header-count, .upload-link, .logout-link, .settings-btn
 *   Tab bar            .tab-bar, .tab-btn, .tab-btn.active/.disabled,
 *                      .tab-badge, .tab-panel
 *   Buttons            .btn, .btn-danger, .btn-ghost, .btn-lb
 *                      Fuse-lighting animation on primary .btn
 *   Form fields        .field, label, input, select, textarea, .field-hint, .error
 *   Modals             .modal-backdrop, .modal, .modal-title, .modal-sub,
 *                      .modal-actions, .modal-thumb
 *   Cards & grid       .grid-wrap, .grid, .card, .card-img-wrap, .card-meta,
 *                      .card-subject, .card-detail, .card-tags
 *   Tags               .tag, .tag.wedding/engagement/elopement/proposal/
 *                      family/senior/commercial/personal/other
 *   Lightbox           .lightbox, .lightbox-inner, .lightbox-img-wrap,
 *                      .lightbox-info, .lightbox-subject, .lightbox-venue,
 *                      .info-row, .lightbox-actions, .lightbox-close,
 *                      .lightbox-nav.prev/.next
 *   Portfolio popup    .add-to-existing-popup, .ate-item, .ate-item-name,
 *                      .ate-item-count, .ate-empty
 *   Empty states       .empty, .empty-title (with ✦ ::before and underline ::after)
 *   Toast              .toast, .toast.show
 *   Loading            .loading (spinner via ::after + spark-spin keyframe)
 *   Theme overrides    [data-theme="quantum"], [data-theme="spark"],
 *                      [data-theme="ink"], [data-theme="photo-club"]
 *   Flourish           fadeUp keyframe, .grid.loaded .card stagger,
 *                      .pf-header dot-grid, empty-state decorations
 *   Responsive         @media (max-width: 600px) shared component overrides
 *
 * THEME PALETTES (data-theme values)
 * ------------------------------------
 *   warm-neutral   Default warm off-white (tokens from settings.json)
 *   quantum        High-contrast black/white brutalist override
 *   spark          Dark design-system palette (#1c1e22 bg, amber accent)
 *                  Body gets dot-grid texture; chrome stays solid for elevation.
 *                  Fraunces serif applied to all heading/title elements.
 *                  See brand-core/ for full Spark design system tokens.
 *
 * MIGRATION NOTE
 * --------------
 *   This file currently lives in apps/library/assets/ and is consumed only
 *   by the library app. When Hub is built (see monorepo CLAUDE.md), migrate
 *   this to packages/ui/spark.css and serve it via Apache Alias so all apps
 *   share a single copy. Until then, do NOT copy this file into other apps —
 *   hand Broadcast the design system doc (sparkstudiolab.com/assets/SPARK_STUDIO_DESIGN_SYSTEM.md)
 *   for UX reference, and unify CSS at packages/ui time.
 */

/* ── FONTS ─────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300;1,9..40,400&family=DM+Serif+Display:ital@0;1&family=Fraunces:ital,opsz,wght@1,9..144,700&display=swap');

/* ── TOKEN DEFAULTS ─────────────────────────────────────────────────────────── */
/* Overridden per-request by _theme.php's inline :root block */
:root {
  --bg:           #F4F1EC;
  --surface:      #FAFAF6;
  --surface2:     #EDE9E1;
  --border:       #D4CFC3;
  --accent:       #5C7A52;
  --accent-dim:   rgba(92,122,82,0.08);
  --text:         #2C3328;
  --text-muted:   #A3B09B;
  --text-dim:     #7A8B72;
  --success:      #2d5a3d;
  --danger:       #9b3a3a;
  --portfolio:    #3a5a7a;
  --portfolio-dim:rgba(58,90,122,0.1);
  --radius:       5px;
}

/* ── RESET & BASE ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 300;
  min-height: 100vh;
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
.header {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.header-brand  { font-family: 'DM Serif Display', Georgia, serif; font-size: 14px; color: var(--text-dim); }
.header-bolt   { height: 22px; width: auto; display: block; flex-shrink: 0; }
.header-logo   { max-height: 28px; max-width: 120px; object-fit: contain; display: block; }
.header-right  { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-count  { color: var(--text-muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.header-count strong { color: var(--accent); font-weight: 500; }
.upload-link   { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: 11px; text-decoration: none; transition: all .15s; background: var(--surface); }
.upload-link:hover { border-color: var(--accent); color: var(--accent); }
.logout-link   { font-size: 11px; color: var(--text-muted); text-decoration: none; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); transition: all .15s; }
.logout-link:hover { border-color: var(--danger); color: var(--danger); }
.settings-btn  { font-size: 13px; color: var(--text-muted); background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 9px; cursor: pointer; transition: all .15s; line-height: 1.4; }
.settings-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── TAB BAR ────────────────────────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 2px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 53px; z-index: 99; overflow-x: auto; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { padding: 12px 16px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 400; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: all .15s; letter-spacing: .02em; margin-bottom: -1px; text-decoration: none; display: inline-flex; align-items: center; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab-btn.disabled { color: var(--border); cursor: not-allowed; font-style: italic; pointer-events: none; }
.tab-btn .tab-badge { font-size: 9px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); padding: 1px 5px; border-radius: 8px; margin-left: 5px; }
.tab-btn.active .tab-badge { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── RANGE SLIDER ───────────────────────────────────────────────────────────── */
input[type=range] { -webkit-appearance: none; width: 70px; height: 3px; background: var(--border); border-radius: 2px; outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; }
.size-wrap { display: flex; align-items: center; gap: 7px; }
.filter-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn { position: relative; overflow: hidden; background: var(--accent); color: #fff; border: none; padding: 6px 13px; border-radius: var(--radius); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; transition: opacity .12s; white-space: nowrap; }
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); opacity: 1; }

/* Fuse-lighting hover on primary buttons */
.btn:not(.btn-ghost):not(.btn-danger)::before {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.18);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .38s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none; border-radius: inherit;
}
.btn:not(.btn-ghost):not(.btn-danger):hover::before { transform: scaleX(1); }
.btn:not(.btn-ghost):not(.btn-danger):hover { opacity: 1; }

/* Secondary button for use inside lightbox (always dark background — theme-immune) */
.btn-lb { background: transparent; color: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.2); padding: 6px 13px; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; cursor: pointer; text-align: center; text-decoration: none; display: block; transition: all .15s; }
.btn-lb:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ── FORM FIELDS ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 400; }
label .req { color: var(--accent); }
input[type=text], input[type=number], input[type=password], select, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 8px 11px; border-radius: var(--radius); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 300; outline: none; transition: border-color .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 65px; }
.field-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.error { background: rgba(155,58,58,.07); border: 1px solid rgba(155,58,58,.25); color: var(--danger); font-size: 12px; padding: 9px 12px; border-radius: var(--radius); }

/* ── MODALS ─────────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,26,24,.55); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; max-width: 380px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,.12); max-height: calc(100vh - 48px); overflow-y: auto; }
.modal-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 19px; margin-bottom: 6px; }
.modal-title em { font-style: italic; color: var(--danger); }
.modal-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.5; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; }
.modal-thumb { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 3px; margin-bottom: 14px; border: 1px solid var(--border); display: block; }

/* ── CARDS & GRID ───────────────────────────────────────────────────────────── */
.grid-wrap { padding: 20px 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(45,90,61,.08); transform: translateY(-1px); }
.card-img-wrap { position: relative; aspect-ratio: 3/2; overflow: hidden; background: var(--surface2); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.card:hover .card-img-wrap img { transform: scale(1.04); }
.card-meta    { padding: 9px 11px; }
.card-subject { font-family: 'DM Serif Display', Georgia, serif; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.card-detail  { color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags    { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }

/* ── TAGS ───────────────────────────────────────────────────────────────────── */
.tag { font-size: 9px; padding: 2px 5px; border-radius: 2px; letter-spacing: .06em; text-transform: uppercase; background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.tag.wedding    { color:#5a3a2a; border-color:rgba(90,58,42,.3);   background:rgba(90,58,42,.07); }
.tag.engagement { color:#2a4a5a; border-color:rgba(42,74,90,.3);   background:rgba(42,74,90,.07); }
.tag.elopement  { color:#4a2a5a; border-color:rgba(74,42,90,.3);   background:rgba(74,42,90,.07); }
.tag.proposal   { color:#5a2a3a; border-color:rgba(90,42,58,.3);   background:rgba(90,42,58,.07); }
.tag.family     { color:#2d5a3d; border-color:rgba(45,90,61,.3);   background:rgba(45,90,61,.07); }
.tag.senior     { color:#5a4a2a; border-color:rgba(90,74,42,.3);   background:rgba(90,74,42,.07); }
.tag.commercial { color:#2a3a5a; border-color:rgba(42,58,90,.3);   background:rgba(42,58,90,.07); }
.tag.personal   { color:#3a5a2a; border-color:rgba(58,90,42,.3);   background:rgba(58,90,42,.07); }
.tag.other      { color:#4a4a4a; border-color:rgba(74,74,74,.3);   background:rgba(74,74,74,.07); }

/* ── LIGHTBOX ───────────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 32px; }
.lightbox.open { display: flex; }
.lightbox-inner { max-width: 1100px; width: 100%; display: flex; gap: 32px; align-items: flex-start; }
.lightbox-img-wrap { flex: 1; min-width: 0; }
.lightbox-img-wrap img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: var(--radius); display: block; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lightbox-info    { width: 240px; flex-shrink: 0; }
.lightbox-subject { font-family: 'DM Serif Display', Georgia, serif; font-size: 20px; margin-bottom: 3px; color: #f0ede8; }
.lightbox-venue   { color: #c8a96e; font-size: 11px; margin-bottom: 14px; }
.info-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 11px; }
.info-row:last-of-type { border-bottom: none; }
.info-key { color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .08em; }
.info-val { color: rgba(255,255,255,.8); text-align: right; max-width: 150px; overflow-wrap: break-word; }
.lightbox-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 7px; }
.lightbox-close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: rgba(255,255,255,.5); font-size: 28px; cursor: pointer; line-height: 1; padding: 4px; }
.lightbox-close:hover { color: #fff; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.7); width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; z-index: 10; }
.lightbox-nav:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-nav:disabled { opacity: .2; cursor: default; }

/* ── PORTFOLIO POPUP (shared by index.php + session.php) ───────────────────── */
.add-to-existing-popup { position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 20px rgba(0,0,0,.1); min-width: 200px; max-height: 240px; overflow-y: auto; display: none; z-index: 300; }
.add-to-existing-popup.open { display: block; }
#lbPortfolioPopup { z-index: 1010; }
.ate-item { padding: 9px 14px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: background .12s; }
.ate-item:last-child { border-bottom: none; }
.ate-item:hover { background: var(--accent-dim); }
.ate-item-name { color: var(--text-dim); }
.ate-item-count { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.ate-empty { padding: 12px 14px; font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ── EMPTY STATES ───────────────────────────────────────────────────────────── */
.empty { padding: 80px 28px; text-align: center; color: var(--text-muted); }
.empty-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 22px; font-style: italic; margin-bottom: 8px; color: var(--text-dim); }
.empty a { color: var(--accent); }

.empty-first-session { padding-top: 32px; padding-bottom: 60px; text-align: left; padding-left: 28px; }
.empty-arrow {
  width: 52px; height: auto; display: block;
  margin-bottom: 20px;
  transform-origin: bottom left;
  animation: arrowFloat 2.2s ease-in-out infinite;
}
@keyframes arrowFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-7px) rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) { .empty-arrow { animation: none; } }

/* ── TOAST ──────────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--success); color: #fff; padding: 9px 18px; border-radius: var(--radius); font-size: 12px; opacity: 0; transition: all .2s; z-index: 2000; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOADING ────────────────────────────────────────────────────────────────── */
.loading { padding: 80px 28px; text-align: center; color: var(--text-muted); }
.loading-bolt {
  width: 32px; height: auto; display: block; margin: 0 auto 16px;
  animation: boltPulse 1.6s ease-in-out infinite;
}
.loading-bolt path { fill: #fece2e; }
.loading-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
  animation: boltFade 1.6s ease-in-out infinite;
}
@keyframes boltPulse {
  0%, 100% { opacity: .5; transform: translateY(0)   scale(1); }
  50%       { opacity: 1;   transform: translateY(-4px) scale(1.08); }
}
@keyframes boltFade {
  0%, 100% { opacity: .4; }
  50%       { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-bolt, .loading-label { animation: none; opacity: .7; }
}

/* ── THEME OVERRIDES ────────────────────────────────────────────────────────── */

/* Quantum */
[data-theme="quantum"] .controls-wrap { background-image: linear-gradient(45deg,#000 25%,transparent 25%),linear-gradient(-45deg,#000 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#000 75%),linear-gradient(-45deg,transparent 75%,#000 75%); background-size: 2px 2px; background-position: 0 0,0 1px,1px -1px,-1px 0; background-color: #fff; }
[data-theme="quantum"] .header,
[data-theme="quantum"] .tab-bar { border-bottom: 2px solid #000; }
[data-theme="quantum"] .card,
[data-theme="quantum"] .session-card { border-width: 2px; border-radius: 0; }
[data-theme="quantum"] .modal { border-width: 2px; border-radius: 0; box-shadow: 4px 4px 0 #000; }
[data-theme="quantum"] .btn { border-radius: 0; }
[data-theme="quantum"] .card-img-wrap img,
[data-theme="quantum"] .session-card-thumb img { image-rendering: pixelated; }

/* Spark — dot-grid on body only; chrome uses solid surface colors for contrast */
body[data-theme="spark"] {
  background-image: radial-gradient(circle, rgba(196,149,106,0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}
[data-theme="spark"] .btn:not(.btn-ghost):not(.btn-danger) { color: #1c1e22; }
[data-theme="spark"] .btn-ghost { color: var(--text-dim); border-color: rgba(255,255,255,0.18); }
[data-theme="spark"] .btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.35); opacity: 1; }
[data-theme="spark"] .delete-toggle .toggle-dot::after { background: var(--bg); }
[data-theme="spark"] .delete-toggle.active .toggle-dot::after { background: #fff; }
[data-theme="spark"] .header-brand,
[data-theme="spark"] .session-card-subject,
[data-theme="spark"] .card-subject,
[data-theme="spark"] .portfolio-name-input,
[data-theme="spark"] .portfolio-empty-title,
[data-theme="spark"] .portfolio-card-name,
[data-theme="spark"] .portfolios-empty-title,
[data-theme="spark"] .pf-title,
[data-theme="spark"] .placeholder-title,
[data-theme="spark"] .empty-title,
[data-theme="spark"] .lightbox-subject,
[data-theme="spark"] .modal-title,
[data-theme="spark"] .tray-title,
[data-theme="spark"] .tray-name-input,
[data-theme="spark"] .session-hero-subject { font-family: 'Fraunces', Georgia, serif; }

/* Vaporwave — topographic contours in perspective floor projection */
body[data-theme="vaporwave"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 106, 210, 0.14) 0, rgba(255, 106, 210, 0.14) 1px,
      transparent 1px, transparent 40px
    ),
    repeating-linear-gradient(
      to right,
      rgba(255, 106, 210, 0.09) 0, rgba(255, 106, 210, 0.09) 1px,
      transparent 1px, transparent 40px
    );
  transform-origin: 50% 100%;
  transform: perspective(500px) rotateX(-25deg);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.75) 55%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.75) 55%);
  pointer-events: none;
  z-index: 0;
}

/* Ink — cream accent needs dark button text */
[data-theme="ink"] .btn:not(.btn-ghost):not(.btn-danger) { color: #111114; }

/* Photo Club — warm gold accent needs dark button text */
[data-theme="photo-club"] .btn:not(.btn-ghost):not(.btn-danger) { color: #0e0e0e; }

/* ── FLOURISH ───────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
.grid.loaded .card {
  animation: fadeUp .26s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: calc(var(--i,0) * .022s);
}

/* Dot-grid on portfolio overlay header (all themes) */
.pf-header {
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Accent spark + underline on empty states */
.empty::before {
  content: '✦'; display: block; font-size: 14px;
  color: var(--accent); opacity: .55; margin-bottom: 8px;
}
.empty-title::after {
  content: ''; display: block; width: 36px; height: 1.5px;
  background: var(--accent); opacity: .4; margin: 9px auto 0; border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .grid.loaded .card { animation: none; }
}

/* ── RESPONSIVE (shared components) ────────────────────────────────────────── */
@media (max-width: 600px) {
  .header { padding: 12px 16px; }
  .tab-bar { padding: 0 16px; }
  .grid-wrap { padding: 16px; }
  .lightbox { padding: 52px 16px 24px; overflow-y: auto; align-items: flex-start; }
  .lightbox-inner { flex-direction: column; }
  .lightbox-img-wrap img { max-height: 55vh; }
  .lightbox-info { width: 100%; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .modal-backdrop { align-items: flex-start; padding: 16px; }
  .modal { padding: 20px 18px; max-height: calc(100dvh - 32px); }
}
