/* ═══════════════════════════════════════════════════════════════
   W3NN Tutorial Page — tutorial.css
   Same design system as builders (variables.css tokens used)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Base / Background ─── */
.tutorial-body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.tutorial-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.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(92, 232, 255, 0.08) 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 ─── */
.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(18px, 3vw, 36px);
  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.55; }
  85%  { opacity: 0.55; }
  100% { transform: translateY(-100vh) scale(1.2) rotate(180deg); opacity: 0; }
}

/* ─── Shared helpers ─── */
.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;
  display: inline-block;
}
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 5px 1px var(--arcane); }
  50% { box-shadow: 0 0 14px 4px var(--arcane); }
}

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

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-mid);
  border-bottom: 2px solid var(--border-mid);
  border-radius: 4px;
  padding: 1px 7px;
  color: var(--text-primary);
}

/* ─── Main Wrap ─── */
.tut-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ─── Page Header ─── */
.tut-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.tut-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: 24px;
}

.tut-title {
  line-height: 0.88;
  margin-bottom: 22px;
}
.tut-title-top {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 54px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.tut-title-bot {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(42px, 10vw, 90px);
  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: gradShift 7s ease-in-out infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.tut-subtitle {
  font-size: clamp(13px, 2vw, 15.5px);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 32px;
}
.tut-subtitle strong { color: var(--text-primary); }

/* ─── Tabs ─── */
.tut-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.tut-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.22s ease;
}
.tut-tab svg { width: 15px; height: 15px; }
.tut-tab:hover {
  border-color: var(--arcane);
  color: var(--text-primary);
}
.tut-tab.active {
  background: rgba(157, 111, 255, 0.12);
  border-color: rgba(157, 111, 255, 0.5);
  color: var(--arcane);
  box-shadow: 0 0 16px rgba(157, 111, 255, 0.15);
}
#tab-effect.active {
  background: rgba(92, 232, 255, 0.1);
  border-color: rgba(92, 232, 255, 0.45);
  color: var(--diamond);
  box-shadow: 0 0 16px rgba(92, 232, 255, 0.12);
}

/* ─── Section ─── */
.tut-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  animation: fadeIn 0.35s ease;
}
.tut-section.hidden { display: none; }

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

.tut-section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.section-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-icon--enchant {
  background: rgba(157, 111, 255, 0.1);
  border: 1px solid rgba(157, 111, 255, 0.2);
}
.section-icon--enchant img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}
.section-icon--effect {
  background: rgba(92, 232, 255, 0.08);
  border: 1px solid rgba(92, 232, 255, 0.2);
}
.section-icon--effect svg { width: 40px; height: 40px; }

.tut-section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.tut-section-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Steps ─── */
.tut-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertical connector line */
.tut-steps::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(180deg, rgba(157, 111, 255, 0.3) 0%, rgba(92, 232, 255, 0.3) 100%);
  z-index: 0;
}

.tut-step {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  position: relative;
  z-index: 1;
}
.tut-step + .tut-step {
  border-top: 1px solid var(--border-faint);
}

/* Step number bubble */
.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.step-num--enchant {
  background: rgba(157, 111, 255, 0.15);
  border: 2px solid rgba(157, 111, 255, 0.45);
  color: var(--arcane);
  box-shadow: 0 0 12px rgba(157, 111, 255, 0.2);
}
.step-num--effect {
  background: rgba(92, 232, 255, 0.12);
  border: 2px solid rgba(92, 232, 255, 0.4);
  color: var(--diamond);
  box-shadow: 0 0 12px rgba(92, 232, 255, 0.18);
}

.step-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  padding-top: 6px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.72;
}
.step-desc strong { color: var(--text-primary); }
.step-desc em { color: var(--arcane); font-style: normal; font-weight: 600; }

.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-list li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}
.step-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--diamond);
}
.step-list li strong { color: var(--text-primary); }
.step-list li em { color: var(--arcane); font-style: normal; font-weight: 600; }

/* ─── Tip / Warn callout boxes ─── */
.tut-tip, .tut-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.6;
}
.tut-tip svg, .tut-warn svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.tut-tip {
  background: rgba(92, 232, 255, 0.06);
  border: 1px solid rgba(92, 232, 255, 0.2);
  color: var(--text-muted);
}
.tut-tip svg { color: var(--diamond); }
.tut-tip strong { color: var(--diamond); }

.tut-warn {
  background: rgba(255, 200, 60, 0.07);
  border: 1px solid rgba(255, 200, 60, 0.25);
  color: var(--text-muted);
}
.tut-warn svg { color: #ffc83c; }
.tut-warn strong { color: #ffc83c; }

/* ─── Screenshot display ─── */
.step-screenshot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
}
.step-screenshot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-md) var(--r-md) 0 0;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.step-screenshot:hover img {
  transform: scale(1.015);
}
.screenshot-caption {
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  padding: 8px 14px 10px;
  letter-spacing: 0.03em;
  font-style: italic;
  border-top: 1px solid var(--border-faint);
}

/* ─── CTA Bar ─── */
.tut-cta-bar {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.tut-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: all 0.25s ease;
}
.tut-cta svg { width: 15px; height: 15px; }
.tut-cta svg:last-child { transition: transform 0.2s ease; }
.tut-cta:hover svg:last-child { transform: translateX(5px); }

.tut-cta--enchant {
  background: rgba(157, 111, 255, 0.12);
  border-color: rgba(157, 111, 255, 0.4);
  color: var(--arcane);
}
.tut-cta--enchant:hover {
  background: var(--arcane);
  color: #0a0c1e;
  box-shadow: 0 0 20px rgba(157, 111, 255, 0.35);
}
.tut-cta--effect {
  background: rgba(92, 232, 255, 0.1);
  border-color: rgba(92, 232, 255, 0.38);
  color: var(--diamond);
}
.tut-cta--effect:hover {
  background: var(--diamond);
  color: #0a0c1e;
  box-shadow: 0 0 20px rgba(92, 232, 255, 0.3);
}

/* ─── Footer ─── */
.tut-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 20px;
  border-top: 1px solid var(--border-faint);
}
.tut-footer strong { color: var(--arcane); font-weight: 700; }
.tut-footer-note { font-size: 11px; color: var(--text-dim); letter-spacing: 0.04em; }

.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;
  vertical-align: middle;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.2); }
}

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

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

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

body.theme-minecraft .tut-badge {
  background: rgba(0,0,0,0.7);
  border: 2px solid #5555ff;
  border-radius: 0;
  color: #55ffff;
  font-family: 'Minecraft', 'VT323', monospace;
}

body.theme-minecraft .tut-title-top {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffaa00;
  -webkit-text-fill-color: #ffaa00;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  animation: none;
  text-shadow: 3px 3px 0 #3f2f00;
}

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

body.theme-minecraft .tut-subtitle {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: clamp(14px, 2.2vw, 18px);
}

body.theme-minecraft .tut-tab {
  font-family: 'Minecraft', 'VT323', monospace;
  border-radius: 0;
  border: 2px solid #555;
  background: #2d2d2d;
  color: #aaaaaa;
  font-size: 14px;
}
body.theme-minecraft .tut-tab:hover,
body.theme-minecraft .tut-tab.active {
  border-color: #aaaaff;
  background: #3c3c3c;
  color: #ffff55;
  box-shadow: none;
}

body.theme-minecraft .tut-section-header {
  background: #2d2d2d;
  border: 3px solid #555;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 #6b6b6b, inset -2px -2px 0 #000;
}
body.theme-minecraft .tut-section-title {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffff55;
  text-shadow: 2px 2px 0 #3f3f00;
}
body.theme-minecraft .tut-section-sub {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: 14px;
}

body.theme-minecraft .step-num--enchant {
  background: #1a1a1a;
  border: 2px solid #5555ff;
  color: #5555ff;
  box-shadow: none;
  border-radius: 0;
}
body.theme-minecraft .step-num--effect {
  background: #1a1a1a;
  border: 2px solid #00cfee;
  color: #00cfee;
  box-shadow: none;
  border-radius: 0;
}

body.theme-minecraft .step-title {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffff55;
  text-shadow: 1px 1px 0 #3f3f00;
}
body.theme-minecraft .step-desc,
body.theme-minecraft .step-list li {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: 15px;
}
body.theme-minecraft .step-desc strong,
body.theme-minecraft .step-list li strong { color: #ffffff; }
body.theme-minecraft .step-desc em { color: #55ff55; }

body.theme-minecraft .tut-tip {
  background: rgba(0,207,238,0.06);
  border: 2px solid rgba(0,207,238,0.25);
  border-radius: 0;
  font-family: 'Minecraft', 'VT323', monospace;
  font-size: 14px;
}
body.theme-minecraft .tut-warn {
  background: rgba(255,200,60,0.06);
  border: 2px solid rgba(255,200,60,0.25);
  border-radius: 0;
  font-family: 'Minecraft', 'VT323', monospace;
  font-size: 14px;
}

body.theme-minecraft .step-screenshot {
  border: 3px solid #555;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 #3c3c3c;
}
body.theme-minecraft .screenshot-caption {
  font-family: 'Minecraft', 'VT323', monospace;
  font-style: normal;
  font-size: 13px;
  color: #555;
}

body.theme-minecraft .tut-cta {
  font-family: 'Minecraft', 'VT323', monospace;
  border-radius: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
}
body.theme-minecraft .tut-cta--enchant {
  background: #3c3c3c;
  border: 2px solid #5555ff;
  color: #aaaaff;
}
body.theme-minecraft .tut-cta--enchant:hover {
  background: #5555ff;
  color: #fff;
  box-shadow: none;
}
body.theme-minecraft .tut-cta--effect {
  background: #3c3c3c;
  border: 2px solid #00cfee;
  color: #00cfee;
}
body.theme-minecraft .tut-cta--effect:hover {
  background: #00cfee;
  color: #0a0c1e;
  box-shadow: none;
}

body.theme-minecraft .tut-footer {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #aaaaaa;
  font-size: 14px;
}
body.theme-minecraft .tut-footer strong { color: #ffaa00; }
body.theme-minecraft .tut-footer-note { font-size: 12px; color: #555; }

/* ──────────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .tut-wrap { padding: 72px 16px 60px; gap: 40px; }
  .tut-section-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tut-steps::before { left: 17px; }
  .tut-step { gap: 14px; }
  .step-num { width: 34px; height: 34px; font-size: 13px; }
}

@media (max-width: 360px) {
  .tut-title-bot { font-size: 38px; }
}
