/* ==========================================================================
   ShopBooks Coming Soon Design System
   Earthy/Forest Brand Color Palette with Responsive Dark Mode support
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Surfaces & Ink */
  --bg: #f4f5f1;
  --bg-soft: #eceee7;
  --card: #ffffff;
  --card-soft: #fbfbf8;
  --ink: #1c211e;
  --ink-soft: #3c433d;
  --muted: #6b7268;
  
  /* Brand accents */
  --accent: #2f6f4f; /* Pine green */
  --accent-hover: #23543b;
  --accent-soft: rgba(47, 111, 79, 0.08);
  --accent-ring: rgba(47, 111, 79, 0.16);
  --accent-ink: #ffffff;

  /* Status and Borders */
  --border: #e2e0d5;
  --border-strong: #d0cdc0;
  --good: #2f6f4f;
  --good-soft: #e4f0e8;
  --bad: #a33a2a;
  --bad-soft: #f7e3df;
  --warn: #9a6b00;
  --warn-soft: #f3ecd9;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px rgba(31, 41, 33, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(31, 41, 33, 0.08), 0 8px 16px -6px rgba(31, 41, 33, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(31, 41, 33, 0.15);
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416;
    --bg-soft: #181c1f;
    --card: #1c2126;
    --card-soft: #232a31;
    --ink: #e5eae3;
    --ink-soft: #c0c7bd;
    --muted: #879086;
    
    --accent: #52a377;
    --accent-hover: #61b487;
    --accent-soft: rgba(82, 163, 119, 0.12);
    --accent-ring: rgba(82, 163, 119, 0.24);
    --accent-ink: #0c1410;

    --border: #2c333a;
    --border-strong: #3b444e;
    --good: #61b487;
    --good-soft: #1c2f24;
    --bad: #e77862;
    --bad-soft: #3a2420;
    --warn: #dcae4c;
    --warn-soft: #362f1c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 16px -6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  }
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Logo
   ========================================================================== */

header {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background-color: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 800;
  font-size: 1.1rem;
}

.badge-pill {
  background-color: var(--accent-soft);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(47, 111, 79, 0.15);
  display: inline-block;
}

/* ==========================================================================
   Hero & Waitlist Form
   ========================================================================== */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 60px 0;
}

.waitlist-hero {
  width: 100%;
}

.waitlist-card {
  background-color: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 50px 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 600px) {
  .waitlist-card {
    padding: 30px 20px;
  }
}

.serif-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
}

.subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 680px;
  line-height: 1.6;
}

/* Signup Form */
.signup-form {
  width: 100%;
  max-width: 500px;
  margin-bottom: 24px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  background-color: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: var(--r);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.signup-form input[type="email"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  font-family: var(--font-sans);
  outline: none;
  min-width: 0; /* prevents flex blowout */
}

.signup-form input[type="email"]::placeholder {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.form-feedback {
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 20px;
  font-weight: 500;
}

.form-feedback.success {
  color: var(--good);
}

.form-feedback.error {
  color: var(--bad);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.prototype-notice {
  font-size: 0.85rem;
  color: var(--muted);
}

.prototype-notice a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.prototype-notice a:hover {
  text-decoration: underline;
}

/* Mini Pillars */
.mini-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.mini-pillar {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.mini-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.mini-pillar h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.mini-pillar p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ==========================================================================
   SEO Content Section
   ========================================================================== */

.seo-content {
  width: 100%;
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.seo-content h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 32px 0 12px;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content p {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 8px;
}

.seo-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background-color: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

.faq-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.faq-home-item {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.faq-home-item h3 {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.faq-home-item p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ==========================================================================
   Blog & Article Pages
   ========================================================================== */

.doc-main {
  display: block;
  align-items: initial;
  padding: 48px 0 64px;
}

.post {
  max-width: 760px;
}

.post-eyebrow {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.post-eyebrow a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.post-eyebrow a:hover { text-decoration: underline; }

.post h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 22px;
}

.post h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 34px 0 12px;
}

.post h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 8px;
}

.post p,
.post li {
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.post p { margin-bottom: 16px; }

.post ul,
.post ol {
  margin: 0 0 16px 1.3em;
}

.post li { margin-bottom: 8px; }

.post strong { color: var(--ink); }

.post em { color: var(--ink-soft); }

.post a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background-color: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

.post table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 24px;
  font-size: 0.95rem;
}

.post th,
.post td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--ink-soft);
}

.post th {
  background-color: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}

.post-cta {
  margin-top: 36px;
  padding: 24px 28px;
  background-color: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.post-cta p { margin-bottom: 14px; font-size: 1rem; }

/* Header nav link (blog/home) */
.header-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.header-link:hover { text-decoration: underline; }

/* Blog index */
.blog-intro {
  margin-bottom: 32px;
}

.blog-intro h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}

.blog-intro p {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 680px;
}

.blog-list {
  display: grid;
  gap: 20px;
}

.blog-card {
  display: block;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.blog-card h2 {
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.blog-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  background-color: var(--bg);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
