/* ============================================================
   Ryvonix Core Layout, Header, Footer, Hero, Editorial Prose
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding-top: var(--ryv-header-h);
    background-color: var(--ryv-bg);
    color: var(--ryv-text);
    font-family: var(--ryv-font-sans);
    font-size: 16px;
    line-height: 1.65;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--ryv-accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--ryv-accent-hover); }

.ryv-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--ryv-accent);
    color: var(--ryv-accent-contrast);
    padding: 10px 16px;
    border-radius: var(--ryv-radius-sm);
    z-index: 100000;
    font-weight: 600;
}
.ryv-skip-link:focus { left: 12px; }

.ryv-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
}

.ryv-main { min-height: calc(100vh - var(--ryv-header-h) - 260px); }

/* ==================== HEADER ==================== */
.ryv-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--ryv-header-h);
    z-index: 9999;
    background: var(--ryv-glass-bg);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border-bottom: 1px solid var(--ryv-glass-border);
    transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.ryv-header.is-sticky { box-shadow: var(--ryv-shadow-md); }

.ryv-header-inner {
    max-width: 1220px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ryv-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ryv-text);
    font-family: var(--ryv-font-display);
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}
.ryv-brand:hover { color: var(--ryv-text); }
.ryv-brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 800;
}

.ryv-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0 auto;
}
.ryv-nav-link {
    color: var(--ryv-text-secondary);
    font-weight: 600;
    font-size: 0.93rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 2px;
}
.ryv-nav-link:hover { color: var(--ryv-accent); }

/* Dropdown */
.ryv-dropdown { position: relative; }
.ryv-chevron { transition: transform 0.2s ease; }
.ryv-dropdown:hover .ryv-chevron,
.ryv-dropdown:focus-within .ryv-chevron { transform: rotate(180deg); }

.ryv-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 520px;
    background: var(--ryv-surface-elevated);
    border: 1px solid var(--ryv-border);
    border-radius: var(--ryv-radius-md);
    box-shadow: var(--ryv-shadow-lg);
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10000;
}
.ryv-dropdown:hover .ryv-dropdown-menu,
.ryv-dropdown:focus-within .ryv-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.ryv-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
}
.ryv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--ryv-radius-sm);
    color: var(--ryv-text);
}
.ryv-dropdown-item:hover { background: var(--ryv-surface-2); color: var(--ryv-accent); }
.ryv-dropdown-logo {
    width: 28px; height: 28px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}
.ryv-dropdown-letter {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--ryv-accent-soft);
    color: var(--ryv-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.ryv-dropdown-name { flex: 1; font-size: 13px; font-weight: 600; }
.ryv-dropdown-count {
    font-size: 11px;
    color: var(--ryv-text-muted);
    background: var(--ryv-surface-2);
    padding: 2px 7px;
    border-radius: var(--ryv-radius-pill);
}
.ryv-dropdown-all {
    display: block;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: var(--ryv-accent);
    color: var(--ryv-accent-contrast);
    border-radius: var(--ryv-radius-sm);
    font-size: 13px;
    font-weight: 600;
}
.ryv-dropdown-all:hover { background: var(--ryv-accent-hover); color: var(--ryv-accent-contrast); }

/* Header Action Buttons */
.ryv-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ryv-icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--ryv-radius-pill);
    border: 1px solid var(--ryv-border);
    background: var(--ryv-surface);
    color: var(--ryv-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.ryv-icon-btn:hover { background: var(--ryv-surface-2); border-color: var(--ryv-border-strong); color: var(--ryv-accent); }
.ryv-hamburger { display: none; }

/* Dark/Light Toggle Icons */
html[data-theme="light"] .ryv-icon-sun { display: none; }
html[data-theme="light"] .ryv-icon-moon { display: block; }
html[data-theme="dark"] .ryv-icon-sun { display: block; }
html[data-theme="dark"] .ryv-icon-moon { display: none; }

/* Header Search Mode */
.ryv-search-bar-wrap { display: none; flex: 1; align-items: center; gap: 10px; }
.ryv-header.is-search-mode .ryv-brand,
.ryv-header.is-search-mode .ryv-nav,
.ryv-header.is-search-mode .ryv-header-actions { display: none; }
.ryv-header.is-search-mode .ryv-search-bar-wrap { display: flex; }
.ryv-search-bar-wrap .pdp-live-search-wrap { flex: 1; width: 100%; }
.ryv-fallback-search { flex: 1; }
.ryv-fallback-search input {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--ryv-radius-pill);
    border: 1px solid var(--ryv-border);
    background: var(--ryv-surface);
    color: var(--ryv-text);
    font-size: 15px;
}

/* Mobile Drawer */
.ryv-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.ryv-drawer-overlay.is-open { opacity: 1; visibility: visible; }

.ryv-drawer {
    position: fixed;
    top: 0; right: -320px; bottom: 0;
    width: 300px;
    max-width: 86vw;
    background: var(--ryv-surface);
    border-left: 1px solid var(--ryv-border);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--ryv-shadow-lg);
}
.ryv-drawer.is-open { right: 0; }
.ryv-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ryv-border);
    font-family: var(--ryv-font-display);
    font-weight: 800;
    font-size: 1.25rem;
}
.ryv-drawer-links { flex: 1; padding: 12px 20px; overflow-y: auto; }
.ryv-drawer-links a {
    display: block;
    padding: 14px 4px;
    color: var(--ryv-text);
    font-weight: 600;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--ryv-border);
}
.ryv-drawer-links a:hover { color: var(--ryv-accent); }
.ryv-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--ryv-border); }
.ryv-drawer-theme-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--ryv-radius-sm);
    border: 1px solid var(--ryv-border);
    background: var(--ryv-surface-2);
    color: var(--ryv-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ==================== HERO ==================== */
.ryv-hero {
    background: var(--ryv-hero-bg);
    border-bottom: 1px solid var(--ryv-border);
    padding: 64px 0 56px;
}
.ryv-hero-inner { text-align: center; max-width: 820px; }
.ryv-hero-kicker {
    display: inline-block;
    padding: 5px 14px;
    border-radius: var(--ryv-radius-pill);
    background: var(--ryv-accent-soft);
    color: var(--ryv-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.ryv-hero-title {
    font-family: var(--ryv-font-display);
    font-size: clamp(2rem, 4.6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
    color: var(--ryv-text);
}
.ryv-hero-sub {
    font-size: 1.08rem;
    color: var(--ryv-text-muted);
    max-width: 620px;
    margin: 0 auto 28px;
}
.ryv-hero-search { max-width: 620px; margin: 0 auto 24px; text-align: left; }
.ryv-hero-brands {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.ryv-brand-chip {
    padding: 6px 14px;
    border-radius: var(--ryv-radius-pill);
    background: var(--ryv-surface);
    border: 1px solid var(--ryv-border);
    color: var(--ryv-text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.ryv-brand-chip:hover { border-color: var(--ryv-accent); color: var(--ryv-accent); }
.ryv-brand-chip-all { background: var(--ryv-accent-soft); border-color: transparent; color: var(--ryv-accent); }

/* ==================== SECTIONS & FOOTER ==================== */
.ryv-section { padding: 52px 0; }
.ryv-section-alt { background: var(--ryv-surface); border-top: 1px solid var(--ryv-border); border-bottom: 1px solid var(--ryv-border); }
.ryv-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.ryv-section-head h2 {
    font-family: var(--ryv-font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}
.ryv-section-head p { margin: 0; color: var(--ryv-text-muted); font-size: 0.95rem; }

.ryv-footer {
    background: var(--ryv-surface);
    border-top: 1px solid var(--ryv-border);
    padding: 56px 0 32px;
    margin-top: 40px;
}
.ryv-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--ryv-border);
}
.ryv-footer-tagline { color: var(--ryv-text-muted); font-size: 0.95rem; max-width: 360px; margin: 14px 0 0; }
.ryv-footer-col h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ryv-text-muted);
    margin: 0 0 14px;
}
.ryv-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ryv-footer-col li { margin-bottom: 10px; }
.ryv-footer-col a { color: var(--ryv-text-secondary); font-size: 0.94rem; font-weight: 500; }
.ryv-footer-col a:hover { color: var(--ryv-accent); }
.ryv-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    font-size: 0.88rem;
    color: var(--ryv-text-muted);
    flex-wrap: wrap;
}
.ryv-footer-bottom p { margin: 0; }
.ryv-footer-theme-pill {
    padding: 6px 14px;
    border-radius: var(--ryv-radius-pill);
    border: 1px solid var(--ryv-border);
    background: var(--ryv-surface-2);
    color: var(--ryv-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 860px) {
    .ryv-nav { display: none; }
    .ryv-hamburger { display: inline-flex; }
    .ryv-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
    .ryv-hero { padding: 42px 0 36px; }
    .ryv-section { padding: 36px 0; }
}
