/* global — โครงหน้า, nav, footer, พื้นผิว */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  background:
    radial-gradient(1100px 500px at 85% -5%, oklch(30% 0.09 295 / 0.35), transparent 60%),
    radial-gradient(900px 420px at 0% 20%, oklch(28% 0.08 220 / 0.28), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
select {
  font: inherit;
}

.page {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: clamp(0.75rem, 2.5vw, 1.5rem);
}

/* ── top nav ─────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  background: oklch(18% 0.045 275 / 0.88);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand em {
  font-style: normal;
  color: var(--gold);
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  align-self: center;
  margin-left: 2px;
  box-shadow: 0 0 10px var(--cyan);
}

.nav-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.nav-search input {
  width: 100%;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 2.6rem 0 1.1rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.nav-search input::placeholder {
  color: var(--text-mute);
}

.nav-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.nav-search .mag {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-mute);
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

@media (max-width: 480px) {
  .nav-inner {
    gap: var(--sp-2);
  }

  .nav-link,
  .nav-cta {
    padding-inline: 0.6rem;
    font-size: var(--text-xs);
  }
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link[aria-current="page"] {
  color: var(--gold);
}

.nav-cta {
  padding: 0.5rem 1.1rem;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: oklch(22% 0.05 80);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-gold);
}

/* ── footer ──────────────────────────────────────── */
.footer {
  margin-top: var(--sp-section);
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding-block: var(--sp-8) var(--sp-6);
  color: var(--text-dim);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-8);
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer h4 {
  color: var(--text);
  font-size: var(--text-base);
  margin-bottom: var(--sp-3);
}

.footer li {
  list-style: none;
  margin-bottom: var(--sp-2);
}

.footer a:hover {
  color: var(--gold);
}

.footer-note {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ── section scaffolding ─────────────────────────── */
.section {
  margin-top: var(--sp-section);
}

.section-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.section-head .icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  font-size: 1.1rem;
}

.section-head h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head .tail {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.section-head .more {
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.section-head .more:hover {
  text-decoration: underline;
}
