@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121214;
  --bg-card: rgba(24, 24, 28, 0.88);
  --metal-light: #c8cdd4;
  --metal-mid: #8b939e;
  --metal-dark: #3d4349;
  --accent: #e85d2a;
  --accent-bright: #f97316;
  --accent-hover: #dc2626;
  --accent-muted: rgba(232, 93, 42, 0.14);
  --fire-glow: rgba(220, 38, 38, 0.35);
  --text-primary: #eceff2;
  --text-secondary: #9ca3af;
  --border: rgba(200, 205, 212, 0.14);
  --border-accent: rgba(232, 93, 42, 0.35);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  --radius: 0.75rem;
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
}

body.portfolio-page {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body.portfolio-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(220, 38, 38, 0.18), transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(232, 93, 42, 0.1), transparent 45%),
    radial-gradient(circle at 85% 70%, rgba(139, 147, 158, 0.08), transparent 40%),
    linear-gradient(180deg, #141416 0%, var(--bg-primary) 100%);
  z-index: -2;
}

body.portfolio-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 205, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 205, 212, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 85%);
  z-index: -1;
}

/* Navbar */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 2002;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--metal-light);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav__brand:hover {
  color: var(--accent-bright);
}

.site-nav__brand img {
  height: 2rem;
  width: 2rem;
  object-fit: contain;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav__link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.site-nav__link:hover {
  color: var(--accent-bright);
  background: var(--accent-muted);
}

/* Main content */
.site-main {
  margin-top: var(--nav-height);
  padding: 2.5rem 1.5rem 4rem;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.site-main:has(.hero) {
  padding-top: 0.75rem;
  padding-bottom: 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 0.25rem 0 0.75rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero__logo {
  width: min(100%, clamp(200px, 32vh, 340px));
  height: auto;
  display: block;
  margin: 0 auto 0.35rem;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(220, 38, 38, 0.25))
          drop-shadow(0 12px 32px rgba(0, 0, 0, 0.6));
}

.hero__tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--metal-mid);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.hero__badge {
  display: inline-block;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero__title span {
  color: var(--accent);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* Project grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  justify-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero + .portfolio-grid {
  gap: 1rem;
}

.hero + .portfolio-grid .project-card {
  padding: 1.35rem 1.25rem;
}

.hero + .portfolio-grid .project-card__icon {
  width: 60px;
  height: 60px;
  margin-bottom: 0.85rem;
  padding: 0.5rem;
}

.hero + .portfolio-grid .project-card__desc {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.project-card {
  background: linear-gradient(160deg, rgba(36, 36, 40, 0.95) 0%, rgba(20, 20, 22, 0.98) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 12px 40px var(--fire-glow), 0 0 0 1px rgba(232, 93, 42, 0.15);
}

.project-card__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: rgba(139, 147, 158, 0.1);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  object-fit: contain;
}

.project-card__tag {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
  margin-bottom: 0.5rem;
}

.project-card__title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--metal-light);
  margin: 0 0 0.75rem;
}

.project-card__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex: 1;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  margin-top: auto;
  width: 100%;
}

.project-card__link:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.45);
}

/* Content card (créditos, detalle) */
.content-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2.5rem 2rem;
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
}

.content-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
}

.content-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 1rem;
}

.content-card a {
  color: var(--accent-bright);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.content-card a:hover {
  border-bottom-color: var(--accent-bright);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer a {
  color: var(--accent-bright);
  text-decoration: none;
}

@media (max-width: 640px) {
  .site-nav {
    padding: 0 1rem;
  }

  .site-main {
    padding: 1.5rem 1rem 3rem;
  }

  .site-main:has(.hero) {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
  }

  .hero {
    padding: 0 0 0.5rem;
  }

  .hero__logo {
    width: min(100%, clamp(180px, 26vh, 260px));
    margin-bottom: 0.25rem;
  }

  .hero__tagline {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .hero + .portfolio-grid .project-card {
    padding: 1.15rem 1rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    max-width: 100%;
  }
}

/* Project detail pages */
.project-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.project-detail__icon {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--accent-muted);
  border-radius: 1.25rem;
  object-fit: contain;
}

.project-detail__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.project-detail__desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 640px;
  margin: 0 0 1.5rem;
}

.project-detail__section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  max-width: 700px;
  width: 100%;
  margin-bottom: 2rem;
  text-align: left;
}

.project-detail__section h2 {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.project-detail__section ul {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0;
  padding-left: 1.25rem;
}

.project-detail__iframe {
  width: 100%;
  max-width: 1240px;
  height: min(800px, 70vh);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.project-detail__actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 1240px;
  margin-top: 0.75rem;
}

.btn-fullscreen {
  background: linear-gradient(135deg, #8b939e, #5c636a);
  color: #0a0a0c;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-fullscreen:hover {
  transform: scale(1.03);
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(139, 147, 158, 0.3);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-bright);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-top: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-hover);
}

/* Embedded game pages (e.g. Slay The King) */
.game-page {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.game-page__player {
  background: linear-gradient(160deg, rgba(28, 28, 32, 0.95), rgba(14, 14, 16, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 93, 42, 0.08);
}

.game-page__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.6rem 1rem;
  background: rgba(10, 10, 12, 0.95);
  border-bottom: 1px solid var(--border);
}

.game-page__frame-wrap {
  position: relative;
  background: #000;
  line-height: 0;
}

.game-page__iframe {
  display: block;
  width: 100%;
  height: min(720px, 72vh);
  border: none;
}

/* Pantalla completa por CSS (funciona en HTTP y móvil) */
.game-page__frame-wrap.stk-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
}

.game-page__frame-wrap.stk-fullscreen .game-page__iframe {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.btn-exit-fullscreen {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10000;
  padding: 0.5rem 0.9rem;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1;
}

.game-page__frame-wrap.stk-fullscreen .btn-exit-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.game-page__info {
  margin-top: 2rem;
  display: grid;
  gap: 1.25rem;
}

.game-page__desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin: 0;
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.game-page__features {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.game-page__features h2 {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.85rem;
}

.game-page__features ul {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0;
  padding-left: 1.2rem;
}

.game-page .back-link {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

@media (max-width: 640px) {
  .game-page__iframe {
    height: min(520px, 58vh);
  }

  .game-page__info {
    margin-top: 1.5rem;
  }

  .game-page__features {
    padding: 1.25rem 1rem;
  }

  .comentarios {
    padding: 1.25rem 1rem;
  }
}

/* Comentarios del demo */
.comentarios {
  margin-top: 2.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.75rem;
  background: linear-gradient(160deg, rgba(28, 28, 32, 0.95), rgba(14, 14, 16, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.comentarios__title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--metal-light);
  margin: 0 0 0.5rem;
}

.comentarios__intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.comentarios__form {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.comentarios__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--metal-mid);
  letter-spacing: 0.03em;
}

.comentarios__input,
.comentarios__textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 12, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comentarios__input:focus,
.comentarios__textarea:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.comentarios__textarea {
  resize: vertical;
  min-height: 100px;
}

.comentarios__submit {
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.comentarios__submit:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

.comentarios__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.comentarios__error {
  color: #f87171;
  font-size: 0.9rem;
  margin: 0;
}

.comentarios__lista {
  display: grid;
  gap: 1rem;
}

.comentarios__vacio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
  padding: 1rem 0;
}

.comentario-item {
  padding: 1rem 1.1rem;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
}

.comentario-item__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.comentario-item__nombre {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: 0.03em;
}

.comentario-item__fecha {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comentario-item__texto {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
