html {
    scroll-behavior: smooth;
}

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

:root {
    --accent: #2563eb;
    --text: #1a1a1a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --code-bg: #f4f4f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.logo-meaning {
    position: relative;
    display: inline-block;
    cursor: help;
}

.logo-meaning::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    background: #18181b;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 10;
}

.logo-meaning::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(6px);
    border-width: 6px;
    border-style: solid;
    border-color: #18181b transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9;
}

.logo-meaning:hover::after,
.logo-meaning:hover::before,
.logo-meaning:focus-visible::after,
.logo-meaning:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.brand-chick {
    position: relative;
    display: inline-block;
    font-size: 1.35rem;
    line-height: 1;
    transform-origin: center;
    animation: chick-float 2.8s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.12));
    cursor: help;
}

.brand-chick::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    background: #18181b;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 10;
}

.brand-chick::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%) translateY(6px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #18181b transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9;
}

.brand-chick:hover::after,
.brand-chick:hover::before,
.brand-chick:focus-visible::after,
.brand-chick:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.brand-chick:hover,
.brand-chick:focus-visible {
    animation: chick-shake 0.35s ease-in-out infinite;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* Hero */
.hero {
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--border);
}

.hero h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text);
}

.hero p {
    color: var(--muted);
    font-size: 1rem;
}

/* Main */
main {
    padding: 48px 0;
}

.section {
    margin-bottom: 48px;
}

h2 {
    font-size: 1.45rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text);
}

p {
    margin-bottom: 12px;
    margin-top: 12px;
    color: var(--text);
}

ul {
    margin: 12px 0;
    padding-left: 20px;
}

li {
    margin-bottom: 6px;
    color: var(--text);
}

/* Info Box */
.info-box {
    background: var(--code-bg);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Mermaid */
.mermaid {
    display: flex;
    justify-content: center;
    margin: 28px 0;
    background: var(--code-bg);
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
}

.chart-collapsible {
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

.chart-collapsible > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.chart-collapsible > summary::marker {
    content: "";
}

.chart-collapsible > summary::-webkit-details-marker {
    display: none;
}

.chart-collapsible > summary::before {
    content: "+";
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--accent);
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chart-collapsible[open] > summary::before {
    content: "-";
}

.chart-collapsible > .mermaid {
    margin: 0;
    border-top: 1px solid var(--border);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

svg {
    max-width: 100%;
}

/* Code */
pre {
    background: #18181b;
    color: #d4d4d8;
    padding: 18px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 2px 5px;
    border-radius: 3px;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

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

.footer a:hover {
    text-decoration: underline;
}

.footer p {
    font-size: 0.875rem;
    color: var(--muted);
}

@keyframes chick-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-12px) rotate(4deg); }
}

@keyframes chick-shake {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    25% { transform: translateY(-1px) rotate(6deg); }
    50% { transform: translateY(1px) rotate(-4deg); }
    75% { transform: translateY(-1px) rotate(5deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .nav-links {
        display: none;
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}

