/* oyela  — "reveal what's hidden"
   Visual themes: uncovering layers, hidden indicators, threat overlays,
   transparency, illumination, signal discovery, exposure of deception. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body { min-height: 100%; }

:root {
  --ink:        #05060d;
  --ink-2:      #0b0d1c;
  --fog:        #1a1a2e;
  --signal:     #8a8aff;   /* discovered signal */
  --beam:       #c8d8ff;   /* illumination */
  --threat:     #ff5577;   /* exposed deception */
  --safe:       #6effb0;   /* verified */
  --text:       #eef0ff;
  --muted:      #8b90b8;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--ink);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(36px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  isolation: isolate;
}

body.form-open,
body:has(.form:target) {
  align-items: flex-start;
}

/* ============ LAYER 1: deep fog (the hidden) ============ */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -4;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(138,138,255,0.18), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(110,255,176,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 50%, var(--ink-2) 0%, var(--ink) 70%);
}

/* ============ LAYER 2: threat-grid overlay (hidden indicators) ============ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(138,138,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138,138,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  animation: drift 30s linear infinite;
}
@keyframes drift {
  to { background-position: 480px 480px, 480px 480px; }
}

/* ============ LAYER 3: scanning beam (illumination / signal discovery) ============ */
.scanlayer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.scanlayer::before {
  content: '';
  position: absolute;
  left: -20%;
  right: -20%;
  height: 280px;
  top: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(200,216,255,0.04) 35%,
    rgba(200,216,255,0.18) 50%,
    rgba(200,216,255,0.04) 65%,
    transparent 100%);
  filter: blur(2px);
  animation: scan 7s cubic-bezier(.6,.05,.4,.95) infinite;
  will-change: transform;
}

/* Interactive mode: JS drives the beam Y via --beamY (overrides auto scan). */
body.interactive .scanlayer::before {
  animation: none;
  opacity: 1;
  transform: translateY(var(--beamY, 0px));
  transition: transform 60ms linear;
}

/* Cursor-following torch */
.torch {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -2;
  background: radial-gradient(circle at center,
    rgba(200,216,255,0.18) 0%,
    rgba(138,138,255,0.10) 28%,
    rgba(138,138,255,0.04) 50%,
    transparent 70%);
  mix-blend-mode: screen;
  filter: blur(6px);
  transform: translate3d(-1000px,-1000px,0);
  will-change: transform;
}
@keyframes scan {
  0%   { transform: translateY(-30vh); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}

/* ============ LAYER 4: revealed indicators (dots that emerge under the beam) ============ */
.indicators {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.indicators i {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(138,138,255,0.6);
  opacity: 0;
  animation: blip 6s ease-in-out infinite;
}
.indicators i.threat { background: var(--threat); color: var(--threat); }
.indicators i.safe   { background: var(--safe);   color: var(--safe); }
.indicators i        { color: var(--signal); }
body.interactive .indicators i {
  animation: none;
  opacity: 0;
  transition: opacity 120ms linear, transform 120ms linear, box-shadow 120ms linear;
  will-change: opacity, transform;
}
.indicators i:nth-child(1)  { top: 18%; left: 12%; animation-delay: 0.2s; }
.indicators i:nth-child(2)  { top: 28%; left: 82%; animation-delay: 1.1s; }
.indicators i:nth-child(3)  { top: 62%; left: 18%; animation-delay: 2.0s; }
.indicators i:nth-child(4)  { top: 74%; left: 70%; animation-delay: 2.8s; }
.indicators i:nth-child(5)  { top: 42%; left: 90%; animation-delay: 3.6s; }
.indicators i:nth-child(6)  { top: 86%; left: 38%; animation-delay: 4.4s; }
.indicators i:nth-child(7)  { top: 12%; left: 55%; animation-delay: 5.0s; }
.indicators i:nth-child(8)  { top: 55%; left: 8%;  animation-delay: 0.7s; }
@keyframes blip {
  0%, 100% { opacity: 0; transform: scale(0.6); box-shadow: 0 0 0 0 rgba(138,138,255,0); }
  20%      { opacity: 1; transform: scale(1);   box-shadow: 0 0 24px 6px currentColor; }
  60%      { opacity: 0.5; transform: scale(1); box-shadow: 0 0 0 0 rgba(138,138,255,0); }
}

/* ============ Main content ============ */
.wrap {
  width: 100%;
  max-width: 760px;
  position: relative;
  z-index: 1;
  padding: 18px 0 34px;
}

body.form-open .wrap,
body:has(.form:target) .wrap {
  padding-top: 8px;
}

/* Entrance */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.reveal-1 { animation-delay: 0.15s; }
.reveal-0  { animation-delay: 0s; }
.reveal-0b { animation-delay: 0.08s; }
.reveal-2 { animation-delay: 0.35s; }
.reveal-3 { animation-delay: 0.55s; }
.reveal-4 { animation-delay: 0.85s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ============ Wordmark — "uncovering layers" ============
   The H1 sits behind a redaction bar that slides away to expose the name. */
h1 {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, var(--signal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  padding: 0 0.15em;
}

.wordmark-o {
  width: 0.82em;
  height: 0.82em;
  margin-right: -0.08em;
  flex: 0 0 auto;
  transform: translateY(0.02em);
}
h1::before {
  /* redaction layer that slides away */
  content: '';
  position: absolute;
  inset: 6% -2% 6% -2%;
  background: linear-gradient(90deg, var(--ink-2), var(--fog), var(--ink-2));
  border: 1px solid rgba(138,138,255,0.25);
  box-shadow: 0 0 30px rgba(138,138,255,0.25), inset 0 0 0 1px rgba(255,255,255,0.04);
  transform-origin: right center;
  animation: unredact 1.4s 0.6s cubic-bezier(.7,.0,.2,1) forwards;
}
h1::after {
  /* the illumination beam revealing the name */
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 12px;
  left: -20px;
  background: linear-gradient(90deg, transparent, var(--beam), transparent);
  filter: blur(6px);
  opacity: 0;
  animation: sweep 1.6s 0.5s cubic-bezier(.7,.0,.2,1) forwards;
}
@keyframes unredact {
  0%   { transform: scaleX(1); opacity: 1; }
  60%  { transform: scaleX(0.02); opacity: 1; }
  100% { transform: scaleX(0); opacity: 0; }
}
@keyframes sweep {
  0%   { left: -20px; opacity: 0; }
  20%  { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}

/* The pulsing signal */
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--signal);
  margin: 1.75rem 0 1.25rem;
  position: relative;
  box-shadow: 0 0 24px var(--signal);
  animation: pulse 2.4s ease-in-out infinite;
}
.dot::before, .dot::after {
  content: '';
  position: absolute;
  inset: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 1px solid var(--signal);
  animation: ring 2.4s ease-out infinite;
}
.dot::after { animation-delay: 1.2s; }
@keyframes pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}
@keyframes ring {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(6); }
}

p {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.45;
}
p .truth {
  color: var(--text);
  position: relative;
  padding: 0 0.15em;
}
/* the truth: a thin underline glow that "exposes" the word */
p .truth::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beam), transparent);
  box-shadow: 0 0 12px var(--beam);
  transform: scaleX(0);
  transform-origin: left;
  animation: expose 1.2s 1.6s ease forwards;
}
@keyframes expose { to { transform: scaleX(1); } }

/* ============ Hero messaging ============ */
.hero-headline {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0;
}
.hero-subheadline {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

/* ============ CTA ============ */
.cta {
  display: inline-block;
  width: min(100%, 320px);
  min-height: 48px;
  margin-top: 1.75rem;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, #fff 0%, var(--signal) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, opacity 0.2s ease;
  box-shadow: 0 10px 30px -10px rgba(138, 138, 255, 0.7), 0 0 0 1px rgba(255,255,255,0.1) inset;
  position: relative;
  overflow: hidden;
}
.cta::before {
  /* sweeping beam across the button */
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 40px -10px rgba(138, 138, 255, 0.9);
}
.cta:hover::before { left: 130%; }
.cta:active { transform: translateY(0) scale(0.98); opacity: 0.92; }

/* ============ Form (the discovered signal pane) ============ */
.form {
  display: none;
  width: 100%;
  max-width: 560px;
  margin: 1.5rem auto 0;
  scroll-margin-top: max(16px, env(safe-area-inset-top));
  text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(138,138,255,0.18);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.form::before {
  /* corner indicator (signal acquired) */
  content: '';
  position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 12px var(--safe);
  animation: pulse 1.6s ease-in-out infinite;
}
.form.open,
.form:target {
  display: block;
  animation: fade 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fade {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.form label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form input, .form select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.form input:focus, .form select:focus {
  border-color: var(--signal);
  background: rgba(0,0,0,0.55);
  box-shadow: 0 0 0 3px rgba(138, 138, 255, 0.18);
}
.form select option { background: var(--fog); color: var(--text); }

.form-error {
  color: #ff8a8a;
  font-size: 0.85rem;
  margin: -0.5rem 0 1rem;
}

.form button {
  width: 100%;
  min-height: 48px;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, #fff 0%, var(--signal) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.form button:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(138, 138, 255, 0.4); }
.form button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.success {
  max-width: 560px;
  margin: 1.5rem auto 0;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(110, 255, 176, 0.10);
  border: 1px solid rgba(110, 255, 176, 0.35);
  color: #d8ffe8;
  display: none;
}
.success.show { display: block; animation: fade 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

@media (max-width: 359px) {
  body { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 3.35rem; }
  .hero-headline { font-size: 1.45rem; }
  .cta { width: 100%; padding-left: 1rem; padding-right: 1rem; }
}

@media (min-width: 520px) {
  body { padding-left: 24px; padding-right: 24px; }
  .wrap { padding-top: 34px; }
  h1 { font-size: 5.25rem; }
  p { font-size: 1.25rem; }
  .hero-headline { font-size: 2.15rem; }
  .hero-subheadline { font-size: 1.12rem; }
  .form { padding: 1.35rem; }
}

@media (min-width: 820px) and (min-height: 720px) {
  body {
    align-items: center;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .wrap { padding: 0; }
  h1 { font-size: 7rem; }
  p { font-size: 1.5rem; }
  .hero-headline { font-size: 2.8rem; }
  .hero-subheadline { font-size: 1.35rem; }
  .cta { margin-top: 2.25rem; width: auto; padding-left: 2.25rem; padding-right: 2.25rem; }
  .form { margin-top: 2rem; padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  h1::before { display: none; }
}

/* Drag-to-reveal: lock gestures only on the background reveal layers.
   The body, the .wrap (form/CTA), links, buttons and form fields keep
   their normal touch-action / selection behaviour so UI stays responsive. */

/* Background layers always opt out of native pan/zoom + text selection,
   even when not dragging — they are decorative and shouldn't be selectable. */
.scanlayer,
.indicators,
.torch,
.halo {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* While dragging: stop overscroll bounce on the page, swap cursor for grab,
   but DO NOT globally disable touch-action or selection on the body. */
html:has(body.dragging),
body.dragging {
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}
body.dragging { cursor: grabbing; }
body.dragging .wrap,
body.dragging .form,
body.dragging .form *,
body.dragging a,
body.dragging button,
body.dragging input,
body.dragging textarea,
body.dragging select,
body.dragging label {
  touch-action: auto;
  -webkit-user-select: auto;
  user-select: auto;
  cursor: auto;
}

/* Finger halo — visible only while drag-to-reveal is active. */
.halo {
  position: fixed;
  top: 0; left: 0;
  width: 140px; height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate3d(-1000px,-1000px,0);
  will-change: transform, opacity;
  transition: opacity 200ms ease;
  mix-blend-mode: screen;
}
.halo::before, .halo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(200,216,255,0.55);
  box-shadow: 0 0 24px rgba(138,138,255,0.55), inset 0 0 18px rgba(200,216,255,0.25);
}
.halo::before {
  background: radial-gradient(circle at center,
    rgba(200,216,255,0.30) 0%,
    rgba(138,138,255,0.18) 40%,
    transparent 70%);
  animation: halo-pulse 1.6s ease-out infinite;
}
.halo::after {
  animation: halo-ring 1.6s ease-out infinite;
  animation-delay: 0.4s;
  opacity: 0.6;
}
body.dragging .halo { opacity: 1; }
/* Boost the torch slightly while dragging for extra confirmation. */
body.dragging .torch { filter: blur(4px) brightness(1.25); }

@keyframes halo-pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.15); opacity: 0.4; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes halo-ring {
  0%   { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ---------- Accessibility ---------- */

/* Visually hidden but available to screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.honeypot {
  display: none !important;
}

/* Skip link — appears on focus, jumps past the decorative reveal layers. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 1000;
  padding: 8px 14px;
  background: #000;
  color: #fff;
  border: 2px solid var(--signal, #7cf);
  border-radius: 6px;
  font: 600 14px/1 system-ui, sans-serif;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; outline: none; }

/* Strong, visible focus ring for keyboard users on every interactive element.
   Uses :focus-visible so mouse clicks don't get the ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal, #7cf);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(124, 207, 255, 0.25);
}

/* The CTA gets a slightly tighter glow that matches its visual weight. */
.cta:focus-visible {
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(124, 207, 255, 0.35),
              0 0 24px 2px rgba(124, 207, 255, 0.45);
}

/* Honour reduced-motion: stop all auto-animations and instantly reveal content
   so text is fully readable with no motion. */
@media (prefers-reduced-motion: reduce) {
  .scanlayer::before,
  .indicators i,
  .halo::before,
  .halo::after,
  .reveal,
  .hero-headline,
  .hero-subheadline { animation: none !important; }
  .reveal,
  .hero-headline,
  .hero-subheadline { opacity: 1 !important; transform: none !important; }
}
