/* ============================================================
   GayCard — Design tokens, type, motion, utilities
   Built on the Gen-Z landing DNA, recolored with pride rainbow.
   ============================================================ */

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

:root {
  /* Canvas */
  --bg: #ffffff;
  --ink: #121212;
  --ink-70: rgba(18, 18, 18, 0.62);
  --ink-45: rgba(18, 18, 18, 0.42);
  --paper: #f7f3ea;       /* warm letter paper */
  --char: #121212;        /* charcoal dark sections */
  --char-soft: #1a1a1a;

  /* Pride flag */
  --red:    #E40303;
  --orange: #FF8C00;
  --yellow: #FFCE00;
  --green:  #1FA63A;
  --blue:   #1257FF;
  --purple: #8B14C9;

  --rainbow: linear-gradient(90deg, #E40303 0%, #FF8C00 20%, #FFCE00 40%, #1FA63A 60%, #1257FF 80%, #8B14C9 100%);
  --rainbow-soft: linear-gradient(90deg, #E40303 0%, #FF8C00 22%, #1FA63A 52%, #1257FF 78%, #8B14C9 100%);

  /* Fonts */
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --radius: 22px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--yellow); color: var(--ink); }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.rainbow-text {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-rainbow {
  color: #fff;
  background: var(--rainbow);
  background-size: 180% 100%;
  background-position: 0% 50%;
  box-shadow: 0 10px 30px -10px rgba(228, 3, 3, 0.45);
}
.btn-rainbow:hover {
  transform: translateY(-2px) scale(1.02);
  background-position: 100% 50%;
  box-shadow: 0 16px 40px -10px rgba(139, 20, 201, 0.5);
}

.btn-ink {
  background: var(--ink);
  color: #fff;
}
.btn-ink:hover { transform: translateY(-2px) scale(1.02); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; transform: translateY(-2px) scale(1.02); }

.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-light:hover { transform: translateY(-2px) scale(1.02); }

/* ---------- Pills / chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 92px 0; position: relative; }
section[id] { scroll-margin-top: 84px; }

/* ---------- Rainbow rule ---------- */
.rainbow-bar { height: 6px; background: var(--rainbow); width: 100%; }

/* ---------- Motion ---------- */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-18px) rotate(calc(var(--rot, 0deg) + 1.5deg)); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glowpulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

.reveal { opacity: 1; transform: translateY(18px); transition: transform 0.7s cubic-bezier(0.25,0.4,0.25,1); }
.reveal.in { transform: none; }

/* scroll-engine driven elements */
[data-anim], [data-hx], [data-hcard], [data-hfade] { will-change: transform, opacity; }
.maskline { overflow: hidden; display: block; }
.maskline > span { display: inline-block; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none !important; transition: none !important; }
  .floaty, .animate-float { animation: none !important; }
  [data-anim], [data-hx], [data-hcard], [data-hfade] { transform: none !important; opacity: 1 !important; }
  .line-in, .load-fade, .card-intro { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------- Load-in intro animations (play once on page load) ---------- */
@keyframes introLineRise { from { transform: translateY(116%); } to { transform: translateY(0); } }
@keyframes introFadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes introCard {
  0% { opacity: 0; transform: scale(0.82) rotate(-3deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes glowText {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 9px rgba(139, 20, 201, 0.55)); }
}
.line-mask { display: block; overflow: hidden; padding-bottom: 0.04em; }
.line-in { display: inline-block; animation: introLineRise 0.95s cubic-bezier(0.22,1,0.36,1) both; }
.load-fade { animation: introFadeUp 0.7s cubic-bezier(0.25,0.4,0.25,1) both; }
.card-intro { animation: introCard 1.05s cubic-bezier(0.22,1,0.36,1) both; will-change: transform, opacity; }
/* Safety net: if the runtime freezes CSS animation timelines, reveal anyway */
.intro-done .line-in,
.intro-done .load-fade,
.intro-done .card-intro { animation: none !important; opacity: 1 !important; transform: none !important; }

/* ---------- Card flip (turn to reveal the other face) ---------- */
@keyframes flipIn {
  from { transform: perspective(1400px) rotateY(-88deg); opacity: 0.35; }
  to { transform: perspective(1400px) rotateY(0deg); opacity: 1; }
}
.card-flip-face { animation: flipIn 0.55s cubic-bezier(0.22,1,0.36,1) both; transform-origin: center; backface-visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .card-flip-face { animation: none !important; } }

/* ---------- Logo / brand ---------- */
.brand { transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.brand:hover { transform: scale(1.06); }
.brand:hover .brand-accent { animation: glowText 1.6s ease-in-out infinite; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  display: flex;
}
/* Two identical groups side by side, each at least as wide as the viewport
   (min-width: 100%), both animated by -100% of their own width. When group A
   scrolls fully off the left, group B sits exactly where A started, so the
   reset is seamless and the band never empties — on any screen width. */
.marquee__group {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2.5rem;
  padding-right: 2.5rem;
  min-width: 100%;
  animation: marquee 26s linear infinite;
  will-change: transform;
}

/* ---------- Forms ---------- */
.field-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-70);
  display: block;
  margin-bottom: 0.5rem;
}
.input, .textarea, .select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 2px solid #e7e2d7;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 87, 255, 0.12);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

/* utility */
.noise::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
}
