:root {
  --bg: #050506;
  --bg-2: #0b0b0e;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f6;
  --muted: #8d8d97;
  --faint: #55555e;
  --rainbow: linear-gradient(100deg, #ff3d6e, #ff8a3d, #ffd23d, #4ade80, #22d3ee, #6366f1, #c026d3);
  --radius: 22px;
  --font-display: 'Sora', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Thai', 'Sora', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* film grain */
  content: '';
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--font-display); font-size: 12px; letter-spacing: .32em; font-weight: 400;
  color: var(--muted); margin: 0 0 18px;
}
.rainbow-text {
  background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------------------------------------------------------- announcement + nav */
.announcement {
  position: relative; z-index: 60; text-align: center; font-size: 14px; padding: 10px 16px;
  background: #0d0d10; border-bottom: 1px solid var(--line);
}
.announcement::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--rainbow); opacity: .6;
}
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 56px);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(5, 5, 6, .72); backdrop-filter: blur(18px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 17px; letter-spacing: .02em; }
.brand b { font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); font-size: 14px; font-family: var(--font-display); }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta { color: var(--text); padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 999px; }
.nav-links .nav-cta:hover { border-color: var(--text); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; min-height: min(calc(100vh - 64px), 980px); display: grid; place-items: center;
  padding: 40px 16px 120px; text-align: center; overflow: hidden;
}
.hero-glow {
  position: absolute; width: min(900px, 140vw); aspect-ratio: 1; top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  background: conic-gradient(from 0deg, #ff3d6e, #ff8a3d, #ffd23d, #4ade80, #22d3ee, #6366f1, #c026d3, #ff3d6e);
  border-radius: 50%; filter: blur(140px); opacity: .16;
  animation: spin 28s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -58%) rotate(360deg); } }
.hero-inner { position: relative; max-width: 820px; }
.hero-logo { width: clamp(170px, 26vw, 280px); margin: 0 auto 40px; animation: float 7s ease-in-out infinite; }
.hero-logo img { width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgba(120, 80, 255, .25)); }
@keyframes float { 50% { transform: translateY(-12px); } }
.hero h1 { font-size: clamp(40px, 7vw, 84px); line-height: 1.05; font-weight: 700; }
.hero-sub { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); max-width: 620px; margin: 24px auto 40px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px; border: 1px solid var(--line-strong); border-radius: 12px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--text); border-radius: 2px; animation: wheel 2s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  padding: 14px 28px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .3s, background .2s, border-color .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--text); color: #050506; }
.btn-primary:hover { box-shadow: 0 10px 40px rgba(255, 255, 255, .15); }
.btn-ghost { color: var(--text); border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.btn-rainbow { position: relative; color: #fff; background: #0b0b0e; isolation: isolate; }
.btn-rainbow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: var(--rainbow); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.btn-rainbow:hover { box-shadow: 0 8px 36px rgba(150, 90, 255, .3); }
.btn[disabled] { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(80px, 12vw, 140px) clamp(16px, 4vw, 56px); max-width: 1320px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: clamp(48px, 7vw, 80px); }
.section-head h2 { font-size: clamp(30px, 4.4vw, 52px); margin-bottom: 14px; }

/* ---------------------------------------------------------------- program grid */
.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.grid > .card { flex: 1 1 300px; max-width: 380px; min-width: 0; }
.loading, .error { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; }

.card {
  position: relative; display: flex; flex-direction: column;
  padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); cursor: pointer;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s, box-shadow .35s;
  opacity: 0; transform: translateY(24px);
}
.card.in { opacity: 1; transform: none; }
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); }
.card:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 3px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-logo { position: relative; width: 120px; height: 120px; flex: none; margin: -12px 0 -12px -14px; }
.card-logo img { width: 100%; height: 100%; object-fit: contain; transition: filter .4s, transform .4s; }
.card:hover .card-logo img { transform: scale(1.04); }
.card h3 { font-size: 22px; margin: 24px 0 2px; }
.card .category { font-family: var(--font-display); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.card .tagline { color: var(--muted); font-size: 15px; margin: 12px 0 22px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-foot .meta { font-size: 13px; color: var(--faint); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.available { color: #4ade80; border-color: rgba(74, 222, 128, .3); }
.chip.beta { color: #fbbf24; border-color: rgba(251, 191, 36, .3); }
.chip.soon { color: var(--muted); }

/* coming soon state */
.soon .card-logo img { filter: grayscale(1) brightness(.55) contrast(1.1); }
.card.soon:hover .card-logo img { filter: grayscale(1) brightness(.7); }
.soon-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-12deg);
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .2em; white-space: nowrap;
  padding: 6px 12px; color: #fff; background: rgba(5, 5, 6, .82); border: 1px solid var(--line-strong);
  border-radius: 6px; backdrop-filter: blur(4px);
}
.dev-note {
  margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .03);
  border: 1px dashed var(--line-strong); font-size: 14px; color: var(--muted);
}
.dev-note strong { display: block; font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--rainbow); border-radius: inherit; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; color: var(--faint); }

/* ---------------------------------------------------------------- about */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pillar { background: var(--bg); padding: 40px 34px; }
.pillar-num { font-family: var(--font-display); font-size: 13px; color: var(--faint); margin-bottom: 40px; }
.pillar h3 { font-size: 22px; margin-bottom: 12px; }
.pillar p { color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- feedback */
.fb-form, .fb-done {
  max-width: 760px; margin: 0 auto; padding: clamp(24px, 4vw, 40px); border-radius: 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
}
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.fb-types input { position: absolute; opacity: 0; pointer-events: none; }
.fb-types span {
  display: inline-block; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 14px; color: var(--muted); cursor: pointer; transition: all .2s;
}
.fb-types span:hover { color: var(--text); }
.fb-types input:checked + span { color: var(--text); background: var(--surface-2); border-color: var(--text); }
.fb-types input:focus-visible + span { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.fb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fb-grid .full { grid-column: 1 / -1; }
.fb-grid label { position: relative; display: block; font-size: 13px; color: var(--muted); }
.fb-grid input, .fb-grid select, .fb-grid textarea {
  width: 100%; margin-top: 6px; padding: 13px 16px; font: inherit; font-size: 15px; color: var(--text);
  background: rgba(5, 5, 6, .55); border: 1px solid var(--line-strong); border-radius: 14px; transition: border-color .2s;
}
.fb-grid textarea { resize: vertical; line-height: 1.6; }
.fb-grid select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.fb-grid select option { background: #0b0b0e; }
.fb-grid input:focus, .fb-grid select:focus, .fb-grid textarea:focus { outline: none; border-color: #8b5cf6; }
.fb-grid .invalid { border-color: #f87171; }
.opt { color: var(--faint); font-size: 12px; margin-left: 4px; }
.req { color: #f472b6; }
.subject-field { position: relative; display: block; }
.subject-field input { padding-right: 118px; }
.subject-tag {
  position: absolute; right: 8px; top: calc(50% + 3px); transform: translateY(-50%); pointer-events: none;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 9px;
  color: var(--text); background: rgba(255, 255, 255, .07); border: 1px solid var(--line-strong);
}
.counter { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--faint); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.fb-error { flex: 1; margin: 0; color: #f87171; font-size: 14px; }
.fb-done { text-align: center; padding: 56px 24px; }
.fb-done h3 { font-size: 24px; margin: 20px 0 6px; }
.fb-done .btn { margin-top: 18px; }
.fb-check {
  width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  font-size: 28px; color: #4ade80; border: 1px solid rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .08);
}
@media (max-width: 640px) { .fb-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 36px clamp(16px, 4vw, 56px); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.footer-brand, .footer-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-meta a:hover { color: var(--text); }

/* ---------------------------------------------------------------- modal */
.modal {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  background: #0b0b0e; color: var(--text); border: 1px solid var(--line-strong); border-radius: 26px;
}
.modal[open] { animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
.modal::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 22px; cursor: pointer; z-index: 2;
}
.modal-close:hover { background: var(--surface-2); }
.m-head { display: flex; gap: 24px; align-items: center; padding: 36px 36px 28px; border-bottom: 1px solid var(--line); }
.m-head .card-logo { width: 130px; height: 130px; margin: -10px; }
.m-head h2 { font-size: 32px; }
.m-head .category { font-family: var(--font-display); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.m-body { padding: 28px 36px 36px; }
.m-body p { color: var(--muted); }
.m-body h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: .2em; color: var(--faint); font-weight: 400; margin: 28px 0 12px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.features li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; background: var(--surface); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.specs div { background: #0b0b0e; padding: 14px 16px; }
.specs dt { font-size: 12px; color: var(--faint); }
.specs dd { margin: 2px 0 0; font-size: 15px; }
.changelog { white-space: pre-wrap; font-size: 14px; color: var(--muted); padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin: 0; font-family: var(--font-body); }
.m-actions { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .m-head { flex-direction: column; text-align: center; padding: 40px 20px 24px; }
  .m-body { padding: 24px 20px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
}
