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

:root {
    --bg: oklch(97% 0.003 80);
    --surface: oklch(94% 0.004 80);
    --raised: oklch(100% 0 0);
    --hover: oklch(92% 0.004 80);
    --text: oklch(15% 0.005 60);
    --text-secondary: oklch(35% 0.005 60);
    --text-muted: oklch(55% 0.005 60);
    --accent: oklch(15% 0.005 60);
    --accent-dim: oklch(15% 0.005 60 / 0.05);
    --border: oklch(82% 0.005 80);
    --border-active: oklch(65% 0.005 80);
    --green: oklch(45% 0.12 148);
    --red: oklch(48% 0.16 25);
    --amber: oklch(50% 0.10 80);
    --serif: 'Fraunces', 'Georgia', serif;
    --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --r: 0px;
    --header-h: 56px;
    --transition: 0.15s ease;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: auto;
    min-height: 100vh;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden;
    font-variant-numeric: tabular-nums;
}

.main > section + section {
    border-top: 1px solid oklch(75% 0 0);
}
.main > .search-hero + .pyramid-section {
    border-top: none;
}
::selection { background: oklch(15% 0.005 60 / 0.15); color: oklch(10% 0 0); }
a { color: inherit; }

/* ── Utilities ─────────────────────────────────────── */

.hidden { display: none !important; }
.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }
.link-accent--underline { text-decoration: underline; font-weight: 600; }
.link-accent--plain { border-bottom: none; }
.link-sm { font-size: 0.85rem; }

/* ── Header ────────────────────────────────────────── */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.25rem, 3vw, 3rem);
    background: var(--bg);
    border-bottom: 2px solid var(--text);
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: -0.03em;
}
.logo-mark {
    width: 28px;
    height: 28px;
    position: relative;
}
.logo-shape {
    position: absolute;
    will-change: transform;
}
.logo-shape-1 {
    width: 10px; height: 10px;
    background: oklch(15% 0 0);
    border-radius: 2px;
    top: 2px; left: 3px;
    opacity: 0.85;
    animation: logoFloat1 5s ease-in-out infinite;
}
.logo-shape-2 {
    width: 8px; height: 8px;
    background: oklch(40% 0 0);
    border-radius: 50%;
    top: 4px; right: 3px;
    opacity: 0.6;
    animation: logoFloat2 5.4s ease-in-out 0.3s infinite;
}
.logo-shape-3 {
    width: 9px; height: 9px;
    background: oklch(60% 0 0);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    bottom: 3px; left: 9px;
    opacity: 0.45;
    animation: logoFloat3 4.8s ease-in-out 0.6s infinite;
}
@keyframes logoFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(0.6px, -0.8px) rotate(1.5deg); }
    66% { transform: translate(-0.6px, 0.6px) rotate(-0.8deg); }
}
@keyframes logoFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-0.6px, 0.6px) scale(1.02); }
    70% { transform: translate(0.6px, -0.6px) scale(0.98); }
}
@keyframes logoFloat3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(0.6px, -0.6px) rotate(-2deg); }
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}
.header-link:hover { color: var(--text); }
.header-auth-group { display: flex; align-items: center; }

.btn-cta {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 0;
    border: 1.5px solid var(--text);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.15s ease, color 0.15s ease;
}
.btn-cta:hover { background: var(--text); color: var(--bg); }
.btn-cta-ghost { background: transparent; }
.btn-cta-ghost--cyan { border-color: var(--accent); color: var(--accent); }
.btn-cta-ghost--muted { border-color: var(--border-active); color: var(--text-secondary); margin-left: 0.5rem; }
.btn-cta-ghost--muted:hover { border-color: var(--red); color: var(--red); background: transparent; }

/* ── Search Hero ───────────────────────────────────── */

.search-hero {
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 3vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
    text-align: left;
}
.search-hero-bg { display: none; }
.search-hero-content {
    max-width: 780px;
    margin: 0 auto;
}
.search-hero-title {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 1.2;
    max-width: 28ch;
    border-bottom: 1px solid var(--border);
    padding-bottom: clamp(1rem, 2vw, 1.5rem);
}
.hero-op { color: var(--text-muted); font-weight: 300; }
.hero-arrow {
    display: inline-block;
    font-size: 0.5em;
    color: var(--text);
    margin-right: 0.5rem;
    vertical-align: 0.2em;
}
.hero-rotate {
    color: var(--accent);
    display: inline-block;
    transition: opacity 0.3s var(--ease-out-quart), transform 0.3s var(--ease-out-quart);
}
.hero-rotate.out {
    opacity: 0;
    transform: translateY(6px);
}

.instant-search-container { width: 100%; }
.instant-search-input-wrapper {
    position: relative;
    width: 100%;
}
.instant-search-input {
    width: 100%;
    padding: 0.9rem 2.5rem 0.9rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-style: italic;
    outline: none;
    transition: border-color 0.2s ease;
}
.instant-search-input::placeholder { color: var(--text-muted); font-style: italic; }
.instant-search-input:focus { border-bottom-color: var(--text); }
.instant-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.instant-search-spinner {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}
.spinner-ring {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-active);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.85rem;
    padding: 0;
}
.search-mode-toggle {
    display: inline-flex;
    gap: 0;
    position: relative;
}
.search-mode-toggle::before { display: none; }
.search-mode-btn {
    text-align: center;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    z-index: 1;
    border-radius: 0;
    transition: color 0.15s ease, background 0.15s ease;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.search-mode-btn:last-child { border-right: 1px solid var(--border); }
.search-mode-btn.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.search-mode-btn.active + .search-mode-btn { border-left-color: var(--text); }
.search-mode-btn:hover:not(.active) { color: var(--text); }
.search-hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Search Interval Slider */
.search-interval-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.search-interval-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 5.5rem;
}
.search-interval-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.search-interval-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #f60);
    cursor: pointer;
    border: none;
}
.search-interval-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #f60);
    cursor: pointer;
    border: none;
}

/* Search Results */
.search-answer {
    margin-top: 1.75rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
}
.search-answer-meta {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-latency { color: var(--green); }
.search-answer-body {
    display: grid;
    grid-template-columns: 1fr 240px;
    height: 300px;
}
.search-answer-text {
    padding: 1.25rem 1.5rem;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text);
    overflow-y: auto;
}
.search-answer-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.search-answer-error { color: var(--red); font-size: 0.85rem; }
.search-answer-sidebar {
    border-left: 1px solid var(--border);
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 300px;
}
.search-sidebar-item {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--r);
    transition: background var(--transition);
    line-height: 1.4;
}
.search-sidebar-item:hover { background: var(--hover); }
.search-sidebar-src {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-sidebar-age {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Skeleton */
.search-skeleton { padding: 0.75rem; }
.skeleton-line {
    height: 10px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--raised) 25%, var(--hover) 50%, var(--raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 0.5rem;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Stream View */
.search-stream-view {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
}
.search-stream-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-stream-status { color: var(--green); }
.search-stream-body {
    max-height: 300px;
    overflow-y: auto;
}
.search-stream-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-stream-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    transition: background var(--transition);
}
.search-stream-item:hover { background: var(--hover); }
.search-stream-item .stream-src {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-right: 0.5rem;
}

/* API View */
.search-api-view {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
}
.search-api-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-api-copy {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--transition);
}
.search-api-copy:hover { border-color: var(--accent); color: var(--accent); }
.search-api-code {
    padding: 0.75rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* Syntax Highlighting */
.ak { color: #c792ea; }
.am { color: #82aaff; }
.av { color: #c3e88d; }

/* Search Hero Subtitle */
/* ── Pillars ───────────────────────────────────────── */

.pillars-section {
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 960px;
    margin: 0 auto;
}
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--border);
}
.pillar-card {
    background: var(--surface);
    padding: 2.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
.pillar-card:hover .pillar-shape { transform: scale(1.12); }
.pillar-shape {
    width: 36px;
    height: 36px;
    margin-bottom: 1.5rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pillar-shape-square {
    background: oklch(15% 0 0);
    border-radius: 2px;
    animation: logoFloat1 5s ease-in-out infinite;
}
.pillar-shape-circle {
    background: oklch(40% 0 0);
    border-radius: 50%;
    animation: logoFloat2 5.4s ease-in-out 0.3s infinite;
}
.pillar-shape-triangle {
    background: oklch(60% 0 0);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    animation: logoFloat3 4.8s ease-in-out 0.6s infinite;
}
.pillar-metric {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}
.pillar-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.pillar-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── API Guide ─────────────────────────────────────── */

.api-guide-section {
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 960px;
    margin: 0 auto;
}
.api-guide-inner {
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
}
.api-guide-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
}
.api-guide-title {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.title-annotation { font-weight: 400; font-size: 0.7em; color: var(--text-muted); }
.api-guide-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.api-guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.guide-step {
    padding: 2rem 2rem;
    border-right: 1px solid var(--border);
}
.guide-step:last-child { border-right: none; }
.guide-step-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.guide-step-number {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--raised);
    border: 1px solid var(--border-active);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.guide-step-number.done {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
.guide-step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.guide-step-body { font-size: 0.85rem; }
.guide-step-done-label {
    color: var(--green);
    font-family: var(--mono);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.guide-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--r);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.guide-cta-btn:hover { background: var(--accent); color: var(--bg); }

.guide-controls { margin-bottom: 0.5rem; }
.guide-select {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--r);
    outline: none;
    cursor: pointer;
}
.guide-select:focus { border-color: var(--accent); }
.guide-code-block {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.guide-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: var(--raised);
    border-bottom: 1px solid var(--border);
}
.guide-code-lang {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.guide-copy-btn {
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 2px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.guide-copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.guide-code-pre {
    padding: 0.6rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    margin: 0;
}

.guide-try-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--transition);
}
.guide-try-btn:hover { border-color: var(--accent); }
.guide-try-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.guide-response-area {
    display: none;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.guide-response-area.visible {
    display: block;
}
.guide-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: var(--raised);
    border-bottom: 1px solid var(--border);
}
.guide-response-tag {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.guide-response-status {
    font-family: var(--mono);
    font-size: 0.65rem;
}
.guide-response-body {
    padding: 0.6rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ── Interactive Pyramid ───────────────────────────── */

.pyramid-section {
    padding: 0 clamp(1.25rem, 3vw, 3rem) clamp(2rem, 3vw, 3rem);
    max-width: 1100px;
    margin: 0 auto;
}
.pyramid-container { width: 100%; }
.pyramid-stack {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface);
    height: clamp(360px, 45vw, 440px);
}
.pyr-level {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    transition: background var(--transition);
}
.pyr-level:last-child { border-right: none; }
.pyr-level:hover { background: var(--hover); }
.pyr-level-bar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.pyr-level-inner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pyr-level-glow { display: none; }
.pyr-level-tag {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 1.4rem;
}
.pyr-level-name {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pyr-level-count {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
}

/* Level accent colors — newspaper grayscale */
.pyr-level[data-level="1"] .pyr-level-bar { border-top: 2px solid oklch(15% 0 0); }
.pyr-level[data-level="2"] .pyr-level-bar { border-top: 2px solid oklch(30% 0 0); }
.pyr-level[data-level="3"] .pyr-level-bar { border-top: 2px solid oklch(45% 0 0); }
.pyr-level[data-level="4"] .pyr-level-bar { border-top: 2px solid oklch(60% 0 0); }
.pyr-level[data-level="5"] .pyr-level-bar { border-top: 2px solid oklch(75% 0 0); }

.pyr-level-stream {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.pyr-level-stream::-webkit-scrollbar { display: none; }
.pyramid-stack { scrollbar-width: none; }
.pyramid-stack::-webkit-scrollbar { display: none; }

.pyr-stream-item {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.25s var(--ease-out-quart);
    transition: background var(--transition);
}
.pyr-stream-item:hover {
    background: oklch(15% 0 0 / 0.03);
    color: var(--text);
}
.pyr-stream-item .stream-src {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.4rem;
}
.pyr-stream-item .stream-age {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-left: 0.4rem;
}
.pyr-stream-empty {
    padding: 1.5rem 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .pyr-stream-item { animation: none; }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ── Value Proposition ─────────────────────────────── */

.value-section {
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 960px;
    margin: 0 auto;
}
.value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--border);
}
.value-card {
    background: var(--surface);
    padding: 3rem 2rem;
}
.value-icon {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-size: 1.75rem;
    display: flex;
    align-items: center;
}
.value-icon svg {
    width: 1.75rem;
    height: 1.75rem;
    fill: currentColor;
}
.abstract-icon {
    width: 1em;
    height: 1em;
    display: block;
}
.abstract-icon .shape-1,
.abstract-icon .shape-2,
.abstract-icon .shape-3 {
    fill: currentColor;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.abstract-icon .shape-1 { opacity: 0.9; }
.abstract-icon .shape-2 { opacity: 0.6; }
.abstract-icon .shape-3 { opacity: 0.7; }
.value-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.85rem;
}
.value-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Code the World / Agents Section ───────────────── */

.agents-section {
    padding: clamp(3rem, 6vw, 6rem) 2.5rem;
    text-align: left;
}
.agents-section h2 {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    margin-bottom: 1rem;
}
.agents-section p { color: var(--text-secondary); font-size: 1rem; margin-bottom: 2.5rem; }
.agents-section a {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: var(--r);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    transition: opacity var(--transition);
}
.agents-section a:hover { opacity: 0.85; }

/* ── Footer ────────────────────────────────────────── */

.footer {
    padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 3rem);
    text-align: left;
    font-family: var(--serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    border-top: 2px solid var(--text);
    max-width: 960px;
    margin: 0 auto;
}

/* ── Modals ────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    width: 100%;
    max-width: 380px;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal--wide { max-width: 420px; }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 0;
}
.modal-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.modal-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--r);
    transition: color var(--transition);
    margin: -0.25rem -0.25rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem 1.75rem; }
.modal-footer {
    padding: 0 1.75rem 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Modal Steps */
.modal-step { display: none; text-align: center; padding: 1.25rem 0; }
.modal-step--compact { padding: 0.75rem 0; }
.modal-step--tall { padding: 1.5rem 0; }
.modal-heading { color: var(--text); margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; }
.modal-heading--flush { margin-bottom: 0; }
.modal-heading--lg { margin-bottom: 0.75rem; }
.modal-text { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
.modal-text--spaced { margin-bottom: 0.75rem; }
.modal-hint { color: var(--text-muted); font-size: 0.75rem; }
.modal-success-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.modal-success-header { text-align: center; margin-bottom: 0.75rem; }
.modal-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group + .form-group { margin-top: 0; }
.form-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}
.form-label-hint { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: normal; }
.form-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 0.85rem;
    border-radius: var(--r);
    font-family: var(--sans);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s var(--ease-out-quart);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--accent); }
select.form-input { padding: 0.5rem 0.65rem; }
.form-error { color: var(--red); font-size: 0.7rem; margin-top: 0.35rem; display: none; }
.form-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.35rem; }

.btn-generate {
    width: 100%;
    background: var(--accent);
    border: none;
    color: var(--bg);
    padding: 0.7rem;
    border-radius: var(--r);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: opacity var(--transition);
}
.btn-generate:hover { opacity: 0.85; }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-generate--ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-generate--ghost:hover { border-color: var(--text-secondary); opacity: 1; }
.btn-generate--sm { font-size: 0.7rem; padding: 0.35rem 0.65rem; }
.btn-generate--mt { margin-top: 0.75rem; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Key Display */
.key-display { display: flex; gap: 0.5rem; }
.key-display input { flex: 1; font-size: 0.7rem; }
.btn-copy {
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.55rem 0.75rem;
    border-radius: var(--r);
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: border-color var(--transition);
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.key-info {
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: var(--raised);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.key-info-row { display: flex; justify-content: space-between; font-size: 0.75rem; }
.key-info-row + .key-info-row { margin-top: 0.25rem; }
.key-info-label { color: var(--text-muted); }
.key-info-value { color: var(--text); font-weight: 600; }

#success-academic { color: var(--accent); font-size: 0.8rem; margin: 0.35rem 0 0; display: none; }

/* ── Toasts ────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: 0.8rem;
    color: var(--text);
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-width: 360px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.toast-error { border-color: var(--red); }
.toast.toast-success { border-color: var(--green); }
.toast.toast-info { border-color: var(--text); }
.toast-icon {
    font-family: var(--mono);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.toast-error .toast-icon { color: var(--red); }
.toast-success .toast-icon { color: var(--green); }
.toast-info .toast-icon { color: var(--accent); }
.toast-msg { flex: 1; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

/* ── MCP Connect Section (developers.html) ─────────── */

.mcp-section { padding: 2rem 1.5rem; max-width: 900px; margin: 0 auto; }
.mcp-connect-section { padding: 0 1.5rem 3rem; }
.mcp-connect-inner { max-width: 700px; margin: 0 auto; }
.mcp-connect-header { margin-bottom: 1rem; }
.mcp-prereq {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.mcp-prereq code {
    background: var(--raised);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}
.mcp-tab-content { display: none; }
.mcp-tab-content.active { display: block; }
.mcp-troubleshoot summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.mcp-troubleshoot summary:hover { color: var(--text); }
.mcp-tabs { display: flex; gap: 0; margin-bottom: 1rem; }
.mcp-tab {
    padding: 0.4rem 0.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.mcp-tab:first-child { border-radius: var(--r) 0 0 var(--r); }
.mcp-tab:last-child { border-radius: 0 var(--r) var(--r) 0; }
.mcp-tab:not(:first-child) { border-left: none; }
.mcp-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.mcp-content { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 1.25rem; }
.mcp-step { margin-bottom: 1rem; }
.mcp-step-number {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}
.mcp-step-title { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 0.35rem; }
.mcp-code-block {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    margin-top: 0.5rem;
}
.mcp-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: var(--raised);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}
.mcp-code-copy, .mcp-copy-btn {
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 2px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.mcp-code-copy:hover, .mcp-copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.mcp-code-pre, .mcp-code-body pre {
    padding: 0.6rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    margin: 0;
}
.mcp-steps { display: flex; flex-direction: column; gap: 1.5rem; }
.mcp-step-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.mcp-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.1rem;
}
.mcp-step-body { flex: 1; min-width: 0; }
.mcp-step-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.mcp-step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.mcp-success-box {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 0.8rem;
    color: var(--text);
}
.mcp-success-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.mcp-success-icon svg {
    width: 12px;
    height: 12px;
}
.mcp-success-text { flex: 1; line-height: 1.5; }
.mcp-divider {
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}
.mcp-key-placeholder {
    font-family: var(--mono);
    background: var(--raised);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.8em;
}

/* ── API Key Display ──────────────────────────────── */

.api-key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.api-key-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.api-key-value {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--raised);
    padding: 0.35rem 0.65rem;
    border-radius: var(--r);
    border: 1px solid var(--border);
    user-select: all;
}
.api-key-copy {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}
.api-key-copy:hover { border-color: var(--accent); color: var(--accent); }

/* ── Gather View ──────────────────────────────────── */

.search-gather-view {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
}
.search-gather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.search-gather-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.gather-select {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    background: var(--raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--r);
    outline: none;
    cursor: pointer;
}
.gather-select:focus { border-color: var(--accent); }
.gather-run-btn {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background: var(--accent);
    border: none;
    color: var(--bg);
    border-radius: var(--r);
    cursor: pointer;
    text-transform: uppercase;
}
.gather-run-btn:hover { opacity: 0.85; }
.search-gather-status {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}
.search-gather-body {
    max-height: 350px;
    overflow-y: auto;
}
.search-gather-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.gather-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.gather-item:hover { background: var(--hover); }
.gather-item .gather-src {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-right: 0.5rem;
}
.gather-item .gather-age {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* ── MCP Section ──────────────────────────────────── */

.mcp-home-section {
    padding: clamp(2rem, 3vw, 3rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 780px;
    margin: 0 auto;
}
.mcp-home-inner {
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    padding: 2rem;
}
.mcp-home-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.mcp-home-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.mcp-home-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
}
.mcp-home-tab {
    padding: 0.4rem 0.85rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.mcp-home-tab:first-child { border-radius: var(--r) 0 0 var(--r); }
.mcp-home-tab:last-child { border-radius: 0 var(--r) var(--r) 0; border-left: none; }
.mcp-home-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.mcp-home-code {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.mcp-home-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--raised);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.mcp-home-copy {
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 2px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.mcp-home-copy:hover { color: var(--accent); border-color: var(--accent); }
.mcp-home-pre {
    padding: 0.75rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    margin: 0;
}
.mcp-home-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
}
.mcp-home-link:hover { text-decoration: underline; }

.guide-run-btn {
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    background: var(--accent);
    border: none;
    color: var(--bg);
    border-radius: 2px;
    cursor: pointer;
    margin-left: 0.35rem;
    font-weight: 600;
}
.guide-run-btn:hover { opacity: 0.85; }

/* ── Pillars (duplicate — keeps specificity) ──────── */

.pillar-icon {
    margin-bottom: 1rem;
    opacity: 0.9;
}
.pillar-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.pillar-label {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 1rem;
}
.pillar-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Pricing ──────────────────────────────────────── */

.pricing-section {
    padding: clamp(2.5rem, 4vw, 4rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 960px;
    margin: 0 auto;
    text-align: left;
}
.pricing-title {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.pricing-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.pricing-card {
    background: var(--surface);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}
.pricing-card--featured {
    background: oklch(15% 0.005 60);
    color: oklch(90% 0.005 60);
}
.pricing-card--featured .pricing-tier-name,
.pricing-card--featured .pricing-amount,
.pricing-card--featured .pricing-period { color: oklch(90% 0.005 60); }
.pricing-card--featured .pricing-features li { color: oklch(75% 0.005 60); border-bottom-color: oklch(25% 0 0); }
.pricing-card-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: oklch(90% 0.005 60);
    color: oklch(15% 0.005 60);
    font-family: var(--sans);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem;
    text-align: center;
}
.pricing-card--featured .pricing-card-header {
    margin-top: 1rem;
}
.pricing-card-header {
    margin-bottom: 1.25rem;
}
.pricing-tier-name {
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}
.pricing-amount {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--text);
}
.pricing-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.15rem;
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
    text-align: left;
}
.pricing-features li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child {
    border-bottom: none;
}
.pricing-features li::before {
    content: '✓';
    color: var(--green);
    margin-right: 0.5rem;
    font-weight: 600;
}
.pricing-btn {
    margin-top: 1.5rem;
    padding: 0.65rem 1rem;
    border-radius: var(--r);
    border: 1px solid var(--border-active);
    background: transparent;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.pricing-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pricing-btn--featured {
    border-color: oklch(90% 0.005 60);
    background: oklch(90% 0.005 60);
    color: oklch(15% 0 0);
}
.pricing-btn--featured:hover {
    background: oklch(100% 0 0);
    border-color: oklch(100% 0 0);
    color: oklch(15% 0 0);
}
.pricing-btn--current {
    border-color: var(--border);
    color: var(--text-muted);
    cursor: default;
}
.pricing-btn--current:hover {
    border-color: var(--border);
    color: var(--text-muted);
}
.pricing-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Enterprise / Research ────────────────────────── */

.enterprise-section {
    padding: clamp(2rem, 3vw, 3rem) clamp(1.25rem, 3vw, 3rem);
    max-width: 780px;
    margin: 0 auto;
}
.enterprise-inner {
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    padding: 2.5rem;
}
.enterprise-header {
    margin-bottom: 1.25rem;
}
.enterprise-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.enterprise-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.enterprise-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.75rem;
}
.enterprise-tag {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    letter-spacing: 0.01em;
}
.enterprise-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.enterprise-needs-group {
    margin-bottom: 0.75rem;
}
.enterprise-textarea {
    resize: vertical;
    min-height: 70px;
    font-family: var(--sans);
    line-height: 1.5;
}
.enterprise-submit {
    width: 100%;
    padding: 0.7rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--accent);
    border: none;
    color: var(--bg);
    border-radius: var(--r);
    cursor: pointer;
    transition: opacity var(--transition);
}
.enterprise-submit:hover { opacity: 0.85; }
.enterprise-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.enterprise-success {
    text-align: center;
    padding: 2rem 0;
}
.enterprise-success-icon {
    font-size: 2rem;
    color: var(--green);
    margin-bottom: 0.75rem;
}
.enterprise-success-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 900px) {
    .search-hero { padding: 3.5rem 1.5rem 2.5rem; }
    .search-hero-title { font-size: 1.2rem; }
    .search-answer-body { grid-template-columns: 1fr; height: auto; max-height: 400px; }
    .search-answer-text { max-height: 12rem; }
    .search-answer-sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 10rem;
    }
    .pillars-grid { grid-template-columns: 1fr; }
    .pillar-card { padding: 2rem 1.5rem; }
    .pillars-section, .value-section, .api-guide-section { padding: 3rem 1.5rem; }
    .value-grid { grid-template-columns: 1fr; }
    .value-card { padding: 2rem 1.5rem; }
    .pyramid-section { padding: 0 1.5rem 3rem; }
    .pyramid-stack {
        flex-direction: column;
        height: auto;
    }
    .pyr-level {
        border-right: none;
        border-bottom: 1px solid var(--border);
        height: 200px;
    }
    .pyr-level:last-child { border-bottom: none; }
    .pyr-level-bar { width: 100% !important; padding: 0.85rem 1.25rem; }
    .pyr-level-stream { width: 100%; height: calc(100% - 48px); }
    .header { padding: 0 1.25rem; }
    .header-nav { gap: 1.25rem; }
    .header-link { font-size: 0.82rem; }
    .agents-section { padding: 4rem 1.5rem; }
    .footer { padding: 3rem 1.5rem; }

    .search-mode-btn { padding: 0.5rem 1.1rem; font-size: 0.78rem; }
    .search-interval-slider::-webkit-slider-thumb { width: 24px; height: 24px; }
    .search-interval-slider::-moz-range-thumb { width: 24px; height: 24px; }
    .search-interval-slider { height: 6px; }
}

/* ── Mobile: swipeable pyramid + spacious layout ───── */
@media (max-width: 640px) {
    .header-nav { gap: 0.75rem; }
    .header-link:not(:first-child) { display: none; }
    .btn-cta { padding: 0.55rem 1rem; font-size: 0.75rem; }
    .btn-cta-ghost--muted { margin-left: 0.35rem; }

    .search-hero { padding: 3rem 1.25rem 3.5rem; }
    .search-hero-title { font-size: 1.1rem; margin-bottom: 2.5rem; line-height: 1.5; }
    .instant-search-input { font-size: 0.95rem; padding: 1rem 2.5rem 1rem 1rem; }

    .search-toolbar { flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
    .search-hint-text { display: none; }
    .search-interval-control { display: none; }

    .search-answer { margin-top: 1.5rem; }
    .search-answer-text { padding: 1.25rem; font-size: 0.92rem; line-height: 1.8; }

    /* Pyramid: horizontal swipe carousel */
    .pyramid-section { padding: 0.5rem 0 2.5rem; }
    .pyramid-stack {
        flex-direction: row;
        height: 320px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        border: none;
        border-radius: 0;
        background: transparent;
        gap: 0.75rem;
        padding: 0 1.25rem;
    }
    .pyr-level {
        min-width: 82vw;
        flex: 0 0 82vw;
        scroll-snap-align: start;
        border-right: none;
        border: 1px solid var(--border);
        border-radius: var(--r);
        background: var(--surface);
    }
    .pyr-level:last-child { border-right: none; }
    .pyr-level-bar { width: 100% !important; padding: 0.85rem 1.25rem; }
    .pyr-level-stream { width: 100%; flex: 1; }
    .pyr-stream-item { padding: 0.6rem 1.25rem; font-size: 0.85rem; line-height: 1.6; }
    .pyr-stream-item .stream-src { font-size: 0.65rem; }
    .pyr-stream-item .stream-age { font-size: 0.65rem; }
    .pyr-level-name { font-size: 0.8rem; }
    .pyr-level-tag { font-size: 0.65rem; }

    .api-guide-section { padding: 3rem 1.25rem; }
    .api-guide-title { font-size: 1.15rem; }
    .api-guide-subtitle { font-size: 0.88rem; }
    .guide-step { padding: 1.5rem 1.25rem; }
    .guide-code-pre { font-size: 0.72rem; line-height: 1.6; }

    .modal { max-width: calc(100vw - 2rem); margin: 0 1rem; }
    .modal-body { padding: 1.5rem 1.5rem; }

    .footer { padding: 3rem 1.25rem; }

    .toast-container { top: 0.75rem; right: 0.75rem; left: 0.75rem; }
    .toast { max-width: 100%; }
    .toast-close { padding: 0.5rem; min-width: 36px; min-height: 36px; }

    .search-interval-slider::-webkit-slider-thumb { width: 28px; height: 28px; }
    .search-interval-slider::-moz-range-thumb { width: 28px; height: 28px; }

    .mcp-home-section { padding: 2.5rem 1.25rem; }
    .mcp-home-inner { padding: 1.5rem 1.25rem; }
    .search-gather-filters { flex-direction: column; align-items: stretch; }
    .gather-select { width: 100%; }
    .api-key-display { flex-wrap: wrap; }
    .pillars-grid { grid-template-columns: 1fr; }
    .pillars-section { padding: 2.5rem 1.25rem; }
    .pillar-card { padding: 2rem 1.5rem; }
    .pricing-section { padding: 2.5rem 1.25rem; }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .enterprise-section { padding: 2.5rem 1.25rem; }
    .enterprise-inner { padding: 1.75rem 1.25rem; }
    .enterprise-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .header-link { display: none; }
    .btn-cta { padding: 0.5rem 0.85rem; font-size: 0.72rem; }

    .search-hero { padding: 2.5rem 1rem 3rem; }
    .search-hero-title { font-size: 0.95rem; margin-bottom: 2rem; }
    .instant-search-input { font-size: 0.9rem; padding: 0.9rem 2.25rem 0.9rem 0.9rem; }

    .search-mode-btn { padding: 0.5rem 0.85rem; font-size: 0.75rem; }

    .pyramid-stack { height: 280px; padding: 0 1rem; gap: 0.6rem; }
    .pyramid-section { padding: 0.5rem 0 2.5rem; }
    .pyr-level { min-width: 85vw; flex: 0 0 85vw; }
    .pyr-level-bar { padding: 0.75rem 1rem; }
    .pyr-stream-item { padding: 0.5rem 1rem; font-size: 0.82rem; }

    .api-guide-section { padding: 2.5rem 1rem; }
    .api-guide-header { padding: 1.5rem 1.25rem; }
    .guide-step { padding: 1.25rem 1rem; }

    .footer { padding: 2.5rem 1rem; }
}

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