:root {
  --paper: #F3F0E8;
  --paper-2: #E9E4D8;
  --ink: #121212;
  --ink-2: #3a3a3a;
  --accent: #FF4A1C;
  --accent-2: #3D3DF5;
  --lime: #C8F04B;
  --radius: 14px;
  --font-head: "Bai Jamjuree", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--ink);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 38px; height: 38px; color: var(--ink); }
.logo-text { font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; line-height: 1; display: flex; flex-direction: column; }
.logo-text small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.35em; color: var(--accent); margin-top: 3px; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; font-size: 15px; position: relative; }
.nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--accent); transition: width .25s; }
.nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta { background: var(--ink); color: var(--paper) !important; padding: 8px 18px; border-radius: 999px; transition: background .2s; }
.nav-cta:hover { background: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span:not(.sr) { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .25s; }
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  border: 1.5px solid var(--ink); cursor: pointer; transition: transform .15s, box-shadow .15s, background .2s;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* Hero */
.hero { padding-top: 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-bottom: 64px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.15em; display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.hero h1 { font-size: clamp(42px, 6.4vw, 84px); font-weight: 700; line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; display: inline-block; }
.hero h1 em.alt { color: var(--accent-2); }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.08em; height: 0.14em; background: currentColor; opacity: .18; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36em; margin-top: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-visual { position: relative; }
.screen { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 14px; box-shadow: 10px 10px 0 var(--accent); transform: rotate(2deg); }
.screen-bar { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; }
.screen-bar i { width: 10px; height: 10px; border-radius: 50%; background: #444; }
.screen-bar i:first-child { background: var(--accent); }
.screen-bar span { margin-left: auto; color: var(--accent); animation: pulse 1.2s infinite; }
.screen-body { position: relative; aspect-ratio: 4 / 3; margin: 12px 0; border-radius: 10px; background: linear-gradient(135deg, var(--accent-2), #1b1b6e); overflow: hidden; }
.pixel-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(3, 1fr); }
.pixel-grid span { border: 1px solid rgba(255,255,255,.07); }
.pixel-grid span:nth-child(3n+2) { animation: blink 3s infinite; }
.pixel-grid span:nth-child(5n) { animation: blink 2.2s .6s infinite; }
@keyframes blink { 0%, 100% { background: transparent; } 50% { background: rgba(200,240,75,.35); } }
.play { position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; font-size: 26px; padding-left: 5px; box-shadow: 0 0 0 10px rgba(243,240,232,.18); }
.screen-foot { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em; color: #aaa; }
.sticker { position: absolute; font-family: var(--font-mono); font-weight: 700; font-size: 14px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 999px; }
.s1 { top: -18px; left: -14px; background: var(--lime); transform: rotate(-10deg); }
.s2 { bottom: -16px; right: 8px; background: var(--paper); transform: rotate(6deg); }

.ticker { border-block: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: scroll 28s linear infinite; }
.ticker-track span { font-family: var(--font-head); font-weight: 600; font-size: 22px; padding: 14px 28px; white-space: nowrap; display: flex; align-items: center; gap: 28px; }
.ticker-track span::after { content: "✦"; color: var(--accent); font-size: 16px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Pillars */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-block: 72px 24px; }
.pillar { display: flex; flex-direction: column; gap: 14px; padding: 36px; border: 1.5px solid var(--ink); border-radius: var(--radius); text-decoration: none; min-height: 300px; transition: transform .2s, box-shadow .2s; }
.pillar:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.pillar-media { background: var(--accent); color: #fff; }
.pillar-game { background: var(--accent-2); color: #fff; }
.pillar-num { font-family: var(--font-mono); font-size: 14px; opacity: .8; }
.pillar h2 { font-size: clamp(30px, 3.6vw, 46px); }
.pillar p { max-width: 30em; opacity: .95; }
.pillar-link { margin-top: auto; font-family: var(--font-head); font-weight: 600; }

/* Sections */
.section { padding-block: 96px; }
.section-head { margin-bottom: 52px; }
.kicker { font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head h2, .contact-copy h2 { font-size: clamp(32px, 4.4vw, 56px); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.card-icon { width: 54px; height: 54px; border-radius: 12px; background: var(--paper-2); display: grid; place-items: center; }
.card-icon svg { width: 32px; height: 32px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.card h3 { font-size: 24px; }
.card p { color: var(--ink-2); }
.card ul { list-style: none; padding: 16px 0 0; margin: auto 0 0; border-top: 1.5px dashed #cfc8b8; display: grid; gap: 6px; font-size: 15px; }
.card li::before { content: "→ "; color: var(--accent); font-weight: 700; }

.section-dark { background: var(--ink); color: var(--paper); }
.section-dark .kicker { color: var(--lime); }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.game-card { border: 1.5px solid #3a3a3a; border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 12px; background: #1a1a1a; transition: border-color .2s, transform .2s; }
.game-card:hover { border-color: var(--lime); transform: translateY(-4px); }
.game-card h3 { font-size: 24px; }
.game-card p { color: #bdb8ad; }
.tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: var(--ink); background: var(--lime); padding: 4px 10px; border-radius: 6px; align-self: flex-start; }
.game-card-wide { grid-column: 1 / -1; background: linear-gradient(110deg, #1a1a1a 55%, #24245e); }
.game-card-wide p { max-width: 44em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.steps li { padding: 30px 26px; border-right: 1.5px solid var(--ink); display: flex; flex-direction: column; gap: 10px; background: var(--paper); transition: background .2s; }
.steps li:last-child { border-right: 0; }
.steps li:hover { background: var(--lime); }
.steps span { font-family: var(--font-mono); font-weight: 700; font-size: 38px; color: var(--accent); line-height: 1; }
.steps h3 { font-size: 22px; }
.steps p { color: var(--ink-2); font-size: 15px; }

/* Contact */
.contact { background: var(--paper-2); border-top: 1.5px solid var(--ink); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-copy > p:not(.kicker) { color: var(--ink-2); margin-top: 18px; max-width: 30em; }
.contact-list { margin: 32px 0 0; display: grid; gap: 14px; }
.contact-list div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; border-bottom: 1.5px solid #cfc8b8; padding-bottom: 12px; }
.contact-list dt { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; color: var(--ink-2); padding-top: 3px; }
.contact-list dd { margin: 0; font-weight: 600; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent); }

.contact-form { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 32px; display: grid; gap: 18px; box-shadow: 8px 8px 0 var(--ink); }
.contact-form > label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.contact-form input:not([type="checkbox"]), .contact-form textarea {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(61,61,245,.2); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 0; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 6px 14px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 14px; cursor: pointer; transition: background .15s; }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.contact-form .btn { justify-self: start; }
.form-note { font-size: 13px; color: var(--ink-2); }

/* Footer */
.site-footer { background: var(--ink); color: var(--paper); padding-block: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; font-size: 14px; }
.footer-inner p { color: #aaa; }

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

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 440px; margin: 20px auto 0; }
  .cards, .game-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(-n+2) { border-bottom: 1.5px solid var(--ink); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1.5px solid var(--ink); padding: 8px 20px 20px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid #ddd6c6; }
  .nav-cta { text-align: center; margin-top: 12px; border-bottom: 0 !important; }
  .pillars, .cards, .game-grid { grid-template-columns: 1fr; }
  .pillar { min-height: 0; padding: 28px; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 1.5px solid var(--ink); }
  .steps li:last-child { border-bottom: 0; }
  .section { padding-block: 72px; }
  .contact-form { padding: 24px; box-shadow: 5px 5px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
