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

:root {
  /* Valinor mode (light) */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a649;
  --accent-hover: #6fbf5e;
  --accent-dark: #2ea043;
  --border: #30363d;
  --gold: #d4a843;
  --gold-glow: #e8c55a;
  --mithril: #c9d1d9;
  --mordor-red: #da3633;
  --shire-green: #58a649;
  --rivendell-blue: #58a6ff;
  --ring-gold: #ffd700;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--rivendell-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ───────────────────────────────────────────── */
.nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.nav-logo:hover { color: var(--text-primary); text-decoration: none; }

.logo-icon {
  width: 36px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CSS Octohobbit - a hobbit foot with tentacles */
.octohobbit {
  font-size: 28px;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-links a.active { color: var(--text-primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-search {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  width: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-search kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Hamburger Menu ────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-align: center;
}

.btn:hover { text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--bg-tertiary); }

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

.btn-primary:hover { background: var(--accent-hover); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-glow));
  color: #1a1200;
  border: none;
  font-weight: 600;
}

.btn-gold:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 100px 32px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(88, 166, 73, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge .new { color: var(--gold); font-weight: 600; margin-right: 6px; }

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .green { color: var(--shire-green); }
.hero h1 .gold { color: var(--gold); }

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta .btn {
  padding: 12px 28px;
  font-size: 1rem;
}

.hero-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  width: 300px;
}

.hero-input::placeholder { color: var(--text-muted); }

.hero-trust {
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Features Grid ────────────────────────────────── */
.features {
  padding: 80px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  margin-bottom: 60px;
}

.features-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.features-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: border-color 0.3s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.feature-card .tag {
  display: inline-block;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ── Stats Banner ─────────────────────────────────── */
.stats {
  padding: 60px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.stat-item h3 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-item h3 .gold { color: var(--gold); }

.stat-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ── Testimonials ─────────────────────────────────── */
.testimonials {
  padding: 80px 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.testimonials h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.testimonial {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.testimonial-quote {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.testimonial-role {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── CTA Section ──────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 100px 32px;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Footer ───────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a { color: var(--text-muted); font-size: 0.8rem; }

/* ── The One Ring (Easter Egg) ─────────────────────── */
.ring-cursor {
  display: none;
  position: fixed;
  pointer-events: none;
  font-size: 24px;
  z-index: 9999;
  transition: opacity 0.3s;
  text-shadow: 0 0 10px var(--ring-gold), 0 0 20px var(--ring-gold);
}

/* ── Tengwar inscription (subtle) ─────────────────── */
.tengwar {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.3;
  letter-spacing: 2px;
  text-align: center;
  padding: 8px;
  transition: opacity 0.5s, color 0.5s;
}

.tengwar:hover {
  opacity: 1;
  color: var(--ring-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ── Pricing Grid ─────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: var(--gold);
  position: relative;
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-glow));
  color: #1a1200;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 999px;
}

.pricing-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-card .price {
  font-size: 2rem;
  font-weight: 800;
  margin: 12px 0 4px;
}

.pricing-card .price-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.pricing-card .tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 20px;
}

.pricing-card ul {
  list-style: none;
  flex: 1;
  margin-bottom: 24px;
}

.pricing-card ul li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-card ul li::before {
  content: '✓ ';
  color: var(--shire-green);
  font-weight: 600;
}

.pricing-card .btn {
  width: 100%;
  padding: 10px;
  text-align: center;
}

/* ── FAQ ──────────────────────────────────────────── */
.faq-section {
  max-width: 700px;
  margin: 60px auto 0;
  padding: 0 32px;
}

.faq-section h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.faq-section details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-section summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-section details[open] summary::after {
  content: '−';
}

.faq-section summary::-webkit-details-marker { display: none; }

.faq-section details p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 12px;
  line-height: 1.6;
}

/* ── Product Pages (Treebeard/Gandalf) ────────────── */
.product-hero {
  text-align: center;
  padding: 80px 32px 40px;
  position: relative;
}

.product-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.product-hero p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.product-features {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.product-feature {
  margin-bottom: 48px;
}

.product-feature h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-feature > p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Mock GitHub comment */
.bot-comment {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 12px;
}

.bot-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.bot-name {
  font-weight: 600;
  color: var(--text-primary);
}

.bot-label {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bot-comment blockquote {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  font-style: italic;
  border-left: 3px solid var(--border);
  padding-left: 12px;
}

/* ── About Page ───────────────────────────────────── */
.about-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.about-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.about-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ── Merch Page ───────────────────────────────────── */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.merch-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.2s;
}

.merch-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.merch-card .merch-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.merch-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.merch-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
}

.merch-card .merch-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
}

/* ── 404 Page ─────────────────────────────────────── */
.four-oh-four {
  text-align: center;
  padding: 120px 32px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.four-oh-four h1 {
  font-size: 6rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.four-oh-four h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.four-oh-four p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ── Page-level section helpers ────────────────────── */
.page-section {
  padding: 80px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .product-hero h1 { font-size: 2.2rem; }
  .nav-search { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 32px;
    gap: 12px;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { gap: 40px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .four-oh-four h1 { font-size: 4rem; }
}

/* ── Konami / Easter Egg animations ───────────────── */
@keyframes ringPulse {
  0%, 100% { text-shadow: 0 0 10px var(--ring-gold); }
  50% { text-shadow: 0 0 30px var(--ring-gold), 0 0 60px rgba(255, 215, 0, 0.3); }
}

.ring-active {
  animation: ringPulse 2s infinite;
}

.mordor-mode {
  --bg-primary: #0a0000;
  --bg-secondary: #1a0505;
  --bg-tertiary: #2a0a0a;
  --accent: #da3633;
  --accent-hover: #f85149;
  --border: #3d1010;
}

.mordor-mode .hero::before {
  background: radial-gradient(circle, rgba(218, 54, 51, 0.1) 0%, transparent 70%);
}
