:root {
  --bg: #0b0c0e;
  --bg-2: #141519;
  --bg-3: #1d1f24;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f3f1ec;
  --muted: #a3a29d;
  --faint: #6d6d6a;
  --accent: #f0b23a;
  --accent-ink: #1a1305;
  --danger: #ff7a6b;
  --radius: 10px;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* -- brand ------------------------------------------------------------------ */
.brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  text-decoration: none; white-space: nowrap;
}
.brand b {
  font-weight: 600; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; line-height: 1;
}
.brand span {
  font-weight: 300; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}

/* -- buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; cursor: pointer; text-decoration: none; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #f5c25d; }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* -- homepage --------------------------------------------------------------- */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.hero {
  position: relative; flex: 1; min-height: 560px; display: flex; flex-direction: column;
  overflow: hidden; isolation: isolate;
}
.slides { position: absolute; inset: 0; z-index: -2; background: radial-gradient(120% 90% at 70% 20%, #23252b, var(--bg) 70%); }
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.08); filter: saturate(0.8);
  transition: opacity 2.4s ease, transform 14s linear;
}
.slides img.on { opacity: 0.5; transform: scale(1); }
.slides img:only-child { transform: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 12, 14, 0.7) 0%, rgba(11, 12, 14, 0.2) 30%, rgba(11, 12, 14, 0.35) 65%, var(--bg) 100%),
    radial-gradient(50% 45% at 50% 50%, rgba(11, 12, 14, 0.55), transparent 85%);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
}

.access {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 16px 96px;
}
.access h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(46px, 8vw, 88px); line-height: 1; letter-spacing: -0.01em; margin: 0 0 20px;
  text-wrap: balance;
}
.access p.lede { color: #d4d2cc; max-width: 440px; margin: 0 auto 32px; font-size: 16px; font-weight: 300; text-wrap: pretty; }
.code-form {
  display: flex; gap: 8px; width: min(440px, 100%); padding: 6px;
  background: rgba(20, 21, 25, 0.72); border: 1px solid var(--line-2); border-radius: 999px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.code-form:focus-within { border-color: rgba(240, 178, 58, 0.6); }
.code-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: 0; background: transparent;
  font-size: 16px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
}
.code-form input::placeholder { letter-spacing: 0.04em; text-transform: none; color: var(--faint); font-weight: 400; }
.code-form input:focus { outline: none; }
.form-msg { min-height: 24px; margin-top: 14px; font-size: 14px; color: var(--danger); }
.form-msg.ok { color: var(--muted); }
.resume { margin-top: 6px; font-size: 14px; color: var(--muted); }
.resume a { color: var(--text); }

.ig-section { padding: 72px clamp(16px, 4vw, 48px) 48px; max-width: 1100px; margin: 0 auto; width: 100%; }
.ig-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; margin-top: 24px; }
.ig-posts .instagram-media { min-width: 0 !important; width: 100% !important; margin: 0 !important; }
footer.site {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 16px 36px; text-align: center; color: var(--faint); font-size: 13px;
}
footer.site p { margin: 0; }
.footer-ig { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); transition: color 0.2s, background 0.2s; }
.footer-ig:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.footer-ig svg { width: 22px; height: 22px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.home footer.site { border-top: 0; }
body:not(.home) footer.site { border-top: 1px solid var(--line); }

/* -- legal pages --------------------------------------------------------- */
.legal { max-width: 720px; margin: 0 auto; padding: 48px 16px 72px; }
.legal h1 { font-family: var(--display); font-weight: 500; font-size: clamp(38px, 6vw, 56px); line-height: 1.05; margin: 0 0 8px; }
.legal .updated { color: var(--muted); margin: 0 0 36px; font-size: 14px; }
.legal h2 { font-size: 18px; font-weight: 600; margin: 36px 0 10px; }
.legal p, .legal li { color: #d4d2cc; font-weight: 300; line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--text); text-underline-offset: 3px; }
.legal .summary { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.legal .summary p { margin: 0; }

/* -- gallery: header and filters --------------------------------------------- */
.g-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 12, 14, 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.g-top { border-bottom: 1px solid var(--line); }
.g-head .filters { padding-top: 14px; }
.g-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px);
}
.g-title-wrap { padding: 28px clamp(16px, 3vw, 32px) 18px; }
.g-title { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
.g-sub { color: var(--muted); margin: 8px 0 0; font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }

.filters {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 clamp(16px, 3vw, 32px) 14px;
}
.filter-wrap { position: relative; }
.filter-btn[aria-expanded="true"] { background: var(--bg-3); border-color: var(--line-2); }
.filter-btn .count {
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px;
  border-radius: 999px; background: rgba(240, 178, 58, 0.14); border: 1px solid rgba(240, 178, 58, 0.4);
  color: #ffd78a; font-weight: 600; font-size: 14px; cursor: pointer;
}
.tag:hover { background: rgba(240, 178, 58, 0.22); }
.tag svg { width: 14px; height: 14px; opacity: 0.8; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.result-count { margin-left: auto; color: var(--muted); font-size: 14px; }

.popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: min(360px, calc(100vw - 32px)); padding: 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.popover[hidden] { display: none; }
.popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.popover-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.popover input[type="search"] {
  width: 100%; height: 40px; padding: 0 14px; margin-bottom: 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg);
}
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; }
.num {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 54px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); cursor: pointer;
}
.num b { font-size: 18px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.num small { font-size: 11px; color: var(--muted); }
.num:hover { border-color: var(--line-2); }
.num[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.num[aria-pressed="true"] small { color: rgba(26, 19, 5, 0.7); }
.pop-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* -- gallery grid (justified rows) ----------------------------------------- */
.grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 18px clamp(16px, 3vw, 32px) 64px;
}
.grid::after { content: ""; flex-grow: 999999; }
.tile {
  position: relative; display: block; padding: 0; border: 0; cursor: zoom-in; overflow: hidden;
  background: var(--bg-3); border-radius: 4px;
  flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--row));
  --row: 240px;
}
.tile img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: var(--r); transition: transform 0.4s ease, opacity 0.4s; opacity: 0; }
.tile img.ld { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile .jn {
  position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; flex-wrap: wrap;
  opacity: 0; transition: opacity 0.2s;
}
.tile:hover .jn, .tile:focus-visible .jn { opacity: 1; }
.tile .jn span {
  font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: rgba(11, 12, 14, 0.75); color: var(--text);
}
.empty { padding: 80px 16px; text-align: center; color: var(--muted); width: 100%; }
.empty h2 { color: var(--text); font-size: 20px; margin: 0 0 8px; font-weight: 600; }
@media (max-width: 640px) {
  .tile { --row: 150px; }
  .grid { gap: 4px; }
  .g-bar .brand span { display: none; }
  .result-count { margin-left: 0; width: 100%; }
}

/* -- lightbox ---------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid;
  grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: 100%; background: #060708;
}
.lightbox[hidden] { display: none; }
.lb-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; --pad: 56px 72px; }
.lb-stage img {
  position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; object-fit: contain;
  box-sizing: border-box; padding: var(--pad); user-select: none; transition: opacity 0.2s;
}
.lb-stage .lb-thumb { filter: blur(12px); opacity: 0.5; }
.lb-loading { position: absolute; z-index: 1; width: 34px; height: 34px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn svg { width: 22px; height: 22px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.lb-counter { position: absolute; z-index: 1; top: 24px; left: 24px; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; }

.lb-panel {
  background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto;
  padding: 72px 28px 28px; display: flex; flex-direction: column; gap: 24px;
}
.lb-panel h2 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.lb-panel .when { color: var(--muted); font-size: 14px; margin-top: 4px; }
.lb-section h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.lb-jerseys { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-jerseys button {
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 48px; height: 40px; padding: 0 10px;
  border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); cursor: pointer;
}
.lb-jerseys button:hover { border-color: var(--accent); }
.lb-jerseys .none { color: var(--muted); font-size: 14px; }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.dl-group { display: flex; flex-direction: column; gap: 10px; }
.dl-group .btn { width: 100%; }
.dl-note { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }

@media (max-width: 900px) {
  .lightbox { display: block; overflow-y: auto; }
  .lb-stage { height: 74svh; --pad: 64px 8px 76px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-panel { border-left: 0; border-top: 1px solid var(--line); padding: 24px 16px 32px; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: var(--bg-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 999px; font-size: 14px;
}
.toast[hidden] { display: none; }

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

/* -- contact ------------------------------------------------------------- */
.email-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  margin: 8px 0 28px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2);
}
.email-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.email-addr { font-size: clamp(22px, 4vw, 28px); font-weight: 500; user-select: all; overflow-wrap: anywhere; }
.email-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.email-status { min-height: 20px; font-size: 13px; color: var(--muted); }

/* -- magnetic access button ------------------------------------------------ */
.magnet {
  position: relative; overflow: hidden; isolation: isolate;
  --mx: 50%; --my: 50%;
  transition: background 0.2s, box-shadow 0.3s ease;
  will-change: transform;
}
.magnet::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(80px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.55), transparent 70%);
}
.magnet span { display: inline-block; will-change: transform; }
.magnet.near::before { opacity: 1; }
.magnet.near { box-shadow: 0 10px 30px -8px rgba(240, 178, 58, 0.55); }
.magnet:disabled { opacity: 1; cursor: progress; }
.magnet:disabled span { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }

/* Button morphs into the next page. */
.morph { position: fixed; z-index: 1000; pointer-events: none; background: var(--accent); border-radius: 999px; }
.leaving .access, .leaving .topbar { transition: opacity 0.35s ease, transform 0.5s ease; opacity: 0; transform: scale(0.98); }
.leaving .slides { transition: opacity 0.5s ease; opacity: 0; }

/* Gallery entrance after the morph. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.entering .g-top, .entering .g-title-wrap, .entering #filter-bar { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.entering .g-title-wrap { animation-delay: 0.06s; }
.entering #filter-bar { animation-delay: 0.12s; }
.entering .tile { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(min(var(--i), 24) * 28ms + 180ms); }
