/* ═══════════════════════════════════════════════
   AlleForge — Global Stylesheet
   ═══════════════════════════════════════════════ */

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

/* ── Light Theme (default) ── */
:root,
[data-theme="light"] {
  --bg-primary: #f4f5f9;
  --bg-secondary: #eaecf2;
  --bg-card: #ffffff;
  --bg-elevated: #eef0f5;
  --bg-nav: rgba(244, 245, 249, 0.9);
  --accent: #0d8f4f;
  --accent-bright: #10a85e;
  --accent-dim: rgba(13, 143, 79, 0.07);
  --accent-glow: rgba(13, 143, 79, 0.16);
  --text-primary: #171a24;
  --text-secondary: #525a6e;
  --text-muted: #8b93a8;
  --border: rgba(0, 0, 0, 0.07);
  --border-accent: rgba(13, 143, 79, 0.18);
  --orange: #d9521c;
  --blue: #2672c4;
  --purple: #6d30d9;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.05);
  --shadow-heavy: 0 24px 64px rgba(0, 0, 0, 0.1);
  --grid-line: rgba(13, 143, 79, 0.05);
  --hero-glow: 0.05;
  --btn-primary-text: #ffffff;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg-primary: #090b0f;
  --bg-secondary: #0f1219;
  --bg-card: #131720;
  --bg-elevated: #191e2c;
  --bg-nav: rgba(9, 11, 15, 0.9);
  --accent: #34e896;
  --accent-bright: #55fcb4;
  --accent-dim: rgba(52, 232, 150, 0.09);
  --accent-glow: rgba(52, 232, 150, 0.2);
  --text-primary: #e5e9f2;
  --text-secondary: #838ca1;
  --text-muted: #4f5769;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(52, 232, 150, 0.18);
  --orange: #ff7849;
  --blue: #49a0ff;
  --purple: #b476ff;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.25);
  --shadow-heavy: 0 24px 64px rgba(0, 0, 0, 0.45);
  --grid-line: rgba(52, 232, 150, 0.025);
  --hero-glow: 0.07;
  --btn-primary-text: #090b0f;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Sora", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Noise texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Smooth transitions on theme-sensitive elements */
nav, footer, section,
.feature-card, .code-preview, .cta-box,
.badge, .btn, .feature-icon,
.privacy-content, .theme-toggle {
  transition: background 0.35s ease, color 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
}


/* ═══════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.logo-dot {
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

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

.nav-link--active {
  color: var(--accent);
}

/* ── Theme Toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.theme-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.25s;
}

.theme-toggle__btn:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.theme-toggle__btn.active {
  background: var(--accent);
  color: var(--btn-primary-text);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.theme-toggle__btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: "Sora", sans-serif;
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-primary-text);
  box-shadow: 0 0 20px var(--accent-dim);
}

.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ── Mobile Menu ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}


/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.hero__grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 70%);
}

.hero__glow {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 420px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 60%);
  opacity: var(--hero-glow);
  filter: blur(60px);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease both;
}

.badge__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

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

.hero__title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -2.5px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.12s both;
}

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

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease 0.24s both;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.6s ease 0.36s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════
   CODE PREVIEW (always dark)
   ═══════════════════════════════════════════════ */
.code-preview {
  margin-top: 4rem;
  max-width: 680px;
  width: 100%;
  background: #181c28;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  animation: fadeInUp 0.6s ease 0.5s both;
  box-shadow: var(--shadow-heavy);
}

.code-preview__titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-preview__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-preview__dot--red    { background: #ff5f57; }
.code-preview__dot--yellow { background: #febc2e; }
.code-preview__dot--green  { background: #28c840; }

.code-preview__filename {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: #4f5769;
}

.code-preview__body {
  padding: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.9;
  color: #838ca1;
  overflow-x: auto;
}

/* Syntax tokens */
.tok-kw     { color: #b476ff; }
.tok-fn     { color: #49a0ff; }
.tok-str    { color: #34e896; }
.tok-cm     { color: #4f5769; }
.tok-method { color: #ff7849; font-weight: 600; }


/* ═══════════════════════════════════════════════
   SECTIONS — Shared
   ═══════════════════════════════════════════════ */
.section {
  padding: 6rem 2rem;
}

.section--alt {
  background: var(--bg-secondary);
}

.section__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.73rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 1rem;
}

.section__title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 1rem;
}

.section__subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 3.5rem;
}


/* ═══════════════════════════════════════════════
   FEATURES GRID
   ═══════════════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-dim);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card__icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.feature-card__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════
   STEPS (How It Works)
   ═══════════════════════════════════════════════ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step__number {
  font-family: "JetBrains Mono", monospace;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.18;
  line-height: 1;
  margin-bottom: 0.8rem;
}

.step__number::before {
  content: "0" counter(step);
}

.step__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.step__desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
}


/* ═══════════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════════ */
.cta-section {
  text-align: center;
  padding: 6rem 2rem;
}

.cta-box {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.cta-box::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 60% 40%, var(--accent-dim) 0%, transparent 50%);
  pointer-events: none;
}

.cta-box__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.cta-box__desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
}


/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  background: var(--bg-primary);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
}


/* ═══════════════════════════════════════════════
   PRIVACY POLICY PAGE
   ═══════════════════════════════════════════════ */
.privacy-hero {
  padding: 8rem 2rem 3rem;
  text-align: center;
  position: relative;
}

.privacy-hero__glow {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 60%);
  opacity: var(--hero-glow);
  filter: blur(60px);
  pointer-events: none;
}

.privacy-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 0.5rem;
  animation: fadeInUp 0.5s ease both;
}

.privacy-hero__date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: fadeInUp 0.5s ease 0.1s both;
}

.privacy-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.privacy-body h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2.8rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.privacy-body p,
.privacy-body li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

.privacy-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.privacy-body li {
  margin-bottom: 0.35rem;
}

.privacy-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-body a:hover {
  color: var(--accent-bright);
}

.privacy-body__back {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ═══════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 1.5rem 2rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1.2rem;
  }

  .hero__title {
    letter-spacing: -1px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .cta-box {
    padding: 3rem 1.5rem;
  }

  .privacy-body {
    padding: 0 1.5rem 4rem;
  }
}
