/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #080808;
    --surface:      #0e0e0e;
    --card:         #141414;
    --border:       rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.22);
    --white:        #f4f4f4;
    --muted:        #666666;
    --muted-light:  #888888;
    --radius:       16px;
    --radius-lg:    24px;
    --amber:        #e8a96a;   /* tag-claude amber */
    --blue:         #7ec8ff;   /* tag-copilot blue */
    --green:        #55cc77;   /* status dot green */
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg);
    color: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* ===== CUSTOM CURSOR ===== */
.cursor {
    position: fixed; width: 10px; height: 10px;
    background: var(--white); border-radius: 50%;
    pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .15s, height .15s, opacity .2s;
    mix-blend-mode: difference;
}
.cursor-trail {
    position: fixed; width: 34px; height: 34px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%; pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width .12s ease-out, height .12s ease-out;
}
.cursor.expanded  { width: 20px; height: 20px; }
.cursor-trail.expanded { width: 60px; height: 60px; }
@media (hover: none) { .cursor, .cursor-trail { display: none; } }

/* ===== NAV ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    padding: 22px 40px;
    transition: padding .3s, background .3s, border-color .3s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(8,8,8,.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 14px 40px;
    border-bottom-color: var(--border);
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 17px;
    color: var(--white); text-decoration: none;
    letter-spacing: -.3px;
}
.nav-logo:hover { color: var(--white); }
.nav-links { display: flex; list-style: none; gap: 4px; align-items: center; }
.nav-links a {
    color: var(--muted); text-decoration: none;
    font-size: 14px; font-weight: 500;
    padding: 8px 16px; border-radius: 8px;
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-links a.active { color: var(--white); }
.nav-cta {
    color: #080808 !important; background: var(--white) !important;
    padding: 8px 20px !important; border-radius: 100px !important; font-weight: 600 !important;
}
.nav-cta:hover { background: #ddd !important; transform: translateY(-1px); }
.nav-burger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-burger span {
    display: block; width: 24px; height: 2px;
    background: var(--white); border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed; inset: 0;
    background: rgba(8,8,8,.98); backdrop-filter: blur(20px);
    z-index: 199; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu ul { list-style: none; text-align: center; }
.mobile-menu li { margin-bottom: 32px; }
.mobile-menu a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px; font-weight: 700;
    color: var(--white); text-decoration: none; transition: color .2s;
}
.mobile-menu a:hover { color: var(--muted-light); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px; border-radius: 100px;
    font-size: 15px; font-weight: 600; text-decoration: none;
    transition: all .3s; cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--white); color: #080808; }
.btn-primary:hover { background: #e0e0e0; transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255,255,255,.12); }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,.05); border-color: var(--border-hover); }

/* ===== SECTIONS ===== */
.section { padding: 130px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.section-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .2em;
    color: var(--muted); margin-bottom: 14px;
}
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(36px, 4vw, 56px); font-weight: 700;
    line-height: 1.08; letter-spacing: -1.5px;
    margin-bottom: 64px; color: var(--white);
}
.section-title .gradient-text {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255,255,255,.32);
}

/* ===== CARD — base (expertise-card pattern) ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    transition: border-color .3s, transform .3s;
}
.card:hover { border-color: var(--border-hover); }

.card-icon {
    width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px; color: var(--muted-light);
    transition: border-color .3s, color .3s;
}
.card:hover .card-icon { border-color: var(--border-hover); color: var(--white); }
.card-icon svg { width: 20px; height: 20px; }

/* ===== TAGS / PILLS ===== */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags span, .tag {
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    color: var(--muted-light); font-size: 11px; font-weight: 500;
    padding: 3px 10px; border-radius: 100px; letter-spacing: .04em;
}
.tag-amber {
    background: rgba(205,127,50,.12) !important;
    border-color: rgba(205,127,50,.35) !important;
    color: var(--amber) !important;
}
.tag-blue {
    background: rgba(32,139,254,.12) !important;
    border-color: rgba(32,139,254,.35) !important;
    color: var(--blue) !important;
}
.tag-green {
    background: rgba(85,204,119,.12) !important;
    border-color: rgba(85,204,119,.35) !important;
    color: var(--green) !important;
}

/* ===== BORDER-GAP GRID (expertise / module-grid pattern) ===== */
.modules-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1px; background: var(--border);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; margin-top: 60px;
}
.module-card {
    background: var(--bg); padding: 32px 28px;
    text-decoration: none; display: block;
    transition: background .3s; cursor: pointer;
    position: relative; overflow: hidden;
}
.module-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,.025), transparent 60%);
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.module-card:hover { background: rgba(255,255,255,.025); text-decoration: none; }
.module-card:hover::after { opacity: 1; }
.module-card:hover .card-icon { border-color: var(--border-hover); color: var(--white); }
.module-num-badge {
    font-size: 11px; font-weight: 700;
    color: var(--muted); letter-spacing: .12em;
    text-transform: uppercase; margin-bottom: 16px;
}
.module-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px; font-weight: 600;
    color: var(--white); margin-bottom: 8px; letter-spacing: -.2px;
}
.module-card p {
    font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 16px;
}

/* ===== FOOTER ===== */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-logo {
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px;
    color: var(--white); letter-spacing: -.3px;
}
.footer-copy { font-size: 13px; color: var(--muted); }

/* ===== SCROLL REVEAL ===== */
.reveal-up    { opacity: 0; transform: translateY(36px);  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
.reveal-left  { opacity: 0; transform: translateX(-36px); transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
.reveal-right { opacity: 0; transform: translateX(36px);  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
.revealed     { opacity: 1 !important; transform: none !important; }

/* ===================================================================
   TUTORIAL-SPECIFIC LAYOUT (module detail pages)
   =================================================================== */

/* Sidebar + content layout */
.tutorial-wrap {
    display: flex;
    min-height: 100vh;
    padding-top: 82px; /* clears nav */
}

.tutorial-sidebar {
    width: 260px; flex-shrink: 0;
    position: fixed; top: 82px; left: 0; bottom: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto; padding: 28px 0;
}

.sidebar-back {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 24px 20px;
    font-size: 13px; color: var(--muted);
    text-decoration: none; border-bottom: 1px solid var(--border);
    margin-bottom: 16px; transition: color .2s;
}
.sidebar-back:hover { color: var(--white); }
.sidebar-back svg { width: 14px; height: 14px; flex-shrink: 0; }

.sidebar-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .18em; color: var(--muted);
    padding: 8px 24px 6px;
}

.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 24px; font-size: 13px; font-weight: 500;
    color: var(--muted); text-decoration: none;
    border-left: 2px solid transparent;
    transition: color .2s, background .2s, border-color .2s;
}
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,.03); }
.sidebar-link.active { color: var(--white); border-left-color: var(--white); background: rgba(255,255,255,.04); }
.sidebar-link .sn {
    font-size: 10px; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(255,255,255,.06); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--muted); letter-spacing: 0;
}
.sidebar-link.active .sn { background: var(--white); color: #080808; border-color: var(--white); }

/* Main tutorial content */
.tutorial-main {
    flex: 1; margin-left: 260px;
    padding: 56px 72px 100px;
    max-width: 900px;
}

/* Progress bar */
.tutorial-progress {
    height: 2px; background: var(--border);
    margin-bottom: 48px; border-radius: 2px; overflow: hidden;
}
.tutorial-progress-fill {
    height: 100%; border-radius: 2px;
    background: var(--white); opacity: .35;
    transition: width .4s cubic-bezier(.16,1,.3,1);
}

/* Page header */
.tutorial-header { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.tutorial-eyebrow {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .18em;
    color: var(--muted); margin-bottom: 10px;
}
.tutorial-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 3vw, 40px); font-weight: 700;
    letter-spacing: -1px; color: var(--white);
    line-height: 1.1; margin-bottom: 12px;
}
.tutorial-header p { font-size: 15px; color: var(--muted-light); line-height: 1.7; }

/* Content typography */
.tutorial-main h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px; font-weight: 700; letter-spacing: -.4px;
    color: var(--white); margin: 48px 0 16px;
    padding-top: 8px;
}
.tutorial-main h2:first-of-type { margin-top: 0; }
.tutorial-main h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px; font-weight: 600;
    color: var(--white); margin: 32px 0 10px;
}
.tutorial-main p { font-size: 15px; color: var(--muted-light); margin-bottom: 16px; line-height: 1.8; }
.tutorial-main a { color: var(--white); border-bottom: 1px solid rgba(255,255,255,.2); text-decoration: none; transition: border-color .2s; }
.tutorial-main a:hover { border-color: var(--white); }

/* ===== CODE BLOCKS ===== */
.code-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .14em; color: var(--muted);
    margin-bottom: 6px; padding-left: 2px;
}
pre {
    background: #050505; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 26px;
    overflow-x: auto; margin: 4px 0 24px;
    position: relative;
}
pre code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px; line-height: 1.75; color: var(--muted-light);
}
code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12.5px;
    background: rgba(255,255,255,.06); color: var(--white);
    padding: 2px 6px; border-radius: 5px;
    border: 1px solid var(--border);
}
pre code { background: none; color: inherit; padding: 0; border: none; font-size: 13px; }

/* Syntax tokens */
.kw  { color: var(--amber); }          /* keywords */
.str { color: var(--blue); }           /* strings */
.cm  { color: var(--muted); font-style: italic; } /* comments */
.nm  { color: var(--muted-light); }    /* numbers */
.fn  { color: #cccccc; }              /* functions */
.cls { color: var(--white); }          /* classes/types */
.op  { color: var(--amber); opacity: .7; } /* operators */

/* ===== CALLOUTS ===== */
.callout {
    border-radius: var(--radius); padding: 18px 22px;
    margin: 20px 0; border: 1px solid var(--border);
    border-left: 3px solid; font-size: 14px;
}
.callout-title {
    font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: .1em;
    margin-bottom: 8px;
}
.callout.info {
    background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08);
    border-left-color: var(--muted-light); color: var(--muted-light);
}
.callout.info .callout-title { color: var(--white); }
.callout.tip {
    background: rgba(85,204,119,.05); border-color: rgba(85,204,119,.12);
    border-left-color: var(--green); color: var(--muted-light);
}
.callout.tip .callout-title { color: var(--green); }
.callout.warning {
    background: rgba(205,127,50,.06); border-color: rgba(205,127,50,.15);
    border-left-color: var(--amber); color: var(--muted-light);
}
.callout.warning .callout-title { color: var(--amber); }
.callout.exercise {
    background: rgba(126,200,255,.05); border-color: rgba(126,200,255,.12);
    border-left-color: var(--blue); color: var(--muted-light);
}
.callout.exercise .callout-title { color: var(--blue); }

/* ===== TABLE ===== */
.tutorial-main table {
    width: 100%; border-collapse: collapse;
    margin: 12px 0 24px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.tutorial-main th {
    background: var(--card); color: var(--muted);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    padding: 10px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
.tutorial-main td {
    padding: 11px 16px; border-bottom: 1px solid var(--border);
    color: var(--muted-light); vertical-align: top;
    font-size: 14px; line-height: 1.6;
}
.tutorial-main tr:last-child td { border-bottom: none; }
.tutorial-main tr:hover td { background: rgba(255,255,255,.015); }

/* ===== STEP LIST ===== */
.step-list { list-style: none; counter-reset: steps; padding: 0; }
.step-list li {
    counter-increment: steps;
    display: flex; gap: 14px; margin-bottom: 12px;
    font-size: 14px; color: var(--muted-light); line-height: 1.7;
}
.step-list li::before {
    content: counter(steps);
    min-width: 24px; height: 24px; border-radius: 50%;
    background: rgba(255,255,255,.06); border: 1px solid var(--border);
    color: var(--muted-light); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}

/* ===== PREV / NEXT NAV ===== */
.tutorial-nav {
    display: flex; gap: 12px; margin-top: 64px;
    padding-top: 32px; border-top: 1px solid var(--border);
}
.tutorial-nav a {
    flex: 1; display: flex; flex-direction: column;
    padding: 20px 24px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none;
    transition: border-color .3s, background .3s; border-bottom: none;
}
.tutorial-nav a:hover { border-color: var(--border-hover); background: rgba(255,255,255,.025); }
.tutorial-nav .tn-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .12em; color: var(--muted); margin-bottom: 6px;
}
.tutorial-nav .tn-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px; font-weight: 600; color: var(--white);
}
.tutorial-nav .next { text-align: right; }

/* ===== TWO-COLUMN COMPARE ===== */
.compare {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1px; background: var(--border);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin: 12px 0 24px;
}
.compare-col { background: var(--bg); padding: 20px 22px; }
.compare-col-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; margin-bottom: 10px;
}
.compare-col-label.bad  { color: rgba(249,113,113,.7); }
.compare-col-label.good { color: var(--green); }
.compare-col pre { margin: 0; }

/* ===================================================================
   MODULES TIMELINE (index.html)
   =================================================================== */
.modules-timeline {
    position: relative;
    max-width: 860px; margin: 64px auto 0;
}
.modules-timeline::before {
    content: ''; position: absolute;
    left: 50%; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--border-hover) 8%,
        var(--border-hover) 92%,
        transparent 100%);
    transform: translateX(-50%);
}

.tl-item {
    display: grid; grid-template-columns: 1fr 56px 1fr;
    margin-bottom: 36px; align-items: start;
}

/* Odd → card on LEFT, dot in centre */
.tl-item:nth-child(odd) .tl-card { grid-column: 1; grid-row: 1; padding-right: 36px; text-align: right; }
.tl-item:nth-child(odd) .tl-dot  { grid-column: 2; grid-row: 1; }

/* Even → dot in centre, card on RIGHT */
.tl-item:nth-child(even) .tl-dot  { grid-column: 2; grid-row: 1; }
.tl-item:nth-child(even) .tl-card { grid-column: 3; grid-row: 1; padding-left: 36px; text-align: left; }

/* Dot */
.tl-dot {
    width: 34px; height: 34px;
    background: var(--card); border: 1px solid var(--border-hover);
    border-radius: 50%; margin: 10px auto 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--muted);
    letter-spacing: .04em; position: relative; z-index: 1;
    transition: border-color .25s, color .25s, background .25s;
}
.tl-dot::after {
    content: ''; position: absolute; inset: -6px;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.08);
    animation: dotRipple 3s ease-out infinite;
}
@keyframes dotRipple {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Card */
.tl-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px;
    text-decoration: none; display: block;
    transition: border-color .25s, transform .25s;
}
.tl-card:hover { border-color: var(--border-hover); transform: translateY(-3px); text-decoration: none; }
.tl-item:has(.tl-card:hover) .tl-dot { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.06); }

.tl-eyebrow {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .16em; color: var(--muted); margin-bottom: 6px;
}
.tl-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px; font-weight: 600; letter-spacing: -.2px;
    color: var(--white); margin-bottom: 6px;
}
.tl-card p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }

/* Right-align tags on odd (left-side) cards */
.tl-item:nth-child(odd) .tl-card .tags { justify-content: flex-end; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) { .modules-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
    .tutorial-sidebar { display: none; }
    .tutorial-main { margin-left: 0; padding: 40px 32px 80px; max-width: none; }
    .tutorial-wrap { padding-top: 72px; }
}
@media (max-width: 768px) {
    .nav { padding: 16px 24px; }
    .nav.scrolled { padding: 12px 24px; }
    .nav-links { display: none; }
    .nav-burger { display: flex; }
    .section { padding: 80px 0; }
    .container { padding: 0 24px; }
    .section-title { margin-bottom: 40px; }
    .modules-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
    .tutorial-main { padding: 32px 24px 60px; }
    .tutorial-nav { flex-direction: column; }
    .compare { grid-template-columns: 1fr; }

    /* Timeline mobile — single column */
    .modules-timeline::before { left: 17px; }
    .tl-item { grid-template-columns: 34px 1fr; gap: 0; }
    .tl-item:nth-child(odd) .tl-card,
    .tl-item:nth-child(even) .tl-card {
        grid-column: 2; grid-row: 1;
        text-align: left; padding: 0 0 0 20px;
    }
    .tl-item:nth-child(odd) .tl-dot,
    .tl-item:nth-child(even) .tl-dot  { grid-column: 1; grid-row: 1; margin: 10px 0 0; }
    .tl-item:nth-child(odd) .tl-card .tags { justify-content: flex-start; }
}
