/* ==========================================================================
   GIVE & GO — shared functional layer
   Visual design lives in each concept. This file only carries behaviour
   primitives that must work identically everywhere: skip link, screen-reader
   text, reveal, lightbox, language switch, form feedback.
   ========================================================================== */

:root {
  --gag-green: #20c653;
  --gag-green-bright: #25d366;
  --gag-purple: #211039;
  --gag-violet: #160b2b;
  --gag-white: #ffffff;
  --gag-off: #f7f7f5;
  --gag-grey: #e9e9ec;
  --gag-lavender: #a99cbf;
  --gag-lb-accent: var(--gag-green);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--gag-green);
  color: #06140a;
  font: 600 14px/1 system-ui, sans-serif;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
  text-decoration: none;
}
.skip-link:focus-visible { transform: none; }

/* Visible focus for keyboard users, everywhere */
:focus-visible {
  outline: 2px solid var(--gag-green-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- reveal -- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------------------------------------------------------- language UI -- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 99px;
}
.lang-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 5px 8px;
  border-radius: 99px;
  line-height: 1;
  opacity: 0.62;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.lang-switch button:hover { opacity: 1; }
.lang-switch button[aria-pressed="true"] { opacity: 1; }
.lang-switch .flag {
  font-size: 15px;
  line-height: 1;
  filter: saturate(1.05);
}
.lang-switch .code {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ----------------------------------------------------------------- tilt -- */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s ease;
}
.tilt.is-tilting { transition: transform 0.08s linear, box-shadow 0.4s ease; }

/* -------------------------------------------------------------- lightbox -- */
body.gag-lb-open { overflow: hidden !important; }

.gag-lb {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}
.gag-lb.is-open { opacity: 1; visibility: visible; }

.gag-lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 6, 26, 0.93);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 0;
  padding: 0;
  cursor: zoom-out;
}

.gag-lb__dialog {
  position: relative;
  z-index: 1;
  width: min(1240px, 94vw);
  height: min(880px, 92vh);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  transform: scale(0.965);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.gag-lb.is-open .gag-lb__dialog { transform: none; }
.gag-lb__dialog > * { pointer-events: auto; }

.gag-lb__stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(32, 198, 83, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  touch-action: pan-y;
}
.gag-lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.28s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.gag-lb__img.is-ready { opacity: 1; }

.gag-lb__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #f4f1fa;
  min-height: 46px;
}
.gag-lb__cap {
  flex: 1;
  font: 400 13.5px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  padding-left: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gag-lb__count {
  font: 500 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
.gag-lb__btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(22, 11, 43, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gag-lb__btn:hover {
  background: var(--gag-lb-accent);
  border-color: var(--gag-lb-accent);
  color: #051208;
}
.gag-lb__btn:active { transform: scale(0.94); }
.gag-lb__btn:disabled { opacity: 0.25; cursor: default; }
.gag-lb__btn svg { width: 20px; height: 20px; pointer-events: none; }
.gag-lb__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.gag-lb__next { right: 14px; top: 50%; transform: translateY(-50%); }
.gag-lb__prev:hover, .gag-lb__next:hover { transform: translateY(-50%); }
.gag-lb__close { top: 12px; right: 12px; width: 40px; height: 40px; }

.gag-lb__thumbs {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.gag-lb__thumb {
  flex: 0 0 64px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  opacity: 0.45;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gag-lb__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gag-lb__thumb[aria-current="true"] { opacity: 1; border-color: var(--gag-lb-accent); }

@media (max-width: 760px) {
  .gag-lb__dialog { width: 100vw; height: 100dvh; gap: 0; }
  .gag-lb__stage { border-radius: 0; border: 0; height: 100%; }
  .gag-lb__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(10, 4, 20, 0.92), transparent);
    align-items: flex-end;
  }
  .gag-lb__cap { font-size: 12.5px; padding-right: 44px; }
  .gag-lb__prev, .gag-lb__next {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: none;
    width: 44px;
    height: 44px;
  }
  .gag-lb__prev { left: 14px; }
  .gag-lb__next { right: 14px; }
  .gag-lb__close { top: calc(10px + env(safe-area-inset-top)); right: 10px; }
}

/* -------------------------------------------------------------- form msg -- */
.gag-status {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font: 500 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.gag-status.is-visible { display: flex; }
.gag-status[data-state="error"] {
  background: rgba(255, 86, 86, 0.12);
  border: 1px solid rgba(255, 86, 86, 0.4);
  color: #ffb4b4;
}
.gag-status[data-state="success"] {
  background: rgba(32, 198, 83, 0.13);
  border: 1px solid rgba(32, 198, 83, 0.45);
  color: #b7f7c9;
}

/* Gallery filtering */
[data-cat].is-hidden { display: none !important; }
[data-cat].is-switching { opacity: 0.25; transform: scale(0.985); }

/* Honeypot — present in the DOM for bots, invisible and unreachable for people */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Success panel (created after a confirmed server-side send) */
.gag-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 34px;
  border-radius: 16px;
  border: 1px solid rgba(32, 198, 83, 0.45);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(32, 198, 83, 0.14), transparent 65%),
    rgba(255, 255, 255, 0.04);
  animation: gag-success-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes gag-success-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.gag-success__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gag-green);
  color: #04170a;
  margin-bottom: 4px;
}
.gag-success__icon svg { width: 24px; height: 24px; }
.gag-success h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
}
.gag-success p {
  margin: 0;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.6;
  color: inherit;
  opacity: 0.78;
}
.gag-success__again {
  margin-top: 12px;
  padding: 11px 20px;
  border-radius: 99px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: 600 13.5px/1 inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.gag-success__again:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }

/* Field error state must be legible on light and dark concepts */
.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: #e04a4a !important;
}
.field .err {
  display: none;
  margin-top: 6px;
  font: 500 12.5px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #e04a4a;
}
.field.is-invalid .err { display: block; }

/* ------------------------------------------------------------ reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .gag-lb, .gag-lb__dialog, .gag-lb__img { transition: none; }
}

/* -------------------------------------------------------- cookie consent -- */
.gag-cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.gag-cookie[hidden] { display: none !important; }
.gag-cookie__in {
  pointer-events: auto;
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(22, 11, 43, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  color: #fff;
  font: 400 13px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  animation: gag-cookie-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes gag-cookie-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.gag-cookie__txt { flex: 1 1 420px; min-width: 0; }
.gag-cookie__txt b { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.gag-cookie__txt p { margin: 0; color: rgba(255, 255, 255, 0.72); }
.gag-cookie__txt a { color: #20c653; text-decoration: underline; text-underline-offset: 2px; }
.gag-cookie__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.gag-cookie__actions button {
  padding: 10px 18px;
  border-radius: 99px;
  font: 700 12px/1 inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  border: 1px solid transparent;
}
.gag-cookie__accept { background: #20c653; color: #04150a; }
.gag-cookie__accept:hover { background: #25d366; transform: translateY(-1px); }
.gag-cookie__decline { background: transparent; border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.gag-cookie__decline:hover { border-color: #fff; }
.footer-cookie {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.footer-cookie:hover { color: var(--gag-green); }
@media (max-width: 600px) {
  .gag-cookie { padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .gag-cookie__in { padding: 14px 16px; gap: 12px; border-radius: 14px; }
  .gag-cookie__actions { width: 100%; }
  .gag-cookie__actions button { flex: 1; }
}
