/* ============================================================
   Pakorn AI — MCP × Claude Code landing
   Palette: deep crimson brand gradient + warm light content
   Fonts: Prompt (display) · Sarabun (body) · IBM Plex Mono (code)
   ============================================================ */

:root {
  --red-900: #4a0812;
  --red-800: #6b0c1c;
  --red-700: #8b0f24;
  --red-600: #a81229;
  --red-500: #c41e3a;
  --red-400: #e0344f;
  --gold: #f3c969;
  --ink: #1d1418;
  --ink-soft: #4b3d43;
  --muted: #756169;
  --line: #ecdfe2;
  --bg: #ffffff;
  --bg-alt: #fbf3f4;
  --bg-tint: #fdeef0;
  --white: #ffffff;

  --grad-hero: linear-gradient(125deg, #4a0812 0%, #8b0f24 48%, #c41e3a 100%);
  --grad-mark: linear-gradient(135deg, #c41e3a, #8b0f24);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(74, 8, 18, 0.06);
  --shadow-md: 0 12px 34px rgba(74, 8, 18, 0.12);
  --shadow-lg: 0 24px 60px rgba(74, 8, 18, 0.18);

  --maxw: 1120px;
  --maxw-narrow: 760px;
  --font-display: "Prompt", "Sarabun", system-ui, sans-serif;
  --font-body: "Sarabun", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1.1em; }
a { color: var(--red-600); text-decoration-color: rgba(196, 30, 58, .35); text-underline-offset: 3px; }
a:hover { color: var(--red-500); }
strong { font-weight: 600; }
code { font-family: var(--font-mono); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: var(--maxw-narrow); }
.center { text-align: center; }
.muted { color: var(--muted); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--red-700); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--white); color: var(--red-700); box-shadow: var(--shadow-md); }
.btn-primary:hover { color: var(--red-600); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); padding: 9px 16px; font-size: .9rem; }
.btn-ghost:hover { background: rgba(255,255,255,.24); color: #fff; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(74, 8, 18, .82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-family: var(--font-display); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-mark);
  display: grid; place-items: center; font-weight: 700; color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); font-size: 1.05rem;
}
.brand-text { font-weight: 500; letter-spacing: .2px; color: #fff; }
.brand-text strong { font-weight: 700; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: rgba(255,255,255,.82); text-decoration: none; font-family: var(--font-display);
  font-weight: 500; font-size: .95rem; transition: color .15s ease; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; background: var(--gold);
}
.nav-cta { margin-left: 4px; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; background: var(--grad-hero); }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px);
  opacity: .5;
}
.hero-bg::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -160px;
  background: radial-gradient(circle, rgba(243,201,105,.22), transparent 62%); filter: blur(8px);
}
.hero-inner { padding: 74px 22px 84px; text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-weight: 600; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  background: rgba(243,201,105,.12); border: 1px solid rgba(243,201,105,.3);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero-title { font-size: clamp(2.05rem, 5.6vw, 3.6rem); font-weight: 700; margin: 0 0 18px; letter-spacing: -.5px; }
.hero-title .hl { color: var(--gold); }
.hero-sub { font-size: clamp(1.02rem, 2.1vw, 1.22rem); max-width: 640px; margin: 0 auto 30px; color: rgba(255,255,255,.92); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 54px; }
.hero-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.stat {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-sm); padding: 16px 26px; min-width: 150px; backdrop-filter: blur(4px);
}
.stat-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--gold); line-height: 1; }
.stat-label { display: block; font-size: .86rem; color: rgba(255,255,255,.82); margin-top: 6px; }

/* ---------- Save banner ---------- */
.save-banner {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-tint); border: 1px solid var(--line); border-left: 5px solid var(--red-500);
  border-radius: var(--radius); padding: 24px 26px; margin: -40px auto 0; position: relative; z-index: 5;
  box-shadow: var(--shadow-md);
}
.save-banner-icon { font-size: 1.8rem; line-height: 1.3; }
.save-banner p { margin: 0 0 .4em; }
.save-banner p:last-child { margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-alt { background: var(--bg-alt); }
.section-tag {
  display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  letter-spacing: .08em; color: var(--red-600); background: var(--bg-tint);
  border: 1px solid var(--line); padding: 5px 14px; border-radius: 999px; margin-bottom: 16px;
}
.section-tag.center { display: block; width: max-content; margin-left: auto; margin-right: auto; }
.section-title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 700; margin-bottom: .8em; }
.section-title.center { text-align: center; }
section[id] { scroll-margin-top: 80px; }

/* ---------- Pullquote / Problem ---------- */
.pullquote {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  color: var(--red-700); border-left: 4px solid var(--red-500); padding: 6px 0 6px 22px; margin: 0 0 1.2em;
  line-height: 1.45;
}
.resolution {
  display: flex; gap: 14px; align-items: flex-start; background: var(--bg-tint);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 18px; border: 1px solid var(--line);
}
.resolution span { font-size: 1.5rem; line-height: 1.4; }
.resolution p { margin: 0; }

/* ---------- Compare ---------- */
.compare { display: flex; gap: 16px; align-items: stretch; margin: 26px 0; flex-wrap: wrap; }
.compare-card { flex: 1 1 240px; border-radius: var(--radius); padding: 22px; }
.compare-card h3 { font-size: 1.1rem; margin-bottom: .35em; }
.compare-card p { margin: 0; }
.compare-before { background: #f3eef0; border: 1px dashed #c9b8bd; color: var(--ink-soft); }
.compare-after { background: var(--grad-mark); color: #fff; box-shadow: var(--shadow-md); }
.compare-after h3 { color: #fff; }
.compare-arrow { display: grid; place-items: center; font-size: 1.8rem; color: var(--red-500); font-weight: 700; }

/* ---------- Diagram ---------- */
.diagram { margin: 30px 0; padding: 30px 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-sm); }
.diagram-node {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: #fff; background: var(--grad-mark); padding: 14px 28px; border-radius: 14px; box-shadow: var(--shadow-md);
}
.diagram-link { position: relative; height: 46px; display: grid; place-items: center; }
.diagram-link::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red-300, #d98a98); left: 50%; transform: translateX(-50%); }
.diagram-pill {
  position: relative; font-family: var(--font-mono); font-weight: 600; font-size: .85rem; letter-spacing: .1em;
  background: var(--gold); color: var(--red-900); padding: 5px 16px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.diagram-apps { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.chip {
  font-family: var(--font-display); font-weight: 500; font-size: .92rem; background: var(--bg-tint);
  border: 1px solid var(--line); color: var(--red-700); padding: 8px 16px; border-radius: 10px;
}
.diagram figcaption { margin-top: 18px; font-size: .9rem; }

/* ---------- Example box ---------- */
.example-box { background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 22px 24px; margin: 24px 0; box-shadow: var(--shadow-sm); }
.example-box h3 { font-size: 1.05rem; color: var(--red-700); margin-bottom: .4em; }
.example-box p { margin: 0; }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 36px 0 0; display: grid; gap: 26px; }
.step-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 30px 32px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.step-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-mark); }
.step-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.step-num {
  flex: none; width: 46px; height: 46px; border-radius: 13px; background: var(--grad-mark); color: #fff;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  box-shadow: var(--shadow-md);
}
.step-head h3 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.4rem); }

/* ---------- Mini / scope grids ---------- */
.mini-grid, .scope-grid { display: grid; gap: 14px; margin: 16px 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mini-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.mini-card h4 { margin: 0 0 .35em; color: var(--red-700); font-size: 1rem; }
.mini-card p { margin: 0; font-size: .96rem; }

.scope-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.scope-card p { margin: 8px 0 0; font-size: .95rem; }
.scope-badge { font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; display: inline-block; }
.scope-highlight { background: var(--grad-mark); color: #fff; border-color: transparent; box-shadow: var(--shadow-md); }
.scope-highlight .scope-badge { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.3); }
.scope-highlight code { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Callouts ---------- */
.callout { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius-sm); padding: 16px 20px; margin: 18px 0; border: 1px solid; }
.callout p { margin: 0; }
.callout-icon { font-size: 1.4rem; line-height: 1.4; flex: none; }
.callout-tip  { background: #fff8e8; border-color: #f0dca0; }
.callout-good { background: #eef7f0; border-color: #bfe0c8; }
.callout-warn { background: var(--bg-tint); border-color: #f1bcc6; }

/* ---------- Result box ---------- */
.result-box { display: flex; gap: 14px; align-items: center; background: var(--grad-mark); color: #fff; border-radius: var(--radius-sm); padding: 18px 22px; margin-top: 18px; box-shadow: var(--shadow-md); }
.result-box span { font-size: 1.6rem; }
.result-box p { margin: 0; }
.result-box strong { color: var(--gold); }

/* ---------- Code blocks ---------- */
.code-block { position: relative; background: #2a0c14; border-radius: var(--radius-sm); margin: 14px 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.code-block pre { margin: 0; padding: 16px 110px 16px 20px; overflow-x: auto; }
.code-block.tight pre { padding: 12px 96px 12px 16px; }
.code-block code { font-family: var(--font-mono); font-size: .95rem; color: #ffe3e8; }
.c-prompt { color: #f3a; color: #ff8aa3; user-select: none; }
.c-cmd { color: var(--gold); }
.c-arg { color: #9fd0ff; }
.copy-btn {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-display); font-weight: 600; font-size: .78rem;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22);
  padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: background .15s ease;
}
.copy-btn:hover { background: rgba(255,255,255,.24); }
.copy-btn.copied { background: var(--gold); color: var(--red-900); border-color: transparent; }

/* inline code */
:not(pre) > code { background: var(--bg-tint); color: var(--red-700); padding: 2px 7px; border-radius: 6px; font-size: .9em; border: 1px solid var(--line); }

/* ---------- Cheat sheet ---------- */
.cheat-grid { display: grid; gap: 16px; margin-top: 22px; }
.cheat-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 18px; align-items: center; }
.cheat-row p { margin: 0; }

/* ---------- Summary ---------- */
.summary-card { background: var(--grad-hero); color: #fff; border-radius: var(--radius); padding: 38px 34px; box-shadow: var(--shadow-lg); text-align: center; }
.summary-list { list-style: none; padding: 0; margin: 0 auto 22px; max-width: 460px; text-align: left; display: grid; gap: 12px; }
.summary-list li { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 1.05rem; }
.summary-list code { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.25); }
.summary-quote { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--gold); margin: 0 0 .6em; }
.summary-by { margin: 0; color: rgba(255,255,255,.9); }
.summary-by a { color: #fff; }

/* ---------- Share ---------- */
.share-section { padding-top: 30px; }
.share-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn-share { background: var(--white); color: var(--red-700); border: 2px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-share:hover { border-color: var(--red-400); color: var(--red-600); }

/* ---------- Footer ---------- */
.site-footer { background: var(--red-900); color: rgba(255,255,255,.82); padding: 40px 0; margin-top: 20px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.brand-footer .brand-text { color: #fff; }
.footer-note { margin: 4px 0 0; }
.footer-note a { color: var(--gold); }
.footer-copy { margin: 0; font-size: .85rem; color: rgba(255,255,255,.55); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .compare-arrow { transform: rotate(90deg); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav-cta { display: none; }
  .hero-inner { padding: 54px 20px 64px; }
  .save-banner { flex-direction: column; gap: 10px; padding: 20px; }
  .step-card { padding: 24px 20px 26px; }
  .cheat-row { grid-template-columns: 1fr; gap: 8px; }
  .stat { min-width: 120px; padding: 14px 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
