/* Naola — base styles */

:root {
  --color-bg: #ffffff;
  --color-surface: #f5f6f8;
  --color-text: #1a1d27;
  --color-text-muted: #5f6578;
  --color-primary: #3b74e0;
  --color-primary-hover: #2d5fc4;
  --color-border: #e0e2e8;
  --color-badge-bg: rgba(59, 116, 224, 0.08);
  --color-badge-border: rgba(59, 116, 224, 0.2);
  --color-error-bg: rgba(220, 50, 50, 0.06);
  --color-error-border: rgba(220, 50, 50, 0.2);
  --color-error-text: #c0392b;
  --color-input-bg: #ffffff;
  --color-input-placeholder: #999;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-text: #e4e6ed;
  --color-text-muted: #8b8fa3;
  --color-primary: #4f8cff;
  --color-primary-hover: #6ba0ff;
  --color-border: #2a2d3a;
  --color-badge-bg: rgba(79, 140, 255, 0.1);
  --color-badge-border: rgba(79, 140, 255, 0.25);
  --color-error-bg: rgba(255, 70, 70, 0.1);
  --color-error-border: rgba(255, 70, 70, 0.3);
  --color-error-text: #ff6b6b;
  --color-input-bg: #0f1117;
  --color-input-placeholder: #555;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding-left: clamp(1.5rem, 6vw, 8rem);
  padding-right: clamp(1.5rem, 6vw, 8rem);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

/* Navigation */

.site-header {
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem clamp(1.5rem, 6vw, 8rem);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo:hover {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 1;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.25rem;
}

.nav-link:hover {
  color: var(--color-primary);
}

/* Skip link — visible only when focused. Keyboard + screen-reader users
   tab into it first thing and jump past the header straight to <main>. */

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  /* Offscreen until focused. Keeping it in the layout rather than
     display:none so screen readers still see it in source order. */
  transform: translateY(-110%);
  transition: transform 0.15s ease;
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* Theme toggle */

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Sun visible in dark mode, moon visible in light mode */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-block; vertical-align: middle; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; vertical-align: middle; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Hero */

.hero {
  text-align: center;
  padding: 6rem 0 4rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

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

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Trust bar */

.trust-bar {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.trust-bar p {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.trust-logos {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.trust-more {
  color: var(--color-primary);
  font-weight: 500;
}

/* How it works */

.how-it-works {
  padding: 5rem 0;
  text-align: center;
}

.how-it-works h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--color-text-muted);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

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

.step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Pricing */

.pricing {
  padding: 5rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.pricing h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
}

.pricing-card-highlight {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.pricing-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-badge-bg);
  border: 1px solid var(--color-badge-border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
}

.pricing-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pricing-period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.pricing-intro {
  font-size: 1.15rem;
  color: var(--color-text);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.pricing-list {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.pricing-list li {
  padding: 0.4rem 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.pricing-list li::before {
  content: "\2713";
  color: var(--color-primary);
  font-weight: 700;
  margin-right: 0.6rem;
}

.btn-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 5rem;
}

.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
}

.feature h3 {
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* CTA */

.cta {
  text-align: center;
  padding: 5rem 0;
  border-top: 1px solid var(--color-border);
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.cta p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Docs layout */

.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  padding: 2rem 0;
  gap: 3rem;
}

.docs-sidebar h4 {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-sidebar ul {
  list-style: none;
}

.docs-sidebar li + li {
  margin-top: 0.5rem;
}

.docs-sidebar a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--color-primary);
}

.docs-content {
  max-width: 780px;
  line-height: 1.7;
}

.docs-content h1 {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.docs-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.docs-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.docs-content p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.4rem;
}

.docs-content pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.docs-content code {
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.docs-content pre code {
  background: none;
  padding: 0;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.docs-content th, .docs-content td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.docs-content th {
  font-weight: 600;
  color: var(--color-text);
}

.docs-content td {
  color: var(--color-text-muted);
}

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

.docs-intro {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
}

/* Legal pages */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 0 4rem;
  text-align: center;
}

.legal h1 {
  margin-bottom: 0.25rem;
}

.legal-updated {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.legal h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal p, .legal li {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.legal ul {
  display: inline-block;
  text-align: left;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.legal li + li {
  margin-top: 0.35rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-border);
}

.legal-table th {
  background: var(--color-surface);
  font-weight: 600;
}

.legal-table td {
  color: var(--color-text-muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 6vw, 8rem);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.site-footer p + p {
  margin-top: 0.5rem;
}

.locale-switcher-wrap {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.locale-switcher-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.locale-switcher {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface, transparent);
  color: var(--color-text, inherit);
  cursor: pointer;
  max-width: 220px;
}

.locale-switcher:focus-visible {
  outline: 2px solid var(--color-accent, #1a73e8);
  outline-offset: 2px;
}

.legal-disclaimer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* RTL support — flip navs and reading order for Arabic, Hebrew, Persian, Urdu. */
[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

/* Ad card — self-served banner used on landing and docs pages.
   Rendered by /js/ads.js into any element with [data-ad-slot].
   Mirrors the visual style of the app's AdBanner component so the
   brand stays consistent between naola.net and the app. */

[data-ad-slot]:empty {
  display: none;
}

.ad-card {
  position: relative;
  margin: 2rem 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.ad-card:hover {
  border-color: var(--color-primary);
}

.ad-card-link {
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  min-height: 96px;
}

.ad-card-link:hover {
  color: inherit;
}

.ad-card-image {
  width: 120px;
  height: auto;
  object-fit: cover;
  background: var(--color-surface);
  flex-shrink: 0;
}

.ad-card-body {
  flex: 1;
  padding: 0.9rem 2.4rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.ad-card-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-desc {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-dismiss {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.ad-card-dismiss:hover {
  background: var(--color-border);
  color: var(--color-text);
}

@media (max-width: 520px) {
  .ad-card-image {
    width: 84px;
  }
  .ad-card-body {
    padding: 0.7rem 2.1rem 0.7rem 0.9rem;
  }
  .ad-card-title {
    font-size: 0.9rem;
  }
  .ad-card-desc {
    font-size: 0.8rem;
  }
}
