:root {
  --ink: #FFFFFF;
  --muted: #94A3B8;
  --line: rgba(255, 255, 255, 0.1);
  --panel: #161F33;
  --soft: #111827;
  --blue: #3B82F6;
  --red: #EF4444;
  --yellow: #FF7A00;
  --green: #22C55E;
  --dark: #0B1020;
  --dark-2: #111827;
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--dark);
  min-width: 320px;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.promo-bar {
  min-height: 56px;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 18px;
  font-weight: 700;
  text-align: center;
  color: #0B1020;
}
.promo-button, .ghost-button, .primary-button, .outline-dark, .outline-light {
  border-radius: 999px;
  min-height: 40px;
  padding: 0 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
}
.primary-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.ghost-button { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); }
.outline-dark { background: transparent; }
.outline-light { color: #fff; border-color: #fff; background: transparent; }
.full { width: 100%; justify-content: center; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 66px;
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 44px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
  flex: 1;
  min-width: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link::after {
  content: "v";
  margin-left: 6px;
  font-size: 12px;
}
.nav-link.active::after { content: "^"; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-grid {
  width: 38px;
  height: 38px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(3, 4px);
  justify-content: center;
  align-content: center;
  gap: 4px;
  border-radius: var(--radius);
}
.icon-grid span {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--ink);
}
.avatar-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF7A00, #8B5CF6);
  color: #fff;
  font-weight: 900;
}

.mega-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 122px;
  z-index: 45;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  padding: 42px clamp(24px, 16vw, 360px);
}
.mega-inner {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.2fr 270px;
  gap: 44px;
}
.mega-column h3 {
  font-size: 15px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.mega-link {
  display: block;
  padding: 8px 0;
  font-weight: 700;
}
.mega-link small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.mega-promo {
  background: var(--panel);
  color: #fff;
  min-height: 280px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: var(--radius);
}
.mega-promo img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--green);
  margin-bottom: 16px;
  border-radius: var(--radius);
}

.app-switcher, .profile-menu {
  position: fixed;
  z-index: 60;
  right: 96px;
  top: 134px;
  width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.switcher-app {
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 82px;
  font-weight: 700;
  color: var(--ink);
}
.app-badge {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #FF7A00, #8B5CF6);
  display: inline-grid;
  place-items: center;
  font-weight: 900;
}
.profile-menu {
  right: 24px;
  width: 330px;
  background: var(--panel);
  color: #fff;
}
.profile-menu a, .profile-menu button {
  width: 100%;
  display: block;
  text-align: left;
  color: #fff;
  background: transparent;
  border: 0;
  padding: 12px 0;
  font-weight: 700;
}
.profile-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 10px;
}

.hero-section {
  min-height: 740px;
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.15), rgba(139, 92, 246, 0.1)), var(--dark);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  align-items: center;
  gap: 30px;
  padding: 72px clamp(24px, 7vw, 110px);
  overflow: hidden;
}
.eyebrow {
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
}
.hero-copy h1 {
  font-size: clamp(56px, 8vw, 118px);
  line-height: .92;
  margin: 28px 0;
  letter-spacing: 0;
}
.hero-copy p {
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.45;
  max-width: 790px;
  color: var(--muted);
}
.hero-actions { display: flex; gap: 18px; margin-top: 28px; }
.hero-art {
  min-height: 540px;
  position: relative;
  display: grid;
  place-items: center;
}
.shape-board {
  position: absolute;
  inset: 30px 0 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 10px;
  transform: rotate(-3deg);
}
.shape-panel {
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 38px rgba(0,0,0,.3);
  border-radius: var(--radius);
}
.panel-pink {
  grid-column: 3 / 6;
  grid-row: 1 / 3;
  background: #ff2fb8;
}
.panel-blue {
  grid-column: 1 / 4;
  grid-row: 2 / 5;
  background: #27a7c9;
}
.panel-yellow {
  grid-column: 4 / 7;
  grid-row: 3 / 6;
  background: #f7dc00;
}
.studio-card {
  position: relative;
  z-index: 2;
  width: min(520px, 92vw);
  background: rgba(22, 31, 51, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  backdrop-filter: blur(20px);
}
.studio-card h2 {
  font-size: clamp(34px, 4vw, 58px);
  margin: 12px 0;
}
.badge {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #FF7A00, #8B5CF6);
  color: #fff;
  border-radius: 8px;
  font-weight: 900;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.tool-grid span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.story-grid, .catalog-section, .pricing-section {
  padding: 56px clamp(20px, 5vw, 72px);
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.story-card {
  min-height: 360px;
  border-radius: var(--radius);
  padding: 28px;
  color: #fff;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.story-card.yellow { background: linear-gradient(135deg, rgba(255, 122, 0, 0.2), rgba(255, 122, 0, 0.05)); color: #fff; }
.story-card.blue { background: var(--soft); }
.story-card h3 { font-size: 28px; margin: 0 0 12px; color: #0F172A; }
.story-card p { color: #0F172A; line-height: 1.5; margin: 0; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.section-heading h2 {
  font-size: clamp(30px, 4vw, 54px);
  margin: 0;
}
.section-heading p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.5;
}
.centered { text-align: center; display: block; }
.centered p { margin: 12px auto 0; }
.category-tabs, .pricing-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.category-tabs button, .pricing-tabs button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 800;
  color: var(--muted);
}
.category-tabs button.active, .pricing-tabs button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.app-card, .plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-height: 190px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-card h3, .plan-card h3 { margin: 0; font-size: 20px; }
.app-card p, .plan-card p { color: var(--muted); line-height: 1.45; margin: 0; }
.app-card footer, .plan-card footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.plan-card.featured {
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.15);
}
.price { font-size: 30px; font-weight: 900; }
.features {
  list-style: none;
  padding: 0;
  margin: 8px 0 18px;
}
.features li {
  padding: 7px 0;
  color: var(--muted);
}
.features li::before {
  content: "+";
  margin-right: 8px;
  font-weight: 900;
  color: var(--yellow);
}

.workspace {
  min-height: calc(100vh - 66px);
  background: var(--dark);
  color: #fff;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px;
}
.workspace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-item {
  border: 0;
  border-radius: var(--radius);
  min-height: 52px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.side-item.active { background: rgba(255, 122, 0, 0.15); color: var(--yellow); }
.workspace-main, .recent-panel {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 24px;
}
.workspace-hero {
  min-height: 420px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.15), rgba(139, 92, 246, 0.1)), var(--dark);
  display: grid;
  place-items: center;
  padding: 28px;
}
.workspace-hero h2 { font-size: clamp(34px, 5vw, 58px); }
.prompt-box {
  width: min(980px, 100%);
  background: rgba(11, 16, 32, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.prompt-box textarea {
  width: 100%;
  min-height: 100px;
  border: 0;
  background: transparent;
  color: #fff;
  resize: vertical;
  outline: none;
}
.workspace-cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.workspace-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 130px;
}
.recent-panel { display: flex; flex-direction: column; }
.empty-file {
  margin: auto;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.modal, .admin-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.7);
  display: grid;
  place-items: center;
  padding: 18px;
}
.auth-shell {
  width: min(1120px, 100%);
  min-height: 660px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.auth-visual {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.2), rgba(139, 92, 246, 0.15)), var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 54px;
}
.auth-brand { font-size: 52px; font-weight: 900; }
.auth-card {
  position: relative;
  padding: 54px min(5vw, 72px);
  overflow-y: auto;
  color: var(--ink);
}
.close-button {
  position: absolute;
  right: 18px;
  top: 18px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-weight: 900;
}
.auth-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.auth-tabs button {
  border: 0;
  background: transparent;
  padding: 12px 0;
  font-weight: 900;
  color: var(--muted);
}
.auth-tabs button.active { color: var(--blue); }
.auth-panel h2 { font-size: 42px; margin: 0 0 24px; }
.auth-panel label, .admin-grid label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 700;
}
.auth-panel input, .auth-panel select, .admin-grid input, .admin-grid textarea {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.auth-panel textarea, .admin-grid textarea { min-height: 92px; padding-top: 12px; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 26px 0;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.social-list {
  display: grid;
  gap: 12px;
}
.social-list button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  color: var(--ink);
}
.social-list button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.message {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.message.error { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.message.success { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.2); }

.admin-card {
  position: relative;
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.admin-grid label:last-child { grid-column: 1 / -1; }
.admin-actions { display: flex; gap: 12px; margin: 14px 0 20px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 130px 92px 120px auto auto auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.user-row input, .user-row select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.danger-button {
  border: 0;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 900;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.stat-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card strong {
  display: block;
  font-size: 28px;
}
.stat-card span {
  color: var(--muted);
  font-weight: 800;
}

.ai-tools-section {
  margin-top: 28px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 22px;
}
.dark-heading {
  color: #fff;
}
.dark-heading p {
  color: #cfd6df;
}
.ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ai-tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
}
.ai-tool-card h3 {
  margin: 12px 0 6px;
}
.ai-tool-card p {
  color: var(--muted);
  min-height: 42px;
}
.ai-tool-card form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.ai-tool-card input,
.ai-tool-card select,
.ai-tool-card textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--dark);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.ai-tool-card textarea {
  min-height: 82px;
  resize: vertical;
}
.tool-result {
  margin-top: 14px;
  background: var(--dark);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
}
.tool-output-text {
  white-space: pre-line;
}
.tool-result img,
.tool-result video,
.tool-result audio {
  width: 100%;
  max-height: 360px;
  margin-top: 10px;
  border-radius: 10px;
}
.ai-history {
  margin-top: 18px;
  color: #fff;
}
.history-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.history-row span {
  font-weight: 900;
  text-transform: capitalize;
}
.history-row small {
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 42px clamp(22px, 6vw, 84px);
  background: var(--soft);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .site-header { padding: 10px 18px; flex-wrap: wrap; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; }
  .mega-menu { top: 130px; padding: 28px; }
  .mega-inner { grid-template-columns: 1fr 1fr; }
  .hero-section { grid-template-columns: 1fr; }
  .story-grid, .apps-grid, .pricing-grid, .workspace-cards, .ai-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 64px 1fr; }
  .recent-panel { display: none; }
}

@media (max-width: 720px) {
  .promo-bar { flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .ghost-button { display: none; }
  .hero-section { padding: 44px 20px; min-height: auto; }
  .hero-art { min-height: 420px; }
  .story-grid, .apps-grid, .pricing-grid, .workspace-cards, .admin-grid, .ai-tools-grid, .admin-stats { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-visual { min-height: 180px; padding: 28px; }
  .auth-card { padding: 34px 22px; }
  .workspace { grid-template-columns: 1fr; padding: 10px; }
  .workspace-sidebar { flex-direction: row; overflow-x: auto; }
  .app-switcher, .profile-menu { right: 12px; left: 12px; width: auto; top: 150px; }
  .mega-inner { grid-template-columns: 1fr; }
  .footer { display: block; }
}
