:root {
    --ink: #111018;
    --ink-soft: #2a2738;
    --muted: #605c70;
    --paper: #f7f5f2;
    --paper-2: #ffffff;
    --accent: #501e99;
    --accent-2: #0055ff;
    --accent-warm: #f2c14e;
    --line: #e6e1ef;
    --shadow: 0 20px 50px rgba(22, 14, 52, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Figtree", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #fef9f3 0%, #f7f5f2 45%, #f2f1f7 100%);
    color: var(--ink);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.hero {
    padding: 64px 24px 56px;
    background: linear-gradient(120deg, rgba(80, 30, 153, 0.12), rgba(0, 85, 255, 0.08));
    border-bottom: 1px solid var(--line);
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.hero h1 {
    font-family: "Fraunces", "Figtree", serif;
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    margin-bottom: 12px;
}

.hero p {
    max-width: 620px;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    border: 1px solid var(--line);
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    background: var(--paper-2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(80, 30, 153, 0.18);
}

.layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 72px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.overview {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.panel p {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 85, 255, 0.08);
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.link-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.link-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.link-card .label {
    font-weight: 600;
}

.link-card .meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.guide {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.toc {
    position: sticky;
    top: 20px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 80px);
    overflow: auto;
}

.toc-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted);
    margin-bottom: 12px;
}

#toc a {
    display: block;
    padding: 6px 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

#toc a.active {
    color: var(--accent);
    font-weight: 600;
}

#toc a.depth-3 {
    padding-left: 12px;
    font-size: 0.88rem;
}

.content {
    background: var(--paper-2);
    border-radius: 20px;
    border: 1px solid var(--line);
    padding: 28px;
    box-shadow: var(--shadow);
}

.content-header {
    margin-bottom: 18px;
}

.content-header p {
    color: var(--muted);
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-family: "Fraunces", "Figtree", serif;
}

.markdown p {
    margin-bottom: 14px;
    color: var(--ink-soft);
}

.markdown ul,
.markdown ol {
    margin: 0 0 14px 20px;
    color: var(--ink-soft);
}

.markdown li {
    margin-bottom: 6px;
}

.markdown strong {
    color: var(--ink);
}

.markdown blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    color: var(--muted);
    margin: 16px 0;
}

pre {
    background: #121118;
    color: #f4f2ff;
    padding: 16px;
    border-radius: 14px;
    overflow: auto;
    font-size: 0.85rem;
    margin-top: 16px;
}

code {
    font-family: "SFMono-Regular", "Menlo", monospace;
}

.content-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(242, 84, 91, 0.12);
    border: 1px solid rgba(242, 84, 91, 0.4);
    border-radius: 12px;
    color: #8f1f2b;
}

.footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 28px 16px 40px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
}

.dot {
    color: var(--line);
}

@media (max-width: 960px) {
    .guide {
        grid-template-columns: 1fr;
    }

    .toc {
        position: relative;
        max-height: none;
    }
}

@media (max-width: 720px) {
    .hero {
        padding: 48px 18px 40px;
    }

    .layout {
        padding: 32px 18px 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
