/* ThaiCoin (thc.thaifi.com) — navy/gold brand, dark default + light toggle */

:root {
  --bg: #01052d;
  --bg-soft: #060a38;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #0b1040;
  --border: rgba(212, 175, 55, 0.22);
  --border-soft: rgba(255, 255, 255, 0.1);
  --gold: #d4af37;
  --gold-bright: #e8c25a;
  --gold-dim: rgba(212, 175, 55, 0.65);
  --text: #eef0fa;
  --muted: #a6adcf;
  --link: #e8c25a;
  --code-bg: rgba(0, 0, 0, 0.32);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

html.light {
  --bg: #f6f7fc;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --border: rgba(1, 5, 45, 0.14);
  --border-soft: rgba(1, 5, 45, 0.08);
  --gold: #a87f16;
  --gold-bright: #c89b2c;
  --gold-dim: rgba(168, 127, 22, 0.7);
  --text: #141838;
  --muted: #5b6188;
  --link: #a87f16;
  --code-bg: #eef0f7;
  --shadow: 0 18px 50px rgba(20, 24, 56, 0.12);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
}

/* ambient gold glows */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
body::before { top: -25vw; right: -25vw; }
body::after { bottom: -30vw; left: -30vw; background: radial-gradient(circle, rgba(212, 175, 55, 0.055) 0%, transparent 65%); }

main { position: relative; z-index: 1; }

.container {
  width: min(1100px, 100% - 3rem);
  margin-inline: auto;
}
.container-narrow { width: min(820px, 100% - 3rem); }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: block;
}
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  gap: 1.4rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--gold-bright); }

.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, transform 0.15s;
}
.theme-toggle:hover { border-color: var(--gold); transform: rotate(15deg); }
html:not(.light) .icon-sun { display: none; }
html.light .icon-moon { display: none; }

/* theme-based logo swap: baked-bg squares, show the one matching theme */
.logo-for-light { display: none; }
html.light .logo-for-light { display: block; }
html.light .logo-for-dark { display: none; }

/* ---------- hero ---------- */
.hero {
  padding: 5.5rem 0 4.5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.4rem;
}
h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.15;
  font-weight: 700;
  background: linear-gradient(92deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-bright) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html.light h1 {
  background: linear-gradient(92deg, #b8901f 0%, #8a6a12 55%, #b8901f 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.lead {
  margin-top: 1.2rem;
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 34rem;
}
.lead strong { color: var(--text); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #e8c25a, #c89b2c);
  color: #01052d;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(212, 175, 55, 0.4); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); transform: translateY(-2px); }

.hero-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2.4rem;
}
.hero-stats li { display: flex; flex-direction: column; }
.stat {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--gold-bright);
}
.stat-label { font-size: 0.8rem; color: var(--muted); }

.hero-logo-wrap { display: flex; justify-content: center; }
.hero-logo {
  width: min(420px, 100%);
  height: auto;
  border-radius: 26px;
  box-shadow: var(--shadow);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
.section { padding: 4.5rem 0; }
.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.section-lead {
  color: var(--muted);
  max-width: 46rem;
  margin-bottom: 2.4rem;
  font-size: 1.04rem;
}
.section-lead strong, .panel strong { color: var(--text); }
.section-soft .section-lead strong, .section-soft .panel strong { color: var(--text); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 1.6rem 1.7rem;
  transition: transform 0.18s, border-color 0.18s;
}
.panel:hover { transform: translateY(-3px); border-color: var(--border); }

/* what */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.panel h3 { margin-bottom: 0.9rem; font-size: 1.12rem; }
.panel-yes h3 { color: var(--gold-bright); }
.panel-no h3 { color: var(--muted); }
.panel ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.panel li { padding-left: 1rem; color: var(--muted); }
.panel li strong { color: var(--text); }
.panel-yes li { border-left: 2px solid var(--gold-dim); }
.panel-no li { border-left: 2px solid var(--border-soft); }

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.step {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 1.7rem 1.6rem;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  background: linear-gradient(135deg, #e8c25a, #c89b2c);
  color: #01052d;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.95rem; }
.step a { color: var(--link); }

/* tokens */
.token-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.token-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.token-symbol {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gold-bright);
}
.token-name { color: var(--muted); font-size: 0.95rem; }
.token-card p { color: var(--muted); font-size: 0.98rem; }
.token-card a { color: var(--link); }
.token-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  color: var(--muted);
}
.address {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  word-break: break-all;
  border-top: 1px dashed var(--border-soft);
  padding-top: 0.9rem;
}
.address:hover { color: var(--gold-bright); }

/* agent onboarding (THCFI + wallet CLI) */
.agent-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}
.agent-link:hover { text-decoration: underline; }
.agent-box {
  margin-top: 1.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.7rem;
}
.agent-box h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.agent-sub {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 46rem;
  margin-bottom: 1.5rem;
}
.agent-sub a { color: var(--link); }
.code-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--code-bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.55rem 0.6rem 0.55rem 0.95rem;
}
.code-line code {
  flex: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--link);
  word-break: break-word;
}
.copy-btn {
  flex: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover, .copy-btn.copied { color: var(--gold-bright); border-color: var(--gold); }

/* principles */
.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.principle-card h3 { margin: 0.9rem 0 0.5rem; font-size: 1.1rem; }
.principle-card p { color: var(--muted); font-size: 0.95rem; }
.p-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.35rem;
  color: var(--gold-bright);
  border: 1px solid var(--border);
  background: rgba(212, 175, 55, 0.07);
}

/* transparency */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.trust-item {
  border-left: 3px solid var(--gold-dim);
  padding: 0.2rem 0 0.2rem 1.2rem;
}
.trust-item h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.trust-item p { color: var(--muted); font-size: 0.95rem; }
.trust-item a { color: var(--link); }

/* faq */
.faq {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--panel);
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.9rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}
.faq summary::marker { color: var(--gold-bright); }
.faq[open] summary { color: var(--gold-bright); margin-bottom: 0.5rem; }
.faq p { color: var(--muted); font-size: 0.97rem; }
.faq a { color: var(--link); }

/* terms */
.terms-box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 16px;
  background: var(--panel);
  padding: 1.8rem 2rem;
}
.terms-box h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.terms-box p { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.8rem; }
.terms-box p:last-child { margin-bottom: 0; }
.terms-box strong { color: var(--text); }
.terms-box a { color: var(--link); }

/* footer */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 3rem 0 2.2rem;
  position: relative;
  z-index: 1;
}
.footer-inner { display: flex; flex-direction: column; gap: 1.4rem; }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-logo { width: 56px; height: 56px; border-radius: 12px; }
.footer-title { font-weight: 700; }
.footer-sub { font-size: 0.85rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--gold-bright); }
.footer-copy { font-size: 0.8rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero { padding: 3.5rem 0 3rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-logo-wrap { order: -1; }
  .hero-logo { width: min(300px, 80%); }
  .two-col, .token-grid { grid-template-columns: 1fr; }
  .steps, .principle-grid, .trust-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .section { padding: 3.2rem 0; }
  .code-line { flex-wrap: wrap; }
  .copy-btn { margin-left: auto; }
}

/* selection */
::selection { background: rgba(212, 175, 55, 0.35); }
