@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --bg: #f8f7f5;
    --panel: #ffffff;
    --panel-2: #faf9f8;
    --line: #e0dcd8;
    --line-strong: #d4ccc3;

    --text: #1a1a1a;
    --muted: #6b6b6b;

    --primary: #000000;
    --accent: #ff6b35;
    --bold: #1a1a1a;
    --muted-color: #999999;
    --outline: #000000;

    --radius: 2px;
    --radius-sm: 1px;

    --shadow-hard: 6px 6px 0 rgba(0, 0, 0, 0.18);
    --shadow-medium: 4px 4px 0 rgba(0, 0, 0, 0.12);
    --ring: 0 0 0 2px rgba(255, 107, 53, 0.3);
}

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

body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f7f5 0%, #f3f0eb 100%);
}

.container { max-width: 1180px; margin: 0 auto; padding: 50px 20px 90px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 9px 16px;
    margin-bottom: 24px;
    transition: all 0.22s ease;
    box-shadow: var(--shadow-medium);
}

.back-link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hard);
    transform: translate(-2px, -2px);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 50px;
    padding: 18px 22px;
    border: 3px solid var(--text);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-hard);
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
    color: var(--text);
    font-weight: 700;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 12px;
    background: var(--panel-2);
    transition: all 0.22s ease;
}

.nav-links a:hover,
.nav-links a.active {
    border-color: var(--accent);
    color: white;
    background: var(--text);
    box-shadow: var(--shadow-medium);
    transform: translate(-1px, -1px);
}

.section { margin-bottom: 70px; }

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    color: var(--text);
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 700;
}

.section-title::before {
    content: '';
    width: 24px;
    height: 3px;
    background: var(--accent);
}

.section-description { margin-bottom: 28px; color: var(--muted); max-width: 760px; }

.component-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }

.btn {
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 10px 18px;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.24s ease;
    position: relative;
    box-shadow: var(--shadow-medium);
}

.btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hard);
    transform: translate(-2px, -2px);
}

.btn:active { transform: translate(-1px, -1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #333333;
    border-color: #333333;
}

.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-accent:hover {
    background: #e55a2a;
    border-color: #e55a2a;
}

.btn-bold {
    background: var(--bold);
    color: white;
    border-color: var(--bold);
}

.btn-bold:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.btn-muted {
    background: var(--muted-color);
    color: white;
    border-color: var(--muted-color);
}

.btn-muted:hover {
    background: #808080;
    border-color: #808080;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm { padding: 7px 13px; font-size: 0.82rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; }

.btn-group {
    display: inline-flex;
    gap: 6px;
    padding: 8px;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: var(--panel-2);
    box-shadow: var(--shadow-medium);
}

.btn-group .btn { box-shadow: none; border-radius: var(--radius); }
.btn-group .btn.active,
.btn-group .btn:hover {
    border-color: var(--accent);
    color: white;
    background: var(--accent);
}

.card {
    border: 3px solid var(--text);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 24px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.18), 1px 1px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.26s ease;
    position: relative;
}

.card:hover {
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.22), 2px 2px 0 rgba(0, 0, 0, 0.08);
    transform: translate(-3px, -3px);
}

.card-accent { position: relative; overflow: visible; border-left: 10px solid var(--accent); }
.card-accent::before {
    content: '';
    position: absolute;
    right: -3px;
    top: -3px;
    width: 50px;
    height: 50px;
    border-top: 4px solid var(--accent);
    border-right: 4px solid var(--accent);
}

.card-title {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
}
.card-text { color: var(--muted); margin-bottom: 16px; }

.profile-card { text-align: center; max-width: 300px; }
.profile-avatar {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    border-radius: 0;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: white;
    border: 2px solid var(--primary);
    background: var(--primary);
}
.profile-name { margin-bottom: 2px; color: var(--text); }
.profile-role { color: var(--muted); margin-bottom: 14px; font-size: 0.9rem; }
.profile-stats { border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: center; gap: 18px; }
.stat-value { color: var(--text); font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.pricing-card { text-align: center; max-width: 320px; }
.pricing-price { font-size: 2.2rem; font-weight: 700; color: var(--text); }
.pricing-price span { font-size: 0.9rem; color: var(--muted); }
.pricing-features { list-style: none; margin: 16px 0 20px; text-align: left; }
.pricing-feature { padding: 5px 0; color: var(--muted); font-size: 0.9rem; }
.pricing-feature::before { content: '—'; color: var(--accent); margin-right: 8px; }

.pricing-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border: 1px solid var(--primary);
    border-radius: 2px;
    color: var(--primary);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
}

.pricing-card.featured {
    background: var(--panel-2);
    border-color: var(--primary);
}

.input-group { width: 100%; max-width: 360px; }
.input-label { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.input,
.search-input,
.textarea {
    width: 100%;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    transition: all 0.18s ease;
}

.input:focus,
.search-input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.search-wrapper { position: relative; width: 100%; max-width: 420px; }
.search-input { padding-left: 38px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.textarea { min-height: 120px; resize: vertical; }

.toggle-wrapper,
.checkbox-wrapper,
.radio-wrapper { display: inline-flex; align-items: center; gap: 10px; }
.toggle-label { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.toggle {
    appearance: none;
    width: 58px;
    height: 32px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
    position: relative;
    cursor: pointer;
    transition: all 0.24s ease;
    box-shadow: var(--shadow-medium);
}

.toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius);
    background: var(--muted);
    transition: transform 0.24s ease, background-color 0.24s ease;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.toggle:checked { border-color: var(--primary); background: var(--primary); }
.toggle:checked::before { transform: translateX(26px); background: white; }

.checkbox,
.radio {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--line);
    background: var(--panel);
    position: relative;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-medium);
}

.checkbox { border-radius: var(--radius); }
.radio { border-radius: 50%; box-shadow: none; }

.checkbox:checked { border-color: var(--primary); background: var(--primary); }
.checkbox:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.radio:checked { border-color: var(--primary); }
.radio:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.progress-container { width: 100%; max-width: 420px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.progress-bar {
    height: 12px;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel-2);
    box-shadow: var(--shadow-medium);
}
.progress-fill { height: 100%; border-radius: var(--radius); }
.progress-fill.primary { background: var(--primary); }
.progress-fill.accent { background: var(--accent); }
.progress-fill.muted { background: var(--muted-color); }

.circular-progress { position: relative; width: 120px; height: 120px; }
.circular-progress svg { transform: rotate(-90deg); }
.circular-progress circle { fill: none; stroke-width: 10; }
.progress-track { stroke: var(--line); }
.progress-indicator { stroke-linecap: butt; }
.progress-indicator.primary { stroke: var(--primary); }
.progress-indicator.accent { stroke: var(--accent); }
.progress-indicator.muted { stroke: var(--muted-color); }
.circular-progress-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 700; color: var(--text); font-size: 0.9rem; }

.slider-container { width: 100%; max-width: 350px; }
.slider {
    width: 100%;
    height: 6px;
    appearance: none;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: var(--line);
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    background: white;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-medium);
}

.slider::-webkit-slider-thumb:hover { background: var(--accent); border-color: var(--accent); }

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    background: white;
    cursor: pointer;
}

.slider-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

/* Advanced Components */
:root {
    --ac-border: #e0dcd8;
    --ac-surface: #ffffff;
    --ac-surface-alt: #faf9f8;
    --ac-text: #1a1a1a;
    --ac-muted: #6b6b6b;
    --ac-accent: #ff6b35;
}

.adv-stack { display: grid; gap: 16px; }
.adv-card {
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    background: var(--ac-surface);
    padding: 18px;
    box-shadow: var(--shadow-medium);
}

.adv-title {
    margin: 0 0 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--text);
    font-weight: 700;
    text-transform: uppercase;
}

.adv-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.adv-row:last-child { margin-bottom: 0; }

.adv-select,
.adv-date,
.adv-file {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    background: var(--ac-surface-alt);
    color: inherit;
    font: inherit;
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.adv-select:focus,
.adv-date:focus,
.adv-file:focus,
.adv-tab:focus-visible,
.adv-page:focus-visible,
.adv-menu-btn:focus-visible {
    outline: none;
    border-color: var(--ac-accent);
    box-shadow: var(--ring);
}

.adv-accordion { display: grid; gap: 8px; }
.adv-details {
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    background: var(--ac-surface-alt);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.adv-details summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 700;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.18s ease;
    border-bottom: 1px solid var(--ac-border);
}

.adv-details summary:hover {
    background: white;
    border-bottom-color: var(--accent);
}

.adv-details p {
    margin: 0;
    padding: 0 14px 12px;
    color: var(--ac-muted);
    font-size: 0.9rem;
}

.adv-details[open] { border-color: var(--text); }

.adv-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--ac-muted);
    font-size: 0.85rem;
}

.adv-breadcrumb a,
.adv-mobile-nav a,
.adv-footer a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.adv-breadcrumb a:hover,
.adv-mobile-nav a:hover,
.adv-footer a:hover { color: var(--accent); text-decoration: underline; }

.adv-tabs,
.adv-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.adv-tab,
.adv-page,
.adv-menu-btn {
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    background: var(--ac-surface);
    color: var(--ac-text);
    padding: 8px 14px;
    font: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 0.85rem;
    box-shadow: var(--shadow-medium);
}

.adv-tab:hover,
.adv-page:hover,
.adv-menu-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hard);
}

.adv-tab.active,
.adv-page.active,
.adv-stepper li.active {
    border-color: var(--text);
    background: var(--text);
    color: white;
    font-weight: 600;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
}

.adv-alert {
    flex: 1 1 220px;
    border: 2px solid var(--ac-border);
    border-left: 5px solid var(--ac-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--ac-surface-alt);
    font-size: 0.9rem;
    box-shadow: var(--shadow-medium);
}

.adv-alert.success { border-left-color: var(--text); border-color: var(--text); background: white; }
.adv-alert.warning { border-left-color: var(--accent); border-color: var(--ac-border); background: #fffaf7; }
.adv-alert.info { border-left-color: var(--text); border-color: var(--text); background: white; }

.adv-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    background: var(--ac-surface-alt);
    color: var(--ac-text);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-medium);
}

.adv-badge:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard); }

.adv-badge.accent { border-color: var(--accent); color: var(--accent); background: white; }
.adv-badge.ok { border-color: var(--text); color: var(--text); background: white; }
.adv-badge.warn { border-color: var(--accent); color: var(--accent); background: white; }

.adv-toast {
    margin-top: 8px;
    border: 2px solid var(--ac-border);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: white;
    color: var(--ac-text);
    font-size: 0.9rem;
    box-shadow: var(--shadow-hard);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px) translateY(10px); opacity: 0; }
    to { transform: translateX(0) translateY(0); opacity: 1; }
}

.adv-table-wrap { overflow-x: auto; border: 2px solid var(--text); border-radius: var(--radius); box-shadow: var(--shadow-medium); }
.adv-table { width: 100%; border-collapse: collapse; min-width: 520px; }

.adv-table th,
.adv-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--ac-border);
    font-size: 0.9rem;
}

.adv-table th {
    background: var(--text);
    color: white;
    font-weight: 700;
    border-bottom: 3px solid var(--accent);
}

.adv-table tr:hover { background: #f5f5f5; }

.adv-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-bottom: 1px dashed var(--text);
    cursor: help;
    color: var(--text);
}

.adv-tooltip-text {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: 220px;
    padding: 10px 12px;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: var(--ac-surface);
    color: var(--ac-text);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: 0.24s ease;
    z-index: 3;
    box-shadow: var(--shadow-hard);
    font-size: 0.85rem;
}

.adv-tooltip:hover .adv-tooltip-text,
.adv-tooltip:focus .adv-tooltip-text { opacity: 1; transform: translateY(0); }

.adv-modal-demo {
    margin: 10px 0;
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--ac-surface-alt);
    box-shadow: var(--shadow-medium);
}

.adv-modal-demo h4 { margin: 0 0 8px; color: var(--text); font-weight: 700; font-size: 0.95rem; border-bottom: 2px solid var(--ac-border); padding-bottom: 6px; }
.adv-modal-demo p { margin: 0 0 10px; color: var(--ac-muted); font-size: 0.9rem; }

.adv-avatars { display: inline-flex; align-items: center; margin-top: 6px; }
.adv-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    border: 2px solid var(--text);
    background: var(--text);
    color: white;
    margin-right: -8px;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-medium);
}

.adv-avatar:hover { transform: scale(1.2) translateY(-3px); }

.adv-empty-state {
    border: 2px dashed var(--ac-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    background: var(--ac-surface-alt);
    box-shadow: var(--shadow-medium);
}

.adv-empty-state p { margin: 0 0 6px; color: var(--ac-muted); font-size: 0.9rem; }
.adv-upload { display: inline-flex; flex-direction: column; gap: 6px; min-width: 220px; }

.adv-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.adv-stepper li {
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 2px solid var(--ac-border);
    color: var(--ac-text);
    transition: all 0.18s ease;
    font-size: 0.85rem;
    box-shadow: var(--shadow-medium);
}

.adv-stepper li.done { border-color: var(--text); color: var(--text); background: white; box-shadow: var(--shadow-hard); transform: scale(1.1); }

.adv-timeline {
    margin: 0 0 10px;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.adv-mobile-nav {
    border: 2px solid var(--ac-border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--ac-surface-alt);
    box-shadow: var(--shadow-medium);
}

.adv-mobile-nav ul {
    list-style: none;
    display: grid;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
}

.adv-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--ac-border);
    padding-top: 10px;
    font-size: 0.9rem;
}

/* Advanced List Styles */
.adv-list-ul,
.adv-list-ol {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--ac-text);
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.adv-list-ul li::marker { color: var(--accent); }
.adv-list-ol li::marker { font-weight: 700; color: var(--text); }

@media (max-width: 860px) {
    .nav { flex-direction: column; align-items: flex-start; }
    .card, .pricing-card, .profile-card { width: 100%; max-width: 100%; }
}

@media (max-width: 560px) {
    .container { padding: 30px 14px 60px; }
    .btn { width: 100%; }
    .btn-group { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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