:root {
  --bg: #05070f;
  --bg-alt: #0b1223;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-border: rgba(148, 163, 184, 0.24);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --accent: #06b6d4;
  --ring: rgba(59, 130, 246, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(6, 182, 212, 0.2), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.2), transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
}

body[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #eef2ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #475569;
  --primary: #1d4ed8;
  --accent: #0f766e;
  --ring: rgba(29, 78, 216, 0.22);
}

a {
  color: inherit;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(5, 7, 15, 0.75);
  border-bottom: 1px solid var(--surface-border);
  backdrop-filter: blur(12px);
}

body[data-theme="light"] .topbar {
  background: rgba(248, 250, 252, 0.85);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.lang-switch {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
}

.lang-btn.active {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
}

body[data-theme="light"] .lang-btn.active {
  color: #fff;
}

.theme-toggle {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.78rem;
  cursor: pointer;
}

.theme-toggle:focus-visible,
.lang-btn:focus-visible,
.doc-link:focus-visible,
.primary-link:focus-visible,
.secondary-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

main {
  padding: 2rem 0 2.8rem;
}

.hero {
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 1.35rem;
  background: linear-gradient(150deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.4));
}

body[data-theme="light"] .hero {
  background: linear-gradient(145deg, rgba(29, 78, 216, 0.12), rgba(15, 23, 42, 0.03));
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.hero p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  max-width: 75ch;
  line-height: 1.65;
}

.meta {
  margin-top: 0.8rem;
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card h2,
.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.doc-link {
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.35);
  padding: 0.68rem 0.74rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

body[data-theme="light"] .doc-link {
  background: rgba(248, 250, 252, 0.9);
}

.doc-link:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.45);
}

.badge {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.primary-link,
.secondary-link {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.primary-link {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
}

.secondary-link {
  border: 1px solid var(--surface-border);
  background: transparent;
}

.policy-wrap {
  margin-top: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.1rem;
}

.policy-wrap h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.policy-wrap h2 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.45rem;
}

.policy-wrap p,
.policy-wrap li {
  color: var(--muted);
  line-height: 1.72;
}

.policy-wrap ul {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
}

.lang-content[data-lang="eng"],
.lang-content[data-lang="swa"] {
  display: none;
}

.lang-content.active {
  display: block;
}

.card-divider {
  border: none;
  border-top: 1px solid var(--surface-border);
  margin: 1rem 0;
}

/* QR Code Modal */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qr-modal-overlay:not([hidden]) {
  opacity: 1;
}

.qr-modal-overlay[hidden] {
  display: none;
}

.qr-modal-panel {
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

body[data-theme="light"] .qr-modal-panel {
  background: #fff;
}

.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--surface-border);
}

.qr-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.qr-modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.qr-modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.qr-modal-body {
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.qr-code-container {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.qr-code-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-url-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
  text-align: center;
}

.qr-modal-footer {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem 1.2rem 1.2rem;
  flex-wrap: wrap;
}

.qr-modal-footer .primary-link,
.qr-modal-footer .secondary-link {
  flex: 1;
  justify-content: center;
  cursor: pointer;
  border: none;
  font: inherit;
  font-weight: 600;
}

.qr-modal-footer .secondary-link {
  background: transparent;
  color: var(--text);
}

.qr-modal-footer .secondary-link:hover {
  background: var(--surface);
}

/* Pitch Deck Modal */
.pitch-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pitch-modal-overlay:not([hidden]) {
  opacity: 1;
}

.pitch-modal-overlay[hidden] {
  display: none;
}

.pitch-modal-panel {
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  max-width: 95vw;
  max-height: 92vh;
  width: 100%;
  height: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-theme="light"] .pitch-modal-panel {
  background: #fff;
}

.pitch-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.pitch-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.pitch-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pitch-modal-share-btn {
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pitch-modal-share-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.pitch-modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pitch-modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

/* Pitch Deck Share Link Modal */
.pitch-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pitch-share-overlay:not([hidden]) {
  opacity: 1;
}

.pitch-share-overlay[hidden] {
  display: none;
}

.pitch-share-panel {
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

body[data-theme="light"] .pitch-share-panel {
  background: #fff;
}

.pitch-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.pitch-share-header h2 {
  margin: 0;
  font-size: 1rem;
}

.pitch-share-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pitch-share-close:hover {
  background: var(--surface);
  color: var(--text);
}

.pitch-share-body {
  padding: 1.5rem 1rem;
}

.pitch-share-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.pitch-share-url-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.7rem 0.8rem;
  outline: none;
}

.pitch-share-copy-btn {
  border: none;
  border-left: 1px solid var(--surface-border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0.7rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  min-width: 70px;
}

.pitch-share-copy-btn:hover {
  background: var(--surface);
  color: var(--primary);
}

.pitch-share-copy-btn i {
  font-size: 1.2rem;
}

.pitch-modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
}

.pitch-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 20px 20px;
}

.footer {
  padding: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

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

@media (max-width: 640px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding-top: 1.2rem;
  }
}
