/* Madrugada.dev — la paleta sale de estudio/src/escena/paleta.ts (azul noche + terracota). */
:root {
  --fondo: #05060f;
  --noche: #0b112e;
  --azul: #1c2f72;
  --terracota: #d2724f;
  --terracota-osc: #a5523a;
  --crema: #f5e6d3;
  --texto: #e7e3ee;
  --tenue: #9a94a6;
  --pantalla: #141019;
  --ventana: #f2c879;
  --display: 'Nunito', ui-rounded, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { background: var(--fondo); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--texto);
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.5;
  background:
    radial-gradient(120% 60% at 70% 0%, rgba(28, 47, 114, 0.55), transparent 60%),
    radial-gradient(80% 50% at 10% 100%, rgba(165, 82, 58, 0.16), transparent 70%),
    var(--fondo);
  overflow-x: hidden;
}

/* Grano de película, como el polvo flotando en la escena. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- La escena ---------- */
.cielo {
  position: relative;
  height: clamp(220px, 25vw, 440px);
  overflow: hidden;
}
.escena {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 45% 58%;
  animation: amanece 1.6s ease-out both;
  /* Se funde con el fondo (sea cual sea el degradado de detrás). */
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 74%, transparent 100%);
}

/* ---------- Contenido ---------- */
.contenido {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: clamp(-56px, -3vw, -24px) auto 0;
  padding: 0 clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 30px) clamp(24px, 4vw, 56px);
  align-items: start;
}

.logo {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.5rem, 6.2vw, 4.9rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--crema);
  text-shadow: 0 6px 40px rgba(5, 6, 15, 0.9);
}
.logo span { color: var(--terracota); }

.lema {
  margin: 0;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  font-weight: 800;
  color: var(--texto);
}

.reloj {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 7px 13px 7px 11px;
  border: 1px solid rgba(245, 230, 211, 0.14);
  border-radius: 999px;
  background: rgba(11, 17, 46, 0.7);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.punto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracota);
  box-shadow: 0 0 12px var(--terracota);
  animation: late 2.4s ease-in-out infinite;
}
.hora { font-weight: 700; color: var(--crema); }
.aviso { color: var(--tenue); }
.de-dia .punto { background: var(--ventana); box-shadow: 0 0 12px var(--ventana); }

.redes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.boton {
  display: inline-block;
  padding: 9px 17px;
  border-radius: 12px;
  font-size: 0.95rem;
  border: 1.5px solid rgba(245, 230, 211, 0.35);
  color: var(--crema);
  font-weight: 800;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.boton:hover { border-color: var(--crema); background: rgba(245, 230, 211, 0.06); transform: translateY(-1px); }
.arroba { margin-left: 4px; font-family: var(--mono); font-size: 0.8em; font-weight: 400; color: var(--tenue); }
.boton.apagado { opacity: 0.45; border-style: dashed; cursor: default; }
.boton.apagado:hover { transform: none; background: none; border-color: rgba(245, 230, 211, 0.35); }

/* ---------- La pantalla del portátil (buscador) ---------- */
.pantalla {
  position: relative;
  padding: 18px clamp(18px, 2.4vw, 26px) 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #181320, var(--pantalla));
  border: 1.5px solid rgba(210, 114, 79, 0.55);
  box-shadow:
    0 0 0 6px rgba(210, 114, 79, 0.06),
    0 30px 80px -20px rgba(210, 114, 79, 0.35),
    0 20px 60px rgba(0, 0, 0, 0.6);
}
.barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--tenue);
}
.luces { display: flex; gap: 6px; }
.luces i { width: 9px; height: 9px; border-radius: 50%; background: #2d2735; }
.luces i:first-child { background: var(--terracota-osc); }

.pantalla h2 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--crema);
}
.sub { margin: 6px 0 16px; font-size: 0.95rem; color: var(--tenue); }

.buscador {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 14px;
  background: #0c0a10;
  border: 1.5px solid #2d2735;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.buscador:focus-within { border-color: var(--terracota); box-shadow: 0 0 0 4px rgba(210, 114, 79, 0.18); }
.prompt { font-family: var(--mono); color: var(--terracota); font-weight: 700; }
.buscador input[type='text'] {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--crema);
  font-family: var(--mono);
  font-size: 0.98rem;
  caret-color: var(--terracota);
}
.buscador input::placeholder { color: #5b5466; }
.buscador button {
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--terracota);
  color: #1a0f0b;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.buscador button:hover { background: #e0835f; }
.buscador button:active { transform: scale(0.97); }
.buscador button:focus-visible, .boton:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; }

.nota { margin: 14px 0 0; font-size: 0.86rem; color: var(--tenue); }
.nota strong { color: var(--texto); }
.consejo {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed #2d2735;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #7d7689;
}
.consejo em { color: var(--crema); font-style: normal; }

/* ---------- Pie ---------- */
.pie {
  max-width: 1000px;
  margin: clamp(44px, 5vw, 72px) auto 0;
  padding: 22px clamp(16px, 4vw, 40px) 36px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-top: 1px solid rgba(245, 230, 211, 0.08);
  font-size: 0.85rem;
  color: #6f6980;
}
.pie p { margin: 0; }

.visualmente-oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Entrada escalonada ---------- */
.logo, .lema, .reloj, .redes, .pantalla { animation: sube 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lema { animation-delay: 0.12s; }
.reloj { animation-delay: 0.22s; }
.redes { animation-delay: 0.3s; }
.pantalla { animation-delay: 0.38s; }

@keyframes sube { from { opacity: 0; transform: translateY(18px); } }
@keyframes amanece { from { opacity: 0; transform: scale(1.04); } }
@keyframes late { 50% { opacity: 0.35; } }

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

/* ---------- Móvil ---------- */
@media (max-width: 820px) {
  .contenido { grid-template-columns: 1fr; margin-top: -40px; }
  .cielo { height: 50vw; min-height: 200px; }
  .escena { object-position: 42% 40%; }
  .pie { flex-direction: column; }
}
@media (max-width: 420px) {
  .buscador { flex-wrap: wrap; padding: 6px; }
  .prompt { padding-left: 8px; }
  .buscador button { width: 100%; }
}
