/* ============================================================
   Trirat Service Part., Ltd. — landing page
   Direction: minimal & modern. Neutral monochrome, hairline
   borders, generous whitespace, one quiet copper accent.
   Inter × Noto Sans Thai, flat surfaces, no gradients.
   ============================================================ */

:root {
  /* --- Palette (oklch, near-achromatic) --- */
  --bg:         oklch(98.5% 0 0);
  --surface:    oklch(100% 0 0);
  --ink:        oklch(18% 0 0);
  --ink-soft:   oklch(44% 0 0);
  --ink-faint:  oklch(60% 0 0);
  --line:       oklch(90% 0 0);
  --line-dark:  oklch(74% 0 0);
  --accent:     oklch(55% 0.12 45);

  /* --- Typography --- */
  --font-body:  "Inter", "Noto Sans Thai", system-ui, sans-serif;

  --text-eyebrow: 0.75rem;
  --text-base:    clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --text-lede:    clamp(1.08rem, 1rem + 0.4vw, 1.3rem);
  --text-h2:      clamp(1.7rem, 1.25rem + 2vw, 2.6rem);
  --text-hero:    clamp(2.1rem, 0.6rem + 6.4vw, 5.6rem);

  /* --- Space / motion --- */
  --space-section: clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --radius:       10px;
  --container:    1120px;
  --duration:     360ms;
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[data-lang="th"] body { line-height: 1.75; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3 { font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: 6px;
  transition: top 150ms var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ============================== HEADER ============================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: oklch(98.5% 0 0 / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }

.brand-word { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }

.nav { display: flex; gap: 1.9rem; }
.nav a {
  font-size: 0.92rem; color: var(--ink-soft); padding: 0.25rem 0;
  transition: color 180ms var(--ease);
}
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.4rem 0.65rem; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}
.lang-toggle:hover { border-color: var(--line-dark); color: var(--ink); }
.lang-toggle .lang-current { color: var(--ink); font-weight: 600; }
.lang-toggle .lang-sep,
.lang-toggle .lang-other { color: var(--ink-faint); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 0.5rem; }
.nav-toggle span { width: 20px; height: 1.5px; background: var(--ink); transition: transform 240ms var(--ease), opacity 180ms var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav { display: none; flex-direction: column; padding: 0.5rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.mobile-nav a { padding: 0.85rem 0; font-size: 1rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.mobile-nav a:last-child { border-bottom: 0; }

/* =============================== HERO =============================== */
.hero { padding-top: clamp(4rem, 8vw, 8rem); padding-bottom: var(--space-section); }
.eyebrow {
  display: inline-block; font-size: var(--text-eyebrow); font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: var(--text-hero); font-weight: 650; letter-spacing: -0.035em;
  max-width: 14ch; margin-bottom: 1.75rem; overflow-wrap: anywhere; line-break: loose;
}
html[data-lang="th"] .hero-title { max-width: 18ch; line-height: 1.2; letter-spacing: -0.01em; }
.hero-lede { font-size: var(--text-lede); color: var(--ink-soft); max-width: 52ch; margin-bottom: 2.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem; border-radius: 8px;
  font-size: 0.94rem; font-weight: 500;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: oklch(30% 0 0); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* ============================= SECTIONS ============================= */
.section { padding-block: var(--space-section); border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(2.5rem, 4vw, 3.5rem); }
.section-kicker {
  font-size: var(--text-eyebrow); font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.85rem;
}
.section-title { font-size: var(--text-h2); color: var(--ink); max-width: 24ch; }

/* ---------------------------- Businesses ---------------------------- */
.biz-grid {
  counter-reset: biz;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.biz-card {
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.5rem, 2.5vw, 2rem);
  transition: border-color 220ms var(--ease);
}
.biz-card::before {
  counter-increment: biz;
  content: "0" counter(biz);
  font-size: 0.78rem; font-weight: 500; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; letter-spacing: 0.08em;
}
.biz-card:hover { border-color: var(--line-dark); }
.biz-card-top { display: flex; flex-direction: column; gap: 0.7rem; }
.biz-tag {
  align-self: flex-start; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--line);
  padding: 0.25rem 0.6rem; border-radius: 4px;
}
.biz-tag--coffee { color: var(--accent); border-color: oklch(82% 0.05 45); }
.biz-name { font-size: 1.35rem; color: var(--ink); }
.biz-desc { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }
.biz-link {
  display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start;
  font-size: 0.9rem; font-weight: 500; color: var(--ink); padding-top: 0.4rem;
}
.biz-link .biz-arrow { transition: transform 220ms var(--ease); color: var(--ink-faint); }
.biz-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.biz-link:hover .biz-arrow { transform: translateX(4px); color: var(--ink); }

/* ------------------------------- About ------------------------------ */
.about-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-text { color: var(--ink-soft); font-size: var(--text-lede); line-height: 1.7; margin-top: 1.5rem; }
.about-stats { list-style: none; display: flex; flex-direction: column; gap: 0; padding: 0; }
.about-stats li {
  display: flex; align-items: baseline; gap: 1.25rem;
  padding: 1.4rem 0; border-top: 1px solid var(--line);
}
.about-stats li:last-child { border-bottom: 1px solid var(--line); }
.stat-num {
  font-size: 1.9rem; font-weight: 650; letter-spacing: -0.03em;
  color: var(--ink); line-height: 1; min-width: 3.2rem;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.92rem; color: var(--ink-soft); }

/* ------------------------------ Contact ----------------------------- */
.contact-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contact-lede { color: var(--ink-soft); font-size: var(--text-lede); margin-top: 1.25rem; max-width: 38ch; }
.contact-list { display: flex; flex-direction: column; }
.contact-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.contact-row:first-child { border-top: 1px solid var(--line); }
.contact-row dt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); padding-top: 0.2rem; }
.contact-row dd { font-size: 1.02rem; color: var(--ink); }
.contact-row dd a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-services { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-services a { color: var(--ink-soft); }
.contact-services a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------ Footer ------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 5vw, 4.5rem); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.site-footer .brand-word { font-size: 1.15rem; }
.footer-legal-name { margin-top: 0.6rem; font-size: 0.9rem; color: var(--ink-soft); max-width: 32ch; }
.footer-legal { display: flex; flex-direction: column; gap: 1rem; }
.footer-legal dt { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.footer-legal dd { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.footer-copy { grid-column: 1 / -1; padding-top: 1.5rem; margin-top: 0.5rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-faint); }

/* ============================ REVEAL anim =========================== */
/* The hidden state is ARMED by main.js (see initReveal), never by CSS alone.
   With JS disabled or main.js failing to load, .is-armed is never added, so
   every .reveal element — hero, business cards, stats — stays fully visible. */
.reveal { transition: opacity 560ms var(--ease), transform 560ms var(--ease); }
.reveal.is-armed { opacity: 0; transform: translateY(14px); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================ RESPONSIVE =========================== */
@media (max-width: 860px) {
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav:not([hidden]) { display: flex; }
  .footer-inner { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .contact-row dt { padding-top: 0; }
}

/* ========================= REDUCED MOTION ========================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal, .reveal.is-armed { opacity: 1 !important; transform: none !important; }
}

/* --------------------- Cafe photo placeholder -----------------------
   Photo placeholder for the shop cards (.biz-card--place: Hianhungtor,
   Horizon Harvest). Swap each .biz-photo for an <img>/<picture> when real
   photos arrive; the 3:2 box already reserves space, so no layout shift. */
.biz-photo {
  aspect-ratio: 3 / 2;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: oklch(96% 0 0);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.biz-photo-inner {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  color: var(--ink-faint);
}
.biz-photo-inner svg { width: 28px; height: 28px; opacity: 0.7; }
.biz-photo-cap {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
