/* Alesia Live Gallery — shared design system (see design/dna.json) */
:root {
  --bg: #000;
  --surface: #0a0a0a;
  --surface-raised: #141414;
  --border: #262626;
  --border-strong: rgba(255, 255, 255, .3);
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --faint: #737373;
  --accent: #d4af37;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(212, 175, 55, .12);
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;

  --font-body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-card: 16px;
  --radius-media: 10px;
  --glow: 0 0 20px rgba(212, 175, 55, .1);
  --lift: 0 2px 8px rgba(0, 0, 0, .5), 0 12px 30px rgba(0, 0, 0, .75);

  --fast: 150ms;
  --normal: 300ms;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

/* Components set display: grid/flex; the hidden attribute must still win. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Signature texture: the faint dotted grid of the Alesia site */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .16) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, .07) 1.5px, transparent 1.5px);
  background-size: 50px 50px;
  background-position: 0 0, 25px 25px;
  opacity: .5;
  z-index: -1;
}

h1, h2, h3 { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(26px, 5vw, 42px); line-height: 1.1; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  font-weight: 500;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand .tag {
  font: 500 11px var(--font-mono);
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font-body);
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease), color var(--fast);
}
.btn:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .04); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: #e2c25a; border-color: #e2c25a; box-shadow: var(--glow); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 12px; }
.btn-icon { width: 42px; padding: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font: 500 11px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(212, 175, 55, .6); animation: live 1.8s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, .55); } 70% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); } }
.chip-live { color: var(--accent); border-color: rgba(212, 175, 55, .35); background: var(--accent-soft); }

/* ---------- Surfaces & forms ---------- */
.card {
  background: rgba(10, 10, 10, .88);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: clamp(18px, 3vw, 28px);
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.input, select.input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: 15px var(--font-body);
  transition: border-color var(--fast);
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #3a3a3a; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="date"].input { color-scheme: dark; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }

/* Credential rows: label / value / copy */
.creds { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cred { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--surface); }
.cred dt { font-size: 12px; color: var(--muted); }
.cred dd { margin: 0; font: 500 16px var(--font-mono); letter-spacing: .02em; overflow-wrap: anywhere; }
.cred.hl dd { color: var(--accent); font-size: 19px; }
@media (max-width: 480px) { .cred { grid-template-columns: 1fr auto; } .cred dt { grid-column: 1 / -1; } }

code { font: 500 .92em var(--font-mono); background: var(--surface-raised); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 999px; background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--lift); font-size: 14px; animation: toast-in var(--normal) var(--ease); max-width: 100%; }
.toast.ok { border-color: rgba(74, 222, 128, .4); }
.toast.err { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Language picker (first visit) ---------- */
.lang-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade var(--normal) var(--ease);
}
.lang-gate-inner { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.lang-gate img { width: 88px; height: 88px; }
.lang-gate h1 { font-size: 22px; }
.lang-gate .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.lang-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.lang-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  padding: 18px; border-radius: var(--radius-card); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left;
  font: inherit; transition: border-color var(--fast), transform var(--fast) var(--ease), background var(--fast);
}
.lang-option:hover { border-color: var(--accent); background: #0f0d06; transform: translateY(-2px); }
.lang-option .code { font: 500 26px var(--font-mono); }
.lang-option .name { font-size: 14px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }

.lang-toggle { font: 600 11px var(--font-mono); letter-spacing: .14em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
