/* ==========================================================================
   LocalPrompts — landing.css
   Design tokens: background #dbdbdb, accent #b39ced, text #141414
   Typography: Open Sans (body/UI), JetBrains Mono (code/terminal accents)
   ========================================================================== */

:root {
  --bg: #dbdbdb;
  --bg-soft: #e8e8e8;
  --bg-card: #f1f1f1;
  --accent: #b39ced;
  --accent-dark: #9374d6;
  --accent-darker: #7a59c4;
  --text: #141414;
  --text-soft: #4a4a4a;
  --border: rgba(20, 20, 20, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --shadow-sm: 0 2px 10px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 20, 0.10);
  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

   /* Set the grid square dimensions */
  background-size: 40px 40px; 
  
  /* Create vertical and horizontal grid lines */
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 0.5em 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin: 0 0 1em 0; color: var(--text-soft); }

:focus-visible {
  outline: 3px solid var(--accent-darker);
  outline-offset: 2px;
}

.section-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-darker);
  margin: 0 0 0.9em 0;
}
.eyebrow.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85em 1.6em;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.98rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 16px 0;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(241, 241, 241, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
}
.logo-bracket {
  font-family: var(--font-mono);
  color: var(--accent-darker);
}

.main-nav {
  display: flex;
  gap: 28px;
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a {
  position: relative;
  padding: 6px 2px;
}
.main-nav a:hover { color: var(--accent-darker); }

.github-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.github-btn:hover {
  background: var(--accent-darker);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 24px 80px;
  text-align: center;
}

.hero-inner { max-width: 760px; margin: 0 auto; }

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

.hero-sub {
  font-size: 1.08rem;
  max-width: 620px;
  margin: 0 auto 2em;
  font-weight: 400;
  color: #4a4a4a;
  line-height: 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 2.2em;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.hero-badges span {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-soft);
}

/* ---------- Features ---------- */
.features { padding: 60px 0 90px; }
.features h2, .screenshots h2, .faq h2 { text-align: center; max-width: 600px; margin: 0 auto 56px; }

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.feature-card p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Callout ---------- */
.callout {
  background: var(--text);
  color: var(--bg);
  padding: 80px 0;
}
.callout-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.callout h2 { color: #fff; }
.callout .eyebrow { color: var(--accent); }
.callout-text p { color: #c9c9c9; }
.callout-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.4em;
}
.callout-list li {
  padding-left: 26px;
  position: relative;
  color: #e4e4e4;
  font-size: 0.95rem;
}
.callout-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.editor-mock {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #262626;
}
.editor-dots {
  display: flex;
  gap: 8px;
}
.editor-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #555;
}
.editor-dots span:nth-child(1) { background: #e0726a; }
.editor-dots span:nth-child(2) { background: #e0c46a; }
.editor-dots span:nth-child(3) { background: #7fc97f; }
.editor-filename {
  font-size: 0.78rem;
  color: #999;
}

.editor-body {
  min-height: 400px;
  padding: 20px 20px 14px;
}
.editor-field {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #d8d3ea;
  word-break: break-word;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.refined-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.refined-line.show {
  opacity: 1;
  transform: translateY(0);
}
.editor-field.refined-mode {
  color: #e8e5f4;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.editor-status {
  font-size: 0.78rem;
  color: #999;
  transition: color 0.2s ease;
}
.editor-status.status-refined {
  color: var(--accent);
}

.refine-btn {
  cursor: default;
  pointer-events: none;
  padding: 0.6em 1.3em;
  font-size: 0.88rem;
}
.refine-btn.is-loading {
  background: var(--accent-dark);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(20,20,20,0.25);
  border-top-color: var(--text);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.demo-disclaimer {
  text-align: center;
  font-size: 0.78rem;
  color: #8a8a8a;
  margin: 12px 0 0;
}

/* ---------- Screenshots ---------- */
.screenshots { padding: 90px 0; }
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.screenshot-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.screenshot-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-soft);
}
.screenshot-card figcaption {
  padding: 14px 16px 18px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ---------- FAQ ---------- */
.faq { padding: 30px 0 90px; }
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 22px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 14px;
  font-size: 1.4rem;
  color: var(--accent-darker);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 18px; margin: 0; }

/* ---------- Open Source ---------- */
.opensource { padding: 0 0 100px; }
.opensource-inner {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  background: var(--accent);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
}
.opensource h2 { margin-bottom: 0.6em; }
.opensource p { color: #2a2a2a; margin-bottom: 1.6em; }
.opensource .btn-primary {
  background: var(--text);
  color: var(--bg);
}
.opensource .btn-primary:hover {
  background: #000;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text);
  color: #c9c9c9;
  padding: 50px 24px 30px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 30px;
}
.footer-brand {
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
}
.footer-brand p {
  font-weight: 400;
  font-size: 0.85rem;
  color: #999;
  margin: 8px 0 0;
}
.footer-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  align-items: center;
}
.footer-nav a:hover { color: var(--accent); }
.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  margin: 24px 0 0;
}

/* ==========================================================================
   Responsive — tablet
   ========================================================================== */
@media (max-width: 940px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .callout-inner { grid-template-columns: 1fr; }
  .callout-visual { order: -1; }
}

/* ==========================================================================
   Responsive — mobile
   ========================================================================== */
@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 20px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 10px 0; }

  .github-btn span { display: none; }
  .nav-toggle { display: flex; }

  .hero { padding: 64px 20px 56px; }
  .hero-actions { flex-direction: column; align-items: stretch; }

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

  .opensource-inner { padding: 40px 24px; }

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .spinner, .caret { animation: none !important; }
}

.hidden {
  display: none;
}