:root {
  --bg: #fff7ef;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(28, 34, 43, 0.1);
  --text: #1b2632;
  --muted: #657180;
  --accent: #f97316;
  --accent-2: #ef4444;
  --accent-3: #facc15;
  --accent-4: #14b8a6;
  --page: linear-gradient(180deg, #fff7ef 0%, #fff0df 52%, #fff8f2 100%);
  --card-shadow: 0 16px 40px rgba(201, 108, 37, 0.08), 0 4px 12px rgba(201,108,37,0.05);
  --hero-shadow: 0 24px 80px rgba(249, 115, 22, 0.15);
  --hover-shadow: 0 24px 60px rgba(201, 108, 37, 0.15), 0 8px 24px rgba(201,108,37,0.1);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  --bg: #0e1419;
  --surface: rgba(19, 26, 33, 0.84);
  --surface-strong: rgba(19, 26, 33, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f6;
  --muted: #9ca8b4;
  --page: linear-gradient(180deg, #0e1419 0%, #141b21 52%, #10161c 100%);
  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0,0,0,0.2);
  --hero-shadow: 0 24px 80px rgba(249, 115, 22, 0.12);
  --hover-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
  opacity: 0.8;
}

.ambient-one {
  width: 28rem;
  height: 28rem;
  top: 2rem;
  left: -7rem;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.26), transparent 65%);
}

.ambient-two {
  width: 24rem;
  height: 24rem;
  top: 22rem;
  right: -5rem;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.18), transparent 66%);
}

.ambient-three {
  width: 22rem;
  height: 22rem;
  bottom: 4rem;
  left: 34%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.16), transparent 62%);
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner,
.hero-panel,
.story-grid,
.intelligence-grid,
.section-head,
.footer-inner,
.drawer-head,
.toggle-row,
.hero-actions,
.field-row,
.hero-login-card,
.install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-inner {
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand img {
  width: 3rem;
  height: 3rem;
}

.brand-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-sub,
.muted {
  color: var(--muted);
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamburger-btn,
.icon-btn,
.menu-btn,
.mini-toggle,
.solid-btn,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.hamburger-btn:hover,
.icon-btn:hover,
.menu-btn:hover,
.mini-toggle:hover,
.solid-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.hamburger-btn {
  width: 3.55rem;
  height: 3.55rem;
  background: var(--surface);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.36rem;
  padding: 0 0.82rem;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.hero {
  padding: 2rem 0 1.2rem;
}

.hero-panel,
.story-card,
.app-card,
.feedback-card,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface-strong);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
}

.story-card:hover, .app-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--hover-shadow);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.hero-panel {
  padding: 1.8rem;
  align-items: stretch;
  box-shadow: var(--hero-shadow);
}

.hero-copy,
.hero-side {
  min-width: 0;
}

.hero-copy {
  flex: 1.1;
}

.hero-side {
  flex: 0.9;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at top right, rgba(250, 204, 21, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}

.hero-login-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  background: rgba(255,255,255,0.03);
  align-items: flex-start;
}

.hero-login-card strong,
.login-card-mini strong {
  display: block;
  font-size: 1rem;
  margin-top: 0.2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

h1 { font-size: clamp(2.3rem, 6vw, 4.8rem); letter-spacing: -0.06em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.4rem); letter-spacing: -0.05em; }
h3 { font-size: 1.05rem; letter-spacing: -0.03em; }

.hero-copy p,
.story-card p,
.app-card p,
.feedback-card p {
  line-height: 1.7;
}

.solid-btn,
.ghost-btn,
.menu-btn,
.mini-toggle {
  padding: 0.78rem 1.05rem;
  background: var(--surface);
  color: var(--text);
}

.solid-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.solid-btn:hover {
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.3);
}

.mini-toggle.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(20, 184, 166, 0.14));
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.05em;
}

.section {
  padding: 0.8rem 0 1.4rem;
}

.story-grid {
  align-items: stretch;
}

.intelligence-grid {
  align-items: stretch;
}

.story-card {
  flex: 1;
  padding: 1.25rem;
}

.dashboard-card {
  min-height: 100%;
}

.signal-list,
.recent-app-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.signal-item,
.recent-app-item {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 0.95rem 1rem;
  background: rgba(255,255,255,0.03);
}

.signal-item strong,
.recent-app-item strong {
  display: block;
  margin-bottom: 0.24rem;
}

.recent-app-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.recent-app-copy {
  min-width: 0;
}

.recent-app-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.highlight-card {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.14), transparent 34%),
    var(--surface-strong);
}

.section-head {
  align-items: flex-end;
  margin-bottom: 1rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.app-controls {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.search-shell {
  display: grid;
  gap: 0.5rem;
}

.search-shell span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.search-shell input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  background: var(--surface);
  color: var(--text);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.68rem 0.95rem;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-chip:hover,
.filter-chip.active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(20, 184, 166, 0.1));
}

.recommend-shell {
  margin-bottom: 1.1rem;
}

.compact-head {
  margin-bottom: 0.9rem;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.app-card {
  padding: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-4));
}

.app-top,
.app-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.app-top-row {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: flex-start;
}

.app-icon {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.16);
}

.status-pill,
.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 700;
}

.status-pill {
  color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
}

body[data-theme="dark"] .category-pill {
  color: #7dd3c7;
}

.app-tagline {
  margin: 0.45rem 0 0.55rem;
  color: var(--accent);
  font-weight: 700;
}

.app-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.app-card-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: auto;
}

.app-card-actions .solid-btn,
.app-card-actions .ghost-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.app-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0.9rem 0 1rem;
}

.app-card .solid-btn {
  border-radius: 1.15rem;
  padding: 0.92rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.feature-pill {
  background: rgba(255,255,255,0.03);
}

.site-footer {
  padding: 1.2rem 0 2rem;
}

.footer-inner {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  flex-wrap: wrap;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.footer-credit-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.feedback-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: 3.3rem;
  height: 3.3rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--hero-shadow);
  cursor: pointer;
}

.feedback-modal,
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.56);
}

.feedback-modal.open,
.drawer-open {
  display: flex;
}

.feedback-card {
  width: min(540px, 100%);
  padding: 1.2rem;
}

.feedback-card input,
.feedback-card textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.feedback-card textarea {
  min-height: 130px;
  resize: vertical;
}

.install-center-card {
  width: min(760px, 100%);
}

.install-note {
  margin: 0.9rem 0 0;
}

.install-center-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.backup-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.install-row {
  padding: 0.95rem 1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  align-items: flex-start;
}

.install-row h3 {
  margin-bottom: 0.3rem;
}

.install-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.field-block {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.field-block label {
  font-weight: 700;
}

.drawer {
  justify-content: flex-end;
}

.drawer-card {
  width: min(760px, 100%);
  padding: 1rem;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.menu-panel {
  padding: 1rem;
  border-radius: 1.3rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.menu-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.menu-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  background: rgba(255,255,255,0.03);
}

.menu-action-stack {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.login-card-mini {
  margin-top: 0.7rem;
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.icon-btn {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero-panel,
  .story-grid,
  .intelligence-grid,
  .section-head,
  .footer-inner,
  .hero-login-card,
  .install-row {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100%, calc(100% - 0.9rem));
  }

  .hero-panel,
  .story-card,
  .app-card,
  .feedback-card,
  .drawer-card {
    border-radius: 1.5rem;
  }

  .hero-stats,
  .backup-stat-grid,
  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .recent-app-item,
  .app-card-actions,
  .app-top-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* Sathi mobile drawer hotfix */
.drawer {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.drawer-open {
  display: grid;
  align-items: start;
}

.drawer-card {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 720px) {
  .drawer {
    padding: 12px;
  }

  .drawer-card {
    width: 100%;
    margin: 0;
  }
}
