:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #eef1f8;
  --text: #101124;
  --text-muted: #525870;
  --border: rgba(16, 17, 36, 0.1);
  --purple: #7658ff;
  --pink: #f052a0;
  --teal: #08a6a6;
  --orange: #e99a30;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 12px 32px -12px rgba(16, 17, 36, 0.14);
  --radius: 18px;
}

html.dark {
  --bg: #101124;
  --surface: #171936;
  --surface-alt: #11132b;
  --text: #f8fafc;
  --text-muted: #a6aec8;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

html[dir='ltr'] body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: 20px;
}

.main-shell {
  flex: 1;
}

.gradient-text {
  background: linear-gradient(135deg, #7658ff 0%, #f052a0 52%, #08a6a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--purple);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 26px -8px rgba(118, 88, 255, 0.55);
}

.btn-teal {
  background: var(--teal);
  color: #ffffff;
  border: none;
}

.btn-danger {
  color: var(--danger);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  padding: 2px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark-inner {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: #101124;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(118, 88, 255, 0.16);
  color: var(--text);
}

.nav-badge {
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-btn {
  display: none;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  background: var(--bg);
}

.mobile-drawer.open {
  display: grid;
  gap: 6px;
}

/* Hero */
.hero {
  padding: 68px 0 60px;
  border-bottom: 1px solid var(--border);
  background-image:
    radial-gradient(at 15% 20%, rgba(118, 88, 255, 0.22) 0px, transparent 52%),
    radial-gradient(at 85% 15%, rgba(240, 82, 160, 0.16) 0px, transparent 48%),
    radial-gradient(at 50% 90%, rgba(8, 166, 166, 0.14) 0px, transparent 52%);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(118, 88, 255, 0.35);
  background: rgba(118, 88, 255, 0.12);
  color: #b7a8ff;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
}

html:not(.dark) .hero-badge {
  color: var(--purple);
}

.hero h1 {
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.hero p {
  max-width: 680px;
  margin-inline: auto;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero-cta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Search Box */
.search-wrap {
  position: relative;
  max-width: 780px;
  margin-inline: auto;
}

.search-box {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 10px;
}

.search-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
}

.search-select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  text-align: start;
  display: none;
}

.search-dropdown.open {
  display: block;
}

.search-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  text-align: start;
}

.search-item:hover {
  background: rgba(118, 88, 255, 0.12);
}

/* Sections & Grids */
.section {
  padding-top: 56px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.7rem;
  font-weight: 800;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Cards */
.card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(118, 88, 255, 0.45);
}

.cat-stripe {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pill-ready {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.pill-soon {
  background: rgba(233, 154, 48, 0.16);
  color: #e99a30;
}

.card h3 {
  font-size: 1.06rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  color: var(--text-muted);
  display: inline-flex;
}

.fav-btn.active {
  color: var(--pink);
}

/* Why ORVIX Panel */
.features-panel {
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 38px;
}

.feature-tile {
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 20px;
}

/* Tool Workspace */
.page-wrap {
  padding-block: 38px;
}

.workspace-card {
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow);
}

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.input,
.textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus,
.textarea:focus {
  border-color: var(--purple);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--teal);
  background: rgba(8, 166, 166, 0.08);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.stat-val {
  font-size: 1.55rem;
  font-weight: 800;
}

.alert {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.alert-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.alert-info {
  background: rgba(118, 88, 255, 0.12);
  border: 1px solid rgba(118, 88, 255, 0.3);
  color: #a996ff;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.tab-btn.active {
  background: var(--purple);
  color: #fff;
}

.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: var(--purple);
  color: #fff;
  border-color: transparent;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-notes {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 44px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

.footer h4 {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer ul {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--purple);
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 980px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .search-box {
    flex-direction: column;
  }
  .grid-3,
  .grid-4,
  .grid-2,
  .meta-notes,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .features-panel,
  .workspace-card {
    padding: 20px;
  }
}