/*
 * Shared styling for the static HTML pages (about, privacy, terms, contact,
 * guides) and for the static header/footer/content on the homepage.
 *
 * Everything here is namespaced under .site-* / .prose / .card so it cannot
 * collide with the React app, which loads alongside it on the homepage only.
 *
 * The :root block below is the single source of truth for colour across the
 * whole site. src/index.css re-expresses these same variables under the names
 * Tailwind and shadcn expect, so the React tool and these static pages can
 * never drift apart.
 */

/*
 * Cascade layer order for the whole site, declared here because this file is
 * the first stylesheet every page loads.
 *
 * site-reset sits at the bottom so the universal reset below cannot outrank
 * Tailwind's utilities inside the React tool — unlayered rules beat layered
 * ones regardless of specificity, which is exactly the trap this avoids.
 * Everything else in this file stays unlayered and therefore still wins over
 * the reset, as it always did.
 */
@layer site-reset, theme, base, app-reset, components, utilities;

:root {
  /* Slate — surfaces and text */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-sunken: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;

  /* Teal — brand, links, primary actions */
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-subtle: #ccfbf1;
  --primary-contrast: #ffffff;

  /* Amber — the generate action and highlights */
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-contrast: #422006;

  /* Semantic */
  --success: #16a34a;
  --danger: #dc2626;
}

@layer site-reset {
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

/* ---------- header / nav ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.site-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-right: auto;
}

.site-nav a:not(.site-brand) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a:not(.site-brand):hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ---------- hero (homepage) ---------- */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto;
}

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- content containers ---------- */

.card {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  width: 90%;
}

.prose h1 {
  font-size: 2rem;
  line-height: 1.25;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.prose h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose p,
.prose li {
  color: var(--text);
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--primary);
}

.prose strong {
  color: var(--text);
}

.prose code {
  background: var(--surface-sunken);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.92em;
  /* Long URLs in inline code would otherwise push the page wider than the
     viewport on narrow screens. */
  overflow-wrap: anywhere;
}

.prose pre {
  background: var(--surface-sunken);
  padding: 1rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.prose th {
  background: var(--surface-sunken);
  color: var(--text);
}

.page-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.callout {
  background: var(--primary-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- homepage sections below the tool ---------- */

.use-cases {
  list-style: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.use-cases li {
  background: var(--surface-sunken);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 0;
}

.use-cases strong {
  display: block;
  color: var(--primary-hover);
  margin-bottom: 0.35rem;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.faq-item:last-child {
  border-bottom: none;
}

.guide-list {
  list-style: none;
  margin: 0;
}

.guide-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.guide-list li:last-child {
  border-bottom: none;
}

.guide-list a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.guide-list a:hover {
  text-decoration: underline;
}

.guide-list span {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.cta {
  display: inline-block;
  padding: 1rem 1.75rem;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s;
}

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

/* ---------- footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 1.5rem;
}

.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .site-footer-inner {
    justify-content: center;
    text-align: center;
  }

  /* Let wide tables scroll inside themselves rather than widening the page. */
  .prose table {
    display: block;
    overflow-x: auto;
  }
}
