/* ============================================================
   Jivora — style.css
   Design system: tokens, base, header, hero, sections, footer,
   search overlay, simple pages, responsive rules.
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  color-scheme: dark;

  --bg: #070a14;
  --bg-2: #0a0f1e;
  --bg-grad: radial-gradient(1100px 520px at 15% -10%, rgba(79, 124, 255, 0.14), transparent 60%),
             radial-gradient(900px 500px at 90% 0%, rgba(139, 92, 246, 0.12), transparent 60%);

  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --field: rgba(8, 13, 27, 0.72);
  --header-bg: rgba(7, 10, 20, 0.72);

  --border: rgba(148, 163, 217, 0.16);
  --border-2: rgba(148, 163, 217, 0.32);

  --text: #e9eeff;
  --text-2: #a9b4cf;
  --text-3: #77829d;

  --blue: #4f7cff;
  --sky: #38bdf8;
  --purple: #8b5cf6;
  --cyan: #34d8f0;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;

  --grad: linear-gradient(135deg, #4f7cff 0%, #8b5cf6 60%, #6d5cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 124, 255, 0.16), rgba(139, 92, 246, 0.16));

  --shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 34px 90px -34px rgba(0, 0, 0, 0.75);
  --glow: 0 14px 34px -14px rgba(79, 124, 255, 0.55);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f8fd;
  --bg-2: #eef2fb;
  --bg-grad: radial-gradient(1100px 520px at 15% -10%, rgba(79, 124, 255, 0.12), transparent 60%),
             radial-gradient(900px 500px at 90% 0%, rgba(139, 92, 246, 0.1), transparent 60%);

  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-3: #ffffff;
  --field: #ffffff;
  --header-bg: rgba(246, 248, 253, 0.78);

  --border: rgba(21, 35, 77, 0.12);
  --border-2: rgba(21, 35, 77, 0.24);

  --text: #101a33;
  --text-2: #4c5878;
  --text-3: #6d7997;

  --grad-soft: linear-gradient(135deg, rgba(79, 124, 255, 0.12), rgba(139, 92, 246, 0.12));

  --shadow: 0 18px 46px -26px rgba(24, 39, 84, 0.35);
  --shadow-lg: 0 30px 80px -34px rgba(24, 39, 84, 0.4);
  --glow: 0 14px 30px -14px rgba(79, 124, 255, 0.4);
}

/* ---------- 2. Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* very light film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="light"] body::after {
  opacity: 0.045;
}

main {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
}

img,
svg,
canvas {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

::selection {
  background: rgba(79, 124, 255, 0.4);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

body.is-locked {
  overflow: hidden;
}

[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;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 28px;
  }
}

.section {
  padding: 84px 0;
  position: relative;
}

.section--sm {
  padding: 56px 0;
}

@media (max-width: 640px) {
  .section {
    padding: 60px 0;
  }
  .section--sm {
    padding: 44px 0;
  }
}

.mono {
  font-family: var(--mono);
}

.grad-text {
  color: var(--blue);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* section headings */

.section-head {
  max-width: 680px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head--left {
  margin-left: 0;
  text-align: left;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.section-sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 1.05rem;
}

/* ---------- 3. Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: none;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
}

.btn--primary:hover {
  box-shadow: 0 18px 40px -14px rgba(124, 92, 255, 0.75);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: rgba(79, 124, 255, 0.55);
}

.btn--soft {
  background: rgba(79, 124, 255, 0.13);
  border-color: rgba(79, 124, 255, 0.3);
  color: var(--text);
}

.btn--soft:hover {
  background: rgba(79, 124, 255, 0.2);
}

.btn--lg {
  min-height: 54px;
  padding: 14px 28px;
  font-size: 1rem;
}

.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: 11px;
}

.btn--block {
  width: 100%;
}

.btn.is-success {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.5);
  color: var(--ok);
  box-shadow: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-2);
}

.pill svg {
  width: 15px;
  height: 15px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 3px 7px;
  margin: 0 2px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

/* ---------- 4. Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.6);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  flex: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(79, 124, 255, 0.8);
  flex: none;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name .brand-j {
  background: var(--grad);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name .brand-j {
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 22px;
}

.nav-link {
  position: relative;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.is-active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* theme toggle icon swap */
.ic-sun,
.ic-moon {
  display: none;
}

.ic-sun {
  display: block;
}

[data-theme="light"] .ic-sun {
  display: none;
}

[data-theme="light"] .ic-moon {
  display: block;
}

/* burger */
.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* mobile menu */
.mobile-menu {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px 20px 22px;
  animation: menu-in 0.22s var(--ease);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu a,
.mobile-menu .mobile-search-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.mobile-menu a:hover,
.mobile-menu .mobile-search-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.mobile-menu a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.mobile-search-btn {
  border: 1px dashed var(--border-2) !important;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }
}

@media (min-width: 901px) {
  .menu-toggle,
  .mobile-menu {
    display: none !important;
  }
}

/* ---------- 5. Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 84px;
  isolation: isolate;
}

@media (max-width: 640px) {
  .hero {
    padding: 52px 0 60px;
  }
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  z-index: -2;
  pointer-events: none;
  animation: blob-drift 17s ease-in-out infinite alternate;
  will-change: transform;
}

.hero-blob--1 {
  width: 520px;
  height: 520px;
  top: -190px;
  left: -140px;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.5), transparent 65%);
}

.hero-blob--2 {
  width: 460px;
  height: 460px;
  top: -60px;
  right: -130px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 65%);
  animation-delay: -6s;
}

.hero-blob--3 {
  width: 380px;
  height: 380px;
  bottom: -220px;
  left: 38%;
  opacity: 0.4;
  background: radial-gradient(circle, rgba(52, 216, 240, 0.4), transparent 65%);
  animation-delay: -11s;
}

@keyframes blob-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(34px, -26px, 0) scale(1.07); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 217, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 217, 0.075) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 36%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 36%, #000 40%, transparent 100%);
}

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(21, 35, 77, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 77, 0.06) 1px, transparent 1px);
}

.hero-inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
              linear-gradient(135deg, rgba(79, 124, 255, 0.75), rgba(139, 92, 246, 0.75)) border-box;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 26px;
  animation: fade-up 0.6s var(--ease) both;
}

.hero-title {
  font-size: clamp(2.35rem, 6.4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  animation: fade-up 0.6s 0.06s var(--ease) both;
}

.hero-sub {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: clamp(1.02rem, 2vw, 1.16rem);
  color: var(--text-2);
  animation: fade-up 0.6s 0.12s var(--ease) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* hero search */

.hero-search {
  position: relative;
  max-width: 640px;
  margin: 36px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  animation: fade-up 0.6s 0.18s var(--ease) both;
}

.hero-search:focus-within {
  border-color: rgba(79, 124, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.18), var(--shadow);
}

.hero-search-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--text-3);
}

.hero-search-icon svg {
  width: 100%;
  height: 100%;
}

.hero-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: none;
  background: none;
  outline: none;
  font-size: 1.06rem;
  color: var(--text);
  transition: opacity 0.22s ease;
  appearance: none;
}

.hero-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.hero-input::placeholder {
  color: var(--text-3);
}

.hero-input.is-fading {
  opacity: 0.25;
}

.hero-tip {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  animation: fade-up 0.6s 0.24s var(--ease) both;
}

/* hero dropdown results (uses .search-list styles below) */

.hero-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  text-align: left;
  animation: fade-up 0.22s var(--ease) both;
}

/* ---------- 6. Search results (shared: overlay + hero) ---------- */

.search-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}

.search-result:hover,
.search-result.is-active {
  background: var(--surface-2);
  border-color: var(--border);
}

.search-result.is-active {
  border-color: rgba(79, 124, 255, 0.55);
}

.search-result.is-soon {
  cursor: default;
  opacity: 0.75;
}

.result-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--sky);
  border: 1px solid var(--border);
}

.result-icon svg {
  width: 21px;
  height: 21px;
}

.result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-name {
  font-weight: 600;
  font-size: 0.97rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-3);
}

.result-cat {
  flex: none;
  font-weight: 600;
  color: var(--sky);
}

.result-desc {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-tag {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(79, 124, 255, 0.16);
  color: #86a6ff;
  border: 1px solid rgba(79, 124, 255, 0.4);
}

[data-theme="light"] .result-tag {
  color: #3556c9;
}

.result-tag.is-soon {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border-2);
}

.search-note {
  padding: 8px 14px 4px;
  font-size: 0.83rem;
  color: var(--text-3);
}

.search-empty {
  padding: 22px 18px 8px;
  text-align: center;
}

.search-empty-title {
  font-weight: 700;
  font-size: 1.04rem;
}

.search-empty-sub {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-3);
}

/* ---------- 7. Search overlay ---------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 20px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}

[data-theme="light"] .search-backdrop {
  background: rgba(21, 30, 56, 0.4);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: panel-in 0.24s var(--ease) both;
}

[data-theme="light"] .search-panel {
  background: rgba(255, 255, 255, 0.96);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-field-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--text-3);
}

.search-field-icon svg {
  width: 100%;
  height: 100%;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: none;
  background: none;
  outline: none;
  font-size: 1.08rem;
  color: var(--text);
  appearance: none;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-input::placeholder {
  color: var(--text-3);
}

.search-esc {
  flex: none;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.search-esc:hover {
  color: var(--text);
  border-color: rgba(79, 124, 255, 0.5);
}

.search-results {
  max-height: min(46vh, 420px);
  overflow-y: auto;
  padding: 8px;
}

.search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-3);
}

.search-hint-private {
  margin-left: auto;
  color: var(--ok);
}

/* ---------- 8. Trust strip ---------- */

.trust {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(79, 124, 255, 0.05), transparent);
  padding: 26px 0;
}

[data-theme="light"] .trust {
  background: linear-gradient(180deg, rgba(79, 124, 255, 0.05), transparent);
}

.trust-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 13px;
  justify-content: center;
}

.trust-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--sky);
}

.trust-icon svg {
  width: 21px;
  height: 21px;
}

.trust-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.trust-label {
  font-weight: 700;
  font-size: 0.97rem;
}

.trust-sub {
  font-size: 0.8rem;
  color: var(--text-3);
}

@media (max-width: 900px) {
  .trust-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 14px;
  }
  .trust-item {
    justify-content: flex-start;
  }
}

/* ---------- 9. Tool cards ---------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease,
    background-color 0.22s ease;
  overflow: hidden;
}

a.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 124, 255, 0.5);
  box-shadow: var(--shadow), 0 0 0 1px rgba(79, 124, 255, 0.18);
  background: var(--surface-2);
}

a.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.22s ease;
}

a.tool-card:hover::before {
  opacity: 1;
}

.tool-card__icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--cat-bg, var(--grad-soft));
  border: 1px solid var(--border);
  color: var(--cat-color, var(--sky));
  margin-bottom: 8px;
}

.tool-card__icon svg {
  width: 26px;
  height: 26px;
}

.tool-card__cat {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cat-color, var(--sky));
}

.tool-card__name {
  font-size: 1.13rem;
  font-weight: 700;
}

.tool-card__desc {
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.6;
  flex: 1;
}

.tool-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sky);
}

.tool-card__foot svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s var(--ease);
}

a.tool-card:hover .tool-card__foot svg {
  transform: translateX(4px);
}

.tool-card--soon {
  opacity: 0.72;
}

.tool-card--soon .tool-card__foot {
  color: var(--text-3);
  font-weight: 600;
}

/* category tints */
[data-cat="student"] { --cat-color: #38bdf8; --cat-bg: rgba(56, 189, 248, 0.12); }
[data-cat="finance"] { --cat-color: #34d399; --cat-bg: rgba(52, 211, 153, 0.12); }
[data-cat="developer"] { --cat-color: #a78bfa; --cat-bg: rgba(167, 139, 250, 0.13); }
[data-cat="text"] { --cat-color: #60a5fa; --cat-bg: rgba(96, 165, 250, 0.12); }
[data-cat="image"] { --cat-color: #f472b6; --cat-bg: rgba(244, 114, 182, 0.12); }
[data-cat="everyday"] { --cat-color: #fbbf24; --cat-bg: rgba(251, 191, 36, 0.12); }

/* ---------- 10. Categories ---------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.cat-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.cat-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-card__icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--cat-bg, var(--grad-soft));
  border: 1px solid var(--border);
  color: var(--cat-color, var(--sky));
}

.cat-card__icon svg {
  width: 24px;
  height: 24px;
}

.cat-card__title {
  font-size: 1.1rem;
}

.cat-card__count {
  font-size: 0.8rem;
  color: var(--text-3);
}

.cat-card__blurb {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease,
    transform 0.16s var(--ease);
}

a.tool-chip:hover {
  border-color: rgba(79, 124, 255, 0.6);
  background: rgba(79, 124, 255, 0.12);
  color: var(--text);
  transform: translateY(-2px);
}

.tool-chip.is-soon {
  opacity: 0.62;
  cursor: default;
}

.tool-chip small {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border-left: 1px solid var(--border-2);
  padding-left: 7px;
}

/* ---------- 11. Privacy band ---------- */

.privacy-band {
  padding: 10px 0 90px;
}

.privacy-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  padding: 34px 30px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(79, 124, 255, 0.65), rgba(139, 92, 246, 0.55), rgba(52, 216, 240, 0.5)) border-box;
  box-shadow: var(--shadow);
}

.privacy-card__icon {
  flex: none;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--ok);
}

.privacy-card__icon svg {
  width: 28px;
  height: 28px;
}

.privacy-card__text {
  text-align: left;
}

.privacy-card__title {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
}

.privacy-card__sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 560px;
}

@media (max-width: 560px) {
  .privacy-card {
    flex-direction: column;
    text-align: center;
  }
  .privacy-card__text {
    text-align: center;
  }
}

/* ---------- 12. Footer ---------- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(79, 124, 255, 0.05));
  padding: 64px 0 0;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px 28px;
}

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

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

.footer-brand .brand {
  font-size: 1.25rem;
}

.footer-tagline {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.83rem;
  color: var(--ok);
}

.footer-privacy svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.footer-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-links a {
  display: inline-block;
  padding: 7px 0;
  color: var(--text-2);
  font-size: 0.94rem;
  transition: color 0.16s ease, transform 0.16s var(--ease);
}

.footer-links a:hover {
  color: var(--text);
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 52px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.86rem;
}

.footer-bottom-note {
  color: var(--text-3);
}

/* ---------- 13. Simple pages (about, privacy, 404…) ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 46px;
  border-bottom: 1px solid var(--border);
}

.page-hero .hero-blob {
  filter: blur(84px);
  opacity: 0.5;
}

.page-hero__inner {
  position: relative;
  max-width: 760px;
}

.page-hero__kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 14px;
}

.page-hero__title {
  font-size: clamp(2rem, 4.6vw, 2.9rem);
}

.page-hero__lead {
  margin-top: 16px;
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 640px;
}

.prose {
  max-width: 760px;
  color: var(--text-2);
  font-size: 1.0rem;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.1em;
  font-size: 1.45rem;
  color: var(--text);
}

.prose h3 {
  margin-top: 1.7em;
  font-size: 1.14rem;
  color: var(--text);
}

.prose strong {
  color: var(--text);
}

.prose a {
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(56, 189, 248, 0.45);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}

.prose li::marker {
  color: var(--blue);
}

.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(79, 124, 255, 0.35);
  background: rgba(79, 124, 255, 0.09);
  color: var(--text-2);
  font-size: 0.95rem;
}

.callout strong {
  color: var(--text);
}

.callout svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--sky);
  margin-top: 2px;
}

/* FAQ */

.faq {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0 20px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.faq details[open] {
  border-color: rgba(79, 124, 255, 0.45);
  background: var(--surface-2);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  min-height: 44px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease), margin-top 0.25s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.faq__answer {
  padding: 0 0 18px;
  margin: 0;
  color: var(--text-2);
  line-height: 1.7;
  font-size: 0.96rem;
}

/* 404 */

.nf {
  text-align: center;
  padding: 80px 0 96px;
  position: relative;
  overflow: hidden;
}

.nf-code {
  font-size: clamp(4.5rem, 15vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.nf-title {
  margin-top: 18px;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.nf-text {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 1.05rem;
}

.nf-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nf-related {
  margin-top: 64px;
  text-align: left;
}

/* ---------- 14. Reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transition-delay: var(--d, 0s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 15. Utilities & motion safety ---------- */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
