:root {
    --bg-page: #FAF9F6;
    --bg-card: #FFFFFF;
    --text-main: #1C1917;
    --text-muted: #57534E;
    --border: #E7E5E4;
    --accent: #0F172A;
    --accent-hover: #334155;
    --success: #15803D;
    --danger: #DC2626;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --transition: 0.2s ease;
}

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

/* === BASE === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .wordmark {
    font-family: 'Playfair Display', Georgia, serif;
    letter-spacing: -0.02em;
}

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === LAYOUT === */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === TYPOGRAPHY UTILITIES === */
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.full-width { width: 100%; justify-content: center; }

/* === NAVIGATION === */
.nav-header {
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.wordmark {
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
    color: var(--text-main);
    text-decoration: none;
    cursor: default;
    user-select: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}
.btn.primary:active { transform: translateY(0); }

.btn.ghost {
    background: transparent;
    color: var(--text-main);
}
.btn.ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn.outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}
.btn.outline:hover {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.04);
}

.btn.large {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}
.btn.small {
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
}
.btn.icon-only {
    padding: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* === DROPDOWN === */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 0.5rem;
    z-index: 60;
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background var(--transition);
}
.menu-item:hover { background: var(--bg-page); }

/* === CREDIT PILL === */
.credit-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #FEF9C3;
    color: #854D0E;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
}

/* === HERO === */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* === SEARCH === */
.search-container { max-width: 800px; margin: 0 auto; }

.search-box {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.search-box:focus-within {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(15, 23, 42, 0.3);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: var(--text-main);
    min-width: 0;
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { outline: none; }

.search-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .search-box {
        flex-direction: column;
        padding: 0.75rem;
    }
    .search-box input {
        padding: 0.75rem 0.5rem;
    }
    .btn.large {
        width: 100%;
        justify-content: center;
    }
}

/* === MODALS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.close-btn:hover { color: var(--text-main); }
.close-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-body { padding: 1.5rem; }

/* === FORMS === */
.input-group {
    margin-bottom: 1rem;
    margin-top: 0.75rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-page);
    color: var(--text-main);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
    background: white;
}

/* === BILLING === */
.price {
    font-size: 3rem;
    font-style: italic;
    color: var(--text-main);
    margin: 1rem 0 0.5rem;
    line-height: 1;
}

.feature-list {
    list-style: none;
    text-align: left;
    margin-top: 1.5rem;
    display: inline-block;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

/* === STATES === */
.state-container {
    text-align: center;
    padding: 5rem 1rem;
}

.state-container h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
}

.icon-large {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto;
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin: 2rem 0;
    font-size: 0.95rem;
}
.alert.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* === RESULTS === */
.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.meta-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: white;
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.results-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

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

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

/* === VIDEO GRID === */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.video-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.video-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.video-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: var(--border);
}

.video-card .vid-title {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--bg-page);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === STEPS & CHECKLISTS === */
.steps-list {
    padding-left: 1.25rem;
}

.steps-list li {
    margin-bottom: 0.9rem;
    padding-left: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.steps-list li::marker {
    color: var(--accent);
    font-weight: 600;
}

.checklist { list-style: none; }

.checklist li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
    gap: 0.5rem;
}

.checklist li:last-child { border-bottom: none; }

.checklist li span {
    flex: 1;
    min-width: 0;
}

.shop-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--accent);
    background: var(--bg-page);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.shop-link:hover {
    background: var(--border);
    border-color: var(--accent);
}

/* === DIAGRAM === */
.diagram-container {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.diagram-container svg {
    display: block;
    width: 100%;
    height: auto;
}

/* === VIDEO CHANNEL BADGE === */
.vid-channel {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}
