/* ═══════════════════════════════════════════════════════════════
   W3NN COMMAND HUB — Portal Landing Page Styles
   Dual-feel: Minecraft Retro  ↔  Premium Original Dark
   ═══════════════════════════════════════════════════════════════ */

@import url('css/fonts.css');
@import url('css/variables.css');
@import url('css/sidebar.css');

/* ─────────────────────────────────────────────
   GLOBAL PAGE BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: rgba(92, 232, 255, 0.1);
  color: var(--diamond);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────
   BACKGROUND — Premium original: deep nebula gradient
───────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(157, 111, 255, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(92, 232, 255, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(6, 8, 18, 1) 0%, rgba(4, 6, 14, 1) 100%);
}

/* ─────────────────────────────────────────────
   FLOATING RUNES — shared with builders
───────────────────────────────────────────── */
.hero-runes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}
.rune {
  position: absolute;
  bottom: -40px;
  font-size: clamp(22px, 3.5vw, 42px);
  color: var(--arcane);
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(157, 111, 255, 0.9)) drop-shadow(0 0 4px rgba(157, 111, 255, 0.6));
  animation: runeRise var(--dur, 10s) linear infinite;
  animation-delay: var(--delay, 0s);
  left: var(--left, 50%);
}
.rune:nth-child(1)  { --dur:12s; --delay:0s;    --left:4%; }
.rune:nth-child(2)  { --dur:15s; --delay:3s;    --left:12%; }
.rune:nth-child(3)  { --dur:10s; --delay:1s;    --left:22%; }
.rune:nth-child(4)  { --dur:18s; --delay:5s;    --left:33%; }
.rune:nth-child(5)  { --dur:11s; --delay:2s;    --left:44%; }
.rune:nth-child(6)  { --dur:14s; --delay:7s;    --left:55%; }
.rune:nth-child(7)  { --dur:13s; --delay:4s;    --left:64%; }
.rune:nth-child(8)  { --dur:16s; --delay:1.5s;  --left:74%; }
.rune:nth-child(9)  { --dur:12s; --delay:8s;    --left:83%; }
.rune:nth-child(10) { --dur:17s; --delay:6s;    --left:91%; }
.rune:nth-child(11) { --dur:14s; --delay:2.5s;  --left:8%; }
.rune:nth-child(12) { --dur:11s; --delay:9s;    --left:28%; }
.rune:nth-child(13) { --dur:15s; --delay:4.5s;  --left:50%; }
.rune:nth-child(14) { --dur:13s; --delay:10s;   --left:68%; }
.rune:nth-child(15) { --dur:16s; --delay:0.5s;  --left:79%; }
.rune:nth-child(16) { --dur:12s; --delay:11s;   --left:96%; }

@keyframes runeRise {
  0%   { transform: translateY(0) scale(0.7) rotate(0deg); opacity: 0; }
  15%  { opacity: 0.65; }
  85%  { opacity: 0.65; }
  100% { transform: translateY(-100vh) scale(1.2) rotate(180deg); opacity: 0; }
}

/* ─────────────────────────────────────────────
   THEME TOGGLE PILL (Fixed top-right)
───────────────────────────────────────────── */
.portal-theme-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-mid);
  background: rgba(6, 8, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.theme-pill:hover {
  border-color: var(--arcane);
  box-shadow: 0 0 12px rgba(157, 111, 255, 0.3);
}

.theme-pill-icon {
  font-size: 14px;
  line-height: 1;
  transition: opacity 0.2s ease;
}
.theme-pill-icon--orig { display: none; }

/* ─────────────────────────────────────────────
   PORTAL MAIN WRAP
───────────────────────────────────────────── */
.portal-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 60px;
}

/* ─────────────────────────────────────────────
   HERO SECTION
───────────────────────────────────────────── */
.portal-hero {
  width: 100%;
  max-width: 720px;
  padding: 100px 0 48px;
  text-align: center;
}

.portal-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ─── Badge ─── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(157, 111, 255, 0.28);
  background: rgba(157, 111, 255, 0.07);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--arcane);
  margin-bottom: 28px;
}

.orb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--arcane);
  box-shadow: 0 0 8px 2px var(--arcane);
  animation: orbPulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 5px 1px var(--arcane); }
  50% { box-shadow: 0 0 14px 4px var(--arcane); }
}

/* ─── Main Title ─── */
.portal-title {
  line-height: 0.88;
  margin-bottom: 24px;
  user-select: none;
}

.portal-title-top {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(38px, 9vw, 78px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-shadow: none;
}

.portal-title-bot {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(50px, 12vw, 104px);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(130deg, var(--arcane) 0%, var(--diamond) 55%, var(--arcane) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 7s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─── Subtitle ─── */
.portal-subtitle {
  font-size: clamp(13.5px, 2.2vw, 16.5px);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ─── Terminal Typewriter Box ─── */
.terminal-box {
  width: 100%;
  max-width: 460px;
  background: rgba(4, 5, 14, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--border-faint);
}
.terminal-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
}
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 14px;
  font-family: var(--font-mono);
  font-size: clamp(12px, 2vw, 14px);
  min-height: 42px;
}

.terminal-prompt {
  color: var(--xp);
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}

.terminal-text {
  color: var(--text-primary);
  word-break: break-all;
}

.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--diamond);
  opacity: 0.9;
  border-radius: 1px;
  animation: blinkCursor 0.85s steps(2, start) infinite;
  flex-shrink: 0;
  vertical-align: middle;
  margin-bottom: -2px;
}
@keyframes blinkCursor {
  to { visibility: hidden; }
}

/* ─────────────────────────────────────────────
   CARDS SECTION
───────────────────────────────────────────── */
.portal-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 820px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .portal-cards {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
}

/* ─── Individual Card ─── */
.portal-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease;
}

.portal-card:hover {
  transform: translateY(-6px);
}

/* Glow ring effect behind card */
.card-glow-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.portal-card:hover .card-glow-ring { opacity: 1; }

/* ─── Enchant Card colors ─── */
.portal-card--enchant {
  --c-glow: rgba(157, 111, 255, 0.18);
  --c-border: rgba(157, 111, 255, 0.4);
  --c-icon-bg: rgba(157, 111, 255, 0.08);
  --c-cta: var(--arcane);
}
.portal-card--enchant:hover {
  border-color: var(--c-border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 30px var(--c-glow);
}
.portal-card--enchant .card-glow-ring {
  background: radial-gradient(ellipse at 50% 0%, var(--c-glow) 0%, transparent 70%);
}

/* ─── Effect Card colors ─── */
.portal-card--effect {
  --c-glow: rgba(92, 232, 255, 0.16);
  --c-border: rgba(92, 232, 255, 0.38);
  --c-icon-bg: rgba(92, 232, 255, 0.07);
  --c-cta: var(--diamond);
}
.portal-card--effect:hover {
  border-color: var(--c-border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 30px var(--c-glow);
}
.portal-card--effect .card-glow-ring {
  background: radial-gradient(ellipse at 50% 0%, var(--c-glow) 0%, transparent 70%);
}

/* ─── Card Inner Body ─── */
.card-body {
  position: relative;
  z-index: 1;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

/* ─── Card Icon ─── */
.card-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: var(--r-md);
  background: var(--c-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
}
.portal-card:hover .card-icon-wrap {
  transform: scale(1.1) translateY(-3px);
}
.card-icon {
  width: 52px;
  height: 52px;
  image-rendering: pixelated;
  object-fit: contain;
}

/* ─── Card Title ─── */
.card-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}

/* ─── Card Description ─── */
.card-desc {
  font-size: clamp(12.5px, 1.8vw, 14px);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 260px;
}

/* ─── Card Tags ─── */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.card-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  color: var(--c-cta);
  background: rgba(255,255,255, 0.025);
  letter-spacing: 0.04em;
}

/* ─── Card CTA Button ─── */
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-cta);
  margin-top: 4px;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.card-cta svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}
.portal-card:hover .card-cta {
  background: var(--c-cta);
  color: #0a0c1e;
  box-shadow: 0 0 14px var(--c-glow);
}
.portal-card:hover .card-cta svg {
  transform: translateX(4px);
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.portal-footer {
  margin-top: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-tip {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.footer-tip strong {
  color: var(--arcane);
  font-weight: 700;
}

.footer-heart {
  display: inline-flex;
  align-items: center;
}
.mc-heart {
  display: inline-block;
  width: 13px;
  height: 11px;
  background-image: url('../assets/img/heart.svg');
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: heartbeat 1.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.2); }
}

.footer-note {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════
   MINECRAFT THEME OVERRIDES
   ══════════════════════════════════════════════════════════════ */

/* Background: Dirt texture */
body.theme-minecraft::before {
  background:
    url('../assets/img/dirt.png') repeat,
    linear-gradient(180deg, #1a1208 0%, #0f0c06 100%);
  background-size: 48px 48px, 100% 100%;
  opacity: 0.85;
}

/* Runes turn green */
body.theme-minecraft .rune {
  color: #55ff55;
  font-family: 'Minecraft', 'VT323', monospace;
}

/* Badge: Minecraft item tooltip */
body.theme-minecraft .hero-badge {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #5555ff;
  border-radius: 0;
  color: #55ffff;
  font-family: 'Minecraft', 'VT323', monospace;
  letter-spacing: 0.06em;
}
body.theme-minecraft .orb-dot {
  background: #55ff55;
  box-shadow: 0 0 8px 2px #55ff55;
}

/* Title: Minecraft gold/yellow */
body.theme-minecraft .portal-title-top {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffaa00 !important;
  -webkit-text-fill-color: #ffaa00 !important;
  text-shadow: 3px 3px 0 #3f2f00;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  animation: none;
  letter-spacing: 0.06em;
}

body.theme-minecraft .portal-title-bot {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffff55 !important;
  -webkit-text-fill-color: #ffff55 !important;
  text-shadow: 3px 3px 0 #3f3f00;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  animation: none !important;
  letter-spacing: 0.06em;
}

/* Subtitle font */
body.theme-minecraft .portal-subtitle {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: clamp(14px, 2.5vw, 18px);
  line-height: 1.6;
}
body.theme-minecraft code {
  font-family: 'Minecraft', 'VT323', monospace;
  background: rgba(85, 255, 85, 0.12);
  color: #55ff55;
}

/* Terminal Box: Minecraft GUI */
body.theme-minecraft .terminal-box {
  background: #101010;
  border: 3px solid #3c3c3c;
  border-radius: 0;
  box-shadow: inset 0 0 0 2px #000, 4px 4px 0 #000;
}
body.theme-minecraft .terminal-dots {
  display: none;
}
body.theme-minecraft .terminal-line {
  padding: 12px 16px;
  font-family: 'Minecraft', 'VT323', monospace;
  font-size: clamp(14px, 2.5vw, 17px);
}
body.theme-minecraft .terminal-prompt {
  color: #55ff55;
}
body.theme-minecraft .terminal-text {
  color: #ffffff;
}
body.theme-minecraft .terminal-cursor {
  background: #ffffff;
  width: 8px;
  height: 16px;
  border-radius: 0;
}

/* Cards: Minecraft item slot */
body.theme-minecraft .portal-card {
  background: #2d2d2d;
  border: 3px solid #555;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 #6b6b6b, inset -2px -2px 0 #000;
}
body.theme-minecraft .portal-card:hover {
  transform: translateY(-4px);
  border-color: #aaaaff;
  box-shadow: inset 2px 2px 0 #6b6b6b, inset -2px -2px 0 #000, 0 0 16px rgba(85, 85, 255, 0.35);
}
body.theme-minecraft .card-glow-ring { display: none; }

body.theme-minecraft .card-icon-wrap {
  background: #1a1a1a;
  border: 2px solid #555;
  border-radius: 0;
}
body.theme-minecraft .card-title {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffff55;
  text-shadow: 2px 2px 0 #3f3f00;
  font-size: clamp(18px, 4vw, 26px);
}
body.theme-minecraft .card-desc {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: clamp(13px, 2.2vw, 16px);
  line-height: 1.5;
}
body.theme-minecraft .card-tag {
  font-family: 'Minecraft', 'VT323', monospace;
  border-radius: 0;
  background: #101010;
  border: 2px solid #555;
  color: #55ff55;
  font-size: 12px;
}
body.theme-minecraft .card-cta {
  font-family: 'Minecraft', 'VT323', monospace;
  border-radius: 0;
  border: 2px solid #555;
  background: #3c3c3c;
  color: #ffffff;
  font-size: 14px;
  letter-spacing: 0.04em;
  box-shadow: inset 1px 1px 0 #6b6b6b, inset -1px -1px 0 #000;
}
body.theme-minecraft .portal-card:hover .card-cta {
  background: #555;
  color: #fff;
  box-shadow: inset 1px 1px 0 #888, inset -1px -1px 0 #000;
}

/* Theme pill: Minecraft style */
body.theme-minecraft .theme-pill {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #555;
  border-radius: 0;
  color: #ffffff;
  font-family: 'Minecraft', 'VT323', monospace;
  letter-spacing: 0.04em;
  font-size: 14px;
}
body.theme-minecraft .theme-pill:hover {
  border-color: #aaaaff;
  box-shadow: none;
}
body.theme-minecraft .theme-pill-icon--mc { display: inline; }
body.theme-minecraft .theme-pill-icon--orig { display: none; }

/* Footer */
body.theme-minecraft .footer-tip {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: 15px;
}
body.theme-minecraft .footer-tip strong { color: #ffaa00; }
body.theme-minecraft .footer-note {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #555;
  font-size: 13px;
}

/* ─── ORIGINAL DARK THEME overrides (body without .theme-minecraft) ─── */
body:not(.theme-minecraft) .theme-pill-icon--mc { display: none; }
body:not(.theme-minecraft) .theme-pill-icon--orig { display: inline; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .portal-hero { padding: 88px 0 40px; }
  .card-body { padding: 28px 20px 22px; }
}

/* Mobile */
@media (max-width: 640px) {
  .portal-wrap { padding: 0 16px 48px; }
  .portal-hero { padding: 80px 0 36px; }
  .portal-subtitle { font-size: 13.5px; }
  .terminal-box { max-width: 100%; }

  .card-body { padding: 24px 18px 20px; }
  .card-icon-wrap { width: 68px; height: 68px; }
  .card-icon { width: 44px; height: 44px; }

  /* Keep theme pill visible but compact */
  .portal-theme-wrap { top: 14px; right: 14px; }
  .theme-pill { padding: 6px 11px; font-size: 11px; gap: 5px; }
}

/* Very small (320–360px) */
@media (max-width: 360px) {
  .portal-title-top { font-size: 32px; }
  .portal-title-bot { font-size: 42px; }
  .theme-pill-label { display: none; }
  .theme-pill { padding: 7px 10px; }
}