/* ============================================
   Lareware Design System
   Dark terminal-inspired theme
   JetBrains Mono (code/labels) + DM Sans (body)
   ============================================ */

:root {
  --bg: #0c0e13;
  --bg-card: #13161d;
  --bg-card-hover: #1a1e28;
  --border: #1e2330;
  --text: #e2e4ea;
  --text-muted: #7a8099;
  --accent: #00e599;
  --accent-dim: #00e59920;
  --accent2: #3b82f6;
  --accent2-dim: #3b82f620;
  --orange: #f59e0b;
  --orange-dim: #f59e0b18;
  --red: #ef4444;
  --terminal-green: #4ade80;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Grain overlay */
body::before {
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- NAV ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-search {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  color: var(--text);
  font-size: 0.85rem;
  width: 220px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}
.nav-search:focus { border-color: var(--accent); }
.nav-search::placeholder { color: var(--text-muted); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- LAYOUT ---- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

/* ---- HERO ---- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  animation: fadeUp 0.8s ease-out;
}
.hero h1 {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin-bottom: 2rem;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-dim);
}

/* ---- TERMINAL ---- */
.terminal {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.terminal-bar {
  background: #161a24;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.r { background: #ef4444; }
.terminal-dot.y { background: #f59e0b; }
.terminal-dot.g { background: #22c55e; }
.terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.terminal-body {
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  min-height: 200px;
}
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-output { color: var(--text-muted); }
.t-highlight { color: var(--orange); }
.t-cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
  vertical-align: middle;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- CARDS ---- */
.tools-grid, .card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tool-card, .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.tool-card::before, .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}
.tool-card:hover::before, .card:hover::before { transform: scaleX(1); }
.tool-card:hover, .card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,229,153,0.08);
}
.tool-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.tool-icon.green { background: var(--accent-dim); color: var(--accent); }
.tool-icon.blue { background: var(--accent2-dim); color: var(--accent2); }
.tool-icon.orange { background: var(--orange-dim); color: var(--orange); }
.tool-card h3, .card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.tool-card p, .card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.tool-tag {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}
.tool-tag.affiliate {
  background: var(--orange-dim);
  color: var(--orange);
}

/* Staggered animations */
.tool-card:nth-child(1), .card:nth-child(1) { animation: fadeUp 0.6s ease-out 0.1s both; }
.tool-card:nth-child(2), .card:nth-child(2) { animation: fadeUp 0.6s ease-out 0.2s both; }
.tool-card:nth-child(3), .card:nth-child(3) { animation: fadeUp 0.6s ease-out 0.3s both; }
.tool-card:nth-child(4), .card:nth-child(4) { animation: fadeUp 0.6s ease-out 0.4s both; }
.tool-card:nth-child(5), .card:nth-child(5) { animation: fadeUp 0.6s ease-out 0.5s both; }
.tool-card:nth-child(6), .card:nth-child(6) { animation: fadeUp 0.6s ease-out 0.6s both; }

/* ---- GUIDES ---- */
.guides-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}
.guide-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
  text-decoration: none;
  color: var(--text);
}
.guide-featured:hover { border-color: var(--accent2); }
.guide-featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3b82f610 0%, transparent 60%);
}
.guide-featured .guide-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent2);
  margin-bottom: 0.75rem;
  position: relative;
}
.guide-featured h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
}
.guide-featured p {
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  max-width: 500px;
}
.guides-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.guide-small {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  flex: 1;
  transition: border-color 0.3s, transform 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.guide-small:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.guide-small .guide-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: 0.5rem;
}
.guide-small h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.guide-small p { color: var(--text-muted); font-size: 0.82rem; }

/* ---- NEWSLETTER ---- */
.newsletter {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.newsletter-box {
  background: linear-gradient(135deg, #13161d, #1a1e28);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.newsletter-box::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}
.newsletter-box h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.newsletter-box p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  position: relative;
}
.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}
.newsletter-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}
.newsletter-input:focus { border-color: var(--accent); }
.newsletter-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: transform 0.2s;
}
.newsletter-btn:hover { transform: translateY(-1px); }

/* ---- AD SLOTS ---- */
.ad-placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  margin: 2rem 0;
  opacity: 0.5;
}

/* ---- ARTICLE / PAGE CONTENT ---- */
.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}
.page-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
}

.article-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}
.article-header .guide-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent2);
  margin-bottom: 0.75rem;
}
.article-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.article-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.article-meta time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.article-body p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--accent2); }
.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
}
.article-body li { margin-bottom: 0.5rem; line-height: 1.7; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body pre {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
}
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}
.article-body p code,
.article-body li code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.82em;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.article-body th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}
.article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
}
.article-body img {
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* TOC */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}
.toc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.toc ul { list-style: none; }
.toc li { margin-bottom: 0.4rem; }
.toc a {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s;
}
.toc a:hover { color: var(--accent); }

/* ---- FOOTER ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero h1 { font-size: 2.2rem; }
  .tools-grid, .card-grid { grid-template-columns: 1fr; }
  .guides-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    gap: 1rem;
  }
  .nav-toggle { display: block; }
  .nav-search { width: 160px; }
  .article-header h1 { font-size: 1.8rem; }
  .newsletter-form { flex-direction: column; }
}
