/* ===========================
   PromptInk — Main Stylesheet
   =========================== */

:root {
  --ink: #0f0f0f;
  --ink-light: #444;
  --ink-muted: #888;
  --ink-faint: #f5f5f5;
  --accent: #5b4ef8;
  --accent-hover: #4a3de0;
  --accent-light: #ede9ff;
  --success: #16a34a;
  --border: #e5e5e5;
  --white: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --max-w: 1160px;
  --content-w: 740px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Container ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  border: 2px solid transparent;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); text-decoration: none; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.logo:hover { text-decoration: none; color: var(--ink); }
.logo-icon { font-size: 1.4rem; }
.logo strong { color: var(--accent); }

.main-nav ul { list-style: none; display: flex; gap: 8px; }
.main-nav a {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--ink-light);
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---- Hero ---- */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #fafafa 0%, #f0eeff 100%);
  border-bottom: 1px solid var(--border);
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -.02em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: 1.1rem; color: var(--ink-light); margin-bottom: 32px; max-width: 480px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Prompt card demo */
.prompt-card-demo {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.card-header { padding: 12px 16px; background: #f9f9f9; border-bottom: 1px solid var(--border); display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.card-body { padding: 20px; }
.card-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); margin-bottom: 10px; }
.card-text { font-family: var(--font-mono); font-size: .85rem; line-height: 1.6; color: var(--ink-light); background: var(--ink-faint); padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-tag { display: inline-block; background: var(--accent-light); color: var(--accent); font-size: .78rem; font-weight: 500; padding: 3px 10px; border-radius: 20px; }

/* ---- Features ---- */
.features { padding: 72px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature-card {
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--ink-light); font-size: .95rem; margin-bottom: 16px; }
.feature-link { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---- Post Cards ---- */
.latest-posts { padding: 72px 0; background: var(--ink-faint); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 36px; }
.section-header h2 { font-size: 1.8rem; font-weight: 700; }
.view-all { color: var(--accent); font-weight: 600; font-size: .9rem; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.post-category {
  background: var(--accent-light);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
}
.post-date { font-size: .8rem; color: var(--ink-muted); }
.post-card h2, .post-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.post-card h2 a, .post-card h3 a { color: var(--ink); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card p { color: var(--ink-light); font-size: .9rem; flex: 1; margin-bottom: 16px; }
.read-more { color: var(--accent); font-weight: 600; font-size: .87rem; margin-top: auto; }

/* ---- CTA Banner ---- */
.cta-banner {
  padding: 80px 0;
  background: var(--accent);
  color: var(--white);
  text-align: center;
}
.cta-banner h2 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.cta-banner p { font-size: 1.05rem; opacity: .85; margin-bottom: 32px; }
.cta-banner .btn-primary { background: var(--white); color: var(--accent); border-color: var(--white); }
.cta-banner .btn-primary:hover { background: var(--accent-light); }

/* ---- Article Single ---- */
.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 48px 0; }
.article-header { margin-bottom: 32px; }
.article-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.article-category {
  background: var(--accent-light);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
}
.article-date, .article-read-time { font-size: .82rem; color: var(--ink-muted); }
.article-header h1 { font-size: 2.2rem; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 16px; }
.article-lead { font-size: 1.15rem; color: var(--ink-light); line-height: 1.6; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag {
  background: var(--ink-faint);
  color: var(--ink-light);
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all .15s;
  text-decoration: none;
}
.tag:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

/* Article body typography */
.article-body { font-size: 1.02rem; }
.article-body h2 { font-size: 1.55rem; font-weight: 700; margin: 40px 0 16px; letter-spacing: -.01em; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; margin: 30px 0 12px; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-light);
}
.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--ink-faint);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.article-body pre {
  background: #1a1a2e;
  color: #e2e2f0;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: .88rem;
  line-height: 1.6;
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body strong { font-weight: 700; }
.article-body a { color: var(--accent); font-weight: 500; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* Prompt box shortcode */
.prompt-box {
  background: #1a1a2e;
  color: #e2e2f0;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 28px 0;
  position: relative;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.7;
}
.prompt-box-label {
  font-family: var(--font-sans);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8b9cf4;
  margin-bottom: 10px;
  font-weight: 700;
}
.prompt-box-copy {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.12);
  color: #ccc;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s;
}
.prompt-box-copy:hover { background: rgba(255,255,255,.2); }

/* Article footer */
.article-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.share-section p { color: var(--ink-muted); margin-bottom: 20px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; }
.post-nav a { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* Sidebar */
.sidebar { padding-top: 8px; }
.sidebar-widget { background: var(--ink-faint); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.sidebar-widget h4 { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin-bottom: 14px; }
.sidebar-cats { list-style: none; }
.sidebar-cats li { margin-bottom: 8px; }
.sidebar-cats a { color: var(--ink-light); font-size: .92rem; font-weight: 500; }
.sidebar-cats a:hover { color: var(--accent); text-decoration: none; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- List page ---- */
.list-layout { padding: 48px 0; }
.list-header { margin-bottom: 40px; }
.list-header h1 { font-size: 2rem; font-weight: 700; }
.list-description { color: var(--ink-light); margin-top: 8px; }

/* ---- Single page (about/contact/privacy) ---- */
.page-layout { max-width: var(--content-w); margin: 0 auto; padding: 56px 0; }
.page-layout h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 28px; letter-spacing: -.02em; }
.page-layout h2 { font-size: 1.45rem; font-weight: 700; margin: 36px 0 14px; }
.page-layout p { margin-bottom: 18px; color: var(--ink-light); }
.page-layout ul { margin: 0 0 18px 24px; }
.page-layout li { margin-bottom: 6px; color: var(--ink-light); }
.page-layout a { color: var(--accent); font-weight: 500; }

/* Contact form */
.contact-form { margin-top: 36px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: .95rem;
  transition: border .15s;
  background: var(--white);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,78,248,.12);
}
.form-group textarea { height: 140px; resize: vertical; }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #ccc; padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .logo { color: var(--white); margin-bottom: 14px; }
.footer-brand p { font-size: .88rem; color: #888; line-height: 1.6; }
.footer-links h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #666; margin-bottom: 14px; font-weight: 700; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #aaa; font-size: .88rem; }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom { border-top: 1px solid #222; padding: 20px 0; text-align: center; }
.footer-bottom p { font-size: .82rem; color: #555; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--ink);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .active { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .features-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .single-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .features-grid, .posts-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 24px; }
  .main-nav.open ul { flex-direction: column; }
  .nav-toggle { display: flex; }
}
