/* ==========================================================================
   Veil — shared design system
   Aesthetic direction: "after-dark polaroid" — inky nightclub darkness,
   grainy film texture, a single acid-lime signal color that reads as
   "something is happening here", coral for urgency/countdown, warm amber
   for hints, cool cyan for a completed mutual reveal. Chunky rounded
   display type for headlines (Unbounded) against a humanist body face
   (Hanken Grotesk) and a mono face for anything that reads like a code,
   timestamp, or ticket stub (JetBrains Mono).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700;900&family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  /* ---- ink / surfaces ---- */
  --ink-950: #07070a;
  --ink-900: #0d0e13;
  --ink-850: #121319;
  --ink-800: #17181f;
  --ink-700: #20222b;
  --ink-600: #2b2d38;
  --line: rgba(245, 244, 240, 0.09);
  --line-strong: rgba(245, 244, 240, 0.16);

  /* ---- signal colors ---- */
  --acid: #c8ff3d;
  --acid-dim: #a3d928;
  --acid-ink: #12210a; /* text-on-acid */
  --coral: #ff5c7a;
  --coral-dim: #ff3d63;
  --amber: #ffb84c;
  --sky: #6fe7dd;

  /* ---- text ---- */
  --text-hi: #f6f5f0;
  --text-mid: #a9adbc;
  --text-low: #6b7080;

  /* ---- paper (tactile ticket/claim-code surfaces) ---- */
  --paper: #f2ecd9;
  --paper-ink: #1c1a12;

  /* ---- type ---- */
  --font-display: "Unbounded", sans-serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* ---- geometry ---- */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.65);
  --shadow-acid: 0 0 0 1px rgba(200, 255, 61, 0.4), 0 8px 30px -6px rgba(200, 255, 61, 0.35);
  --shadow-coral: 0 0 0 1px rgba(255, 92, 122, 0.4), 0 8px 30px -6px rgba(255, 92, 122, 0.4);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

/* Author styles like `.feed { display: flex }` otherwise beat the browser's
   UA-level `[hidden] { display: none }` rule (author origin always wins),
   so anything toggled via the `hidden` attribute needs this reinforced. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink-950);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Atmosphere: layered radial glows + a faint grain canvas sit behind
   everything on every page. See js/grain.js for the canvas noise. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% -6%, rgba(200, 255, 61, 0.16), transparent 60%),
    radial-gradient(50% 45% at 105% 8%, rgba(255, 92, 122, 0.14), transparent 60%),
    radial-gradient(70% 60% at 50% 115%, rgba(111, 231, 221, 0.09), transparent 60%),
    var(--ink-950);
}

#veil-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 900px) {
  .container {
    max-width: 1080px;
    padding: 0 40px;
  }
  .container.container--narrow {
    max-width: 640px;
  }
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 26px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.18s var(--ease-spring), box-shadow 0.25s var(--ease-out), filter 0.2s;
  will-change: transform;
  position: relative;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn--primary {
  background: var(--acid);
  color: var(--acid-ink);
  box-shadow: var(--shadow-acid);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(200, 255, 61, 0.55), 0 14px 34px -8px rgba(200, 255, 61, 0.5);
}

.btn--coral {
  background: var(--coral);
  color: #2a0510;
  box-shadow: var(--shadow-coral);
}
.btn--coral:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-hi);
  border: 1.5px solid var(--line-strong);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--acid);
  color: var(--acid);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  padding: 12px;
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------------------
   Chips / pills / tags
   --------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-mid);
}

.chip--select {
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), border-color 0.2s, color 0.2s, background 0.2s;
  user-select: none;
}
.chip--select:hover {
  border-color: var(--line-strong);
  color: var(--text-hi);
}
.chip--select:active {
  transform: scale(0.94);
}
.chip--select.is-active {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--acid-ink);
  transform: translateY(-1px);
}

.chip--state {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 5px 10px;
}
.chip--state.new { color: var(--sky); border-color: rgba(111, 231, 221, 0.4); background: rgba(111, 231, 221, 0.08); }
.chip--state.hint { color: var(--amber); border-color: rgba(255, 184, 76, 0.4); background: rgba(255, 184, 76, 0.08); }
.chip--state.pending { color: var(--coral); border-color: rgba(255, 92, 122, 0.45); background: rgba(255, 92, 122, 0.1); }
.chip--state.revealed { color: var(--acid); border-color: rgba(200, 255, 61, 0.45); background: rgba(200, 255, 61, 0.1); }
.chip--state.expired { color: var(--text-low); border-color: var(--line); background: rgba(255, 255, 255, 0.02); }

.tag-hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--amber);
  background: rgba(255, 184, 76, 0.09);
  border: 1px dashed rgba(255, 184, 76, 0.4);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------------------------------------------------------------------
   Card
   --------------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------------------
   Form fields (shared by claim.html, login.html, signup.html)
   --------------------------------------------------------------------- */
.text-field {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--ink-900);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.text-field:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 4px rgba(200, 255, 61, 0.1);
}
.text-field::placeholder {
  color: var(--text-low);
}
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-error {
  font-size: 12px;
  color: var(--coral);
  margin-top: 6px;
  min-height: 15px;
}

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 10, 0.72);
  border-bottom: 1px solid var(--line);
}
.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--acid);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(200, 255, 61, 0.55);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 3px;
  background: var(--ink-950);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 55% 55%, 55% 100%, 0 100%);
}

/* ---------------------------------------------------------------------
   Scrollbar + selection, small kindnesses
   --------------------------------------------------------------------- */
::selection {
  background: var(--acid);
  color: var(--acid-ink);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--ink-600);
  border-radius: 8px;
  border: 2px solid var(--ink-950);
}

/* ---------------------------------------------------------------------
   Skeletons
   --------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--ink-800);
  border-radius: var(--radius-md);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ---------------------------------------------------------------------
   Reveal / entrance animation utilities
   --------------------------------------------------------------------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.rise-in {
  animation: rise-in 0.6s var(--ease-out) both;
}

@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
.pop-in {
  animation: pop-in 0.5s var(--ease-spring) both;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-700);
  border: 1px solid var(--line-strong);
  color: var(--text-hi);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.35s var(--ease-spring);
  z-index: 200;
  white-space: nowrap;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
  flex-shrink: 0;
}
