/* AUDIO_HAXOR — Tutorial pages
   Cyberpunk walkthrough styles. Loads after hud-static.css and
   reuses its CSS variables (var(--bg), --text, --accent, --border).
*/

.tutorial-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tutorial-header {
  position: relative;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 4%, transparent) 0%,
      transparent 100%),
    var(--bg);
  padding: 1.1rem 1.5rem 0.85rem;
}
.tutorial-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0.55;
  pointer-events: none;
}
.tutorial-header-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.tutorial-brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 0.2rem;
}
.tutorial-crumbs {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.tutorial-crumbs a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 120ms ease;
}
.tutorial-crumbs a:hover { color: var(--accent); }
.tutorial-crumbs .sep {
  display: inline-block;
  margin: 0 0.35rem;
  color: color-mix(in srgb, var(--text-dim) 50%, transparent);
}
.tutorial-crumbs .current { color: var(--accent); }

.tutorial-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tutorial-main {
  flex: 1;
  max-width: 56rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.step-meter {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.25rem 0 1.15rem;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.step-meter .meter-label {
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
}
.step-meter .meter-bar {
  flex: 1;
  max-width: 16rem;
  height: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}
.step-meter .meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 80%, transparent),
    var(--accent)
  );
  box-shadow: 0 0 8px var(--accent);
}
.step-meter .meter-count {
  font-variant-numeric: tabular-nums;
}

.tutorial-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: var(--text);
  line-height: 1.2;
}
.tutorial-title .step-hash {
  color: var(--accent);
  margin-right: 0.55rem;
  opacity: 0.85;
  font-size: 0.85em;
}
.tutorial-subtitle {
  margin: 0 0 1.5rem;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  line-height: 1.55;
  padding-left: 0.75rem;
  border-left: 2px solid
    color-mix(in srgb, var(--accent) 60%, transparent);
}

.tutorial-section {
  margin: 1.75rem 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--accent) 5%, transparent),
      transparent 40%
    ),
    var(--bg-secondary);
  border-radius: 2px;
  position: relative;
}
.tutorial-section::before {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: 0.7;
}
.tutorial-section::after {
  content: "";
  position: absolute;
  bottom: -1px; left: -1px;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  opacity: 0.7;
}
.tutorial-section > h2 {
  margin: 0 0 0.6rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.tutorial-section > h2::before {
  content: "// ";
  opacity: 0.7;
}
.tutorial-section > h3 {
  margin: 0.9rem 0 0.35rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
}
.tutorial-section > p,
.tutorial-section li {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.tutorial-section > p {
  margin: 0.5rem 0;
}
.tutorial-section ul,
.tutorial-section ol {
  margin: 0.4rem 0 0.6rem;
  padding-left: 1.25rem;
}
.tutorial-section li { margin: 0.35rem 0; }
.tutorial-section li strong {
  color: var(--text);
  font-weight: 600;
}
.tutorial-section code {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 12px;
  padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--accent);
}
.tutorial-section pre {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  color: var(--text);
  margin: 0.5rem 0;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .tutorial-section pre {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.tutorial-shot {
  margin: 0.85rem 0 0.25rem;
}
.tutorial-shot img {
  display: block;
  width: 100%;
  max-width: 52rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .tutorial-shot img {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}
.tutorial-shot figcaption {
  margin-top: 0.3rem;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.75;
  letter-spacing: 0.5px;
}

.tutorial-callout {
  margin: 0.75rem 0;
  padding: 0.6rem 0.85rem;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}
.tutorial-callout strong {
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-right: 0.4rem;
}
.tutorial-callout.warn {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.06);
}
.tutorial-callout.warn strong { color: #ff6b6b; }

.tutorial-nav {
  margin: 2.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
}
.tutorial-nav-top {
  margin: 0 0 1.25rem;
  padding-top: 0;
  padding-bottom: 0.9rem;
  border-top: none;
  border-bottom: 1px dashed var(--border);
  animation: fadeSlideIn 0.45s ease 0.04s both;
}
.tutorial-nav-top a,
.tutorial-nav-top .nav-stub {
  padding: 0.55rem 0.85rem;
}
.tutorial-nav a,
.tutorial-nav .nav-stub {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-secondary);
  text-decoration: none;
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease,
              background 150ms ease;
}
.tutorial-nav a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px
    color-mix(in srgb, var(--accent) 35%, transparent);
}
.tutorial-nav .nav-stub {
  opacity: 0.35;
  cursor: default;
}
.tutorial-nav .nav-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}
.tutorial-nav .nav-title { color: var(--text); }
.tutorial-nav .nav-prev { text-align: left; }
.tutorial-nav .nav-prev::before { content: "◂ "; color: var(--accent); }
.tutorial-nav .nav-next { text-align: right; }
.tutorial-nav .nav-next::after { content: " ▸"; color: var(--accent); }
.tutorial-nav .nav-index {
  text-align: center;
  align-items: center;
}
.tutorial-nav .nav-index .nav-label { color: var(--text-dim); }
.tutorial-nav .nav-index:hover .nav-label { color: var(--accent); }

/* Landing page (tutorial/index.html) */
.tutorial-landing-lead {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background: var(--bg-secondary);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.tutorial-landing-lead strong {
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.85rem;
  margin: 1.2rem 0 2rem;
}
.tutorial-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease,
              transform 150ms ease;
  overflow: hidden;
}
.tutorial-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: var(--accent);
  opacity: 0.4;
  transition: opacity 150ms ease;
}
.tutorial-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px
    color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateY(-1px);
}
.tutorial-card:hover::before { opacity: 1; }
.tutorial-card .card-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}
.tutorial-card .card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
}
.tutorial-card .card-desc {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.chapter-divider {
  margin: 1.8rem 0 0.6rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chapter-divider::before { content: "▸"; opacity: 0.7; }
.chapter-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 60%, transparent),
    transparent
  );
}

/* ===================================================================
   ANIMATIONS — cyberpunk entrance + ambient motion
   =================================================================== */

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

@keyframes meterGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes cursorBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes neonBreathe {
  0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent); }
  50%      { box-shadow: 0 0 14px var(--accent),
                         0 0 24px color-mix(in srgb, var(--accent) 60%, transparent); }
}

@keyframes titleGlitch {
  0%, 88%, 100% { transform: none; text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent); }
  89%           { transform: translate(-1px, 0) skewX(-1deg); text-shadow: 2px 0 0 var(--accent), -2px 0 0 var(--cyan, var(--accent)); }
  90%           { transform: translate(1px, 0) skewX(1deg);   text-shadow: -2px 0 0 var(--accent), 2px 0 0 var(--cyan, var(--accent)); }
  91%           { transform: translate(0, 0);                  text-shadow: 0 0 12px var(--accent); }
}

@keyframes sweepHighlight {
  0%   { transform: translateX(-110%); }
  60%  { transform: translateX(110%); }
  100% { transform: translateX(110%); }
}

@keyframes cornerBracketPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@keyframes bootFlicker {
  0%, 19%, 21%, 23%, 100% { opacity: 1; }
  20%, 22%                { opacity: 0.35; }
}

@keyframes scanlineDrift {
  from { background-position-y: 0; }
  to   { background-position-y: 100%; }
}

/* Apply animations */

.tutorial-title {
  animation:
    fadeSlideIn 0.55s ease both,
    titleGlitch 9s ease-in-out 1.4s infinite;
}
.tutorial-subtitle {
  animation: fadeSlideIn 0.65s ease 0.08s both;
}
.tutorial-subtitle::after {
  content: " ▌";
  color: var(--accent);
  animation: cursorBlink 1.1s steps(1, end) infinite;
  margin-left: 0.15rem;
}

.step-meter {
  animation: fadeSlideIn 0.5s ease 0.12s both;
}
.step-meter .meter-fill {
  transform-origin: left center;
  animation: meterGrow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.tutorial-section {
  animation: fadeSlideIn 0.55s ease both;
  opacity: 0;
}
.tutorial-section:nth-of-type(1) { animation-delay: 0.18s; }
.tutorial-section:nth-of-type(2) { animation-delay: 0.26s; }
.tutorial-section:nth-of-type(3) { animation-delay: 0.34s; }
.tutorial-section:nth-of-type(4) { animation-delay: 0.42s; }
.tutorial-section:nth-of-type(5) { animation-delay: 0.50s; }
.tutorial-section:nth-of-type(6) { animation-delay: 0.58s; }
.tutorial-section:nth-of-type(7) { animation-delay: 0.66s; }
.tutorial-section:nth-of-type(8) { animation-delay: 0.74s; }
.tutorial-section:nth-of-type(9) { animation-delay: 0.82s; }
.tutorial-section:nth-of-type(n+10) { animation-delay: 0.90s; }

.tutorial-section::before,
.tutorial-section::after {
  animation: cornerBracketPulse 3.5s ease-in-out infinite;
}
.tutorial-section::after { animation-delay: 1.75s; }

.tutorial-section > h2 {
  position: relative;
  overflow: hidden;
}
.tutorial-section > h2::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 40%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 30%, transparent),
    transparent
  );
  animation: sweepHighlight 6s ease-in-out infinite;
  pointer-events: none;
}

.tutorial-nav a:hover {
  animation: neonBreathe 2s ease-in-out infinite;
}

.tutorial-card {
  animation: fadeSlideIn 0.5s ease both;
  opacity: 0;
}
.tutorial-card:nth-child(1)  { animation-delay: 0.10s; }
.tutorial-card:nth-child(2)  { animation-delay: 0.14s; }
.tutorial-card:nth-child(3)  { animation-delay: 0.18s; }
.tutorial-card:nth-child(4)  { animation-delay: 0.22s; }
.tutorial-card:nth-child(5)  { animation-delay: 0.26s; }
.tutorial-card:nth-child(6)  { animation-delay: 0.30s; }
.tutorial-card:nth-child(7)  { animation-delay: 0.34s; }
.tutorial-card:nth-child(8)  { animation-delay: 0.38s; }
.tutorial-card:nth-child(9)  { animation-delay: 0.42s; }
.tutorial-card:nth-child(10) { animation-delay: 0.46s; }
.tutorial-card:nth-child(11) { animation-delay: 0.50s; }
.tutorial-card:nth-child(12) { animation-delay: 0.54s; }
.tutorial-card:nth-child(13) { animation-delay: 0.58s; }
.tutorial-card:nth-child(14) { animation-delay: 0.62s; }
.tutorial-card:nth-child(15) { animation-delay: 0.66s; }
.tutorial-card:nth-child(16) { animation-delay: 0.70s; }
.tutorial-card:nth-child(17) { animation-delay: 0.74s; }
.tutorial-card:nth-child(n+18) { animation-delay: 0.78s; }

.tutorial-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent 45%,
    color-mix(in srgb, var(--accent) 18%, transparent) 50%,
    transparent 55%
  );
  transform: translateX(-100%);
  transition: transform 650ms ease;
  pointer-events: none;
}
.tutorial-card:hover::after {
  transform: translateX(110%);
}

.tutorial-brand {
  animation: bootFlicker 0.9s steps(2, end) both, fadeSlideIn 0.4s ease both;
}

.chapter-divider {
  animation: fadeSlideIn 0.5s ease both;
}

.tutorial-shot img {
  animation: fadeSlideIn 0.6s ease 0.2s both;
}

/* Ambient scanline drift on the header underline */
.tutorial-header::after {
  background-size: 200% 2px;
  animation: scanlineDrift 8s linear infinite;
}

/* Reduced-motion: honor user preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .tutorial-section { opacity: 1; }
  .tutorial-card    { opacity: 1; }
}

