:root {
  color-scheme: dark;
  --color-bg: #090707;
  --color-bg-secondary: #100c0c;
  --color-surface: #141010;
  --color-surface-elevated: #1c1717;
  --color-surface-hover: #251c1c;
  --color-primary: #d71920;
  --color-primary-hover: #f02a32;
  --color-deep-red: #7f1015;
  --color-gold: #d6b25e;
  --color-gold-light: #f0d58a;
  --color-gold-dark: #9b7a35;
  --color-text: #f8f5f0;
  --color-text-secondary: #b9b1af;
  --color-text-muted: #938b89;
  --color-border: rgba(214, 178, 94, 0.18);
  --color-border-strong: rgba(214, 178, 94, 0.35);
  --color-success: #22c55e;
  --container-width: 1280px;
  --container-gutter: clamp(1rem, 3vw, 1.75rem);
  --radius-sm: 10px;
  --radius-md: 16px;
  --space-md: 1.25rem;
  --space-xl: clamp(3.5rem, 6vw, 5.75rem);
  --page-top-gap: clamp(1.25rem, 1.8vw, 2rem);
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --font-display: "Leelawadee UI", "Noto Sans Thai", Tahoma, system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  background: var(--color-bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(127, 16, 21, 0.12), transparent 30rem),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

body.ml-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--color-gold-light);
  outline-offset: 3px;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ml-container,
.mlb-container {
  width: min(calc(100% - (var(--container-gutter) * 2)), var(--container-width));
  margin-inline: auto;
}

.ml-main {
  min-height: 70vh;
}

.ml-page-shell,
.ml-home-no-hero {
  padding-top: var(--header-height);
}

.ml-section,
.mlb-section {
  padding-block: var(--space-xl);
}

.ml-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  color: var(--color-gold-light);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.55;
  text-transform: uppercase;
}

.ml-eyebrow::before {
  width: 24px;
  height: 1px;
  background: var(--color-gold);
  content: "";
}

.ml-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.ml-section-heading h1,
.ml-section-heading h2,
.ml-archive-header h1,
.ml-page-article h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.8rem, 2.7vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.ml-text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-weight: 600;
  text-decoration: none;
}

.ml-text-link svg,
.ml-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.ml-text-link:hover {
  color: var(--color-gold-light);
}

.ml-text-link:hover svg,
.ml-button:hover svg {
  transform: translateX(3px);
}

.ml-button,
.mlb-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.68rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ml-button:hover {
  transform: translateY(-2px);
}

.ml-button--primary,
.mlb-button-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(215, 25, 32, 0.2);
}

.ml-button--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.ml-button--secondary,
.mlb-button-secondary {
  border-color: var(--color-border-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--color-text);
}

.ml-button--secondary:hover {
  border-color: var(--color-gold);
  background: var(--color-surface-hover);
}

.ml-prose {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.ml-prose > * {
  max-width: 68ch;
}

.ml-prose h2,
.ml-prose h3 {
  margin-top: 1.75em;
  color: var(--color-text);
  line-height: 1.45;
}

.ml-prose a {
  color: var(--color-gold-light);
}

.ml-prose .ml-prose-accent {
  color: var(--color-gold-light);
  font-weight: 700;
}

.ml-prose img,
.ml-prose iframe {
  border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
