:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --surface: #ffffff;
    --bg: #f8fafc;
    --border: #e2e8f0;
    --text: #475569;
    --heading: #0f172a;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px; left: 0;
    background: var(--primary); color: white;
    padding: 8px; z-index: 100;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; justify-content: space-between; align-items: center;
    height: 70px;
}
.brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 700; font-size: 1.25rem; color: var(--heading); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.main-nav ul { display: flex; gap: 1.5rem; }
.main-nav a { color: var(--text); font-weight: 500; transition: color 0.2s; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--primary); text-decoration: none; }
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); }

/* Typography */
h1, h2, h3 { color: var(--heading); line-height: 1.2; margin-bottom: 1rem; }
h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.875rem; font-weight: 700; margin-top: 2rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; }
p { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; font-weight: 600; border-radius: var(--radius);
    cursor: pointer; transition: background-color 0.2s, transform 0.1s;
    border: none; font-size: 1rem; font-family: var(--font-sans);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--heading); text-decoration: none; }

/* Hero */
.hero { padding: 4rem 0; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); }
.hero p { font-size: 1.25rem; color: var(--text); max-width: 700px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Generator Tool */
.tool-section { padding: 3rem 0; }
.tool-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
    align-items: start;
}
.card {
    background: var(--surface); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--heading); }
.form-control {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 1rem; font-family: var(--font-sans);
    background: var(--surface); color: var(--heading); transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.rule-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.help-text { font-size: 0.875rem; color: var(--text); margin-top: 0.25rem; }

/* Preview */
.preview-card { position: sticky; top: 90px; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.code-preview {
    background: #1e293b; color: #f8fafc; padding: 1.5rem;
    border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.9rem;
    overflow-x: auto; white-space: pre; min-height: 200px; margin-bottom: 1.5rem;
}
.preview-actions { display: flex; gap: 1rem; }

/* Content Sections */
.content-section { padding: 4rem 0; }
.content-container { max-width: 800px; margin: 0 auto; }
.content-container h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.content-container ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.content-container li { margin-bottom: 0.5rem; }
code { background: var(--border); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: var(--font-mono); font-size: 0.9em; color: var(--heading); }
pre { background: #1e293b; color: #f8fafc; padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem; font-family: var(--font-mono); font-size: 0.9rem; }
pre code { background: transparent; color: inherit; padding: 0; }
.example-block { position: relative; margin-bottom: 2rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
    width: 100%; text-align: left; background: none; border: none;
    padding: 1.5rem 0; font-size: 1.125rem; font-weight: 600; color: var(--heading);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-sans);
}
.faq-question::after { content: '+'; font-size: 1.5rem; transition: transform 0.2s; }
.faq-question[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.faq-answer-inner { padding-bottom: 1.5rem; color: var(--text); }

/* Checker UI */
.checker-result { margin-top: 1.5rem; padding: 1rem; border-radius: var(--radius); display: none; }
.checker-result.valid { background: #f0fdf4; border: 1px solid var(--success); color: #166534; display: block; }
.checker-result.error { background: #fef2f2; border: 1px solid var(--error); color: #991b1b; display: block; }

/* Breadcrumbs */
.breadcrumbs { padding: 1rem 0; font-size: 0.875rem; color: var(--text); background: var(--surface); border-bottom: 1px solid var(--border); }
.breadcrumbs ol { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span[aria-current="page"] { font-weight: 600; color: var(--heading); }

/* Footer */
.site-footer { background: var(--heading); color: #94a3b8; padding: 4rem 0 2rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.footer-col h3 { color: white; font-size: 1.125rem; margin-bottom: 1.5rem; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a { color: #94a3b8; transition: color 0.2s; }
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 2rem; text-align: center; font-size: 0.875rem; }

/* Responsive */
@media (max-width: 768px) {
    .tool-grid { grid-template-columns: 1fr; }
    .hero { padding: 3rem 0; }
    .mobile-menu-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 70px; left: 0; right: 0;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem;
        box-shadow: var(--shadow);
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 1rem; }
}
