:root {
  --bg: #f6f5f1;
  --card: #fdfcfa;
  --ink: #141413;
  --ink-2: #52514e;
  --ink-3: #8a8983;
  --rule: #e3e1da;
  --rule-2: #cfccc3;
  --hover: #efede7;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6;
  --sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --w: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312; --card: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8f8e86;
    --rule: #2b2b29; --rule-2: #3c3c39; --hover: #222220;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #0ca30c; --c7: #9085e9;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.mono { font-family: var(--mono); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: var(--w); margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.mark { text-decoration: none; font-weight: 600; font-size: 17px; }
.mark-b { color: var(--ink-3); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-btn, .burger { font: inherit; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.nav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 15px; font-weight: 500; }
.nav-btn:hover, .burger:hover, .nav-btn[aria-expanded="true"], .burger[aria-expanded="true"] { background: var(--hover); border-color: var(--rule); }
.chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
[aria-expanded="true"] .chev { transform: rotate(180deg); }
.burger { width: 40px; height: 38px; display: grid; place-content: center; gap: 4px; }
.burger span { display: block; width: 18px; height: 1.6px; background: currentColor; border-radius: 2px; }
.nav-btn:focus-visible, .burger:focus-visible, .dd-item:focus-visible, .card:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }

.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 340px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px -12px rgb(0 0 0 / .18); }
.dd-right { min-width: 180px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.dd-item:hover { background: var(--hover); }
.dd-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dd-name { font-weight: 500; font-size: 15px; white-space: nowrap; }
.dd-sub { margin-left: auto; padding-left: 12px; white-space: nowrap; font: 12px var(--mono); color: var(--ink-3); }

/* ---------- hero ---------- */
main { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.hero { padding: 88px 0 56px; max-width: 760px; }
.eyebrow { font: 13px var(--mono); color: var(--ink-3); margin: 0 0 18px; }
h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.06; font-weight: 600; margin: 0 0 22px; letter-spacing: -0.02em; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; max-width: 620px; }
.meta { font: 13px var(--mono); color: var(--ink-3); margin: 0; min-height: 1.5em; }

/* ---------- project boxes ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; padding-bottom: 96px; }
.card { position: relative; display: flex; flex-direction: column; min-height: 300px; padding: 22px 22px 18px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; text-decoration: none; transition: border-color .15s, transform .15s; scroll-margin-top: 90px; }
a.card:hover { border-color: var(--rule-2); transform: translateY(-2px); }
.card.flash { border-color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.idx { font: 12px var(--mono); color: var(--ink-3); }
.motif { width: 76px; height: 48px; }
.motif * { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.motif .fill { fill: var(--accent); stroke: none; }
.motif .faint { stroke: var(--rule-2); }
.card h2 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 600; }
.full { font: 12.5px var(--mono); color: var(--ink-3); margin: 4px 0 12px; }
.tag-line { font-size: 15px; color: var(--ink-2); margin: 0 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-bottom: 16px; }
.tag { font: 11.5px var(--mono); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--rule); padding-top: 14px; font: 12.5px var(--mono); color: var(--ink-2); }
.state { display: inline-flex; align-items: center; gap: 7px; }
.state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.state.live i { background: var(--c6); }
.state.soon i { background: transparent; border: 1.5px solid var(--ink-3); }
.arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
a.card:hover .arrow { transform: translate(2px, -2px); }

.foot { max-width: var(--w); margin: 0 auto; padding: 22px 24px 40px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }

@media (max-width: 560px) {
  .hero { padding: 56px 0 40px; }
  .grid { grid-template-columns: 1fr; }
  .dd-menu { position: fixed; top: 64px; left: 12px; right: 12px; transform: none; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
