/* ==========================================================
   1. Variables
   ========================================================== */
:root {
  color-scheme: dark;

  --navy-900: #051220;
  --navy-800: #07182b;
  --navy-700: #0a2b50;
  --blue-500: #1268a8;
  --blue-line: #16466d;
  --gold: #ffb400;
  --text: #f2f4f6;
  --text-muted: #aab5c0;
  --text-faint: #7f8d9a;

  --font: "Segoe UI Variable Display", "Avenir Next", "Helvetica Neue",
    "Segoe UI", Roboto, Arial, sans-serif;

  --frame-corner: 1.75rem;
  --frame-stroke: 2px;
}

/* ==========================================================
   2. Base
   ========================================================== */
* {
  box-sizing: border-box;
}

html {
  background: var(--navy-800);
}

body {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(1.25rem, 5vw, 3rem);
  place-items: center;
  overflow-x: hidden;
  background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Cuadrícula de fondo que se desvanece hacia los bordes */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 4.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4.5%) 1px, transparent 1px);
  background-size: 3rem 3rem;
  content: "";
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}

/* ==========================================================
   3. Marco de visor (elemento principal)
   ========================================================== */
.page {
  position: relative;
  z-index: 1;
  width: min(100%, 44rem);
}

.frame {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 3.5rem);
  background-color: rgb(3 27 49 / 55%);
  /* Cuatro esquinas dibujadas con degradados: sin marcado extra */
  --c: var(--gold);
  background-image:
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c));
  background-position:
    left top, left top,
    right top, right top,
    left bottom, left bottom,
    right bottom, right bottom;
  background-size:
    var(--frame-corner) var(--frame-stroke), var(--frame-stroke) var(--frame-corner),
    var(--frame-corner) var(--frame-stroke), var(--frame-stroke) var(--frame-corner),
    var(--frame-corner) var(--frame-stroke), var(--frame-stroke) var(--frame-corner),
    var(--frame-corner) var(--frame-stroke), var(--frame-stroke) var(--frame-corner);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgb(18 104 168 / 22%);
}

/* Único movimiento de la página: una pasada de enfoque al cargar */
.frame::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  box-shadow: 0 0 1.5rem 0.2rem rgb(255 180 0 / 35%);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: scan 1.8s cubic-bezier(0.45, 0, 0.2, 1) 0.3s 1 both;
}

@keyframes scan {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(var(--frame-height, 28rem));
  }
}

/* ==========================================================
   4. Marca
   ========================================================== */
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 clamp(1.75rem, 5vw, 2.5rem);
}

.brand__shield {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
}

.brand__wordmark {
  width: min(100%, 15rem);
  height: auto;
  max-height: 3.25rem;
  object-fit: contain;
  object-position: left center;
}

/* ==========================================================
   5. Contenido
   ========================================================== */
h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 3.75rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

.message {
  max-width: 32rem;
  margin: 1.5rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  line-height: 1.65;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2rem 0 0;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--blue-line);
  border-radius: 999px;
  background: rgb(3 27 49 / 80%);
  color: var(--text);
  font-size: 0.95rem;
}

.status::before {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0.25rem rgb(255 180 0 / 18%);
  content: "";
}

/* ==========================================================
   6. Contacto y pie
   ========================================================== */
.contact {
  margin: 2.25rem 0 0;
  padding-top: 1.35rem;
  border-top: 1px solid rgb(22 70 109 / 70%);
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.contact a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}

.contact a:hover {
  color: var(--gold);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

footer {
  margin: 1.5rem 0 0;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
}

/* ==========================================================
   7. Pantallas pequeñas y preferencias de movimiento
   ========================================================== */
@media (max-width: 30rem) {
  :root {
    --frame-corner: 1.25rem;
  }
  .brand__shield {
    width: 2.75rem;
    height: 2.75rem;
  }

  .brand__wordmark {
    max-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .frame::after {
    display: none;
  }
}
