/* ai-for-shared.css — Shared styles for all course pages */

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

:root {
  --ink: #1a1a1a;
  --ink-light: #4a4a4a;
  --ink-muted: #7a7a7a;
  --paper: #faf9f7;
  --paper-warm: #f5f3ef;
  --paper-cool: #f0eee9;
  --accent: #c45d3e;
  --accent-light: #e8d5cc;
  --accent-bg: #fdf6f3;
  --green: #3a7d5c;
  --green-bg: #f0f7f3;
  --blue: #3d5a80;
  --blue-bg: #f0f4f8;
  --border: #e0ddd7;
  --border-light: #eae7e1;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 720px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

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

/* === NAV / TOC === */
.toc {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.toc.visible { transform: translateY(0); }
.toc-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.toc-inner::-webkit-scrollbar { display: none; }
.toc-brand {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.toc-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}
.toc-links a {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.2s;
}
.toc-links a:hover { color: var(--ink); background: var(--paper-warm); }
.toc-links a.active { color: var(--accent); background: var(--accent-bg); }

/* === BREADCRUMB === */
.breadcrumb {
  padding: 0.8rem 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.4rem; }

/* === LAYOUT === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* === HERO === */
.hero {
  padding: 5rem 0 3.5rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--paper-cool) 0%, var(--paper) 100%);
  z-index: -1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-light);
  line-height: 1.6;
  max-width: 580px;
  margin-bottom: 2rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.hero-meta span { display: flex; align-items: center; gap: 0.35rem; }
.hero-meta .dot { color: var(--border); }

/* === COURSE OVERVIEW === */
.overview {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
}
.overview p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--ink-light);
}
.overview p + p { margin-top: 1rem; }

.workflow-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}
.workflow-toc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
}
.workflow-toc-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(196, 93, 62, 0.08);
}
.workflow-toc-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.workflow-toc-text { font-size: 0.82rem; font-weight: 500; line-height: 1.3; }
.workflow-toc-time { font-size: 0.72rem; color: var(--green); font-weight: 500; margin-top: 0.2rem; }

/* === WORKFLOW SECTIONS === */
.workflow {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-light);
}
.workflow:last-of-type { border-bottom: none; }
.workflow-header { margin-bottom: 2rem; }
.workflow-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.workflow h2 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.workflow-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.workflow-body h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 2rem 0 0.6rem;
}
.workflow-body h3:first-child { margin-top: 0; }
.workflow-body p { font-size: 0.95rem; line-height: 1.75; color: var(--ink-light); }
.workflow-body p + p { margin-top: 0.8rem; }

/* === PROMPT BLOCKS === */
.prompt-block {
  position: relative;
  margin: 1.5rem 0;
  background: #1e1e2e;
  border-radius: 10px;
  overflow: hidden;
}
.prompt-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #2a2a3c;
  border-bottom: 1px solid #3a3a4c;
}
.prompt-block-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: #a0a0b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.copy-btn {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: #a0a0b8;
  background: transparent;
  border: 1px solid #3a3a4c;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { color: #fff; border-color: #5a5a7c; background: #3a3a4c; }
.copy-btn.copied { color: #7dcea0; border-color: #3a7d5c; }
.prompt-block pre {
  padding: 1.2rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.65;
  color: #cdd6f4;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* === BEFORE/AFTER === */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.ba-card { padding: 1rem 1.2rem; border-radius: 8px; font-size: 0.85rem; line-height: 1.5; }
.ba-card.before { background: #fdf2f2; border-left: 3px solid #d4564a; }
.ba-card.after { background: var(--green-bg); border-left: 3px solid var(--green); }
.ba-card strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.ba-card.before strong { color: #d4564a; }
.ba-card.after strong { color: var(--green); }

/* === IMAGE PLACEHOLDERS === */
.screenshot {
  margin: 1.5rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--paper-warm);
}
.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}
.screenshot-placeholder {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-style: italic;
}
.screenshot-caption {
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: white;
  border-top: 1px solid var(--border-light);
}

/* === EMAIL CAPTURE === */
.email-capture {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--blue-bg);
  border: 1px solid #d0dbe8;
  border-radius: 12px;
}
.email-capture h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.email-capture p { font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 1rem; }
.email-form { display: flex; gap: 0.5rem; max-width: 420px; }
.email-form input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
.email-form input:focus { border-color: var(--blue); }
.email-form button {
  padding: 0.65rem 1.2rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  background: var(--blue);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.email-form button:hover { background: #2e4a6a; }
.email-privacy { font-size: 0.72rem; color: var(--ink-muted); margin-top: 0.5rem; }
.email-privacy a { color: var(--ink-muted); text-decoration: underline; }

/* === CHAT SECTION === */
.chat-section { padding: 2.5rem 0; border-bottom: 1px solid var(--border-light); }
.chat-section h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin-bottom: 0.4rem; }
.chat-section > .container > p { font-size: 0.9rem; color: var(--ink-light); margin-bottom: 1.5rem; max-width: 520px; }
.chat-widget { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-width: 560px; }
.chat-messages { padding: 1.5rem; min-height: 200px; display: flex; flex-direction: column; gap: 1rem; }
.chat-msg { display: flex; gap: 0.6rem; max-width: 85%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600; flex-shrink: 0;
}
.chat-msg.bot .chat-avatar { background: var(--accent-bg); color: var(--accent); }
.chat-msg.user .chat-avatar { background: var(--blue-bg); color: var(--blue); }
.chat-bubble { padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.85rem; line-height: 1.5; }
.chat-msg.bot .chat-bubble { background: var(--paper-warm); color: var(--ink-light); }
.chat-msg.user .chat-bubble { background: var(--blue); color: white; }
.chat-input-area { display: flex; gap: 0.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); background: var(--paper); }
.chat-input-area input {
  flex: 1; padding: 0.6rem 0.8rem;
  font-family: var(--sans); font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: white; outline: none;
}
.chat-input-area input:focus { border-color: var(--accent); }
.chat-input-area button {
  padding: 0.6rem 1rem;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  color: white; background: var(--accent); border: none; border-radius: 6px;
  cursor: pointer; transition: background 0.2s;
}
.chat-input-area button:hover { background: #b04e32; }

/* === AUTOMATION ROADMAP === */
.roadmap-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--accent-bg);
}
.roadmap-section h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.roadmap-section > .container > p {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* === CROSS LINKS === */
.cross-links { padding: 3rem 0; border-top: 1px solid var(--border-light); }
.cross-links h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.cross-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.cross-link-card {
  padding: 1rem; background: white;
  border: 1px solid var(--border-light); border-radius: 8px;
  text-decoration: none; color: var(--ink); transition: all 0.2s;
}
.cross-link-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.cross-link-card .label { font-size: 0.72rem; color: var(--ink-muted); margin-bottom: 0.2rem; }
.cross-link-card .title { font-weight: 600; font-size: 0.88rem; }

/* === AUTHOR BIO === */
.author-bio {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-light);
}
.author-bio-inner {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}
.author-bio img {
  width: 56px; height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}
.author-bio-text { font-size: 0.88rem; color: var(--ink-light); line-height: 1.6; }
.author-bio-text strong { color: var(--ink); }
.author-bio-text a { color: var(--accent); text-decoration: none; }
.author-bio-text a:hover { text-decoration: underline; }
.author-bio-links {
  display: flex; gap: 1rem; margin-top: 0.5rem;
  font-size: 0.78rem;
}
.author-bio-links a { color: var(--ink-muted); text-decoration: none; }
.author-bio-links a:hover { color: var(--accent); }

/* === DISCLAIMER === */
.disclaimer {
  padding: 1.5rem 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-light);
}

/* === YOUTUBE === */
.youtube-section { padding: 3rem 0; border-bottom: 1px solid var(--border-light); }
.youtube-section h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin-bottom: 1rem; }
.youtube-grid { display: grid; gap: 1rem; }
.youtube-embed { border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; }
.youtube-embed iframe { width: 100%; height: 100%; border: none; }

/* === FOOTER === */
.footer { padding: 2rem 0; text-align: center; font-size: 0.78rem; color: var(--ink-muted); border-top: 1px solid var(--border-light); }
.footer a { color: var(--ink-muted); text-decoration: underline; }

/* === ANIMATIONS === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { opacity: 0; animation: fadeUp 0.5s ease forwards; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .hero { padding: 4rem 0 2.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .workflow { padding: 3rem 0; }
  .email-form { flex-direction: column; }
  .workflow-toc-grid { grid-template-columns: 1fr; }
  .before-after { grid-template-columns: 1fr; }
  .toc-links { display: none; }
  .author-bio-inner { flex-direction: column; }
}
