/* =========================
   RESET + BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #000;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", "Courier New", monospace;
  background: radial-gradient(circle at top, #00110a, #000);
  color: #c8ffcc;
  line-height: 1.6;
  animation: ambientGlow 12s ease-in-out infinite;
}

/* =========================
   GLOBAL AMBIENT
========================= */
@keyframes ambientGlow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.03);
  }
}

/* =========================
   LAYOUT GLOBAL (GRID)
========================= */
.page {
  display: grid;
  grid-template-columns:
    minmax(1rem, 1fr)
    minmax(0, 960px)
    minmax(1rem, 1fr);

  grid-template-rows:
    auto   /* header */
    1fr    /* main → empuja */
    auto;  /* footer */

  min-height: 100vh;
}

.page > * {
  grid-column: 2;
}

/* =========================
   HEADER / NAV
========================= */
header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid #003322;
  animation: headerPulse 6s ease-in-out infinite;
}

@keyframes headerPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(0,255,136,0);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0,255,136,.15);
  }
}

header h1 {
  margin: 0;
  color: #00ff88;
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(0,255,136,.7);
  animation: textFlicker 4s infinite;
}

header a {
  text-decoration: none;
}

h2 {
  position: relative;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  animation: typing 2.5s steps(30, end) forwards;
}

/* cursor */
h2::after {
  content: "█";
  margin-left: 4px;
  color: #00ff88;
  animation: blinkCursor 1s steps(15) infinite;
}

/* escritura */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* parpadeo */
@keyframes blinkCursor {
  50% {
    opacity: 0;
  }
}

@keyframes textFlicker {
  0%, 100% { opacity: 1; }
  97% { opacity: 1; }
  98% { opacity: .85; }
  99% { opacity: 1; }
}

nav {
  margin-top: .5rem;
}

nav a {
  color: #66ffcc;
  margin-right: 1rem;
  text-decoration: none;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: #00ffcc;
  transition: width .2s steps(4);
}

nav a:hover::after {
  width: 100%;
}

/* =========================
   MAIN CONTENT
========================= */
main {
  padding: 2rem 0;
}

/* =========================
   POSTS
========================= */
article {
  margin-bottom: 4rem;
  animation: fadeUp .6s ease-out both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

article h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: #00ffcc;
  text-shadow: 0 0 12px rgba(0,255,204,.5);
}

article img {
  max-width: 100%;
  border: 1px solid #003322;
  box-shadow: 0 0 15px rgba(0,255,136,.2);
  animation: imagePulse 8s ease-in-out infinite;
}

@keyframes imagePulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0,255,136,.2); }
  50% { box-shadow: 0 0 30px rgba(0,255,136,.35); }
}

/* =========================
   CODE BLOCKS
========================= */
pre {
  background: #020202;
  padding: 1rem;
  overflow-x: auto;
  border-left: 4px solid #00ff88;
  box-shadow: inset 0 0 20px #000;
  animation: codeGlow 5s infinite alternate;
}

@keyframes codeGlow {
  from { border-left-color: #00ff88; }
  to { border-left-color: #33ccff; }
}

/* =========================
   COMMENTS SECTION
========================= */
.comments {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px dashed #00ff88;
}

.comments h3 {
  color: #00ff88;
  margin-bottom: 2rem;
  text-shadow: 0 0 8px rgba(0,255,136,.6);
}

/* comentario individual */
.comment {
  background: linear-gradient(135deg, #020202, #050505);
  border-left: 4px solid #00ff88;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow:
    0 0 12px rgba(0,255,136,.25),
    inset 0 0 20px rgba(0,0,0,.9);
  animation: commentIn .5s ease-out both;
}

@keyframes commentIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* hover dinámico */
.comment:hover {
  transform: translateX(4px);
  box-shadow:
    0 0 25px rgba(0,255,136,.45),
    inset 0 0 30px rgba(0,0,0,1);
}

/* indicador tipo log */
.comment::before {
  content: "[LOG]";
  position: absolute;
  top: .5rem;
  right: .8rem;
  font-size: .7rem;
  color: #00ff88;
  opacity: .35;
  animation: blink 2.5s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: .1; }
}

/* alternar */
.comment:nth-child(even) {
  border-left-color: #33ccff;
}

.comment:nth-child(even)::before {
  color: #33ccff;
}

/* =========================
   FOOTER
========================= */
footer {
  border-top: 1px solid #003322;
  padding: 1rem 0 2rem;
  font-size: .8rem;
  color: #666;
  text-align: center;
}

/* =========================
   LINKS
========================= */
a {
  color: #00ffcc;
}

a:hover {
  text-shadow: 0 0 6px rgba(0,255,204,.8);
}

/* =========================
   IMAGENES
========================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  justify-items: center;
}

.img-frame {
  margin: 3rem auto;
  text-align: center;
}

.img-frame img {
  /* max-width: 800px; */
  /* width: 100%; */
  border: 2px solid #9d7cff;
  box-shadow: 0 0 25px rgba(157,124,255,.4);
}

.img-frame span {
  display: block;
  margin-top: .5rem;
  font-size: .75rem;
  color: #ffeb3b;
  letter-spacing: .15em;
}

/* =========================
   SCANLINES (ANIMADAS)
========================= */
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.03),
      rgba(255,255,255,.03) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: .12;
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  from { background-position-y: 0; }
  to { background-position-y: 100px; }
}

/* =========================
   COMMENT FORM
========================= */

.comment-form {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  border: 2px solid #003322;
  background: linear-gradient(135deg, #010a06, #000);
  box-shadow:
    0 0 25px rgba(0,255,136,.25),
    inset 0 0 30px rgba(0,0,0,.9);
  animation: fadeUp .6s ease-out both;
}

.comment-form__title {
  color: #00ff88;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 8px rgba(0,255,136,.6);
}

/* formulario */
.comment-form__form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* campo */
.comment-form__field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.comment-form__label {
  font-size: .75rem;
  color: #66ffcc;
  opacity: .85;
}

/* inputs */
.comment-form__input,
.comment-form__textarea {
  background: #020202;
  color: #c8ffcc;
  border: 1px solid #003322;
  padding: .5rem .6rem;
  font-family: inherit;
  font-size: .85rem;
  box-shadow: inset 0 0 10px #000;
  transition: border-color .2s, box-shadow .2s;
}

.comment-form__input:focus,
.comment-form__textarea:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow:
    inset 0 0 10px #000,
    0 0 10px rgba(0,255,136,.4);
}

/* botón */
.comment-form__submit {
  margin-top: .8rem;
  align-self: flex-start;
  background: transparent;
  color: #00ff88;
  border: 1px solid #00ff88;
  padding: .4rem 1rem;
  font-family: inherit;
  font-size: .8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .15em;
  box-shadow: 0 0 10px rgba(0,255,136,.3);
  transition:
    background .2s,
    box-shadow .2s,
    transform .15s;
}

.comment-form__submit:hover {
  background: rgba(0,255,136,.1);
  box-shadow: 0 0 20px rgba(0,255,136,.6);
  transform: translateY(-1px);
}

/* nota */
.comment-form__note {
  display: block;
  margin-top: 1rem;
  font-size: .7rem;
  color: #66ffcc;
  opacity: .7;
}

/* =========================
   CARD
========================= */
.card {
  background: linear-gradient(145deg, #010a06, #00110a);
  border: 1px solid #00ff88;
  padding: 1.5rem 1.8rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow:
    0 0 15px rgba(0,255,136,.3),
    inset 0 0 20px rgba(0,255,136,.1);
  transition: transform .2s, box-shadow .3s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 25px rgba(0,255,136,.6),
    inset 0 0 25px rgba(0,255,136,.15);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: #00ff88;
  font-size: 1.5rem;
  text-shadow: 0 0 6px rgba(0,255,136,.7);
}

.card p {
  margin: 0 0 1rem 0;
  color: #c8ffcc;
  line-height: 1.5;
}

.card .links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card .links a {
  color: #66ffcc;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #00ff88;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background .2s, box-shadow .2s;
}

.card .links a:hover {
  background: rgba(0,255,136,.1);
  box-shadow: 0 0 10px rgba(0,255,136,.5);
}

/* -----------------------
   CARDS ABOUT
------------------------ */
.about-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.about-cards .card {
  background: linear-gradient(135deg, #010a06, #001100);
  border: 1px solid #00ff88;
  padding: 1rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,255,136,.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.about-cards .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 25px rgba(0,255,136,.5);
}

.about-cards .card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #00ff88;
}

.about-cards .card p {
  font-size: 0.85rem;
  margin: 0 0 0.7rem;
  color: #c8ffcc;
}

.about-cards .card .links a {
  font-size: 0.8rem;
  color: #66ffcc;
  margin: 0 0.3rem;
  text-decoration: none;
}

.about-cards .card .links a:hover {
  text-shadow: 0 0 6px rgba(0,255,204,.8);
}




/* =========================
   RESPONSIVE — MOBILE
========================= */

/* ---------- Tablets y mobile ---------- */
@media (max-width: 768px) {

  .main-layout {
    flex-direction: column;
  }

  .left-column, .right-column {
    flex: none;
    width: 100%;
  }

  .right-column {
    margin-top: 2rem;
    align-items: center;
  }

  .img-frame img {
    max-width: 80%;
  }

  /* layout: usar todo el ancho */
  .page {
    grid-template-columns:
      minmax(0, 1fr);
  }

  .page > * {
    grid-column: 1;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* header */
  header h1 {
    font-size: 1.6rem;
    text-align: center;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: center;
  }

  nav a {
    margin-right: 0;
    font-size: .85rem;
  }

  /* títulos con typing → sin overflow raro */
  h2 {
    white-space: normal;
    animation: none;
  }

  h2::after {
    display: none;
  }

  /* posts */
  article h1 {
    font-size: 1.6rem;
  }

  main {
    padding: 1.5rem 0;
  }

  article {
    margin-bottom: 3rem;
  }

  /* imágenes */
  .img-frame {
    margin: 2rem auto;
  }

  .img-frame img {
    max-width: 100%;
  }

  /* galería */
  .gallery {
    grid-template-columns: 1fr;
  }

  /* comentarios */
  .comment {
    padding: .8rem 1rem;
  }

  .comment:hover {
    transform: none;
  }

  /* formulario */
  .comment-form {
    padding: 1.5rem 1rem;
  }

  .comment-form__submit {
    align-self: stretch;
    text-align: center;
  }
}

/* ---------- Mobile chico ---------- */
@media (max-width: 480px) {

  body {
    font-size: .9rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  nav a {
    font-size: .8rem;
  }

  article h1 {
    font-size: 1.4rem;
  }

  /* reducir efectos pesados */
  body::after {
    opacity: .06;
  }

  /* code blocks */
  pre {
    font-size: .75rem;
    padding: .8rem;
  }

  /* comentarios */
  .comments h3 {
    font-size: 1.1rem;
  }

  .comment::before {
    display: none;
  }

  /* formulario */
  .comment-form__label {
    font-size: .7rem;
  }

  .comment-form__input,
  .comment-form__textarea {
    font-size: .8rem;
  }
}