/* AIH base styles — reset, fonts, elements, helpers. Pairs with tokens.css. */

/* Self-hosted Google Sans (Latin). Thai falls back to Noto Sans Thai (loaded via <link>). */
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/google-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/google-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "Google Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/google-sans-700.woff2") format("woff2");
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 { line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); font-weight: 600; color: var(--color-text); text-wrap: balance; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 700; }
p { text-wrap: pretty; }

a { color: var(--color-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { padding: 0; list-style-position: inside; }

:where(button, input, select, textarea) { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--content-default); margin-inline: auto; padding-inline: var(--space-4); }
.container--narrow { max-width: var(--content-narrow); }
.container--wide { max-width: var(--content-wide); }
.section { padding-block: var(--section-y); }
.prose { max-width: 65ch; }
.prose p + p { margin-top: var(--space-4); }

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

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 1000;
  background: var(--color-surface); color: var(--color-text);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.skip-link:focus { top: var(--space-4); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.7rem 1.4rem; border-radius: var(--radius-full);
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-cta-bg); color: var(--color-cta-text); }
.btn--primary:hover { background: var(--color-cta-bg-hover); text-decoration: none; }
.btn--secondary { background: transparent; color: var(--color-link); border-color: var(--color-primary); }
.btn--secondary:hover { background: rgb(0 181 157 / 0.08); text-decoration: none; }

/* ---- Brand bits ---- */
.text-gradient {
  background: var(--grad-dawn); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rule-dawn { height: 4px; border: 0; border-radius: var(--radius-full); background: var(--grad-dawn); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm);
}

.placeholder-note {
  border: 1px dashed var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-6); color: var(--color-text-muted); background: var(--color-surface-2);
}
