/* tostecode.dev — main.css */
/* Design system: Fraunces (display) + DM Sans (body) + DM Mono (code/labels) */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;1,9..144,300&family=DM+Sans:wght@300;400;500&display=swap');

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

/* ─── Tokens ────────────────────────────────────────────────── */
:root {
  --bg:           #F5F3EE;
  --surface:      #FAFAF8;
  --surface-2:    #F0EDE6;
  --border:       rgba(60,55,45,0.12);
  --border-strong:rgba(60,55,45,0.22);
  --text:         #1C1A16;
  --text-2:       #5C5848;
  --text-3:       #8C8778;
  --accent:       #1D6B5F;
  --accent-light: #E1F0EE;
  --accent-dark:  #0F4E44;
  --tag-bg:       #E8EBE7;
  --tag-text:     #3A4A38;
  --font-sans:    'DM Sans', sans-serif;
  --font-serif:   'Fraunces', serif;
  --font-mono:    'DM Mono', monospace;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --nav-h:        56px;
}

[data-theme="dark"] {
  --bg:           #141410;
  --surface:      #1C1C18;
  --surface-2:    #242420;
  --border:       rgba(200,195,180,0.10);
  --border-strong:rgba(200,195,180,0.20);
  --text:         #EDE8DC;
  --text-2:       #A8A394;
  --text-3:       #6A6558;
  --accent:       #3BB89F;
  --accent-light: #0F2E2A;
  --accent-dark:  #5DCEB5;
  --tag-bg:       #252520;
  --tag-text:     #8AAA86;
}

/* ─── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ─── Navigation ────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: var(--nav-h);
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.25s;
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-wordmark span { color: var(--accent); }

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

.nav-links a {
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.15s;
}

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

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

.dark-toggle {
  background: var(--surface-2);
  border: 0.5px solid var(--border-strong);
  border-radius: 20px;
  width: 38px;
  height: 22px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.dark-toggle::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.2s;
}

[data-theme="dark"] .dark-toggle::after { transform: translateX(16px); }

/* ─── Layout Helpers ────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 32px;
}

.divider {
  border: none;
  border-top: 0.5px solid var(--border);
}

/* ─── Typography ────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}

h1, h2, h3, h4 { line-height: 1.2; }

.display-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.02em;
  color: var(--text);
}

.display-title em {
  font-style: italic;
  color: var(--text-2);
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.mono-comment {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  border: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 0.5px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn-sm {
  font-size: 12px;
  padding: 6px 14px;
}

/* ─── Tags / Badges ─────────────────────────────────────────── */
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  display: inline-block;
}

.badge-active {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  display: inline-block;
}

.badge-dev {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #FFF3DC;
  color: #7A5800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  display: inline-block;
}

[data-theme="dark"] .badge-dev {
  background: #2A1E00;
  color: #C49A00;
}

.badge-archived {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-3);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  display: inline-block;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-strong); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

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

.card-icon {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 12px;
}

.card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid var(--border);
}

.card-link {
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}

.card-link:hover { gap: 7px; }

.price-label {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* ─── Section Headers ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-more {
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}

.section-more:hover { gap: 7px; }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ─── Page Hero (inner pages) ───────────────────────────────── */
.page-hero {
  padding: 56px 0 48px;
  border-bottom: 0.5px solid var(--border);
}

.page-hero p {
  font-size: 15px;
  color: var(--text-2);
  margin-top: 14px;
  max-width: 560px;
  line-height: 1.7;
}

/* ─── Feature List ──────────────────────────────────────────── */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-item h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ─── Purchase / CTA Block ──────────────────────────────────── */
.purchase-block {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.purchase-block .price-main {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 500;
  color: var(--text);
  margin: 8px 0 4px;
}

.purchase-block .price-note {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 24px;
}

.purchase-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-paypal {
  background: #FFC439;
  color: #003087;
  border: none;
  font-weight: 500;
}

.btn-paypal:hover { background: #f0b800; color: #003087; }

/* ─── FAQ ───────────────────────────────────────────────────── */
.faq-item {
  border-bottom: 0.5px solid var(--border);
  padding: 20px 0;
}

.faq-item:first-child { border-top: 0.5px solid var(--border); }

.faq-q {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-a {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ─── About ─────────────────────────────────────────────────── */
.about-section {
  padding: 56px 0;
}

.about-section + .about-section {
  border-top: 0.5px solid var(--border);
}

.about-section p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.8;
  max-width: 620px;
}

.about-section p + p { margin-top: 16px; }

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* ─── Support ───────────────────────────────────────────────── */
.support-block {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.support-block h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 24px;
  color: var(--text);
  margin-bottom: 12px;
}

.support-block p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 28px;
}

.support-email {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  margin-top: 16px;
  display: block;
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 0.5px solid var(--border);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

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

.footer-links a {
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.15s;
}

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

/* ─── Prose ─────────────────────────────────────────────────── */
.prose {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.8;
  max-width: 640px;
}

.prose p + p { margin-top: 16px; }

.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ─── Screenshots placeholder ───────────────────────────────── */
.screenshot-placeholder {
  background: var(--surface-2);
  border: 0.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ─── Sections spacing ──────────────────────────────────────── */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 20px; }
  .nav { padding: 0 20px; }
  footer { padding: 20px; }
  .nav-links { display: none; }
  .hero { padding: 48px 0 40px; }
  .card-grid, .card-grid-2 { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .purchase-block { padding: 24px; }
}
