:root {
  color-scheme: dark;
  --bg: #06100c;
  --bg-2: #0a1612;
  --surface: rgba(255,255,255,.055);
  --surface-strong: rgba(255,255,255,.085);
  --surface-soft: rgba(255,255,255,.035);
  --border: rgba(255,255,255,.12);
  --text: #f4fbf7;
  --muted: #9bb5aa;
  --faint: #6c8178;
  --primary: #00C96A;
  --primary-2: #34D399;
  --track: #A7F3D0;
  --danger: #ff5c7a;
  --warning: #ffb020;
  --orange: #ff8a3d;
  --shadow: 0 28px 90px rgba(0,0,0,.35);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6fbf8;
  --bg-2: #edf8f1;
  --surface: rgba(255,255,255,.82);
  --surface-strong: #ffffff;
  --surface-soft: rgba(0, 80, 42, .045);
  --border: rgba(10, 35, 24, .12);
  --text: #0b1712;
  --muted: #496057;
  --faint: #718178;
  --shadow: 0 26px 70px rgba(8, 45, 24, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, rgba(0,201,106,.24), transparent 34rem),
    radial-gradient(circle at 90% 5%, rgba(52,211,153,.16), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", sans-serif;
  min-height: 100vh;
}

body.lang-th {
  font-family: "Noto Sans Thai", "IBM Plex Sans Thai Looped", Inter, ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

button, select, textarea {
  font: inherit;
}

.page-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(20px);
  opacity: .5;
  z-index: -1;
}

.page-orb-a {
  width: 260px;
  height: 260px;
  background: rgba(0,201,106,.22);
  top: 140px;
  left: -80px;
}

.page-orb-b {
  width: 320px;
  height: 320px;
  background: rgba(52,211,153,.16);
  right: -120px;
  top: 420px;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
  backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 12px 14px;
  position: sticky;
  top: 12px;
  z-index: 20;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,201,106,.24), rgba(52,211,153,.08));
  border: 1px solid rgba(0,201,106,.35);
}

.brand strong { display: block; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn, .lang-switch button, .small-btn, .copy-btn, .secondary-link {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

.icon-btn {
  width: 40px;
  height: 40px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-soft);
}

.lang-switch button {
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
}

.lang-switch button.active {
  color: #06100c;
  background: var(--primary);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 28px;
  align-items: center;
  padding: 52px 0 72px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,201,106,.32);
  background: rgba(0,201,106,.08);
  color: var(--primary-2);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 20px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 8px rgba(0,201,106,.12);
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(46px, 7vw, 86px);
  line-height: .92;
  letter-spacing: -.07em;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  max-width: 720px;
  margin: 22px 0 0;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.center { justify-content: center; }

.primary-link, .secondary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 16px;
  font-weight: 900;
}

.primary-link {
  background: var(--primary);
  color: #06100c;
  box-shadow: 0 20px 50px rgba(0,201,106,.24);
}

.secondary-link {
  color: var(--text);
}

.as-link { border: 1px solid var(--border); }

.trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.trust-row span {
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 750;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.runtime-frame {
  width: min(100%, 520px);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 80%, transparent), var(--surface));
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 18px;
}

.runtime-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.window-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--border);
  margin-right: 4px;
}

.runtime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.mini-card, .message-preview, .action-preview {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 22px;
  padding: 16px;
}

.mini-card span, .message-preview span, .action-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 900;
  margin-bottom: 8px;
}

.mini-card strong {
  display: block;
  font-size: 28px;
  letter-spacing: -.04em;
}

.mini-card small {
  display: block;
  color: var(--faint);
  margin-top: 4px;
}

.message-preview, .action-preview {
  margin-top: 12px;
}

.message-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.action-preview strong {
  display: block;
  line-height: 1.5;
  color: var(--primary-2);
}

.checker-section, .how-section, .patterns-section, .cta-section {
  padding: 78px 0;
}

.section-heading {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.section-heading.left {
  text-align: left;
  margin-left: 0;
}

.eyebrow {
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 12px;
  font-weight: 950;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1;
  letter-spacing: -.055em;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}

.checker-grid {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border-radius: 30px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.panel h3 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -.035em;
}

.small-btn {
  padding: 10px 12px;
}

textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 22px;
  padding: 16px;
  line-height: 1.6;
  outline: none;
}

html[data-theme="light"] textarea {
  background: rgba(255,255,255,.74);
}

textarea:focus, select:focus {
  border-color: rgba(0,201,106,.58);
  box-shadow: 0 0 0 4px rgba(0,201,106,.12);
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

select {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 16px;
  padding: 12px;
  outline: none;
}

#analyzeBtn {
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  color: #06100c;
  font-weight: 950;
  padding: 12px 18px;
  cursor: pointer;
}

.note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 0;
}

.result-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.result-hero h3 {
  margin: 4px 0 8px;
  font-size: 34px;
  letter-spacing: -.05em;
}

.result-hero p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.score-circle {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 30px;
  font-weight: 950;
}

.score-low { color: var(--primary); }
.score-medium { color: var(--warning); }
.score-high { color: var(--orange); }
.score-critical { color: var(--danger); }

.result-blocks {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.result-block {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 22px;
  padding: 16px;
}

.result-block h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

ul, ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.copy-box {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

html[data-theme="light"] .copy-box {
  background: rgba(255,255,255,.64);
}

.pre-box {
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.copy-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
}

.steps-grid, .pattern-grid {
  display: grid;
  gap: 14px;
}

.steps-grid {
  grid-template-columns: repeat(4, 1fr);
}

.step-card, .pattern-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
}

.step-card span {
  display: inline-flex;
  color: var(--primary-2);
  font-weight: 950;
  margin-bottom: 28px;
}

.step-card h3 {
  margin: 0 0 8px;
  letter-spacing: -.025em;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pattern-grid {
  grid-template-columns: repeat(3, 1fr);
}

.pattern-card {
  font-weight: 900;
  color: var(--text);
  min-height: 90px;
  display: flex;
  align-items: end;
}

.cta-section {
  text-align: center;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top, rgba(0,201,106,.16), transparent 26rem),
    var(--surface);
  border-radius: 34px;
  margin-bottom: 40px;
  padding-left: 18px;
  padding-right: 18px;
}

.cta-section h2 {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -.055em;
}

.cta-section p {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 34px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
}

button:hover, .primary-link:hover, .secondary-link:hover, .copy-btn:hover, .small-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

@media (max-width: 980px) {
  .nav { display: none; }
  .hero-section, .checker-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    justify-content: stretch;
  }
  .runtime-frame {
    width: 100%;
  }
  .steps-grid, .pattern-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    width: min(100% - 20px, 1180px);
    border-radius: 18px;
  }
  .brand small { display: none; }
  main { width: min(100% - 20px, 1180px); }
  .hero-section {
    min-height: auto;
    padding: 42px 0 46px;
  }
  h1 {
    font-size: 46px;
  }
  .controls {
    grid-template-columns: 1fr;
  }
  .result-hero {
    flex-direction: column;
  }
  .steps-grid, .pattern-grid, .runtime-grid {
    grid-template-columns: 1fr;
  }
  textarea {
    min-height: 260px;
  }
}

/* Brand icon + strict dark foundation */
html,
body {
  background: #020A06;
}

.brand-mark {
  overflow: hidden;
  background: #020A06;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

html[data-theme="light"] body {
  background: #020A06;
}

/* Main-site font alignment */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-th: "IBM Plex Sans Thai Looped", "Noto Sans Thai", "Inter", ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-th {
  font-family: var(--font-th);
}

h1,
h2,
h3,
h4,
.brand strong,
.primary-link,
.secondary-link,
button,
.eyebrow {
  font-family: inherit;
}

body.lang-th h1,
body.lang-th h2,
body.lang-th h3,
body.lang-th h4 {
  letter-spacing: -0.045em;
  line-height: 1.06;
}

body.lang-th .hero-subtitle,
body.lang-th .section-heading p,
body.lang-th .step-card p,
body.lang-th .note,
body.lang-th li,
body.lang-th .copy-box {
  line-height: 1.72;
}

/* Force dark-only product theme */
html,
html[data-theme="dark"],
html[data-theme="light"] {
  color-scheme: dark;
  --bg: #020A06;
  --bg-2: #06100c;
  --surface: rgba(255,255,255,.055);
  --surface-strong: rgba(255,255,255,.085);
  --surface-soft: rgba(255,255,255,.035);
  --border: rgba(255,255,255,.12);
  --text: #f4fbf7;
  --muted: #9bb5aa;
  --faint: #6c8178;
}

html[data-theme="light"] body,
body {
  background:
    radial-gradient(circle at 10% -10%, rgba(0,201,106,.24), transparent 34rem),
    radial-gradient(circle at 90% 5%, rgba(52,211,153,.16), transparent 28rem),
    linear-gradient(180deg, #020A06, #06100c);
  color: var(--text);
}

.site-header,
html[data-theme="light"] .site-header {
  background: rgba(8, 18, 14, .82);
  color: var(--text);
}

.panel,
.runtime-frame,
.step-card,
.pattern-card,
.cta-section,
html[data-theme="light"] .panel,
html[data-theme="light"] .runtime-frame,
html[data-theme="light"] .step-card,
html[data-theme="light"] .pattern-card,
html[data-theme="light"] .cta-section {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
  color: var(--text);
}

textarea,
select,
.copy-box,
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] .copy-box {
  background: rgba(0,0,0,.22);
  color: var(--text);
}

/* Main-site strict black background override */
:root,
html,
html[data-theme="dark"],
html[data-theme="light"] {
  --bg: #020A06;
  --bg-2: #020A06;
  --surface: rgba(255, 255, 255, .045);
  --surface-strong: rgba(255, 255, 255, .065);
  --surface-soft: rgba(255, 255, 255, .028);
  --border: rgba(255, 255, 255, .11);
  --text: #F4FBF7;
  --muted: #8EA49A;
  --faint: #62766D;
  color-scheme: dark;
}

html,
body {
  background: #020A06 !important;
  color: var(--text);
}

body {
  background-image: none !important;
}

/* Remove decorative green background blobs */
.page-orb,
.page-orb-a,
.page-orb-b {
  display: none !important;
}

/* Keep header dark, not grey/green */
.site-header,
html[data-theme="light"] .site-header {
  background: rgba(2, 10, 6, .86) !important;
  border-color: rgba(255, 255, 255, .10);
  backdrop-filter: blur(22px);
}

/* Hero should sit on black, not green haze */
.hero-section,
.checker-section,
.how-section,
.patterns-section {
  background: transparent !important;
}

/* Product cards: dark glass only */
.runtime-frame,
.panel,
.step-card,
.pattern-card,
.cta-section,
.mini-card,
.message-preview,
.action-preview,
.result-block,
html[data-theme="light"] .runtime-frame,
html[data-theme="light"] .panel,
html[data-theme="light"] .step-card,
html[data-theme="light"] .pattern-card,
html[data-theme="light"] .cta-section,
html[data-theme="light"] .mini-card,
html[data-theme="light"] .message-preview,
html[data-theme="light"] .action-preview,
html[data-theme="light"] .result-block {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024)) !important;
  color: var(--text);
}

/* CTA still dark, green only as accent */
.cta-section {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024)) !important;
}

/* Hero text contrast */
h1 {
  color: #F4FBF7 !important;
}

.hero-subtitle,
.section-heading p,
.step-card p,
.message-preview p,
.note,
ul,
ol {
  color: var(--muted) !important;
}

/* Accent stays green only in small UI elements */
.pill {
  background: rgba(0, 201, 106, .08) !important;
  border-color: rgba(0, 201, 106, .28) !important;
}

.primary-link,
#analyzeBtn,
.lang-switch button.active {
  background: #00C96A !important;
  color: #020A06 !important;
}
