/* Bangkok Tails — bangkoktails.com, version 1
   Golden Hour palette, taken from the BKK TODAY group plate. */

:root {
  --teak-night: #2B1F14;   /* text, footer */
  --old-teak: #874C1B;     /* headings */
  --lantern: #DB791E;      /* buttons */
  --golden-hour: #EFA24A;  /* highlights */
  --honey-light: #F2BD70;  /* cards */
  --rice-paper: #FBF1DF;   /* background */
  --skytrain-teal: #4F7A7A;/* links, accents */
  --tuk-green: #5E9A3A;    /* small touches only */

  /* One stack per role. Latin uses the first font; Thai and Chinese
     characters fall through to the Thai and Chinese fonts automatically. */
  --font-display: "Fraunces", "Noto Serif Thai", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "Instrument Sans", "Anuphan", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;

  --radius: 18px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--rice-paper);
  color: var(--teak-night);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

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

a { color: var(--skytrain-teal); text-underline-offset: 0.18em; }

:focus-visible { outline: 3px solid var(--golden-hour); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Thai needs room for stacked vowels and tone marks */
:lang(th) { line-height: 1.7; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.4; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--lantern); color: var(--teak-night);
  padding: 0.6rem 1rem; border-radius: 999px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  background: var(--lantern);
  color: var(--teak-night);
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  box-shadow: 0 6px 20px -8px rgba(43, 31, 20, 0.6);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--golden-hour); transform: translateY(-1px); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Top bar ---------- */

.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px max(16px, 3vw);
}

.wordmark img {
  height: clamp(28px, 4vw, 40px);
  width: auto;
  border-radius: 5px;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.55);
}

.lang {
  display: flex; gap: 2px; padding: 4px;
  background: rgba(43, 31, 20, 0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 999px;
}
.lang button {
  font: 600 0.95rem/1 var(--font-body);
  color: var(--rice-paper);
  background: transparent;
  border: 0; border-radius: 999px;
  padding: 0.55em 0.85em;
  cursor: pointer;
}
.lang button:hover { background: rgba(251, 241, 223, 0.15); }
.lang button[aria-pressed="true"] { background: var(--lantern); color: var(--teak-night); }

/* ---------- 1. Opening ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  overflow: hidden;
  background: var(--teak-night);
  color: var(--rice-paper);
  isolation: isolate;
}

.hero picture, .hero picture img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero picture img {
  object-fit: cover;
  object-position: 50% 55%;
  transform-origin: 50% 55%;
  animation: push-in 10s ease-out forwards;
}
/* the whole painting sits behind the words, not just the image inside it */
.hero picture { z-index: -2; }
@keyframes push-in { from { transform: scale(1); } to { transform: scale(1.04); } }

/* warm dark gradient for the text, plus a light one behind the top bar */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(43, 31, 20, 0.55) 0%, rgba(43, 31, 20, 0) 16%),
    linear-gradient(to top, rgba(43, 31, 20, 0.94) 0%, rgba(43, 31, 20, 0.7) 18%, rgba(43, 31, 20, 0) 45%);
}

.hero-text {
  align-self: end;
  text-align: center;
  padding: 0 max(16px, 4vw) clamp(28px, 6vh, 64px);
  display: grid; justify-items: center; gap: 0.9rem;
}

.hero h1 {
  font-weight: 560;
  font-variation-settings: "SOFT" 70, "WONK" 1;
  font-size: clamp(2.3rem, 4.1vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--rice-paper);
  text-shadow: 0 2px 24px rgba(43, 31, 20, 0.6);
  max-width: 24ch;
}
@media (min-width: 900px) { .hero h1 { max-width: none; } }

.hero .echo {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  color: var(--honey-light);
}
.hero .btn { margin-top: 0.4rem; }

/* Phones and portrait screens: the tall v03 plate. The sky fills the top
   half of that painting, so the words sit there and the crew stays clear. */
@media (max-aspect-ratio: 4/5) {
  .hero::before {
    background: linear-gradient(to bottom, rgba(43, 31, 20, 0.85) 0%, rgba(43, 31, 20, 0.55) 30%, rgba(43, 31, 20, 0) 52%);
  }
  .hero-text { align-self: start; padding-top: clamp(84px, 13vh, 130px); }
  .hero h1 { font-size: clamp(2.3rem, 10vw, 3.6rem); }
  html[lang="zh-Hans"] .hero h1 { font-size: clamp(1.9rem, 8vw, 3.2rem); }
}

/* Chinese headline breaks only at its comma, never mid-word */
html[lang="zh-Hans"] .hero h1 { word-break: keep-all; }

/* ---------- Section titles ---------- */

section[id] { scroll-margin-top: 16px; }

.section { padding-block: clamp(4.5rem, 10vw, 8rem); }

.section-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.section-head h2 {
  font-weight: 620;
  font-variation-settings: "SOFT" 50, "WONK" 1;
  font-size: clamp(2.6rem, 1.2rem + 6vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--old-teak);
}
.section-head .echo {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--skytrain-teal);
}

/* "tuk-tuk-tuk": three small green dots under each title */
.tuk-dots { display: flex; justify-content: center; gap: 9px; margin-top: 1.1rem; }
.tuk-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tuk-green); }

/* In Thai and Chinese the page speaks one language, so the Thai echo lines go */
html:not([lang="en"]) .echo { display: none; }

/* ---------- 2. Meet the crew ---------- */

.crew-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(14px, 2vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.card {
  background: var(--honey-light);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 14px 30px -18px rgba(135, 76, 27, 0.55);
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-body { padding: 1.1rem 1.15rem 1.4rem; display: grid; gap: 0.45rem; align-content: start; }

.card h3 {
  font-weight: 640;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--old-teak);
}
.card .th-name { font-family: var(--font-display); font-weight: 450; font-size: 0.72em; }
html[lang="th"] .th-name { display: none; }

.card .line { font-size: 0.98rem; }
.card .say {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "SOFT" 80, "WONK" 1;
  font-size: 1.12rem;
  line-height: 1.35;
}
.card .say:empty { display: none; }

/* Thai and Chinese fonts have no true italic; avoid the computer-slanted fake */
html[lang="th"] .card .say, html[lang="zh-Hans"] .card .say,
html[lang="th"] .story-text .quiet, html[lang="zh-Hans"] .story-text .quiet,
.card .say [lang="th"] { font-style: normal; }

/* Small phones: picture beside the words, so five cards don't become a long scroll */
@media (max-width: 559px) {
  .card { flex-direction: row; align-items: stretch; }
  .card img { width: 38%; flex: none; align-self: stretch; }
  .card-body { padding: 0.95rem 1rem 1.05rem; }
  .card h3 { font-size: 1.35rem; }
  .card .say { font-size: 1.02rem; }
}

/* ---------- 3. Watch ---------- */

.watch { background: var(--teak-night); color: var(--rice-paper); }
.watch .section-head h2 { color: var(--golden-hour); }
.watch .section-head .echo { color: var(--honey-light); }

.video-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(18px, 2.4vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.video-frame {
  position: relative; display: block;
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: #1c140d;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
}
.video-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%;
  transition: transform 0.6s ease, filter 0.3s ease;
}
.video-frame:hover img { transform: scale(1.03); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-frame .play {
  position: absolute; left: 14px; top: 14px;   /* top-left corner, clear of the characters and title text */
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--lantern);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  display: none;
}
.video-frame .play::after {
  content: ""; position: absolute; left: 27px; top: 21px;
  border-style: solid; border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--teak-night);
}
.video.has-video .play { display: block; }

.video-frame .soon {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(43, 31, 20, 0.78);
  color: var(--honey-light);
  font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em;
  padding: 0.35em 0.8em; border-radius: 999px;
}
.video:not(.has-video) .video-frame img { filter: saturate(0.85) brightness(0.85); }
.video.has-video .video-frame img { object-position: 50% 50%; }
.video.has-video .soon { display: none; }

.video .kicker {
  margin-top: 1rem;
  font-size: 0.82rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--golden-hour);
}
.video h3 {
  margin-top: 0.25rem;
  font-weight: 560;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  line-height: 1.15;
  color: var(--rice-paper);
}

.subscribe { text-align: center; margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* ---------- 4. The story ---------- */

.story-text {
  max-width: 40rem; margin-inline: auto;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 40;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.45rem);
  line-height: 1.65;
}
html[lang="en"] .story-text p:first-child::first-letter {
  float: left;
  font-weight: 650;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 4.1em;
  line-height: 0.82;
  margin: 0.06em 0.1em 0 0;
  color: var(--lantern);
}
.story-text .quiet {
  margin-top: 1.4rem;
  font-style: italic;
  color: var(--old-teak);
  text-align: center;
}

/* ---------- 5. Footer ---------- */

.footer {
  background: var(--teak-night);
  color: rgba(251, 241, 223, 0.78);
  padding-block: 3.5rem 2.5rem;
  font-size: 0.95rem;
}
.footer-inner { display: grid; gap: 1.6rem; justify-items: center; text-align: center; }
.footer .wordmark img { height: 40px; }
.footer a { color: var(--honey-light); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.6rem; list-style: none; margin: 0; padding: 0; font-weight: 600; }
.credits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.copyright { color: rgba(251, 241, 223, 0.55); font-size: 0.88rem; }

/* ---------- Gentle reveal (only when JavaScript is on) ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Reduce motion: no push-in, no fades ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero picture img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .video-frame img { transition: none; }
  .btn:hover, .video-frame:hover img { transform: none; }
}
