:root {
  --color-bg: #ffffff;
  --color-bg-alt: #faf8f5;
  --color-bg-warm: #f6f5f4;
  --color-text: rgba(17, 17, 16, 0.95);
  --color-text-2: #615d59;
  --color-text-3: #a39e98;
  --color-accent: #0075de;
  --color-accent-soft: #eaf3fc;
  --color-accent-active: #005bab;
  --color-ink: #31302e;
  --color-line: rgba(0, 0, 0, 0.08);
  --color-line-strong: rgba(0, 0, 0, 0.12);
  --shadow-card: rgba(24, 22, 18, 0.05) 0px 2px 6px, rgba(24, 22, 18, 0.04) 0px 12px 32px;
  --shadow-hover: rgba(24, 22, 18, 0.08) 0px 6px 18px, rgba(24, 22, 18, 0.05) 0px 18px 48px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font: 'Inter', 'Sarabun', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --read-width: 700px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.03em; }

/* ---------- Ambient background ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(0, 117, 222, 0.05), transparent 60%),
    radial-gradient(700px 360px at 90% 20%, rgba(255, 193, 128, 0.05), transparent 55%);
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--color-line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); font-weight: 700; font-size: 16px; min-width: 0; }
.brand-name { white-space: nowrap; letter-spacing: -0.2px; }
.brand-dot {
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(0,117,222,0.35);
  animation: pulse 3.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,117,222,0.30); }
  70% { box-shadow: 0 0 0 9px rgba(0,117,222,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,117,222,0); }
}
.nav-links { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--color-text-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: color 0.15s; white-space: nowrap; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--color-accent); transition: right 0.2s ease; border-radius: 2px;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-links a:hover::after { right: 0; }
.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-line-strong);
  border-radius: 999px;
  background: var(--color-bg);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.lang-btn {
  background: transparent;
  border: none;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--color-text-2);
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.lang-btn:not(.active):hover { background: var(--color-bg-warm); color: var(--color-text); transform: translateY(-1px); }
.lang-btn.active { background: var(--color-accent); color: #fff; box-shadow: 0 2px 8px rgba(0,117,222,0.35); }
.nav-links a.active { color: var(--color-accent); font-weight: 700; }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--color-accent); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px; margin: 0 auto;
  padding: 52px 32px 72px;
  text-align: center;
  overflow-wrap: break-word;
}
/* Banner: full-bleed, edge to edge, flush under the nav */
.banner-wrap {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  position: relative;
}
.banner-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
}
.banner-wrap:hover .banner-img { transform: scale(1.01); filter: saturate(1.05); }
.banner-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 72%, rgba(20,18,15,0.14) 100%);
  pointer-events: none;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--color-accent); text-transform: uppercase; letter-spacing: 0.16em;
  margin-bottom: 18px; overflow-wrap: break-word;
}
.hero h1 {
  font-size: clamp(38px, 6.2vw, 68px);
  font-weight: 700; line-height: 1.06; letter-spacing: -2.2px;
  margin-bottom: 22px; overflow-wrap: break-word;
  max-width: 800px; margin-left: auto; margin-right: auto;
}
.hero-sub {
  max-width: 560px; margin: 0 auto 38px;
  font-size: 18.5px; font-weight: 400; line-height: 1.55;
  color: var(--color-text-2); overflow-wrap: break-word;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: 15px; font-weight: 600; text-align: center;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-accent); color: #fff; box-shadow: 0 6px 18px rgba(0,117,222,0.22); }
.btn-primary:hover { background: var(--color-accent-active); box-shadow: 0 8px 24px rgba(0,117,222,0.30); }
.btn-secondary { background: var(--color-bg-warm); color: var(--color-ink); border: 1px solid var(--color-line-strong); }
.btn-secondary:hover { background: rgba(0,0,0,0.07); }
.hero-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--color-text-3); }
.hero-meta .mono-chip {
  background: var(--color-bg-warm); border: 1px solid var(--color-line);
  padding: 5px 12px; border-radius: 999px; font-family: var(--mono); font-size: 12px;
}
.dot-sep { color: var(--color-text-3); }

/* ---------- Sections ---------- */
.section { padding: 88px 28px; overflow-wrap: break-word; }
.section-alt { background: var(--color-bg-alt); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.section-head { max-width: 1080px; margin: 0 auto 44px; text-align: center; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; letter-spacing: -1.6px; line-height: 1.12; overflow-wrap: break-word; }
.section-head .lede { max-width: 520px; margin: 12px auto 0; color: var(--color-text-2); font-size: 16.5px; }

/* ---------- Cast ---------- */
.cast-grid {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px;
}
.cast-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 30px 28px 26px;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  position: relative;
  overflow: hidden;
}
.cast-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), rgba(0,117,222,0)); opacity: 0;
  transition: opacity 0.22s;
}
.cast-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: var(--color-line-strong); }
.cast-card:hover::before { opacity: 1; }
.cast-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 17px; font-weight: 600;
  color: #fff; background: var(--color-ink); margin-bottom: 16px;
  letter-spacing: 0;
}
.cast-card:nth-child(1) .cast-avatar { background: linear-gradient(135deg, #0075de, #2a9d99); }
.cast-card:nth-child(2) .cast-avatar { background: linear-gradient(135deg, #31302e, #615d59); }
.cast-card:nth-child(3) .cast-avatar { background: linear-gradient(135deg, #391c57, #0075de); }
.cast-card:nth-child(4) .cast-avatar { background: linear-gradient(135deg, #dd5b00, #f0b429); }
.cast-role {
  font-family: var(--mono); font-size: 11px; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 7px;
}
.cast-name { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 8px; }
.cast-line { font-size: 14.5px; color: var(--color-text-2); line-height: 1.6; }

/* ---------- Entries (timeline) ---------- */
.entry-list { max-width: var(--read-width); margin: 0 auto; display: flex; flex-direction: column; gap: 30px; }
.news-card {
  display: block;
  padding: 26px 28px;
  background: var(--color-card, var(--color-bg));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.news-card:hover { transform: translateY(-2px); border-color: var(--color-accent); box-shadow: 0 8px 28px rgba(0,0,0,0.08); }
.news-highlight { color: var(--color-text-soft); font-size: 15.5px; line-height: 1.7; margin-top: 4px; }
.news-readmore { color: var(--color-accent); font-size: 14px; font-weight: 600; margin-top: 12px; }
.btn-back { margin-bottom: 20px; display: inline-flex; align-items: center; gap: 6px; }
.entry-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 34px 36px 30px;
  overflow-wrap: break-word;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
}
.entry-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--color-line-strong); }
.entry-card:first-child { border-left: 3px solid var(--color-accent); }
.entry-date {
  font-family: var(--mono); font-size: 12px; color: var(--color-text-3);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  display: inline-flex; align-items: center; gap: 8px;
}
.entry-date::before { content: "◷"; color: var(--color-accent); }
.entry-title { font-size: 25px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 16px; overflow-wrap: break-word; line-height: 1.25; }
.entry-body { color: var(--color-text); font-size: 16.5px; line-height: 1.7; overflow-wrap: break-word; word-break: normal; }
.entry-tldr {
  margin: 14px 0 22px;
  padding: 14px 18px;
  background: rgba(0, 117, 222, 0.07);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  line-height: 1.65;
}
.tldr-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.entry-tldr p { margin: 0; }
.entry-tldr ul.tldr-list { margin: 4px 0 0; padding-left: 20px; list-style: disc; }
.entry-tldr ul.tldr-list li { margin-bottom: 5px; line-height: 1.6; }
.entry-tldr ul.tldr-list li:last-child { margin-bottom: 0; }
.entry-body p { margin-bottom: 14px; }
  .entry-body p:last-child { margin-bottom: 0; }
  .entry-body p::first-letter { font-weight: 600; }
  .entry-body ul.md-list, .entry-body ol.md-list { margin: 0 0 14px; padding-left: 22px; list-style-position: outside; }
  .entry-body ul.md-list { list-style: disc; }
  .entry-body ol.md-list { list-style: decimal; }
  .entry-body li { margin-bottom: 7px; line-height: 1.65; }
  .entry-body li:last-child { margin-bottom: 0; }
  .entry-body code { font-family: var(--mono); background: var(--color-bg-deep); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
  .entry-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
  .entry-body em { font-style: italic; }
.load-more-wrap { max-width: var(--read-width); margin: 36px auto 0; text-align: center; }
.btn-load-more { display: inline-flex; align-items: center; gap: 8px; }
.btn-load-more::after { content: "↓"; font-family: var(--mono); }

/* ---------- About ---------- */
.about-card {
  max-width: var(--read-width); margin: 0 auto;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 44px;
}
.about-body { font-size: 17px; color: var(--color-text); line-height: 1.7; }
.about-body p { margin-bottom: 16px; }
.about-body p:last-child { margin-bottom: 0; }
.placeholder-text { font-style: italic; color: var(--color-text-3); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--color-line); padding: 32px 28px; background: var(--color-bg-warm); }
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--color-text-3); font-size: 13px; overflow-wrap: break-word; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-inner { padding: 12px 20px; }
  .lang-switch { margin-left: auto; }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 0;
    margin-top: 2px;
  }
}

@media (max-width: 640px) {
  .nav-inner { padding: 11px 16px; }
  .nav-links a { font-size: 13.5px; }
  .lang-btn { padding: 5px 10px; font-size: 12px; }
  .hero { padding: 34px 16px 52px; }
  .hero h1 { font-size: clamp(30px, 9vw, 44px); letter-spacing: -1.4px; }
  .hero-sub { font-size: 16.5px; }
  .btn { width: 100%; max-width: 340px; }
  .section { padding: 60px 18px; }
  .cast-grid { grid-template-columns: 1fr; }
  .entry-card { padding: 24px 20px; }
  .entry-title { font-size: 21px; }
  .entry-body { font-size: 15.5px; }
  .about-card { padding: 28px 22px; }
}

@media (max-width: 380px) {
  .nav-inner { gap: 6px 10px; }
  .nav-links { gap: 12px; }
  .hero h1 { font-size: clamp(26px, 8.5vw, 36px); }
  .entry-body { font-size: 15px; }
}