@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-variable.woff2") format("woff2");
}

/* NEAX Demo Portal: light enterprise workspace, navy sidebar, restrained brand accents */
:root {
  --bg: #f4f6f9;
  --surface: #fff;
  --surface-subtle: #eef2f6;
  --ink: #0f2236;
  --muted: #4b5e72;
  --quiet: #5f7285;
  --line: #dbe2ea;
  --line-strong: #b4c0cc;
  --primary: #0e3a5f;
  --primary-hover: #0a2c49;
  --link: #1a6a2c;
  --success-bg: #e5f4e6;
  --nav-bg: #0b2238;
  --nav-ink: #c9d6e3;
  --nav-hover: rgba(255, 255, 255, .07);
  --nav-active: rgba(184, 250, 104, .12);
  --accent: #b8fa68;
  --focus: #1d6fd1;
  --shadow-sm: 0 1px 2px rgba(15, 34, 54, .06);
  --shadow-md: 0 6px 18px rgba(15, 34, 54, .1);
  --radius: 12px;
  --sidebar-w: 264px;
  --font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); font-family: var(--font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: var(--accent); }
[tabindex="-1"]:focus-visible { outline: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
::selection { background: var(--accent); color: var(--nav-bg); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon svg { display: block; width: 24px; height: 24px; }
.container { width: min(100% - 64px, 1180px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: -100px; left: 16px; padding: 12px 18px; border-radius: 8px; background: var(--primary); color: #fff; }
.skip-link:focus { top: 12px; }

/* Shell */
.site-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1 0 auto; }
.topbar { display: none; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--nav-bg); color: var(--nav-ink); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px; border-radius: 8px; }
.brand-logo { width: 118px; height: auto; display: block; }
.brand-context { font-size: 12px; font-weight: 500; letter-spacing: .04em; color: #9fb3c6; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { margin: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8ea5bb; }
.side-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.3; transition: background .15s ease, color .15s ease; }
.side-link .icon svg { width: 20px; height: 20px; }
.side-link:hover { background: var(--nav-hover); color: #fff; }
.side-link[aria-current="page"] { background: var(--nav-active); color: #fff; }
.side-link[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-link[aria-current="page"] .icon { color: var(--accent); }
.sidebar-note { margin: auto 10px 0; font-size: 12px; line-height: 1.5; color: #8ea5bb; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8, 20, 33, .5); }

/* Page header */
.home-view, .detail-view { padding-top: 32px; padding-bottom: 64px; }
.page-header { padding: 4px 0 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-header-text { min-width: 0; }
.eyebrow { margin: 0 0 8px; color: var(--link); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.page-title { margin: 0; font-size: clamp(28px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
.page-subtitle { margin: 10px 0 0; max-width: 640px; font-size: 15px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.page-emblem { width: 52px; height: 52px; border-radius: 12px; background: var(--surface); color: var(--primary); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 auto; }
.page-emblem .icon svg { width: 26px; height: 26px; }

.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.015em; line-height: 1.35; }
.section-helper { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.collection-count { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--surface-subtle); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
#collections-heading { scroll-margin-top: 22px; }

/* Cards */
.card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-subtle); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.card-icon .icon svg { width: 22px; height: 22px; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-card { min-height: 200px; padding: 22px 24px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.category-card:hover, .entry-card.is-clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-title { margin: 14px 0 0; font-weight: 650; font-size: 19px; letter-spacing: -.02em; line-height: 1.3; }
.category-description { margin: 6px 0 16px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.category-card-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-meta { font-size: 13px; color: var(--quiet); font-weight: 500; }
.category-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--primary); }
.category-cta .icon svg { width: 16px; height: 16px; transition: transform .15s ease; }
.category-card:hover .category-cta .icon svg { transform: translateX(3px); }

/* Navigation inside views */
.detail-navigation { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.breadcrumbs { min-height: 36px; display: flex; align-items: center; overflow-x: auto; scrollbar-width: thin; }
.breadcrumb-list { padding: 0; margin: 0; display: flex; align-items: center; list-style: none; white-space: nowrap; gap: 8px; }
.breadcrumb-list li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumb-list li > .icon { color: var(--quiet); }
.breadcrumb-list li > .icon svg { width: 13px; height: 13px; }
.breadcrumb-list a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 2px; border-radius: 4px; }
.breadcrumb-list a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb-home > .icon svg { width: 15px !important; height: 15px !important; }
.breadcrumb-current { font-weight: 600; color: var(--ink); }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-size: 13px; font-weight: 600; min-height: 44px; white-space: nowrap; }
.back-link:hover { text-decoration: underline; }
.back-link > .icon svg { width: 16px; height: 16px; }

/* Entries */
.entries-section { padding-top: 0; }
.entries-section + .entries-section { margin-top: 40px; }
.entries-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.entries-headline { min-width: 0; }
.entries-title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-wrap { height: 44px; width: min(100%, 320px); flex: 0 1 320px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; display: flex; align-items: center; transition: border-color .15s ease, box-shadow .15s ease; }
.search-wrap:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(29, 111, 209, .18); }
.search-wrap > .icon { margin-left: 12px; color: var(--quiet); }
.search-wrap > .icon svg { width: 18px; height: 18px; }
.search-input { width: 100%; height: 100%; border: 0; background: transparent; outline: none; color: var(--ink); padding: 8px 10px; min-width: 0; font-size: 14px; }
.search-input:focus-visible { outline: none; }
.search-input::placeholder { color: var(--quiet); opacity: 1; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; display: grid; place-items: center; }
.search-clear .icon svg { width: 16px; height: 16px; }
.search-clear:hover { color: var(--ink); background: var(--surface-subtle); }

.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.entry-card { --tile-bg: #e6f0f9; --tile-ink: #1b5e8f; min-height: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; display: flex; flex-direction: column; min-width: 0; }
.entry-card.tone-sage { --tile-bg: #e6f3da; --tile-ink: #2f6b12; }
.entry-card.tone-lavender { --tile-bg: #ece9f9; --tile-ink: #5a45a8; }
.entry-card.tone-sand { --tile-bg: #f8eed9; --tile-ink: #85560f; }
.entry-card.is-clickable { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.entry-card.is-unavailable { background: #fafbfc; box-shadow: none; }
.entry-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.entry-icon { background: var(--tile-bg); color: var(--tile-ink); }
.entry-kind { font-size: 11px; font-weight: 600; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.entry-title { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.015em; font-weight: 650; overflow-wrap: anywhere; }
.entry-description { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 6px 0 0; }
.entry-footer { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.entry-meta, .entry-muted { color: var(--quiet); font-size: 12px; font-weight: 500; }
.entry-action { color: var(--primary); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.entry-action .icon svg { width: 15px; height: 15px; transition: transform .15s ease; }
.entry-group:hover .entry-action .icon svg { transform: translateX(3px); }
.status-soon, .status-available { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-soon { background: var(--surface-subtle); color: var(--muted); }
.status-available { background: var(--success-bg); color: var(--link); }
.status-available::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.search-trail { margin: -8px 0 8px; color: var(--quiet); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.detail-tip { display: flex; gap: 8px; align-items: flex-start; margin: 32px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.detail-tip .icon svg { width: 16px; height: 16px; margin-top: 2px; }

/* Languages */
.language-switcher { display: inline-flex; padding: 3px; background: var(--surface-subtle); border-radius: 8px; }
.language-button { min-width: 48px; min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.language-button:hover { color: var(--ink); }
.language-button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* States */
.initial-state { padding: 80px 0; text-align: center; color: var(--muted); font-size: 14px; }
.empty-state { padding: 56px 24px; border: 1px dashed var(--line-strong); background: var(--surface); border-radius: var(--radius); text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty-icon { width: 52px; height: 52px; }
.empty-state h3 { margin: 18px 0 0; font-size: 17px; letter-spacing: -.01em; }
.empty-state p { margin: 8px 0 0; font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 400px; }
.text-button, .primary-button { margin-top: 20px; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.text-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary); }
.text-button:hover { background: var(--surface-subtle); }
.primary-button { background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-hover); }
.text-button:active, .primary-button:active { transform: translateY(1px); }
.not-found { padding-top: 96px; padding-bottom: 96px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.not-found h1 { font-size: 28px; letter-spacing: -.03em; margin: 20px 0 0; }
.not-found p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--quiet); }
.footer-brand { color: var(--ink); font-weight: 600; }
.footer-separator { padding-inline: 6px; color: var(--quiet); font-weight: 400; }

/* Tablet and mobile: sidebar becomes a drawer */
@media (max-width: 1023px) {
  .site-shell { display: block; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar-logo { height: 22px; width: auto; }
  .menu-button { width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); display: grid; place-items: center; }
  .menu-button:hover { background: var(--surface-subtle); }
  .menu-button svg { width: 22px; height: 22px; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
  .nav-open { overflow: hidden; }
  .side-link[aria-current="page"]::before { left: -14px; }
  .container { width: min(100% - 48px, 1180px); }
}

@media (max-width: 700px) {
  .container { width: min(100% - 32px, 1180px); }
  .home-view, .detail-view { padding-top: 20px; padding-bottom: 48px; }
  .category-grid { grid-template-columns: 1fr; gap: 12px; }
  .category-card { min-height: 0; }
  .detail-navigation { flex-wrap: wrap; gap: 0 14px; }
  .page-emblem { display: none; }
  .entries-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .search-wrap { width: 100%; flex-basis: 44px; }
  .entry-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Visual polish layer */
body { background: radial-gradient(ellipse 60% 40% at 90% 0%, rgba(26, 106, 44, .06), transparent 70%), radial-gradient(ellipse 50% 40% at 0% 100%, rgba(14, 58, 95, .07), transparent 70%), var(--bg); background-attachment: fixed; }
.sidebar { background: linear-gradient(180deg, #0d2a45 0%, #0a1d31 100%); border-right: 1px solid rgba(255, 255, 255, .06); }
.side-link .icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .06); transition: background .15s ease; }
.side-link:hover .icon { background: rgba(255, 255, 255, .12); }
.side-link[aria-current="page"] .icon { background: rgba(184, 250, 104, .16); }
.side-link { gap: 10px; }
.brand-context { display: inline-flex; align-items: center; gap: 8px; }
.brand-context::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--accent); }

/* Hero */
.hero { position: relative; overflow: hidden; margin-bottom: 36px; padding: 44px 44px 36px; border-radius: 20px; color: #fff; background: radial-gradient(ellipse 60% 120% at 100% 0%, rgba(184, 250, 104, .2), transparent 60%), radial-gradient(ellipse 50% 90% at 0% 100%, rgba(57, 140, 200, .28), transparent 65%), linear-gradient(135deg, #0e3a5f 0%, #0a2238 100%); box-shadow: 0 18px 40px -18px rgba(11, 34, 56, .55); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 36px 36px; mask-image: radial-gradient(ellipse 70% 100% at 100% 0%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 100% at 100% 0%, #000, transparent 75%); pointer-events: none; }
.hero > * { position: relative; }
.hero-eyebrow { margin: 0 0 12px; display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.hero-eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.hero-title { margin: 0; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -.04em; font-weight: 750; text-wrap: balance; }
.hero-subtitle { margin: 14px 0 0; max-width: 560px; font-size: 16px; line-height: 1.65; color: #c3d3e3; }
.hero-stats { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats li { display: flex; flex-direction: column; min-width: 120px; padding: 12px 18px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.hero-stats strong { font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.hero-stats span { margin-top: 2px; font-size: 12px; color: #aebfd1; }

/* Tonal cards */
.category-card { --tone-bg: #e6f0f9; --tone-ink: #1b5e8f; --tone-line: #1b5e8f; position: relative; overflow: hidden; }
.category-card:nth-child(2) { --tone-bg: #e6f3da; --tone-ink: #2f6b12; --tone-line: #4f9a22; }
.category-card:nth-child(3) { --tone-bg: #ece9f9; --tone-ink: #5a45a8; --tone-line: #7a63cc; }
.category-card:nth-child(4) { --tone-bg: #f8eed9; --tone-ink: #85560f; --tone-line: #d89a2b; }
.category-card::before, .entry-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone-line, var(--tile-ink)); opacity: 0; transition: opacity .15s ease; }
.category-card:hover::before, .entry-card.is-clickable:hover::before { opacity: 1; }
.entry-card { position: relative; overflow: hidden; }
.category-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--tone-bg); color: var(--tone-ink); }
.category-icon .icon svg { width: 26px; height: 26px; }
.category-title { font-size: 20px; }
.category-card:hover .category-cta { color: var(--tone-ink); }
.entry-icon { width: 48px; height: 48px; border-radius: 12px; }

/* Detail header */
.page-header { padding: 24px 28px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, #fff 0%, #f4f8fb 100%); box-shadow: var(--shadow-sm); }
.page-emblem { width: 60px; height: 60px; border-radius: 14px; background: linear-gradient(145deg, #0e3a5f, #0a2238); color: var(--accent); border: 0; box-shadow: 0 8px 18px -8px rgba(11, 34, 56, .6); }
.section-heading { font-size: 19px; }
.empty-state { background: linear-gradient(180deg, #fff, #f7f9fb); }

@media (max-width: 700px) {
  .hero { padding: 28px 22px 24px; border-radius: 16px; }
  .hero-stats li { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .page-header { padding: 18px; }
}

/* Hero art, card previews */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 24px; }
.hero-art { position: relative; height: 270px; }
.hero-window { position: absolute; width: 200px; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .96); color: #0f2236; box-shadow: 0 22px 40px -16px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .5); }
.hero-window-1 { top: 0; left: 8%; transform: rotate(-3deg); }
.hero-window-2 { top: 44px; right: 0; transform: rotate(3deg); }
.hero-window-3 { top: 150px; left: 12%; transform: rotate(-1deg); z-index: 1; }
.hero-window-bar { display: flex; gap: 5px; padding: 9px 12px; background: #e8eef4; }
.hero-window-bar i { width: 7px; height: 7px; border-radius: 50%; background: #b4c0cc; }
.hero-window-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.hero-window-body b { font-size: 13px; letter-spacing: -.01em; }
.hero-window-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #e6f0f9; color: #1b5e8f; }
.hero-window-2 .hero-window-icon { background: #e6f3da; color: #2f6b12; }
.hero-window-3 .hero-window-icon { background: #ece9f9; color: #5a45a8; }
.hero-window-icon .icon svg { width: 16px; height: 16px; }
.hero-line { height: 6px; border-radius: 3px; background: #dbe2ea; }
.hero-line.short { width: 60%; }

.category-chips { list-style: none; margin: -4px 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.category-chips li { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--tone-ink); background: var(--tone-bg); }
.category-chips .chip-more { background: var(--surface-subtle); color: var(--muted); }
.category-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, var(--tone-bg), transparent 70%); opacity: .8; pointer-events: none; }
.category-card > * { position: relative; z-index: 1; }
.entry-card-head .entry-icon { box-shadow: inset 0 0 0 1px rgba(15, 34, 54, .06); }
.site-footer { background: transparent; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* Interactive layer */
.category-chips { flex-wrap: nowrap; overflow: hidden; }
.category-chips li { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-chips li:last-child { flex: 0 0 auto; }

.search-trigger { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: auto; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; background: rgba(255, 255, 255, .05); color: var(--nav-ink); font-size: 14px; text-align: left; transition: background .15s ease, border-color .15s ease; }
.search-trigger:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger span { flex: 1; }
kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; }
.sidebar-note { margin-top: 0; }
.topbar-search { margin-left: auto; }

.category-card, .entry-card.is-clickable { background-image: radial-gradient(260px circle at var(--mx, -400px) var(--my, -400px), rgba(14, 58, 95, .08), transparent 70%); }
.hero-window { translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px); transition: translate .25s ease-out; }
.hero-window-2 { translate: calc(var(--px, 0) * 12px) calc(var(--py, 0) * 8px); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.hero, .category-card, .is-entering > .entry-card, .page-header { animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards; }
.category-card, .is-entering > .entry-card { animation-delay: calc(var(--i, 0) * 45ms + 80ms); }

/* Command palette */
.palette { width: min(640px, calc(100% - 32px)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(8, 20, 33, .6); overflow: hidden; }
.palette::backdrop { background: rgba(8, 20, 33, .55); backdrop-filter: blur(3px); }
.palette[open] { animation: rise .18s ease-out; }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--quiet); }
.palette-field .icon svg { width: 20px; height: 20px; }
.palette-input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: none; }
.palette-input::placeholder { color: var(--quiet); }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 420px); overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.palette-item .icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-subtle); color: var(--primary); }
.palette-item .icon svg { width: 18px; height: 18px; }
.palette-item[aria-selected="true"] { background: #e6eef6; }
.palette-item[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.palette-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-text small { font-size: 12px; color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }
.palette-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.palette-foot { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--quiet); background: #f8fafc; }
@media (max-width: 700px) { .palette-tag { display: none; } .palette { margin-top: 8vh; } }
/* Touch screens have no keyboard to use the shortcut hints. */
@media (hover: none) and (pointer: coarse) { #palette-hint, .palette-field kbd, .palette-foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-window { translate: none !important; } .hero, .category-card, .entry-card, .page-header { animation: none !important; } }

/* Thumbnails */
.entry-card.has-thumb { padding-top: 0; }
.entry-card.has-thumb .entry-card-head { position: relative; margin: 0 -20px 14px; }
.entry-thumb { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-subtle); border-bottom: 1px solid var(--line); }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .35s ease; }
.entry-card.is-clickable:hover .entry-thumb img { transform: scale(1.04); }
.entry-card.has-thumb .entry-kind { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); }
.entry-card.has-thumb .search-trail { margin-top: 0; }
.hero-window-body.has-shot { padding: 0; gap: 0; }
.hero-shot { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; }
.hero-window-body.has-shot b { padding: 8px 12px 10px; }
.hero-art { height: 300px; }
.hero-window-3 { top: 168px; }

/* Hero cascade */
.hero-art { height: 290px; }
.hero-window { width: 196px; }
.hero-window-1 { top: 0; left: 0; right: auto; transform: rotate(-3deg); }
.hero-window-2 { top: 62px; left: 128px; right: auto; transform: rotate(1deg); }
.hero-window-3 { top: 122px; left: 256px; right: auto; transform: rotate(3deg); z-index: 1; }

/* Cool layer: tilt, recents, theme switch */
.category-card:hover, .entry-card.is-clickable:hover { transform: perspective(900px) translateY(-3px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); }
.theme-toggle { margin-top: 0; }
.switch { position: relative; width: 32px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .22); transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.theme-toggle[aria-pressed="true"] .switch { background: var(--accent); }
.theme-toggle[aria-pressed="true"] .switch::after { transform: translateX(14px); background: var(--nav-bg); }

.recent-section { margin-bottom: 32px; }
.recent-clear { margin: 0; min-height: 36px; padding: 6px 14px; font-size: 13px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.recent-card { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.recent-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.recent-card img { width: 72px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); flex: 0 0 auto; }
.recent-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-text small { font-size: 12px; color: var(--quiet); }
.recent-card > .icon svg { width: 16px; height: 16px; color: var(--quiet); }

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1622; --surface: #12263a; --surface-subtle: #1a3149;
  --ink: #e8eff6; --muted: #a9bccd; --quiet: #8fa4b8;
  --line: #254058; --line-strong: #3d5a76;
  --primary: #8cc4f2; --primary-hover: #b3d8f7; --link: #9be26a;
  --success-bg: rgba(155, 226, 106, .14); --focus: #6db3ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow-md: 0 10px 24px rgba(0, 0, 0, .4);
}
:root[data-theme="dark"] body { background: radial-gradient(ellipse 60% 40% at 90% 0%, rgba(155, 226, 106, .05), transparent 70%), radial-gradient(ellipse 50% 40% at 0% 100%, rgba(60, 130, 200, .09), transparent 70%), var(--bg); background-attachment: fixed; }
:root[data-theme="dark"] .primary-button { color: #0b1622; }
:root[data-theme="dark"] .skip-link { color: #0b1622; }
:root[data-theme="dark"] .page-header { background: linear-gradient(120deg, var(--surface), #0f2033); }
:root[data-theme="dark"] .page-emblem { border: 1px solid var(--line-strong); }
:root[data-theme="dark"] .empty-state { background: var(--surface); }
:root[data-theme="dark"] .entry-card.is-unavailable { background: #0f1f30; }
:root[data-theme="dark"] .entry-card.has-thumb .entry-kind { background: rgba(11, 22, 34, .85); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .category-card, :root[data-theme="dark"] .entry-card.is-clickable { background-image: radial-gradient(260px circle at var(--mx, -400px) var(--my, -400px), rgba(140, 196, 242, .09), transparent 70%); }
:root[data-theme="dark"] .category-card { --tone-bg: rgba(87, 164, 224, .16); --tone-ink: #8cc4f2; --tone-line: #5aa7e6; }
:root[data-theme="dark"] .category-card:nth-child(2) { --tone-bg: rgba(130, 200, 80, .16); --tone-ink: #9be26a; --tone-line: #7ec44a; }
:root[data-theme="dark"] .category-card:nth-child(3) { --tone-bg: rgba(150, 125, 230, .18); --tone-ink: #c1b2f5; --tone-line: #9d86e6; }
:root[data-theme="dark"] .category-card:nth-child(4) { --tone-bg: rgba(230, 170, 70, .16); --tone-ink: #f0c673; --tone-line: #e0a63a; }
:root[data-theme="dark"] .entry-card { --tile-bg: rgba(87, 164, 224, .16); --tile-ink: #8cc4f2; }
:root[data-theme="dark"] .entry-card.tone-sage { --tile-bg: rgba(130, 200, 80, .16); --tile-ink: #9be26a; }
:root[data-theme="dark"] .entry-card.tone-lavender { --tile-bg: rgba(150, 125, 230, .18); --tile-ink: #c1b2f5; }
:root[data-theme="dark"] .entry-card.tone-sand { --tile-bg: rgba(230, 170, 70, .16); --tile-ink: #f0c673; }
:root[data-theme="dark"] .palette-foot { background: var(--surface-subtle); }
:root[data-theme="dark"] .palette-item[aria-selected="true"] { background: #1f3b57; }
:root[data-theme="dark"] .topbar-logo { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .site-footer { border-top-color: var(--line); }
:root[data-theme="dark"] .hero { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { .category-card:hover, .entry-card.is-clickable:hover { transform: none; } }

/* More interaction: view toggle, hero hover, image shimmer, search highlight */
.toolbar-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.view-toggle { display: inline-flex; background: var(--surface-subtle); border-radius: 10px; }
.view-button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; transition: background .15s ease, color .15s ease; }
.view-button .icon svg { width: 18px; height: 18px; }
.view-button:hover { color: var(--ink); }
.view-button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.entry-grid.is-list { grid-template-columns: 1fr; gap: 10px; }
.is-list .entry-card { display: grid; grid-template-columns: 176px minmax(0, 1fr) auto; grid-template-areas: "head title foot" "head desc foot"; column-gap: 20px; align-items: center; min-height: 0; padding: 12px 20px 12px 12px; }
.is-list .entry-card-head { grid-area: head; margin: 0 !important; display: block; }
.is-list .entry-thumb { border: 1px solid var(--line); border-radius: 8px; }
.is-list .entry-title { grid-area: title; align-self: end; }
.is-list .entry-description { grid-area: desc; align-self: start; margin-top: 4px; }
.is-list .entry-footer { grid-area: foot; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 0; margin: 0; }
.is-list .search-trail { display: none; }
.is-list .entry-card:not(.has-thumb) .entry-kind { display: none; }
.is-list .entry-card.has-thumb .entry-kind { top: 6px; right: 6px; }
.is-list .entry-card.is-clickable:hover, .is-list .entry-card.is-clickable:active { transform: translateX(3px); }

a.hero-window { display: block; color: #0f2236; cursor: pointer; transition: translate .25s ease-out, scale .2s ease, box-shadow .2s ease; }
a.hero-window:hover { scale: 1.06; z-index: 5; box-shadow: 0 28px 48px -14px rgba(0, 0, 0, .65); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(420px circle at calc((var(--px, 0) + .5) * 100%) calc((var(--py, 0) + .5) * 100%), rgba(184, 250, 104, .16), transparent 60%); }
.hero:hover::after { opacity: 1; }
.hero > * { z-index: 1; }

.entry-thumb { background: linear-gradient(100deg, var(--surface-subtle) 40%, var(--surface) 50%, var(--surface-subtle) 60%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
.entry-thumb.is-loaded { animation: none; background: var(--surface-subtle); }
.entry-thumb img { opacity: 0; transition: opacity .4s ease, transform .35s ease; }
.entry-thumb.is-loaded img { opacity: 1; }
@keyframes shimmer { to { background-position: -200% 0; } }

mark { background: rgba(184, 250, 104, .55); color: inherit; border-radius: 3px; padding: 0 2px; }
:root[data-theme="dark"] mark { background: rgba(155, 226, 106, .3); }

@media (max-width: 700px) {
  .toolbar-tools { width: 100%; }
  .toolbar-tools .search-wrap { flex: 1 1 0; width: auto; }
  .is-list .entry-card { grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "head title" "head desc" "foot foot"; column-gap: 14px; row-gap: 4px; }
  .is-list .entry-footer { flex-direction: row; justify-content: space-between; align-items: center; padding-top: 8px; }
}
