/* NAVA — tokens, type, navigation, hero. Mobile first. */

:root {
  /* Thai lacquer + celadon ceramic + mother-of-pearl */
  --ink:      #101c19;
  --ink-2:    #1b2f2a;
  --ink-soft: #3d534c;
  --paper:    #e7e9e2;
  --paper-2:  #f1f2ec;
  --paper-3:  #dcdfd5;
  --celadon:  #93ae9e;
  --nacre:    #e9d3d1;
  --gilt:     #7f5a1c; /* was #a87a2b: 3.4:1 on paper, now ~5.6:1 */
  --gilt-lit: #c2913f;

  --rail-w: 0px;
  --gut: 20px;
  --maxw: 1180px;

  --step--1: clamp(.8rem, .77rem + .15vw, .875rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.075rem);
  --step-1:  clamp(1.2rem, 1.12rem + .4vw, 1.4rem);
  --step-2:  clamp(1.7rem, 1.45rem + 1.25vw, 2.6rem);
  --step-3:  clamp(2.5rem, 1.9rem + 3vw, 4.6rem);
  --step-4:  clamp(3.1rem, 2.2rem + 4.4vw, 5.8rem);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "IBM Plex Sans Thai", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  font-weight: 400; /* 300 was too thin for 14-15px body text */
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}
h3 { line-height: 1.16; letter-spacing: -.005em; }
p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper-2);
  padding: 12px 18px; font-size: var(--step--1);
}
.skip:focus { left: 8px; top: 8px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  font-family: var(--text); font-size: var(--step--1); font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid transparent;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn--solid { background: var(--ink); color: var(--paper-2); }
.btn--solid:hover { background: var(--ink-2); }
.btn--quiet { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.btn--quiet:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn--wide { width: 100%; }

/* ── Section shell ───────────────────────────────────────────────────── */
.stop {
  position: relative;
  padding: clamp(56px, 11vw, 132px) var(--gut);
  margin-left: var(--rail-w);
}
.stop > * { max-width: var(--maxw); margin-inline: auto; }

.head { margin-bottom: clamp(32px, 6vw, 66px); }
.head__stop {
  font-size: var(--step--1); font-weight: 500;
  color: var(--gilt); letter-spacing: .02em;
  margin-bottom: 14px;
}
.head__stop::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 26px; height: 1px; background: var(--gilt);
  margin-right: 10px;
}
.head__h { font-size: var(--step-3); max-width: 15ch; }
.head__sub {
  margin-top: 20px; max-width: 54ch;
  color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5;
}

/* ── Route rail (desktop nav) ────────────────────────────────────────── */
.rail { display: none; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding-top: calc(40svh + 10px); padding-bottom: 96px;
  background:
    radial-gradient(120% 62% at 72% 6%, #f7f5ef 0%, var(--paper) 52%, #d7dcd2 100%);
  overflow: hidden;
}
/* On a phone the vessel gets its own plate above the words. Nothing sits on
   top of the headline — the type has to stay readable at arm's length. */
#vessel {
  position: absolute; z-index: 0;
  top: 0; left: 0; right: 0;
  width: 100%; height: 40svh;
  pointer-events: none;
}
.hero__note {
  position: relative; z-index: 2;
  order: -1;
  max-width: 32ch;
  margin-bottom: 30px;
  font-size: .75rem; line-height: 1.45; color: var(--ink-soft);
}
.hero__body { position: relative; z-index: 2; width: 100%; }
.hero__place {
  font-size: var(--step--1); letter-spacing: .06em;
  color: var(--ink-soft); margin-bottom: 22px;
}
.hero__h1 {
  font-size: var(--step-4);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144;
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: .93;
}
.hero__h1 i {
  font-style: italic;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144;
  color: var(--ink-2);
}
.hero__lede {
  margin-top: 26px; max-width: 46ch;
  color: var(--ink-soft); line-height: 1.62;
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 32px;
}
.hero__facts {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px;
  margin: 52px auto 0;
  padding-top: 26px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.hero__facts dt {
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gilt); margin-bottom: 5px;
}
.hero__facts dd { margin: 0; font-size: var(--step--1); line-height: 1.4; }

/* ── Mobile passage bar ──────────────────────────────────────────────── */
.passbar {
  position: fixed; z-index: 90;
  left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 8px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--paper-2);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(16, 28, 25, .28);
  backdrop-filter: blur(10px);
}
.passbar__toggle {
  flex: 1; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 6px;
  background: none; border: 0; color: inherit;
  font: inherit; font-size: var(--step--1); font-weight: 400;
  text-align: left; cursor: pointer;
}
.passbar__dots { display: flex; align-items: center; gap: 5px; flex: none; }
.passbar__dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: color-mix(in srgb, var(--paper-2) 34%, transparent);
  transition: background-color .3s ease, transform .3s ease;
}
.passbar__dots i.on { background: var(--gilt-lit); transform: scale(1.5); }
.passbar__now { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.passbar__cta {
  flex: none; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 20px;
  background: var(--paper-2); color: var(--ink);
  border-radius: 999px; text-decoration: none;
  font-size: var(--step--1); font-weight: 500;
}
.passbar__list {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px);
  margin: 0; padding: 8px; list-style: none;
  background: var(--ink); border-radius: 22px;
  box-shadow: 0 14px 40px rgba(16, 28, 25, .34);
}
.passbar__list a {
  display: flex; align-items: baseline; gap: 10px;
  min-height: 48px; padding: 6px 14px;
  color: var(--paper-2); text-decoration: none;
  font-size: var(--step-0); border-radius: 14px;
}
.passbar__list a em {
  font-style: normal; font-size: .75rem;
  color: color-mix(in srgb, var(--paper-2) 55%, transparent);
}
.passbar__list a:hover { background: var(--ink-2); }

body { padding-bottom: 74px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.foot {
  background: var(--ink); color: var(--paper-2);
  padding: clamp(48px, 8vw, 84px) var(--gut) 40px;
  margin-left: var(--rail-w);
}
.foot > * { max-width: var(--maxw); margin-inline: auto; }
.foot__mark {
  font-family: var(--display); font-size: 2rem;
  font-variation-settings: "WONK" 1; letter-spacing: .22em;
}
.foot__th { margin-left: 12px; opacity: .55; font-size: 1.1rem; }
.foot__brand p { margin-top: 8px; color: color-mix(in srgb, var(--paper-2) 60%, transparent); font-size: var(--step--1); }
.foot__nav {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  margin: 32px auto; padding: 26px 0;
  border-block: 1px solid color-mix(in srgb, var(--paper-2) 16%, transparent);
}
.foot__nav a { text-decoration: none; font-size: var(--step--1); }
.foot__nav a:hover { color: var(--gilt-lit); }
.foot__legal { margin-inline: 0 auto;
  color: color-mix(in srgb, var(--paper-2) 45%, transparent);
  font-size: .76rem; line-height: 1.6; max-width: 78ch;
}

/* ── Desktop: the rail appears, the passbar goes away ────────────────── */
@media (min-width: 1024px) {
  :root { --rail-w: 244px; --gut: 56px; }

  body { padding-bottom: 0; }
  .passbar, .topbar { display: none; }

  .rail {
    display: flex; flex-direction: column;
    position: fixed; z-index: 80; inset: 0 auto 0 0;
    width: var(--rail-w);
    padding: 34px 26px 30px;
    background: var(--paper-2);
    border-right: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  }
  .rail__mark { text-decoration: none; display: block; }
  .rail__mark-en {
    display: block; font-family: var(--display); font-size: 1.5rem;
    font-variation-settings: "WONK" 1; letter-spacing: .26em;
  }
  .rail__mark-th { display: block; font-size: .95rem; color: var(--gilt); letter-spacing: .1em; }

  .rail__list {
    list-style: none; margin: 44px 0 0; padding: 0 0 0 20px;
    position: relative; flex: 1;
  }
  .rail__list::before {
    content: ""; position: absolute; left: 3px; top: 8px; bottom: 14px;
    width: 1px; background: color-mix(in srgb, var(--ink) 18%, transparent);
  }
  /* The line fills as you travel — the rail is a route, so it has progress. */
  .rail__progress {
    position: absolute; left: 3px; top: 8px; bottom: 14px;
    width: 1px; background: var(--gilt);
    transform-origin: 50% 0; transform: scaleY(var(--travel, 0));
    transition: transform .5s cubic-bezier(.2,.7,.3,1);
  }
  .rail__list li + li { margin-top: 22px; }
  .rail__list a {
    display: block; position: relative; text-decoration: none;
    padding-left: 4px;
  }
  .rail__list i {
    position: absolute; left: -21px; top: 7px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--paper-2);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent);
    transition: background-color .3s ease, box-shadow .3s ease, transform .3s ease;
  }
  .rail__list b {
    display: block; font-weight: 400; font-size: var(--step-0);
    line-height: 1.2; transition: color .25s ease;
  }
  .rail__list em {
    display: block; font-style: normal; font-size: .75rem;
    color: var(--ink-soft);
  }
  .rail__list a:hover i { box-shadow: inset 0 0 0 1px var(--ink); }
  .rail__list a.on i { background: var(--gilt); box-shadow: inset 0 0 0 1px var(--gilt); transform: scale(1.28); }
  .rail__list a.on b { color: var(--gilt); }

  .rail__cta {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 46px; border-radius: 999px;
    background: var(--ink); color: var(--paper-2);
    text-decoration: none; font-size: .78rem; letter-spacing: .04em;
  }
  .rail__cta:hover { background: var(--ink-2); }

  .hero {
    justify-content: flex-end;
    padding-top: 118px; padding-bottom: 82px;
  }
  /* The vessel gets its own column. It cannot reach the type at any width,
     rather than being tuned to just miss it at one. */
  #vessel { top: 0; bottom: 0; left: 54%; right: auto; width: 46%; height: 100%; }
  /* Left-aligned, not auto-centred — `.stop > *` centres by default, which
     would push the text back under the vessel's column. */
  .hero__body, .hero__facts, .hero__note { max-width: 50%; margin-inline: 0 auto; }
  .hero__note {
    order: 1;
    max-width: 100%; text-align: right;
    margin: 22px 0 0; opacity: .8;
  }
  .hero__facts { grid-template-columns: repeat(4, 1fr); }
}

/* Reduced motion: the WebGL scene never starts, so the band it would occupy
   is removed rather than left as a hole. */
@media (prefers-reduced-motion: reduce) {
  #vessel, .hero__note { display: none; }
  .hero { padding-top: 96px; justify-content: center; }
}


/* ── Sticky top bar (phone / tablet) ─────────────────────────────────── */
.topbar {
  position: fixed; z-index: 95; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right));
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(1.1);
  transform: translateY(-102%);
  transition: transform .42s cubic-bezier(.2,.7,.3,1), border-color .42s ease;
}
.topbar.is-up {
  transform: none;
  border-bottom-color: color-mix(in srgb, var(--ink) 12%, transparent);
}
.topbar__mark {
  display: inline-flex; align-items: baseline; gap: 8px;
  min-height: 40px; align-content: center;
  text-decoration: none;
  font-family: var(--display); font-variation-settings: "WONK" 1;
  font-size: 1.05rem; letter-spacing: .2em;
}
.topbar__th { font-family: var(--text); font-size: .8rem; letter-spacing: .06em; color: var(--gilt); }
.topbar__now {
  font-size: .78rem; letter-spacing: .04em; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__now::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 18px; height: 1px; background: var(--gilt); margin-right: 8px;
}

/* ── One load sequence, once, on the hero ────────────────────────────── */
#vessel,
.hero__place, .hero__h1 span, .hero__lede, .hero__actions, .hero__facts, .hero__note {
  opacity: 0; transform: translateY(20px);
  transition: opacity .9s cubic-bezier(.2,.7,.3,1), transform .9s cubic-bezier(.2,.7,.3,1);
}
#vessel { transform: none; transition: opacity 1.4s ease .15s; }
body.ready #vessel,
body.ready .hero__place, body.ready .hero__h1 span, body.ready .hero__lede,
body.ready .hero__actions, body.ready .hero__facts, body.ready .hero__note {
  opacity: 1; transform: none;
}
.hero__place            { transition-delay: .10s; }
.hero__h1 span:nth-child(1) { transition-delay: .20s; }
.hero__h1 span:nth-child(2) { transition-delay: .30s; }
.hero__h1 span:nth-child(3) { transition-delay: .40s; }
.hero__lede             { transition-delay: .52s; }
.hero__actions          { transition-delay: .62s; }
.hero__facts            { transition-delay: .72s; }
.hero__note             { transition-delay: .80s; }
.hero__h1 span { display: block; }

@media (prefers-reduced-motion: reduce) {
  #vessel,
  .hero__place, .hero__h1 span, .hero__lede, .hero__actions, .hero__facts, .hero__note {
    opacity: 1; transform: none; transition: none;
  }
  .topbar { transition: none; }
}


/* The rail replaces the top bar on desktop. Stated last so it wins over the
   .topbar block above it. */
@media (min-width: 1024px) {
  .topbar { display: none; }
}
