/* =========================================================
   Kolosok — shared guide styles
   Extends style.css. Adds guide components + animations.
   Palette and base tokens come from style.css :root.
   ========================================================= */

/* ---------- Scroll reveal ---------- */
body.js-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

body.js-ready .reveal.delay-1 { transition-delay: 0.08s; }
body.js-ready .reveal.delay-2 { transition-delay: 0.16s; }
body.js-ready .reveal.delay-3 { transition-delay: 0.24s; }
body.js-ready .reveal.delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  body.js-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Guide hero ---------- */
.guide-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 34px;
  align-items: center;
  padding: 78px 0 46px;
}

.guide-hero-copy {
  max-width: 720px;
}

.guide-hero h1 {
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.94;
}

.guide-hero .hero-text {
  max-width: 620px;
  font-size: 17px;
}

/* animated gold underline for the hero title */
.title-shine {
  background: linear-gradient(100deg, var(--text) 20%, var(--gold-bright) 40%, var(--gold-bright) 55%, var(--text) 75%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 7s linear infinite;
}

@keyframes titleShine {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

/* Floating decorative cube in the hero */
.hero-cube {
  position: relative;
  justify-self: center;
  width: 210px;
  height: 210px;
  perspective: 900px;
}

.cube {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 130px;
  height: 130px;
  transform-style: preserve-3d;
  animation: cubeSpin 16s linear infinite;
}

.cube face,
.cube .face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(243, 216, 143, 0.55);
  background: linear-gradient(135deg, rgba(243, 216, 143, 0.16), rgba(122, 71, 31, 0.12));
  box-shadow: inset 0 0 30px rgba(214, 168, 79, 0.18);
}

.cube .f-front  { transform: translateZ(65px); }
.cube .f-back   { transform: rotateY(180deg) translateZ(65px); }
.cube .f-right  { transform: rotateY(90deg) translateZ(65px); }
.cube .f-left   { transform: rotateY(-90deg) translateZ(65px); }
.cube .f-top    { transform: rotateX(90deg) translateZ(65px); }
.cube .f-bottom { transform: rotateX(-90deg) translateZ(65px); }

@keyframes cubeSpin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}

.cube-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 168, 79, 0.28), transparent 62%);
  filter: blur(6px);
  animation: pulseGlow 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .cube { animation: none; }
  .cube-glow { animation: none; }
  .title-shine { animation: none; color: var(--text); }
}

/* ---------- TOC pills ---------- */
.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.guide-toc a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.guide-toc a:hover {
  border-color: rgba(243, 216, 143, 0.45);
  color: var(--gold-bright);
  background: rgba(214, 168, 79, 0.08);
  transform: translateY(-2px);
}

/* ---------- Section rhythm ---------- */
.guide-section {
  padding: 60px 0;
  border-top: 1px solid rgba(243, 216, 143, 0.08);
}

.guide-section .section-heading {
  margin-bottom: 30px;
}

/* ---------- Card grids ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(20, 17, 11, 0.78);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(243, 216, 143, 0.4);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.34);
}

.info-card h3 {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: 17px;
}

.info-card p {
  margin: 0;
  font-size: 14.5px;
}

.info-card .card-index {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

/* ---------- Callout ---------- */
.callout {
  border: 1px solid rgba(243, 216, 143, 0.22);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 24px 0;
  background: linear-gradient(135deg, rgba(243, 216, 143, 0.1), rgba(20, 17, 11, 0.6));
}

.callout strong { color: var(--gold-bright); }

/* ---------- Data table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(20, 17, 11, 0.78);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 14.5px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  color: var(--gold-bright);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(214, 168, 79, 0.06);
}

table.data tr:last-child td { border-bottom: 0; }

table.data tr:hover td { background: rgba(214, 168, 79, 0.05); }

table.data code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--light);
  font-size: 13px;
}

/* ---------- Step list ---------- */
.step-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 22px 74px;
  background: rgba(20, 17, 11, 0.78);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.step-list li:hover {
  border-color: rgba(243, 216, 143, 0.35);
  transform: translateX(4px);
}

.step-list li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 22px;
  top: 22px;
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 18px;
}

.step-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.step-list p { margin: 0; font-size: 15px; }

/* ---------- Related links ---------- */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.related-links a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.related-links a:hover {
  border-color: rgba(243, 216, 143, 0.4);
  color: var(--gold-bright);
  transform: translateY(-2px);
}

/* ---------- Badge / pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(20, 17, 11, 0.7);
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.6; }
}

/* ---------- Brewing animation ---------- */
.brew {
  position: relative;
  width: 200px;
  height: 220px;
  justify-self: center;
}

.brew-stand {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 120px;
  height: 130px;
  transform: translateX(-50%);
  border: 1px solid rgba(243, 216, 143, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(243, 216, 143, 0.1), rgba(122, 71, 31, 0.08));
}

.brew-stand::before,
.brew-stand::after {
  content: "";
  position: absolute;
  bottom: 16px;
  width: 26px;
  height: 44px;
  border: 1px solid rgba(214, 168, 79, 0.6);
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, transparent 40%, rgba(122, 71, 31, 0.5));
}

.brew-stand::before { left: 14px; }
.brew-stand::after { right: 14px; }

.brew-bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.brew-bubbles i {
  position: absolute;
  bottom: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 216, 143, 0.7);
  filter: blur(1px);
  animation: bubble 4s ease-in infinite;
}

.brew-bubbles i:nth-child(1) { left: 30%; animation-delay: 0s; }
.brew-bubbles i:nth-child(2) { left: 45%; animation-delay: 0.9s; width: 6px; height: 6px; }
.brew-bubbles i:nth-child(3) { left: 58%; animation-delay: 1.8s; }
.brew-bubbles i:nth-child(4) { left: 40%; animation-delay: 2.6s; width: 5px; height: 5px; }
.brew-bubbles i:nth-child(5) { left: 52%; animation-delay: 3.3s; }

@keyframes bubble {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-120px) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brew-bubbles i { animation: none; }
}

/* ---------- Redstone animation ---------- */
.redstone-line {
  display: flex;
  align-items: center;
  gap: 0;
  justify-self: center;
  margin-top: 8px;
}

.redstone-line .segment {
  width: 34px;
  height: 10px;
  background: rgba(122, 71, 31, 0.7);
  position: relative;
}

.redstone-line .segment::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ff5a3c;
  opacity: 0;
  animation: signal 3.2s linear infinite;
}

.redstone-line .segment:nth-child(1)::after { animation-delay: 0s; }
.redstone-line .segment:nth-child(2)::after { animation-delay: 0.4s; }
.redstone-line .segment:nth-child(3)::after { animation-delay: 0.8s; }
.redstone-line .segment:nth-child(4)::after { animation-delay: 1.2s; }
.redstone-line .segment:nth-child(5)::after { animation-delay: 1.6s; }
.redstone-line .segment:nth-child(6)::after { animation-delay: 2s; }
.redstone-line .segment:nth-child(7)::after { animation-delay: 2.4s; }
.redstone-line .segment:nth-child(8)::after { animation-delay: 2.8s; }

.redstone-line .torch {
  width: 14px;
  height: 34px;
  background: #ff5a3c;
  border-radius: 3px;
  box-shadow: 0 0 18px #ff5a3c;
}

@keyframes signal {
  0%, 100% { opacity: 0; }
  8%, 22% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .redstone-line .segment::after { animation: none; opacity: 1; }
}

/* ---------- Enchanting pedestal ---------- */
.enchant-stage {
  position: relative;
  width: 220px;
  height: 220px;
  justify-self: center;
}

.enchant-book {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 76px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(243, 216, 143, 0.6);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(243, 216, 143, 0.2), rgba(122, 71, 31, 0.15));
  animation: floaty 5s ease-in-out infinite;
}

.enchant-book::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(243, 216, 143, 0.5);
}

.enchant-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(243, 216, 143, 0.35);
  animation: spinRing 12s linear infinite;
}

.enchant-particles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 12px var(--gold-bright);
  animation: orbit 6s linear infinite;
}

.enchant-particles i:nth-child(1) { animation-delay: 0s; }
.enchant-particles i:nth-child(2) { animation-delay: 1.5s; }
.enchant-particles i:nth-child(3) { animation-delay: 3s; }
.enchant-particles i:nth-child(4) { animation-delay: 4.5s; }

@keyframes floaty {
  0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
  50% { transform: translate(-50%, -58%) rotate(3deg); }
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(105px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(105px) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .enchant-book { animation: none; }
  .enchant-glow { animation: none; }
  .enchant-particles i { animation: none; opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .guide-hero {
    grid-template-columns: 1fr;
    padding-top: 60px;
  }
  .guide-hero .hero-visual { order: -1; }
}

@media (max-width: 620px) {
  .step-list li { padding: 20px 18px 18px 58px; }
  .step-list li::before { left: 16px; font-size: 16px; }
}
