/* ============================================================
   Claude Professional Training — Design System
   หลักสูตรการใช้งาน Claude อย่างมืออาชีพ
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Warm "Claude" palette */
  --clay-900: #2b1a12;
  --clay-800: #3a2418;
  --clay-700: #5a3826;
  --ink:      #2a221d;
  --ink-soft: #5c5048;
  --ink-mute: #8a7d72;

  --coral:      #d97757;   /* signature Claude coral */
  --coral-deep: #c05f3f;
  --coral-soft: #f0b49b;
  --coral-wash: #fbeae1;

  --amber:  #e0a458;
  --sage:   #7d9471;
  --teal:   #4f8a83;
  --plum:   #8a6a8f;
  --sky:    #6c8fb5;

  --paper:   #fbf7f2;
  --paper-2: #f5ede4;
  --paper-3: #efe4d7;
  --card:    #fffdfb;
  --line:    #e6d9ca;
  --line-soft: #efe6da;

  --shadow-sm: 0 1px 2px rgba(60,40,25,.06), 0 2px 6px rgba(60,40,25,.05);
  --shadow-md: 0 4px 14px rgba(70,45,25,.09), 0 10px 30px rgba(70,45,25,.07);
  --shadow-lg: 0 12px 40px rgba(70,45,25,.14), 0 30px 60px rgba(70,45,25,.10);

  --radius:   14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --font-th: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 86px; }

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

/* Textured warm background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 600px at 8% -8%, rgba(217,119,87,.10), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(224,164,88,.10), transparent 55%),
    radial-gradient(1000px 800px at 50% 120%, rgba(125,148,113,.08), transparent 60%),
    var(--paper);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .4;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
h1,h2,h3,h4 { color: var(--clay-900); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.25rem); margin: 0 0 .5em; }
h3 { font-size: 1.28rem; }
p { margin: 0 0 1em; }
a { color: var(--coral-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--coral-deep);
}
.lead { font-size: 1.16rem; color: var(--ink-soft); }
strong { color: var(--clay-800); font-weight: 600; }
mark { background: linear-gradient(transparent 55%, var(--coral-soft) 55%); color: inherit; padding: 0 1px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(251,247,242,.82);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--clay-900); font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.brand .spark { width: 30px; height: 30px; flex: none; }
.brand small { display:block; font-weight:400; font-size:.7rem; color: var(--ink-mute); letter-spacing:.02em; margin-top:-3px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-soft); font-size: .93rem; font-weight: 500;
  padding: 7px 13px; border-radius: 9px; transition: .18s;
}
.nav-links a:hover { background: var(--paper-3); color: var(--clay-800); text-decoration: none; }
.nav-links a.active { background: var(--coral); color: #fff; }
.nav-toggle { display:none; }

/* burger — base appearance defined BEFORE the media query so the query's display:flex wins at mobile widths */
.nav-burger { display:none; cursor:pointer; width:42px; height:38px; align-items:center; justify-content:center; border-radius:9px; margin-left:auto; }
.nav-burger:hover { background: var(--paper-3); }
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content:""; display:block; width:20px; height:2px; background: var(--clay-800); border-radius:2px; position:relative;
}
.nav-burger span::before { position:absolute; top:-6px; }
.nav-burger span::after { position:absolute; top:6px; }

@media (max-width: 900px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 10px 16px 16px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; opacity:0; transition: .25s;
  }
  .nav-links a { padding: 11px 14px; }
  .nav input.nav-toggle:checked ~ .nav-links { max-height: 520px; opacity:1; padding-top:10px; }
  .nav-burger { display:flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-th); font-weight: 600; font-size: 1rem;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: .2s; text-decoration: none;
}
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(217,119,87,.35); }
.btn-primary:hover { background: var(--coral-deep); text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(217,119,87,.42); }
.btn-ghost { background: var(--card); color: var(--clay-800); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

/* ---------- Section spacing ---------- */
.section { padding: 84px 0; }
.section-sm { padding: 52px 0; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-left:auto; margin-right:auto; text-align:center; }

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; background: var(--coral-wash); color: var(--coral-deep);
  border: 1px solid rgba(217,119,87,.22);
}
.pill.ghost { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Prompt / example blocks ---------- */
.example {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow-sm); margin: 24px 0;
}
.example-tab {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  letter-spacing: .04em; padding: 12px 18px; color: #fff;
}
.example-tab .ic { width: 17px; height: 17px; }
.tab-prompt { background: linear-gradient(100deg, #3a2418, #5a3826); }
.tab-py { background: linear-gradient(100deg, #2f4858, #3f6a7a); }
.tab-flow { background: linear-gradient(100deg, #5a3826, #7d5a3a); }
.prompt-body {
  font-family: var(--font-mono); font-size: .92rem; line-height: 1.7;
  padding: 18px 20px; color: var(--clay-800);
  background: repeating-linear-gradient(180deg, #fffdfb, #fffdfb 27px, #faf3ec 27px, #faf3ec 28px);
  white-space: pre-wrap;
}
.prompt-body.code { background: #2b2320; color: #f2e6db; }
.prompt-body.code .cm { color: #a99; }
.prompt-body.code .kw { color: var(--coral-soft); }
.prompt-body.code .st { color: #b8cf9e; }

/* result / teaching-note strips under examples */
.strip { display: grid; gap: 0; }
.strip .row { padding: 15px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 13px; }
.strip .row .lbl { font-weight: 700; font-size: .8rem; color: var(--coral-deep); flex: none; width: 118px; padding-top: 2px; }
.strip .row.teach .lbl { color: var(--sage); }
.strip .row p { margin: 0; font-size: .96rem; color: var(--ink-soft); }
@media (max-width:640px){ .strip .row { flex-direction: column; gap: 4px; } .strip .row .lbl{ width:auto; } }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius); padding: 20px 22px 20px 54px; position: relative;
  margin: 22px 0; font-size: .98rem; border: 1px solid;
}
.callout .cico { position: absolute; left: 18px; top: 19px; width: 24px; height: 24px; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { background: #fdf0e8; border-color: #f2c6ac; color: #7a3f22; }
.callout-info { background: #eef4f6; border-color: #c2dbe0; color: #2f5560; }
.callout-tip  { background: #eef4ec; border-color: #cbdcc4; color: #43593a; }
.callout-note { background: var(--paper-2); border-color: var(--line); color: var(--ink-soft); }
.callout strong { color: inherit; }

/* ---------- Feature / concept grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .grid-3,.grid-4 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 620px){ .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr;} }

.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: .25s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--coral-soft); }
.feature .ficon { width: 46px; height: 46px; margin-bottom: 14px; }
.feature h3 { margin: 0 0 8px; font-size: 1.12rem; }
.feature p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Comparison table ---------- */
.tbl { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .96rem; overflow:hidden; border-radius: var(--radius); }
.tbl th, .tbl td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl thead th { background: var(--clay-800); color: #fff; font-weight: 600; font-size: .9rem; letter-spacing:.01em; }
.tbl thead th:first-child { border-top-left-radius: var(--radius); }
.tbl thead th:last-child { border-top-right-radius: var(--radius); }
.tbl tbody tr:nth-child(even) { background: var(--paper-2); }
.tbl tbody tr:hover { background: var(--coral-wash); }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tbl-wrap .tbl { margin: 0; }
.yes { color: var(--sage); font-weight: 700; }
.care { color: var(--coral-deep); font-weight: 700; }

/* ---------- Exercise block ---------- */
.exercise {
  background: linear-gradient(135deg, #fff8f2, #fdf1e8);
  border: 1px solid #f2d3bd; border-radius: var(--radius-lg);
  padding: 24px 26px; margin: 26px 0; position: relative;
}
.exercise::before {
  content:""; position:absolute; left:0; top:20px; bottom:20px; width:4px;
  border-radius: 4px; background: linear-gradient(var(--coral), var(--amber));
}
.exercise h4 { display:flex; align-items:center; gap:9px; margin:0 0 12px; color: var(--coral-deep); }
.exercise ol { margin: 0; padding-left: 22px; }
.exercise li { margin-bottom: 8px; color: var(--ink-soft); }
.exercise li::marker { color: var(--coral); font-weight: 700; }

/* mini-project / capstone */
.project {
  border-radius: var(--radius-lg); padding: 28px 30px; margin: 30px 0; color:#fff;
  background: linear-gradient(120deg, var(--clay-800), var(--clay-700));
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.project.gold { background: linear-gradient(120deg, #6b4a2a, #9a6a34); }
.project h3 { color:#fff; display:flex; align-items:center; gap:10px; margin-top:0; }
.project ol, .project ul { color: rgba(255,255,255,.9); }
.project li { margin-bottom: 7px; }
.project .deco { position:absolute; right:-40px; top:-40px; width:200px; height:200px; opacity:.14; }

/* ---------- Module card (level pages) ---------- */
.module {
  scroll-margin-top: 90px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 40px;
}
.module-head {
  display: flex; align-items: flex-start; gap: 20px; padding: 30px 32px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(120deg, var(--paper-2), transparent);
}
.module-num {
  flex: none; width: 60px; height: 60px; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-weight: 700; font-size: 1.3rem; box-shadow: var(--shadow-sm);
}
.module-head h3 { margin: 2px 0 6px; font-size: 1.42rem; }
.module-body { padding: 8px 32px 32px; }
.module-body h4 { margin: 26px 0 10px; font-size: 1.1rem; color: var(--clay-800); }
.objectives {
  list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 9px;
}
.objectives li { display: flex; gap: 11px; align-items: flex-start; font-size: .98rem; color: var(--ink-soft); }
.objectives li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--coral); }
@media (max-width:640px){ .module-head { padding: 22px; flex-direction:column; gap:14px; } .module-body{ padding: 4px 22px 26px; } }

/* level intro banner on level pages */
.level-hero { padding: 68px 0 40px; position: relative; }
.level-badge {
  display:inline-flex; align-items:center; gap:10px; padding: 8px 16px; border-radius: 999px;
  font-family: var(--font-display); font-weight:600; font-size:.85rem; letter-spacing:.05em;
  color:#fff; margin-bottom: 20px;
}

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; margin: 22px 0; padding:0; list-style:none; }
.steps li {
  position: relative; padding: 16px 20px 16px 62px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: .98rem; color: var(--ink-soft);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--coral); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 60px; background: var(--clay-900); color: #e9ddd0;
  padding: 56px 0 34px; font-size: .95rem;
}
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #fff; font-size: 1rem; margin: 0 0 14px; }
.footer a { color: #d3bfae; display: block; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer .brand-f { display:flex; align-items:center; gap:11px; color:#fff; font-weight:700; margin-bottom:14px; }
.footer .fine { grid-column: 1/-1; border-top: 1px solid rgba(255,255,255,.12); margin-top: 22px; padding-top: 20px; color: #b09985; font-size: .85rem; }
@media (max-width: 760px){ .footer .wrap { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.divider { height:1px; background: var(--line); border:0; margin: 40px 0; }
.chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.reveal { opacity:0; transform: translateY(20px); transition: .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity:1; transform:none; }
/* if JS disabled, never hide content */
.no-js .reveal { opacity:1 !important; transform:none !important; }
@media (prefers-reduced-motion: reduce){ .reveal{opacity:1;transform:none} * {scroll-behavior:auto} }

/* progress bar */
.progress-bar { position: fixed; top:0; left:0; height:3px; background: linear-gradient(90deg, var(--coral), var(--amber)); z-index:200; width:0; }

/* ---------- Responsive split layouts (hero / two-col sections) ---------- */
.split { display: grid; gap: 40px; align-items: center; }
.split.hero { grid-template-columns: 1.05fr .95fr; }
.split.wide { grid-template-columns: 1.5fr 1fr; }
.split.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) {
  .split { gap: 30px; }
  .split.hero, .split.wide, .split.even { grid-template-columns: 1fr; }
  .split .hero-art, .split .level-art { order: -1; max-width: 320px; margin: 0 auto; }
}
/* stat strip becomes 2x2 then 1-col */
.statstrip { display: grid; grid-template-columns: repeat(4,1fr); }
.statstrip > div { border-right: 1px solid var(--line-soft); }
@media (max-width: 720px) {
  .statstrip { grid-template-columns: repeat(2,1fr); }
  .statstrip > div:nth-child(2){ border-right: none; }
  .statstrip > div:nth-child(1),.statstrip > div:nth-child(2){ border-bottom:1px solid var(--line-soft); }
}
@media (max-width: 420px){
  .statstrip { grid-template-columns: 1fr; }
  .statstrip > div { border-right: none !important; border-bottom: 1px solid var(--line-soft); }
}
