/* ============================================================
   Chill Company — Base
   Minimal reset, typography, body, defaults.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Guard against horizontal page scroll caused by long nowrap CJK headlines
     on narrow viewports. Inner elements that legitimately scroll (tables,
     code blocks, slider rails) set their own overflow-x: auto. */
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  /* Mirror html: belt-and-suspenders. Without this, an inner element with
     a wider intrinsic width than the viewport can still trigger a body
     scrollbar on Safari iOS. */
  overflow-x: clip;
}

html[lang="zh-Hant"] body { font-family: var(--font-han); }
html[lang="ja"]       body { font-family: var(--font-jp); }

/* When the page is in Traditional Chinese, force translated headings + body
   typography to sans-serif (黑體). Elements that always display English
   (footer tagline, format labels, emails, etc.) are intentionally NOT in this
   list so they keep Lato regardless of the current language. */
html[lang="zh-Hant"] h1,
html[lang="zh-Hant"] h2,
html[lang="zh-Hant"] h3,
html[lang="zh-Hant"] h4,
html[lang="zh-Hant"] h5,
html[lang="zh-Hant"] h6,
html[lang="zh-Hant"] .t-serif,
html[lang="zh-Hant"] .pullquote,
html[lang="zh-Hant"] .pullquote__attribution,
html[lang="zh-Hant"] .story-hero__quote,
html[lang="zh-Hant"] .story-body blockquote,
html[lang="zh-Hant"] .story-signature,
html[lang="zh-Hant"] .product-card__tagline,
html[lang="zh-Hant"] .card__sub,
html[lang="zh-Hant"] .inn-9hz__layer-label,
html[lang="zh-Hant"] .home-closing__sub,
html[lang="zh-Hant"] .philosophy-meaning__label {
  font-family: var(--font-han);
  font-style: normal;
}

/* Japanese: sans (Noto Sans JP) by default; headlines may use Noto Serif JP for
   editorial gravity. Same exclusion principle as Chinese above — always-English
   elements stay in Lato. */
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] h4,
html[lang="ja"] h5,
html[lang="ja"] h6,
html[lang="ja"] .t-serif,
html[lang="ja"] .pullquote,
html[lang="ja"] .pullquote__attribution,
html[lang="ja"] .story-hero__quote,
html[lang="ja"] .story-body blockquote,
html[lang="ja"] .story-signature,
html[lang="ja"] .product-card__tagline,
html[lang="ja"] .card__sub,
html[lang="ja"] .inn-9hz__layer-label,
html[lang="ja"] .home-closing__sub,
html[lang="ja"] .philosophy-meaning__label {
  font-family: var(--font-jp);
  font-style: normal;
  letter-spacing: 0.02em;
}

/* Always render in the Latin (Lato) font — these strings are the same English
   in every language file ("Stay Vibrant. Stay Chill.", section labels like
   "Opening / Movement", email addresses, etc.). */
.footer__tagline,
.inn-format-item__label,
.inn-booking__email,
.plz-closing__statement {
  font-family: var(--font-sans) !important;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent-hover); }

::selection {
  background: var(--color-chill-blue);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Typography defaults --------------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

p { margin: 0; }
p + p { margin-top: var(--space-4); }

.t-display { font-size: var(--text-display); line-height: var(--lh-display); font-weight: 700; }
.t-h1      { font-size: var(--text-h1);      line-height: var(--lh-h1);      font-weight: 700; }
.t-h2      { font-size: var(--text-h2);      line-height: var(--lh-h2);      font-weight: 700; }
.t-h3      { font-size: var(--text-h3);      line-height: var(--lh-h3);      font-weight: 700; }
.t-h4      { font-size: var(--text-h4);      line-height: var(--lh-h4);      font-weight: 700; }

.t-lead    { font-size: var(--text-body-lg); line-height: var(--lh-body-lg); color: var(--text-muted); }
.t-body    { font-size: var(--text-body);    line-height: var(--lh-body); }
.t-small   { font-size: var(--text-small);   line-height: var(--lh-small);   color: var(--text-muted); }

.t-eyebrow {
  display: inline-block;
  font-size: var(--text-micro);
  line-height: var(--lh-micro);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-hover);
}

.t-serif { font-family: var(--font-serif); font-style: italic; font-weight: 700; }

.t-muted { color: var(--text-muted); }
.t-soft  { color: var(--text-soft); }
.t-accent{ color: var(--accent-hover); }

/* ---- Layout primitives ----------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--narrow { max-width: 880px; }
.container--wide   { max-width: 1360px; }

.section {
  padding: var(--space-9) 0;
}
.section--lg { padding: var(--space-10) 0; }
.section--sm { padding: var(--space-7) 0; }

@media (max-width: 1023px) {
  .section    { padding: var(--space-8) 0; }
  .section--lg{ padding: var(--space-9) 0; }
  .section--sm{ padding: var(--space-6) 0; }
}

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.stack-xl > * + * { margin-top: var(--space-8); }

.center { text-align: center; }
.measure { max-width: 64ch; }
.measure-sm { max-width: 50ch; }

.hidden { display: none !important; }

/* ---- Scroll reveal --------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
