/* ==========================================================================
   Antos Pinnacles — base: design tokens, reset, typography, layout primitives
   Visual language: (near-black surfaces, Inter Tight
   headings, IBM Plex Mono labels, pill buttons, soft glows); brand accent is
   Antos orange. Dark is the default theme; light is opt-in via [data-theme].
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Brand */
  --brand-navy: #101b30;
  --brand-orange: #ffa000;
  --brand-orange-deep: #fc8f00;

  /* Surfaces & text (dark) */
  --bg: #000;
  --bg-section: #0a0a0a;
  --surface: #0e0e0e;
  --surface-2: #141414;
  --surface-3: #1b1b1b;
  --border: #1f1f1f;
  --border-strong: #2c2c2c;
  --text: #f1f1f1;
  --text-muted: #a3a3a3;
  --text-subtle: #6f6f6f;
  --heading: #fff;
  --logo-text: #fff;

  /* Accents */
  --accent: var(--brand-orange);
  --accent-strong: var(--brand-orange-deep);
  --accent-contrast: #111;
  --accent-soft: rgb(255 160 0 / 0.12);
  --glow-1: rgb(255 160 0 / 0.35);
  --glow-2: rgb(59 130 246 / 0.35);
  --positive: #4ade80;
  --negative: #f87171;

  /* Pill button (template: white pill, dark text) */
  --pill-bg: #fff;
  --pill-text: #0a0a0a;

  --header-bg: rgb(0 0 0 / 0.6);
  --overlay: rgb(0 0 0 / 0.72);
  --shadow: 0 24px 60px -24px rgb(0 0 0 / 0.8);
  --img-adapt-filter: invert(0.92) hue-rotate(180deg);

  /* Type */
  --font-heading: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-hero: clamp(2.4rem, 1.2rem + 4.6vw, 5.6rem);
  --fs-h1: clamp(2.1rem, 1.3rem + 3.2vw, 4.4rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.1vw, 3.2rem);
  --fs-h3: clamp(1.35rem, 1.05rem + 1.1vw, 2rem);
  --fs-h4: clamp(1.15rem, 1rem + 0.55vw, 1.5rem);
  --fs-lead: clamp(1.02rem, 0.95rem + 0.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem; /* 12px: the legibility floor for mono uppercase labels */

  /* Space & shape */
  --gutter: clamp(1rem, 0.6rem + 1.6vw, 2.5rem);
  --section-y: clamp(4rem, 2.5rem + 6vw, 9rem);
  --container: 1320px;
  --container-narrow: 880px;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-section: #eef0f4;
  --surface: #fff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --border: #e3e6ec;
  --border-strong: #cfd4dd;
  --text: #1d2639;
  --text-muted: #535d70;
  --text-subtle: #7d8697;
  --heading: var(--brand-navy);
  --logo-text: var(--brand-navy);
  --accent-contrast: #111;
  --accent-soft: rgb(255 160 0 / 0.14);
  --glow-1: rgb(255 160 0 / 0.28);
  --glow-2: rgb(59 130 246 / 0.22);
  --positive: #16a34a;
  --negative: #dc2626;
  --pill-bg: var(--brand-navy);
  --pill-text: #fff;
  --header-bg: rgb(245 246 248 / 0.75);
  --overlay: rgb(16 27 48 / 0.45);
  --shadow: 0 24px 60px -28px rgb(16 27 48 / 0.35);
  --img-adapt-filter: none;
}

/* CJK pages: native font fallbacks, and no tight Latin tracking on headings */
:root:lang(zh) { --font-heading: "Inter Tight", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; --font-body: var(--font-heading); }
:root:lang(ja) { --font-heading: "Inter Tight", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif; --font-body: var(--font-heading); }
:lang(zh) :is(h1, h2, h3, h4, .hero__title, .cta__title, .service-card__name),
:lang(ja) :is(h1, h2, h3, h4, .hero__title, .cta__title, .service-card__name) { letter-spacing: 0; }

/* Thai: Inter Tight has no Thai glyphs; use native Thai faces, untracked, with room for stacked tone marks */
:root:lang(th) { --font-heading: "Inter Tight", "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Tahoma", sans-serif; --font-body: var(--font-heading); }
:lang(th) :is(h1, h2, h3, h4, .hero__title, .cta__title, .service-card__name) { letter-spacing: 0; line-height: 1.3; }

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, video, iframe, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-contrast); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--heading);
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: var(--fs-h4); line-height: 1.3; letter-spacing: -0.01em; }
h5, h6 { font-size: 1.05rem; line-height: 1.4; letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--fs-lead); color: var(--text-muted); line-height: 1.6; }
.muted { color: var(--text-muted); }

/* Mono uppercase label used for eyebrows, tags and meta text */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-section); }
.section + .section--flush-top { padding-top: 0; }

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 1.4rem + 2.4vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.section-head--split > :first-child { max-width: 720px; }

.grid { display: grid; gap: clamp(1rem, 0.7rem + 1vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Two-column text/media split; add .split--reverse to swap sides on desktop */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 6rem);
}
.split--reverse > :first-child { order: 2; }
.split__media, .split__media img { width: 100%; border-radius: var(--radius); }

.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }

.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: 1rem; top: -100px;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--pill-text);
}
.skip-link:focus { top: 1rem; }

/* Dark line-art icons on transparent backgrounds need lifting on dark surfaces */
.img-adapt { filter: var(--img-adapt-filter); }

/* ---------- Scroll reveal (progressive enhancement, see main.js) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@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; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Responsive layout ---------- */
@media (max-width: 991px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split--reverse > :first-child { order: 0; }
}
@media (max-width: 767px) {
  :root { --header-h: 64px; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 479px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .eyebrow { letter-spacing: 0.1em; }
}
