/* ── 1. CSS Variables ───────────────────────────────────────────────────────── */
:root {
  --bg-base:           #0f0f0d;
  --bg-surface:        #161614;
  --bg-card:           #1e1e1b;
  --accent:            #39d353;
  --accent-hover:      #52e56a;
  --accent-tint:       rgba(57,211,83,0.08);
  --accent-tint-border:rgba(57,211,83,0.22);
  --text-primary:      #f0ede8;
  --text-secondary:    #888580;
  --text-muted:        #464340;
  --border:            rgba(255,255,255,0.07);
  --danger:            #f87171;
  --radius:            8px;
  --radius-lg:         14px;
  --radius-pill:       999px;
}

/* ── Light mode overrides ───────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:            #f7f5f2;
  --bg-surface:         #f0ede8;
  --bg-card:            #e8e4de;
  --accent:             #1a5c3a;
  --accent-hover:       #236b45;
  --accent-tint:        #d4ebe0;
  --accent-tint-border: #a8d5bc;
  --text-primary:       #181816;
  --text-secondary:     #5c5950;
  --text-muted:         #9e9b94;
  --border:             rgba(0,0,0,0.09);
  --danger:             #c0392b;
}

/* Hardcoded SVG stroke/fill overrides for light mode */
[data-theme="light"] .pillar-icon svg path,
[data-theme="light"] .pillar-icon svg rect {
  stroke: #1a5c3a;
}

[data-theme="light"] .export-icon svg rect,
[data-theme="light"] .done-icon  svg path:first-child {
  fill: rgba(26,92,58,0.10);
}

[data-theme="light"] .export-icon svg path,
[data-theme="light"] .done-icon  svg path:last-child {
  stroke: #1a5c3a;
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* ── 2. Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── 3. Base ────────────────────────────────────────────────────────────────── */
html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  /* Arabic-first font stack — system fonts with explicit Arabic fallbacks */
  font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic',
               'Helvetica Neue', Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; }

a { color: inherit; }

/* ── 4. Typography ──────────────────────────────────────────────────────────── */
/* Arabic script needs: no tight letter-spacing, generous line-height */
.t-logo    { font-size: 22px;  font-weight: 600; letter-spacing: 0; }
.t-hero    { font-size: 40px;  font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.t-heading { font-size: 24px;  font-weight: 500; letter-spacing: 0; }
.t-label   { font-size: 16px;  font-weight: 500; }
.t-body    { font-size: 15px;  font-weight: 400; color: var(--text-secondary); line-height: 1.75; }
.t-mono    { font-size: 13px;  font-family: monospace; }
.t-caption { font-size: 12px;  color: var(--text-muted); }

/* ── 5. Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px;  font-size: 13px; }

.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.1);
  border-color: var(--danger);
}

/* ── 6. Privacy badge ───────────────────────────────────────────────────────── */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-tint);
  border: 0.5px solid var(--accent-tint-border);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── 7. Top bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-base);
  border-bottom: 0.5px solid var(--border);
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

/* ── 8. Screen utility ──────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - 52px);
}

.screen.active {
  display: flex;
  animation: screen-in 0.18s ease;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LANDING PAGE — index.html
   ══════════════════════════════════════════════════════════════════════════════ */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Landing nav ──────────────────────────────────────────────────────────── */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-base);
  border-bottom: 0.5px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-how {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

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

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  border-bottom: 0.5px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-badge {
  align-self: flex-start;
}

.hero-title {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
}

.hero-accent {
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-note {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Hero mockup */
.hero-mockup {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}

.mockup-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
}

.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  opacity: 0.5;
}

.mockup-url {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-inline-start: 6px;
}

.mockup-body {
  display: flex;
  flex-direction: column;
}

.mockup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
}

.mockup-btn {
  width: 52px;
  height: 22px;
  border-radius: var(--radius);
  background: var(--bg-card);
}

.mockup-count {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.mockup-canvas {
  padding: 16px;
  background: var(--bg-surface);
}

.mockup-image-area {
  position: relative;
  height: 160px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  /* faint lines simulating a document/photo */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 18px,
    rgba(255,255,255,0.03) 18px,
    rgba(255,255,255,0.03) 19px
  );
}

.mockup-redact {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
}

.mockup-redact--noise {
  background: repeating-linear-gradient(
    45deg,
    #444 0px, #555 1px, #333 2px, #666 3px, #444 4px
  );
  top: 20px; inset-inline-start: 20px;
  width: 120px; height: 24px;
}

.mockup-redact--2 {
  background: repeating-linear-gradient(
    45deg,
    #444 0px, #555 1px, #333 2px, #666 3px, #444 4px
  );
  top: 62px; inset-inline-start: 20px;
  width: 80px; height: 24px;
}

.mockup-redact--3 {
  background: #111;
  top: 104px; inset-inline-start: 20px;
  width: 100px; height: 24px;
}

.mockup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 0.5px solid var(--border);
}

.mockup-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.mockup-cta-btn {
  font-size: 11px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius);
}

/* ── Shared section styles ────────────────────────────────────────────────── */
.section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 48px;
}

.section-title + .steps-grid,
.section-title + .pillars-grid,
.section-title + .proof-grid {
  margin-top: 48px;
}

/* ── How it works ─────────────────────────────────────────────────────────── */
.how-it-works {
  padding: 80px 0;
  border-bottom: 0.5px solid var(--border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.step-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-num {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-tint-border);
  font-family: monospace;
  line-height: 1;
}

.step-card h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.step-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Why Tams ─────────────────────────────────────────────────────────────── */
.why-tams {
  padding: 80px 0;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.pillar-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-tint);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.pillar p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Redaction modes ──────────────────────────────────────────────────────── */
.modes-section {
  padding: 80px 0;
  border-bottom: 0.5px solid var(--border);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.mode-preview {
  height: 72px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.mode-preview--noise {
  background: repeating-linear-gradient(
    45deg,
    #3a3a3a 0px, #555 1px, #2a2a2a 2px, #666 3px,
    #3a3a3a 4px, #444 5px, #222 6px, #555 7px, #3a3a3a 8px
  );
}

.mode-preview--blur {
  background: linear-gradient(135deg, #1f3a28 0%, #2a4f36 30%, #163020 60%, #224030 100%);
  filter: blur(4px);
  transform: scale(1.05);
}

.mode-preview--pixel {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 11px, var(--bg-card) 11px, var(--bg-card) 12px),
    repeating-linear-gradient(90deg, transparent, transparent 11px, var(--bg-card) 11px, var(--bg-card) 12px);
  background-color: #1e4a28;
  background-size: 12px 12px;
}

.mode-preview--solid {
  background: #000;
}

.mode-card h4 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.mode-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Privacy proof ────────────────────────────────────────────────────────── */
.privacy-proof {
  padding: 80px 0;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.proof-point {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proof-point code {
  display: block;
  font-family: monospace;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  word-break: break-all;
}

.proof-point p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── CTA banner ───────────────────────────────────────────────────────────── */
.cta-banner {
  padding: 80px 0;
  border-bottom: 0.5px solid var(--border);
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.cta-inner h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-inner p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.landing-footer {
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.footer-tag {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: monospace;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link--icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.footer-sep {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-legal {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 0.5px solid var(--text-muted);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.footer-legal:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* ── Landing mobile (≤768px) ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 48px 0 40px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-mockup {
    display: none;
  }

  .nav-actions .privacy-badge {
    display: none;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pillars-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .modes-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .proof-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .how-it-works,
  .why-tams,
  .modes-section,
  .privacy-proof,
  .cta-banner {
    padding: 48px 0;
  }

  .section-title {
    font-size: 22px;
  }
}
