/* style.css — matches mateocela.com: dark console, cyan neon, glass panels. */

:root {
  --bg: #070a0f;
  --c200: #a5f3fc;
  --c300: #67e8f9;
  --c400: #22d3ee;
  --muted: rgba(165, 243, 252, .7);
  --line: rgba(22, 78, 99, .4);
  --edge: rgba(0, 255, 255, .18);
  --danger: #fca5a5;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
::selection { background: var(--c400); color: #000; }

/* ---------- Console background: glow, grid, scanlines ---------- */

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--c200);
  font: 400 1rem/1.5 var(--font);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 255, 255, .18), transparent 50%),
    radial-gradient(1000px 500px at 120% 10%, rgba(0, 255, 255, .08), transparent 60%),
    var(--bg);
}
body::before,
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::before {
  background-image:
    linear-gradient(rgba(0, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, .06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 65%);
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 65%);
  opacity: .55;
}
body::after {
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .03) 0, rgba(255, 255, 255, .03) 1px, transparent 2px, transparent 6px);
  opacity: .18;
}
.page { position: relative; z-index: 1; }

:focus-visible { outline: 2px solid var(--c300); outline-offset: 3px; }

/* Step progress line (top of the page) and cursor glow */
#progress {
  position: fixed; top: 0; left: 0; z-index: 1000;
  width: 100%; height: 2px;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, #22d3ee, #67e8f9, #fff);
  box-shadow: 0 0 16px rgba(34, 211, 238, .75);
  transition: transform .6s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
#cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 0;
  width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(34, 211, 238, .10) 0%, rgba(34, 211, 238, .045) 34%, transparent 70%);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .35s;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.topbar-in {
  max-width: 34rem; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: block; height: 2rem; width: auto; }
.topbar .btn { margin-left: auto; }

.wrap { max-width: 34rem; margin: 0 auto; padding: 0 1rem 2.5rem; }

/* ---------- Hero ---------- */

.hero { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 2.25rem 0 1.5rem; }
.hero-copy { min-width: 0; }
.hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(0, 255, 255, .55);
}
.tagline { margin: 1rem 0 0; color: rgba(165, 243, 252, .9); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(0, 255, 255, .25);
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  color: rgba(207, 255, 255, .92);
  font-size: .75rem;
  user-select: none;
}

/* Glitch on hover (name only), same trick as the main site */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  opacity: 0; pointer-events: none; text-shadow: none;
}
.glitch::before { transform: translate(1px, 0); color: rgba(0, 255, 255, .95); }
.glitch::after { transform: translate(-1px, 0); color: rgba(255, 255, 255, .85); }
@media (prefers-reduced-motion: no-preference) {
  .glitch:hover::before { opacity: .14; animation: g1 .35s steps(2, end) infinite; }
  .glitch:hover::after { opacity: .12; animation: g2 .35s steps(2, end) infinite; }
}
@keyframes g1 { 0% { clip-path: inset(0 0 85% 0); } 50% { clip-path: inset(45% 0 20% 0); } 100% { clip-path: inset(10% 0 60% 0); } }
@keyframes g2 { 0% { clip-path: inset(70% 0 0 0); } 50% { clip-path: inset(20% 0 45% 0); } 100% { clip-path: inset(55% 0 10% 0); } }

/* Padlock tile: takes the place of the photo tile on the main site */
.tile {
  flex: none;
  display: grid; place-items: center;
  width: 6.5rem; height: 6.5rem;
  border: 1px solid rgba(34, 211, 238, .4);
  border-radius: 1rem;
  background: linear-gradient(145deg, #0e4553, #061319 62%, #0a2a33);
  box-shadow: 0 0 40px rgba(0, 255, 255, .25);
  transition: box-shadow .6s;
}
.unlocked .tile { box-shadow: 0 0 64px rgba(0, 255, 255, .5); }
.lock { display: block; width: 3.4rem; height: auto; overflow: visible; }
.lock .body { fill: #fff; }
.lock .hole { fill: #0a2a33; }
.lock .shackle {
  fill: none; stroke: var(--c400); stroke-width: 9; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, .7));
  transform-origin: 68px 48px;
  transition: transform .5s cubic-bezier(.3, 1.5, .5, 1);
}
.unlocked .lock .shackle { transform: translateY(-12px) rotate(16deg); }

/* ---------- Glass panel styled as a terminal ---------- */

.glass {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: 1rem;
  background: rgba(7, 10, 15, .58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, .06) inset, 0 24px 70px rgba(0, 0, 0, .55), 0 0 22px rgba(0, 255, 255, .10);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .22;
  background: linear-gradient(135deg, rgba(0, 255, 255, .22), transparent 35%), linear-gradient(315deg, rgba(0, 255, 255, .12), transparent 30%);
}
.panel { overflow: hidden; }
.panel::after {
  content: ""; position: absolute; top: 0; left: -40%; width: 30%; height: 100%;
  pointer-events: none; opacity: 0; transform: skewX(-16deg);
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .08), transparent);
}
.panel.scan::after { animation: scan 1.25s ease-out 1; }
@keyframes scan { 0% { left: -40%; opacity: 0; } 15% { opacity: 1; } 100% { left: 120%; opacity: 0; } }

.panel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.lights { display: inline-flex; gap: .25rem; margin-right: .6rem; vertical-align: middle; }
.lights i { width: .5rem; height: .5rem; border-radius: 50%; }
.lights i:nth-child(1) { background: #f87171; }
.lights i:nth-child(2) { background: #fde047; }
.lights i:nth-child(3) { background: #4ade80; }
.panel-host { color: rgba(103, 232, 249, .7); font: .75rem var(--mono); }

/* ---------- Steps ---------- */

.steps { list-style: none; margin: 0; padding: .25rem 1.25rem; counter-reset: step; }
.step { counter-increment: step; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step-head { display: flex; align-items: center; gap: .75rem; }
.step h2 { margin: 0; color: #fff; font-size: 1rem; line-height: 1.3; font-weight: 600; }

.dot {
  flex: none; display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem;
  border: 1px solid rgba(34, 211, 238, .3);
  border-radius: 50%;
  color: rgba(103, 232, 249, .6);
  font: 600 .8rem/1 var(--mono);
}
.dot::before { content: counter(step); }
.step[data-state="active"] .dot { background: var(--c400); border-color: var(--c400); color: #000; box-shadow: 0 0 16px rgba(34, 211, 238, .5); }
.step[data-state="done"] .dot { background: rgba(34, 211, 238, .12); border-color: var(--c400); color: var(--c300); }
.step[data-state="done"] .dot::before { content: "\2713"; }
.step[data-state="locked"] h2 { color: rgba(103, 232, 249, .5); }

.step-body { margin: .8rem 0 .2rem 2.5rem; }
.step:not([data-state="active"]) .step-body { display: none; }
.step-body p { margin: 0 0 .9rem; color: var(--muted); font-size: .95rem; }
.step-body p strong { color: #fff; overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .5rem 1.25rem;
  border: 1px solid rgba(165, 243, 252, .3);
  border-radius: .375rem;
  background: var(--c400);
  color: #000;
  font: 700 .95rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 255, 255, .22);
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--c300); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-outline { border-color: rgba(34, 211, 238, .5); background: rgba(0, 0, 0, .2); color: var(--c200); font-weight: 500; box-shadow: none; }
.btn-outline:hover { border-color: var(--c300); background: rgba(0, 0, 0, .3); color: #fff; }
.btn-sm { min-height: 2.25rem; padding: .4rem .9rem; font-size: .85rem; }

.linkish { padding: 0; border: 0; background: none; color: var(--c300); font: inherit; text-decoration: underline; cursor: pointer; }
.linkish:hover { color: #fff; }

/* ---------- Task countdown ---------- */

.wait { margin-top: 1rem; }
.track { height: .3rem; border-radius: 99px; background: rgba(22, 78, 99, .5); overflow: hidden; }
.bar {
  width: 0; height: 100%;
  background: linear-gradient(90deg, #22d3ee, #67e8f9, #fff);
  box-shadow: 0 0 12px rgba(34, 211, 238, .6);
  transition-property: width; transition-timing-function: linear;
}
.step-body .hint { margin: .5rem 0 0; font: .8rem var(--mono); }

/* ---------- Form ---------- */

label { display: block; margin-bottom: .9rem; color: var(--c200); font-size: .875rem; }
input {
  display: block; width: 100%; min-height: 2.75rem; margin-top: .3rem; padding: .5rem .75rem;
  border: 1px solid var(--line); border-radius: .375rem;
  background: rgba(0, 0, 0, .4);
  color: var(--c200);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--c400); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.step-body p.error { min-height: 1.25rem; margin: 0 0 .5rem; color: var(--danger); font-size: .875rem; }
.step-body p.note { margin: .9rem 0 0; color: rgba(103, 232, 249, .7); font-size: .8rem; }

/* ---------- Reward / result ---------- */

.reward { padding: 1.5rem 1.25rem; }
.log {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  color: rgba(207, 255, 255, .92);
  font: 13px/1.55 var(--mono);
  white-space: pre;
}
.log code { font: inherit; }
.reward h2 { margin: 0 0 1rem; color: #fff; font-size: 1.6rem; line-height: 1.15; font-weight: 800; text-shadow: 0 0 10px rgba(0, 255, 255, .55); }
.reward h2:focus { outline: none; }
.reward .lead { margin: 0 0 1.25rem; color: rgba(165, 243, 252, .9); }
.secret {
  margin: 0 0 1rem; padding: .9rem 1rem;
  border: 1px solid rgba(34, 211, 238, .4); border-radius: .375rem;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font: 500 1rem/1.5 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: all;
}

.foot { margin: 2rem 0 0; text-align: center; color: rgba(103, 232, 249, .7); font-size: .75rem; }

/* ---------- Load-in (one small moment) + small screens ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero { animation: rise .55s cubic-bezier(.22, 1, .36, 1) both; }
  .panel { animation: rise .6s cubic-bezier(.22, 1, .36, 1) .12s both; }
  .tile { animation: float 3.2s ease-in-out 1s infinite alternate; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float { to { transform: translateY(-8px); } }

@media (max-width: 26rem) {
  .tile { width: 5rem; height: 5rem; }
  .lock { width: 2.6rem; }
  .step-body { margin-left: 0; }
}
@media (max-width: 767px) { #cursor-glow { display: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #cursor-glow, #progress { display: none !important; }
  .glitch::before, .glitch::after { display: none !important; }
}
