/* ── Loregend Tutorial Shared Stylesheet ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: #d0d0e0;
    background: #0f0f1a;
}
a { color: #4a8ec5; text-decoration: none; }
a:hover { color: #6ab0e8; text-decoration: underline; }
img { max-width: 100%; border-radius: 8px; }
code {
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 13px;
    background: #1a1a2e;
    color: #e5a53a;
    padding: 2px 6px;
    border-radius: 4px;
}
kbd {
    display: inline-block;
    background: #2a2a4e;
    border: 1px solid #3a3a5e;
    border-radius: 4px;
    padding: 1px 7px;
    font-family: system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #e0e0f0;
    box-shadow: 0 1px 0 #1a1a2e;
}
strong { color: #e0e0f0; }

/* ── Site Header ── */
.site-header {
    background: #0a0a16;
    border-bottom: 1px solid #1a1a2e;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .logo {
    font-size: 16px; font-weight: 800; color: #fff; text-decoration: none; white-space: nowrap;
}
.site-header .logo span { color: #e5a53a; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a {
    font-size: 13px; color: #8888aa; padding: 5px 10px; border-radius: 5px; transition: all 0.15s; text-decoration: none;
}
.site-header nav a:hover { color: #d0d0e0; background: rgba(255,255,255,0.05); }

/* ── Layout ── */
.tut-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 52px);
}

/* ── Sidebar ── */
.tut-sidebar {
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    background: #0a0a16;
    border-right: 1px solid #1a1a2e;
    padding: 24px 0 40px;
    display: flex;
    flex-direction: column;
}
.sidebar-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #6666aa; padding: 0 16px 16px;
    border-bottom: 1px solid #1a1a2e; margin-bottom: 16px;
    text-decoration: none; transition: color 0.15s;
}
.sidebar-back:hover { color: #4a8ec5; text-decoration: none; }
.sidebar-back::before { content: '\2190'; }
.sidebar-track {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: #555577; padding: 0 16px 10px;
}
.sidebar-nav a {
    display: flex; align-items: baseline; gap: 8px;
    padding: 6px 16px; font-size: 13px; color: #8888cc;
    border-left: 2px solid transparent; transition: all 0.15s; text-decoration: none;
}
.sidebar-nav a:hover { color: #d0d0e0; background: rgba(58,110,165,0.08); border-left-color: #3a6ea5; }
.sidebar-nav a.active { color: #e5a53a; border-left-color: #e5a53a; background: rgba(229,165,58,0.06); }
.sidebar-nav .nav-num { font-size: 10px; font-weight: 700; color: #444466; min-width: 28px; }
.sidebar-divider { height: 1px; background: #1a1a2e; margin: 10px 16px; }

/* ── Main content ── */
.tut-main {
    padding: 40px 56px 100px;
    max-width: 860px;
}

/* ── Hero ── */
.tut-hero { margin-bottom: 40px; }
.tut-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; margin-bottom: 14px;
}
.eyebrow-qs  { color: #66cc66; }
.eyebrow-int { color: #4a8ec5; }
.eyebrow-exp { color: #e5a53a; }
.tut-hero h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 900; color: #fff; line-height: 1.15; margin-bottom: 12px;
}
.tut-hero .lead {
    font-size: 16px; color: #8888aa; max-width: 600px; margin-bottom: 20px;
}
.tut-meta {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 32px;
}
.meta-item {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #6666aa;
    background: #12122a; border: 1px solid #1a1a2e;
    padding: 4px 10px; border-radius: 8px;
}

/* ── What You'll Learn box ── */
.learn-box {
    background: #12122a; border: 1px solid #1a1a2e;
    border-radius: 12px; padding: 24px 28px; margin-bottom: 40px;
}
.learn-box h2 {
    font-size: 12px; font-weight: 700; color: #e5a53a;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.learn-list {
    list-style: none; padding: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px;
}
.learn-list li {
    position: relative; padding-left: 18px;
    font-size: 13px; color: #b0b0cc;
}
.learn-list li::before { content: '\2713'; position: absolute; left: 0; color: #66cc66; font-weight: 700; }
@media (max-width: 600px) { .learn-list { grid-template-columns: 1fr; } }

/* ── Step sections ── */
.step {
    margin-bottom: 52px;
    scroll-margin-top: 24px;
}
.step-header {
    display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.step-num.qs  { background: rgba(102,204,102,0.15); color: #66cc66; }
.step-num.int { background: rgba(74,142,197,0.15);  color: #6ab0e8; }
.step-num.exp { background: rgba(229,165,58,0.15);  color: #e5a53a; }
.step-header h2 { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.2; }
.step-time {
    display: inline-block; background: rgba(58,110,165,0.12); color: #4a8ec5;
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px;
}
.step p { margin: 10px 0; }
.step ol, .step ul { padding-left: 22px; margin: 10px 0; }
.step li { margin: 6px 0; }
.step h3 { font-size: 16px; font-weight: 700; color: #e0e0f0; margin: 22px 0 8px; }
.step h4 { font-size: 14px; font-weight: 700; color: #e5a53a; margin: 16px 0 6px; }

.step-divider {
    width: 48px; height: 2px;
    background: linear-gradient(90deg, #3a6ea5, #e5a53a);
    border-radius: 2px; margin: 52px 0; opacity: 0.35;
}

/* ── Info boxes ── */
.tip, .note, .warn, .try-it {
    padding: 12px 16px; border-radius: 8px; margin: 14px 0;
    font-size: 14px; border-left: 3px solid; line-height: 1.7;
}
.tip    { background: rgba(102,204,102,0.07); border-color: #66cc66; }
.tip::before    { content: 'Tip: ';     font-weight: 700; color: #66cc66; }
.note   { background: rgba(74,142,197,0.07);  border-color: #4a8ec5; }
.note::before   { content: 'Note: ';    font-weight: 700; color: #4a8ec5; }
.warn   { background: rgba(255,102,102,0.07); border-color: #ff6666; }
.warn::before   { content: 'Warning: '; font-weight: 700; color: #ff6666; }
.try-it { background: rgba(229,165,58,0.06);  border-color: #e5a53a; border-style: dashed; }
.try-it::before { content: 'Try it: ';  font-weight: 700; color: #e5a53a; }

/* ── Screenshot ── */
.screenshot {
    background: #0a0a16; border: 1px solid #1a1a2e;
    border-radius: 10px; padding: 16px; margin: 18px 0; text-align: center;
}
.screenshot img { max-height: 420px; display: block; margin: 0 auto; }
.screenshot .caption { font-size: 12px; color: #555577; margin-top: 10px; }
.screenshot-placeholder {
    background: #12122a; border: 1px dashed #2a2a4e;
    border-radius: 10px; padding: 32px 20px; margin: 18px 0;
    text-align: center; color: #555577; font-size: 13px;
}
.screenshot-placeholder strong { display: block; margin-bottom: 4px; color: #666688; }

/* ── Flow diagram ── */
.flow {
    background: #0a0a16; border: 1px solid #1a1a2e;
    border-radius: 10px; padding: 24px 20px; margin: 18px 0;
    display: flex; align-items: center; justify-content: center;
    gap: 8px; flex-wrap: wrap;
}
.flow-box {
    background: #1a1a2e; border: 1px solid #2a2a4e;
    border-radius: 6px; padding: 8px 16px;
    font-size: 13px; color: #d0d0e0; white-space: nowrap;
}
.flow-box.accent { border-color: #3a6ea5; color: #6ab0e8; }
.flow-box.gold   { border-color: #e5a53a; color: #e5a53a; }
.flow-box.green  { border-color: #66cc66; color: #66cc66; }
.flow-arrow { color: #3a3a5e; font-size: 18px; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #1a1a2e; }
th { color: #e5a53a; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
tr:hover td { background: rgba(58,110,165,0.05); }

/* ── Next / Prev nav ── */
.tut-nav-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 64px; padding-top: 24px; border-top: 1px solid #1a1a2e; gap: 16px; flex-wrap: wrap;
}
.nav-btn {
    display: flex; flex-direction: column;
    background: #12122a; border: 1px solid #1a1a2e;
    border-radius: 10px; padding: 14px 20px; text-decoration: none;
    min-width: 180px; max-width: 300px; transition: border-color 0.2s;
}
.nav-btn:hover { border-color: #3a6ea5; text-decoration: none; }
.nav-btn .nav-dir { font-size: 11px; color: #555577; margin-bottom: 4px; }
.nav-btn .nav-title { font-size: 14px; font-weight: 700; color: #e0e0f0; }
.nav-btn.next { text-align: right; }
.nav-btn.next .nav-dir::after { content: ' →'; }
.nav-btn.prev .nav-dir::before { content: '← '; }

/* ── Mobile ── */
.tut-hamburger {
    display: none; position: fixed; top: 60px; left: 12px; z-index: 200;
    background: #12122a; border: 1px solid #2a2a4e; border-radius: 6px;
    padding: 7px 10px; color: #d0d0e0; cursor: pointer; font-size: 18px;
}
@media (max-width: 900px) {
    .tut-layout { grid-template-columns: 1fr; }
    .tut-sidebar {
        position: fixed; top: 52px; left: 0; width: 260px; z-index: 150;
        transform: translateX(-100%); transition: transform 0.25s;
        height: calc(100vh - 52px);
    }
    .tut-sidebar.open { transform: translateX(0); }
    .tut-main { padding: 32px 24px 80px; }
    .tut-hamburger { display: block; }
    .site-header nav { display: none; }
    .site-header { padding: 12px 20px; }
}
