/* base.css — type, space and layout tokens, reset, layout primitives.
   Type: Kanit (Slimtech's brand face, Thai + Latin) for every role; hierarchy comes
   from size and weight. */
:root {
  --font: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --font-display: var(--font);

  /* Type: 7 steps */
  --t-xs: .875rem;                                     /* 14  badges, meta */
  --t-sm: clamp(1rem, .97rem + .15vw, 1.0625rem);      /* 16→17 body */
  --t-md: clamp(1.125rem, 1.05rem + .3vw, 1.25rem);    /* 18→20 card titles, lede */
  --t-lg: clamp(1.375rem, 1.2rem + .7vw, 1.75rem);     /* 22→28 sub-heads */
  --t-xl: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);    /* 30→44 section titles */
  --t-2xl: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);      /* 36→60 page titles */
  --t-3xl: clamp(2.375rem, 1.4rem + 3.6vw, 4.25rem);   /* 38→68 home headline */

  /* Space: 4px base */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;

  /* Layout */
  --max: 80rem;                                  /* 1280px content */
  --gutter: clamp(1rem, .4rem + 3vw, 3rem);      /* 16→48, equal both sides */
  --col-gap: clamp(1.5rem, .5rem + 3vw, 3rem);
  --gap: clamp(1rem, .6rem + 1vw, 1.5rem);       /* 16→24 between cards */
  --pad: clamp(1rem, .8rem + .8vw, 1.5rem);      /* 16→24 inside cards */
  --pad-lg: clamp(1.5rem, 1rem + 2vw, 3rem);     /* 24→48 inside panels */
  --section: clamp(4rem, 3rem + 4vw, 7rem);      /* 64→112 between sections */

  --r-sm: 8px;    /* buttons, inputs, badges */
  --r-md: 16px;   /* cards, images inside cards */
  --r-lg: 24px;   /* big panels, marquee photos */
  --pill: 999px;  /* tabs, chips */
  --fast: 150ms; --med: 200ms; --slow: 500ms;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 7rem; }
body { font: 300 var(--t-sm) / 1.65 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; background: var(--surface-2); }
input, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-underline-offset: .25em; text-decoration-thickness: 1px; text-decoration-color: var(--rule); transition: text-decoration-color var(--fast); }
a:hover { color: var(--ink); text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--t-2xl); line-height: 1.12; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); }
h4 { font-size: var(--t-sm); }
p, li, dd { max-width: 68ch; }
strong { font-weight: 500; }
[hidden] { display: none !important; }

/* Layout primitives */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sec { padding-top: var(--section); }
main > .sec:last-child, main > .band-section:last-child { padding-bottom: var(--section); }
.grid12 { display: grid; gap: var(--s7) var(--col-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid12 { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* Section title: centred heading with optional intro */
.sec-title { text-align: center; margin: 0 auto var(--s7); max-width: 46rem; }
.sec-title p { margin: var(--s4) auto 0; color: var(--ink-soft); }
.sec-title--left { text-align: left; margin-left: 0; }
.sec-title--left p { margin-left: 0; }

.stack > * + * { margin-top: var(--s4); }
.lede { font-size: var(--t-md); line-height: 1.55; max-width: 52ch; }
.soft { color: var(--ink-soft); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.center { justify-content: center; text-align: center; max-width: none; }

/* Visible placeholder for content the client must supply */
.ph { background: var(--surface-2); color: var(--ink); padding: 0 var(--s1); border-radius: 4px; font-weight: 400; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Accessibility */
.skip { position: absolute; left: var(--gutter); top: -6rem; z-index: 100; padding: var(--s3) var(--s5); border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; }
.skip:focus { top: var(--s3); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--brand-red); color: #fff; }

/* One entrance per block; content stays visible if JS never runs. */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity var(--slow) ease, transform var(--slow) cubic-bezier(.2, .7, .2, 1); }
.js-reveal [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}
