/* Falcon Cirrus — Redesign v0.1 (Direction A)
   Values come from Figma file At7A9jBQkW9rH2qD0xy1pd: Home 68:3 / 74:2,
   States & Interaction 77:3, Legal 86:3 / 87:2 / 87:77. */

:root {
  --ink: #0f1d29;
  --ink-hover: #243442;
  --ink-press: #06121c;
  --bg: #fafbfc;
  --bg-alt: #edf1f5;
  --row-hover: #f1f4f8;
  --text-2: #4c5a66;
  --text-3: #5f6d79;
  --text-nav: #36434e;
  --chip-text: #3f4e5b;
  --rule: #e2e7ec;
  --rule-strong: #cfd8e0;
  --on-dark: #a9b7c4;
  --dark-rule: #2b3946;

  --sans: "Instrument Sans", "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;

  --gutter: 64px;
  --ease: 150ms ease-out;
  --nav-h: 73px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }

/* Hidden while a stored TH preference is applied, so EN never flashes. */
.i18n-pending body { visibility: hidden; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 12px 18px; font-size: 14px;
}
.skip-link:focus { top: 16px; }

/* ── Global interaction rules (77:3 › Global rules) ───────────────────── */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--on-dark); }

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

/* ── Type helpers ─────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  color: var(--text-2); text-transform: uppercase;
}
.wordmark { width: 151px; height: auto; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px;
  font-family: var(--sans); font-weight: 500; font-size: 15px; line-height: 1;
  border: 1px solid var(--ink);
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn--primary:active { background: var(--ink-press); border-color: var(--ink-press); transition: none; }
.btn--secondary { background: transparent; color: var(--ink); }
.btn--secondary:hover { background: var(--bg-alt); }
.btn--secondary:active { background: var(--rule); transition: none; }
.btn--sm { min-height: 39px; padding: 0 22px; font-size: 14px; }

.link-underline {
  font-weight: 500; font-size: 15px; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
  transition: color var(--ease), border-color var(--ease);
}
.link-underline:hover { color: var(--ink-hover); border-color: var(--ink-hover); }

/* Nav link: hover adds the underline; colour alone never carries state. */
.nav-link {
  font-size: 14px; color: var(--text-nav);
  text-decoration: underline 1px transparent; text-underline-offset: 4px;
  transition: color var(--ease), text-decoration-color var(--ease);
}
.nav-link:hover,
.nav-link[aria-current="true"] { color: var(--ink); text-decoration-color: currentColor; }
.nav-link:active { color: var(--text-2); transition: none; }

/* ── Language switch ──────────────────────────────────────────────────── */
.lang {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--text-nav);
}
.lang button {
  min-width: 28px; min-height: 28px; padding: 0 4px;
  font-family: var(--mono); color: var(--text-3);
  text-decoration: underline 1px transparent; text-underline-offset: 4px;
  transition: color var(--ease), text-decoration-color var(--ease);
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration-color: currentColor; }

/* ── Site nav ─────────────────────────────────────────────────────────── */
.site-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter); height: var(--nav-h);
  z-index: 40;
  transition: background-color var(--ease), border-color var(--ease);
}
.site-nav__brand { justify-self: start; display: inline-flex; padding: 6px 0; }
.site-nav__links { display: flex; gap: 36px; }
.site-nav__right { justify-self: end; display: flex; align-items: center; gap: 28px; }
.menu-toggle { display: none; }

/* Home: nav floats over the hero (Figma 69:7, 32px from the top). */
.site-nav--overlay {
  position: absolute; inset: 0 0 auto 0;
  height: auto; padding-top: 32px;
  border-bottom: 1px solid transparent;
}
/* Legal pages: solid bar with a hairline (87:78). */
.site-nav--solid { position: relative; background: var(--bg); border-bottom: 1px solid var(--rule); }

/* ── Mobile menu ──────────────────────────────────────────────────────── */
.menu-toggle {
  width: 44px; height: 44px; margin-right: -11px;
  align-items: center; justify-content: center;
}
.menu-toggle__bars { position: relative; width: 22px; height: 7px; }
.menu-toggle__bars::before, .menu-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 1px; background: var(--ink);
}
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { bottom: 0; }
[aria-expanded="true"] .menu-toggle__bars::before { top: 3px; transform: rotate(45deg); }
[aria-expanded="true"] .menu-toggle__bars::after { bottom: 3px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 30;
  background: var(--bg);
  padding: 96px 24px 32px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__list { border-bottom: 1px solid var(--rule); }
.mobile-menu__list li { border-top: 1px solid var(--rule); }
.mobile-menu__list li:first-child { border-top-color: var(--ink); }
.mobile-menu__list a {
  display: flex; align-items: baseline; gap: 16px; padding: 20px 0;
  font-weight: 500; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15;
  text-decoration: underline 1px transparent; text-underline-offset: 6px;
  transition: background-color var(--ease), text-decoration-color var(--ease);
}
.mobile-menu__num { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--text-3); letter-spacing: 0; min-width: 20px; }
.mobile-menu__list a:hover,
.mobile-menu__list a[aria-current="true"] { text-decoration-color: currentColor; }
.mobile-menu__foot { margin-top: 32px; }
body.menu-open { overflow: hidden; }

/* ── Home › Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  height: clamp(640px, 100svh, 900px);
  background: var(--bg) url("../img/hero-desktop.jpg") no-repeat right center / 177.64% auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
.hero::before { /* Scrim — 0.95 / 0.90 @38% / 0.80 @52% / 0 @74% (69:5) */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(250,251,252,.95) 0%, rgba(250,251,252,.9) 38%, rgba(250,251,252,.8) 52%, rgba(250,251,252,0) 74%);
}
.hero::after { /* Nav band — 0.62 → 0 over 160px (69:6) */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px;
  background: linear-gradient(180deg, rgba(250,251,252,.62), rgba(250,251,252,0));
}
.hero__copy { position: relative; z-index: 1; width: min(656px, 100%); display: flex; flex-direction: column; gap: 36px; }
.hero__title {
  font-weight: 600; font-size: clamp(56px, 6.667vw, 96px);
  line-height: 0.95; letter-spacing: -0.035em;
}
.hero__ctas { display: flex; align-items: center; gap: 28px; }
.scroll-cue {
  position: absolute; z-index: 1; left: var(--gutter); bottom: 40px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--text-2);
  text-transform: uppercase;
}
.scroll-cue::before { content: ""; width: 48px; height: 1px; background: var(--text-2); }

/* ── Home › Services ──────────────────────────────────────────────────── */
.section { padding: 104px var(--gutter) 112px; scroll-margin-top: 0; }
.services__head { display: flex; justify-content: space-between; align-items: baseline; gap: 40px; margin-bottom: 44px; }
.section-title { font-weight: 600; font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; }
.services__lead { width: min(430px, 100%); font-size: 17px; line-height: 1.6; color: var(--text-2); }
.index-row {
  display: grid; grid-template-columns: 64px minmax(0, 438fr) minmax(0, 730fr); gap: 40px;
  padding: 32px 0; border-top: 1px solid var(--rule);
}
.index-row:first-child { border-top-color: var(--ink); }
.index-row:last-child { border-bottom: 1px solid var(--rule); }
.index-row__num { font-family: var(--mono); font-size: 13px; color: var(--text-3); padding-top: 4px; }
.index-row__title { font-weight: 500; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.index-row__desc { font-size: 16px; line-height: 1.65; color: var(--text-2); }

/* ── Home › Health ────────────────────────────────────────────────────── */
.health { background: var(--bg-alt); display: grid; grid-template-columns: minmax(0, 520fr) minmax(0, 752fr); gap: 40px; align-items: start; }
.health__eyebrow { color: var(--text-3); }
.health__title { margin-top: 20px; font-weight: 600; font-size: 46px; line-height: 1.06; letter-spacing: -0.028em; }
.health__lead { margin-top: 22px; font-size: 17px; line-height: 1.68; color: var(--text-2); }
.health__content { display: flex; flex-direction: column; gap: 24px; }
.feature { background: var(--bg); padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.feature__title { font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.feature__body { font-size: 16px; line-height: 1.68; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--rule-strong); padding: 8px 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--chip-text); line-height: 16px;
  text-transform: uppercase;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pair__item { border-top: 1px solid var(--ink); padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.pair__title { font-weight: 500; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
.pair__body { font-size: 15px; line-height: 1.65; color: var(--text-2); }

/* ── Footer (compact, 88:2) ───────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--bg); padding: 64px var(--gutter) 36px; }
.site-footer__company { padding-bottom: 48px; }
.site-footer__name { margin-top: 28px; font-weight: 500; font-size: 17px; }
.site-footer__address { margin-top: 10px; width: min(470px, 100%); font-size: 15px; line-height: 1.7; color: var(--on-dark); font-style: normal; }
.legal-bar {
  border-top: 1px solid var(--dark-rule); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap;
  font-size: 14px; line-height: 24px; color: var(--on-dark);
}
.legal-bar__links { display: flex; gap: 28px; flex-wrap: wrap; }
.legal-bar__links a {
  display: inline-block; min-height: 24px;
  text-decoration: underline 1px transparent; text-underline-offset: 4px;
  transition: color var(--ease), text-decoration-color var(--ease);
}
.legal-bar__links a:hover,
.legal-bar__links a[aria-current="page"] { color: var(--bg); text-decoration-color: currentColor; }

/* ── Legal pages (86:3 / 87:2 / 87:77) ────────────────────────────────── */
.legal-header { padding: 88px var(--gutter) 56px; }
.legal-header .eyebrow { color: var(--text-3); }
.legal-header__title { margin-top: 18px; width: min(720px, 100%); font-weight: 600; font-size: 46px; line-height: 1.06; letter-spacing: -0.028em; }
.legal-header__updated { margin-top: 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text-3); white-space: pre-wrap; }
.legal-body { display: flex; gap: 64px; align-items: flex-start; padding: 0 var(--gutter) 112px; }
.toc { flex: 0 0 240px; padding-top: 8px; position: sticky; top: 32px; }
.toc__label { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; color: var(--text-3); text-transform: uppercase; margin-bottom: 20px; }
.toc ol { display: flex; flex-direction: column; gap: 12px; }
.toc a {
  display: flex; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text-2);
  text-decoration: underline 1px transparent; text-underline-offset: 3px;
  transition: color var(--ease), text-decoration-color var(--ease);
}
.toc a:hover, .toc a[aria-current="true"] { color: var(--ink); text-decoration-color: currentColor; }
.legal-sections { flex: 0 1 720px; min-width: 0; }
.legal-section { border-top: 1px solid var(--rule); padding: 32px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; scroll-margin-top: 24px; }
.legal-section:first-child { border-top-color: var(--ink); }
.legal-section:last-child { border-bottom: 1px solid var(--rule); }
.legal-section__head { display: flex; gap: 24px; width: 100%; }
.legal-section__num { flex: 0 0 48px; font-family: var(--mono); font-size: 13px; color: var(--text-3); padding-top: 4px; }
.legal-section__title { font-weight: 500; font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; }
.placeholder-tag { border: 1px solid var(--rule-strong); padding: 5px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-3); }
.legal-section__body { font-size: 16px; line-height: 1.7; color: var(--text-2); }

/* ── Thai: Instrument Sans has no Thai glyphs, so IBM Plex Sans Thai renders it.
      Tight tracking and sub-1 line heights clip Thai vowels and tone marks. ── */
:lang(th) .hero__title { letter-spacing: 0; line-height: 1.18; }
:lang(th) .health__title,
:lang(th) .legal-header__title { letter-spacing: 0; line-height: 1.3; }
:lang(th) .index-row__title,
:lang(th) .feature__title,
:lang(th) .pair__title,
:lang(th) .legal-section__title,
:lang(th) .mobile-menu__list a { letter-spacing: 0; line-height: 1.4; }
:lang(th) .eyebrow,
:lang(th) .section-title,
:lang(th) .chip,
:lang(th) .scroll-cue { letter-spacing: 0.04em; }
:lang(th) .eyebrow { font-size: 13px; }

/* ── Mid widths ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .health { grid-template-columns: 1fr; gap: 48px; }
  .health__head { max-width: 640px; }
}

/* ── Mobile (74:2) ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  :root { --gutter: 24px; --nav-h: 64px; }

  .site-nav { grid-template-columns: 1fr auto; height: var(--nav-h); }
  .site-nav__links, .site-nav__right, .site-nav__spacer { display: none; }
  .menu-toggle { display: inline-flex; }
  .wordmark { width: 128px; }

  /* Home nav sits over the hero, then turns solid once the page scrolls. */
  .site-nav--overlay { position: fixed; padding-top: 0; }
  .site-nav--overlay.is-solid,
  body.menu-open .site-nav { background: var(--bg); border-bottom-color: var(--rule); }
  .site-nav--solid { position: sticky; top: 0; }
  body.menu-open .site-nav { position: fixed; inset: 0 0 auto 0; }

  .hero {
    height: clamp(640px, 100svh, 760px);
    background-image: url("../img/hero-mobile.jpg");
    background-size: cover; background-position: center;
    justify-content: flex-end; padding-bottom: 40px;
  }
  .hero::before { /* Scrim rises from the bottom (74:6) */
    background: linear-gradient(0deg, rgba(250,251,252,.97) 0%, rgba(250,251,252,.93) 44%, rgba(250,251,252,.55) 66%, rgba(250,251,252,0) 86%);
  }
  .hero::after { height: 120px; }
  .hero__copy { gap: 18px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.14em; }
  .hero__title { font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
  .hero__ctas { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero__ctas .link-underline { /* becomes the full-width secondary button on mobile */
    min-height: 48px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--ink); padding: 0;
    transition: background-color var(--ease);
  }
  .hero__ctas .link-underline:hover { background: var(--bg-alt); color: var(--ink); border-color: var(--ink); }
  .hero__ctas .link-underline:active { background: var(--rule); transition: none; }
  .scroll-cue { display: none; }

  .section { padding: 64px var(--gutter); scroll-margin-top: var(--nav-h); }
  .services__head { flex-direction: column; gap: 12px; margin-bottom: 32px; }
  .section-title { font-size: 13px; letter-spacing: 0.16em; }
  .services__lead { width: auto; font-size: 16px; }
  .index-row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .index-row__num { font-size: 12px; padding-top: 0; }
  .index-row__title { font-size: 24px; }
  .index-row__desc { font-size: 15px; }

  .health { gap: 28px; }
  .health__eyebrow { font-size: 11px; }
  .health__title { margin-top: 16px; font-size: 32px; line-height: 1.08; letter-spacing: -0.025em; }
  .health__lead { margin-top: 16px; font-size: 16px; line-height: 1.65; }
  .feature { padding: 28px 24px; gap: 12px; }
  .feature__title { font-size: 22px; }
  .feature__body { font-size: 15px; line-height: 1.65; }
  .chips { flex-direction: column; margin-top: 6px; }
  .chip { padding: 8px 12px; font-size: 11px; line-height: 14px; }
  .pair { grid-template-columns: 1fr; gap: 20px; }
  .pair__item { padding-top: 18px; }
  .pair__title { font-size: 18px; letter-spacing: 0; }
  .pair__body { line-height: 1.6; }

  .site-footer { padding: 56px var(--gutter) 28px; scroll-margin-top: var(--nav-h); }
  .site-footer__company { padding-bottom: 40px; }
  .site-footer__name { margin-top: 24px; }
  .legal-bar { flex-direction: column-reverse; align-items: flex-start; gap: 14px; padding-top: 20px; }
  .legal-bar__links { gap: 10px 18px; }
  .legal-bar__copy { font-size: 13px; }
  .legal-bar__rights { display: none; }

  .legal-header { padding: 48px var(--gutter) 40px; }
  .legal-header__title { font-size: 32px; line-height: 1.08; letter-spacing: -0.025em; }
  .legal-body { flex-direction: column; gap: 40px; padding-bottom: 64px; }
  .toc { position: static; flex: none; width: 100%; padding-top: 0; }
  .legal-sections { flex: none; width: 100%; }
  .legal-section { padding: 28px 0; scroll-margin-top: calc(var(--nav-h) + 16px); }
  .legal-section__head { gap: 12px; }
  .legal-section__num { flex-basis: 28px; }
  .legal-section__title { font-size: 20px; }
  .legal-section__body { font-size: 15px; line-height: 1.65; }
}
