:root {
    --paper: #f4f1e8;
    --paper-deep: #ebe6d9;
    --ink: #172026;
    --muted: #687078;
    --line: rgba(23, 32, 38, .12);
    --card: rgba(255, 255, 255, .72);
    --navy: #172b4d;
    --blue: #2855d9;
    --orange: #f2663a;
    --sidebar-w: 252px;
    --shadow: 0 12px 30px rgba(31, 38, 44, .08);
}

html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(circle at 82% 7%, rgba(242, 102, 58, .10), transparent 24rem),
        linear-gradient(115deg, transparent 0 48%, rgba(23, 32, 38, .025) 48% 48.2%, transparent 48.2% 100%),
        var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
    z-index: -1;
}

.container { display: block; max-width: none; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    color: #fff;
    padding: 28px 16px;
    border: 0;
    box-shadow: 8px 0 30px rgba(23, 43, 77, .12);
}

.sidebar-header { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { color: white; text-decoration: none; display: flex; gap: 12px; align-items: center; }
.brand-mark {
    width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
    background: var(--orange); color: white; font: 800 20px/1 Georgia, serif;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.brand strong { display: block; font-size: 16px; letter-spacing: -.2px; }
.brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.55); font-size: 11px; }
.sidebar-label { display: block; margin-top: 28px; color: rgba(255,255,255,.38); font-size: 9px; letter-spacing: 1.8px; font-weight: 800; }
.nav-menu { padding: 14px 0 50px; }
.nav-item {
    min-height: 43px; padding: 10px 12px; margin: 3px 0; border-radius: 10px;
    color: rgba(255,255,255,.62); font-size: 13px; border: 0;
}
.nav-item:hover, .nav-item.active, .nav-item.expanded { background: rgba(255,255,255,.10); color: #fff; border: 0; }
.nav-item i { color: rgba(255,255,255,.42); }
.nav-item:hover i, .nav-item.active i { color: #ffac91; }
.submenu { background: transparent; }
.submenu.expanded { max-height: 700px; }
.submenu-item { margin-left: 27px; padding: 8px 10px; border-left: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.45); font-size: 12px; }
.submenu-item:hover, .submenu-item.active { background: transparent; color: #fff; border-left-color: var(--orange); }

.main-content { margin-left: var(--sidebar-w); width: auto; max-width: none; padding: 0 5vw 72px; }
.search-header { max-width: 1120px; margin: 0 auto 66px; padding: 78px 0 0; }
.hero-copy { max-width: 760px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--blue); font-size: 10px; letter-spacing: 2.5px; font-weight: 800; }
.eyebrow span { width: 26px; height: 2px; background: var(--orange); }
.hero-copy h1 { margin-top: 18px; font: 700 clamp(38px, 5vw, 68px)/1.08 Georgia, "Noto Serif SC", serif; letter-spacing: -2.5px; color: var(--ink); }
.hero-copy h1 em { color: var(--orange); font-style: italic; font-weight: 500; }
.hero-copy p { margin-top: 18px; color: var(--muted); font-size: 15px; }

.search-container { display: block; max-width: none; padding: 0; margin-top: 36px; }
.search-box {
    max-width: none; height: 64px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.82);
    box-shadow: 0 14px 35px rgba(23,32,38,.08); overflow: hidden; align-items: center;
}
.search-box:focus-within { border-color: rgba(40,85,217,.55); box-shadow: 0 16px 38px rgba(40,85,217,.12); }
.search-leading { margin-left: 22px; color: var(--blue); }
.search-input { padding: 0 16px; height: 100%; font-size: 15px; color: var(--ink); }
.search-box kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 8px; color: var(--muted); font: 11px/1.5 ui-monospace, monospace; background: var(--paper); }
.search-btn { height: 44px; margin: 10px; padding: 0 18px; border-radius: 10px; background: var(--navy); color: white; font-size: 12px; }
.search-btn:hover { background: var(--blue); }
.search-meta { min-height: 42px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.search-engine-selector { background: transparent; border: 0; gap: 4px; }
.engine-btn { padding: 6px 9px; border-radius: 7px; font-size: 10px; }
.engine-btn:hover { background: rgba(23,32,38,.06); }
.engine-btn.active { background: var(--ink); color: white; }

.section { max-width: 1120px; margin: 0 auto 72px; scroll-margin-top: 30px; }
.content-header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.content-header h2 { font: 700 28px/1.2 Georgia, "Noto Serif SC", serif; letter-spacing: -.6px; color: var(--ink); margin: 0; }
.content-header h2 i { width: 34px; color: var(--orange); font-size: 17px; }
.content-header p { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 12px; }
.subsection { margin: 0 0 38px; scroll-margin-top: 24px; }
.subsection-header { margin: 0 0 14px; padding: 0; border: 0; }
.subsection-header h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--blue); }

.sites-grid { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; margin-bottom: 0; }
.site-card {
    position: relative; min-height: 112px; padding: 17px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--card); box-shadow: none; overflow: hidden; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.site-card::after { content: "\2197"; position: absolute; top: 16px; right: 16px; color: transparent; font-size: 15px; transition: color .2s ease, transform .2s ease; }
.site-card:hover { transform: translateY(-3px); border-color: rgba(40,85,217,.32); box-shadow: var(--shadow); }
.site-card:hover::after { color: var(--blue); transform: translate(2px,-2px); }
.site-card-header { gap: 12px; margin-bottom: 10px; padding-right: 18px; }
.site-icon { width: 32px; height: 32px; border-radius: 9px; background: white; box-shadow: 0 0 0 1px var(--line); }
.site-info h3 { color: var(--ink); font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.site-info .url { color: var(--muted); font-size: 9px; opacity: .72; }
.site-description { color: var(--muted); font-size: 11px; line-height: 1.55; min-height: 17px; }
.site-card[hidden], .section[hidden], .subsection[hidden] { display: none !important; }

.back-to-top { width: 44px; height: 44px; right: 24px; bottom: 24px; border-radius: 12px; background: var(--orange); color: #fff; font-size: 13px; }
.back-to-top:hover { background: var(--navy); }
.mobile-menu-btn { background: var(--navy); color: white; }
.overlay { backdrop-filter: blur(5px); }

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-thumb { background: rgba(23,32,38,.22); border-radius: 10px; }

@media (max-width: 900px) {
    :root { --sidebar-w: 228px; }
    .main-content { padding-left: 4vw; padding-right: 4vw; }
    .sites-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar { width: 280px; }
    .main-content { margin-left: 0; padding: 0 18px 54px; width: 100%; }
    .search-header { padding-top: 94px; margin-bottom: 52px; }
    .hero-copy h1 { font-size: 42px; letter-spacing: -1.6px; }
    .hero-copy p { font-size: 13px; }
    .search-box { height: 58px; }
    .search-box kbd { display: none; }
    .search-btn { padding: 0 13px; }
    .search-meta { align-items: flex-start; gap: 8px; }
    .engine-btn { padding: 6px; }
    .content-header { display: block; }
    .content-header p { margin-top: 5px; }
    .sites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .site-card { min-height: 104px; padding: 14px; }
}

@media (max-width: 430px) {
    .hero-copy h1 { font-size: 37px; }
    .search-leading { margin-left: 16px; }
    .search-input { width: 0; min-width: 0; }
    .search-btn { white-space: nowrap; }
    .search-meta { display: block; }
    .search-engine-selector { margin-top: 6px; }
    .sites-grid { grid-template-columns: 1fr; }
    .site-card { min-height: 96px; }
}

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