/* ===================== TARI Landing Page ===================== */
:root {
  --indigo:        #211C44;
  --indigo-deep:   #181438;
  --indigo-light:  #2E2860;
  --gold:          #F5B700;
  --green:         #8DC63F;
  --lavender:      #E9E6FA;
  --lavender-card: #EEEBFB;
  --ink:           #1B1736;
  --muted:         #5b5570;
  --line:          #e3e0ee;
  --white:         #ffffff;

  --font-en: 'Merriweather';
  /* Merriweather has no Thai glyphs. Sarabun is the face the portal already uses
     for Thai (05 Portal Application/frontend-react/src/index.css), so switching
     on --font-active here keeps the two halves of the product in step. */
  --font-th: 'Sarabun';
  --font-active: var(--font-en);
  --type-body: 16px;
  --type-title: 22px;
  --type-display: 40px;
  --serif: var(--font-active);
  --cond:  var(--font-active);
  --sans:  var(--font-active);

  --maxw: 1180px;
}

/* i18n.js sets the lang attribute; every font rule reads --font-active, so this
   one line is the whole Thai type swap. */
html[lang="th"] { --font-active: var(--font-th); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; font-family: var(--font-active); font-size: var(--type-body); }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  background: var(--indigo);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- shared bits ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--gold);
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  margin-bottom: 14px;
}
.eyebrow--light { color: var(--gold); }
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--type-display);
  line-height: 1.2;
  margin: 0 0 28px;
  color: var(--white);
  max-width: 35ch;
}
.section-title--light { color: var(--white); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--type-body);
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 9999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  text-align: center;
}
.btn--gold { background: var(--gold); color: var(--indigo-deep); }
.btn--gold:hover { background: #ffce3a; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(245,183,0,.32); }
.btn--dashboard { background: #fff; color: var(--indigo-deep); border-color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.16); }
.btn--dashboard:hover { background: var(--gold); border-color: var(--gold); color: var(--indigo-deep); transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn--outline:hover { background: rgba(255,255,255,.12); border-color: #fff; transform: translateY(-2px); }
.btn--sm { padding: 9px 18px; font-size: var(--type-body); }
.btn--block { width: 100%; }

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(24,20,56,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
}
.nav__brand img { height: 34px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  color: rgba(255,255,255,.86);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--type-body);
}
.nav__links a:hover { color: #fff; }
.nav__links a.btn { color: var(--indigo-deep); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.nav__toggle span { width: 24px; height: 2px; background: #fff; display: block; transition: .2s; }

/* ---------- language switcher (TH / EN) ---------- */
.langswitch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  font-family: var(--sans);
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.langswitch:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0,0,0,.28); }
.langswitch:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(245,183,0,.55); }

.langswitch__side {
  font-weight: 700;
  font-size: var(--type-body);
  letter-spacing: .06em;
  color: #9a94ad;
  transition: color .2s ease;
}
/* default (unchecked) = English active; .is-th flips it */
.langswitch__side--en { color: var(--indigo-deep); }
.langswitch.is-th .langswitch__side--en { color: #9a94ad; }
.langswitch.is-th .langswitch__side--th { color: var(--indigo-deep); }

.langswitch__track {
  position: relative;
  flex: 0 0 auto;
  width: 46px; height: 24px;
  border-radius: 9999px;
  background: var(--indigo-deep);
}
.langswitch__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(22px);   /* knob right = EN */
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}
.langswitch.is-th .langswitch__knob { transform: translateX(0); }  /* knob left = TH */

/* ===================== HERO ===================== */
/* Hero + Founders share one continuous curve graphic on a flat indigo base */
.flow { position: relative; background: var(--indigo); overflow: hidden; }
.flow::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: min(94%, 1300px);
  aspect-ratio: 2400 / 1350;
  background: url('../img/hero-curves.png') top right / contain no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.hero {
  position: relative;
  background: transparent;
  color: var(--white);
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: flex-start;
}
.hero__overlay { display: none; }
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1in 24px 0.5in;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--type-display);
  line-height: 1.08;
  margin: 0 0 24px;
  max-width: 35ch;
}
.hero__tagline {
  font-family: var(--serif);
  font-size: var(--type-title);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 16px;
  max-width: 70ch;
  line-height: 1.4;
}
.hero__subtagline {
  font-family: var(--serif);
  font-size: var(--type-title);
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 48px;
  max-width: 60ch;
  line-height: 1.45;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 0; }
/* Each hero entry point carries its own explanation, so the three doors are a
   card grid rather than a bare button row. */
.hero__entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.entry {
  display: flex; flex-direction: column;
  /* The hero curve graphic runs behind the third card, so this sits on a tinted
     indigo backing rather than the .04 white wash .stage/.card use elsewhere —
     the curve stays visible through it without crossing the copy. */
  background: rgba(24,20,56,.72);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(255,255,255,.1);
  border-top: 4px solid var(--gold);
  border-radius: 12px;
  padding: 24px 22px 26px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.entry:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.entry__num { font-family: var(--cond); font-weight: 900; font-size: var(--type-title); color: var(--gold); line-height: 1; }
.entry__title { font-family: var(--serif); font-weight: 700; color: #fff; font-size: var(--type-title); margin: 6px 0 10px; }
.entry__text { color: rgba(255,255,255,.74); font-size: var(--type-body); margin: 0 0 22px; }
/* auto keeps every button on one baseline however long its description runs */
.entry .btn { margin-top: auto; align-self: flex-start; }
.hero__partners-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: var(--type-body);
  color: rgba(255,255,255,.55);
  margin-bottom: 16px;
}
.hero__partners-logos { display: flex; align-items: center; gap: 38px; flex-wrap: nowrap; }
.hero__partners-logos img { height: 38px; width: auto; object-fit: contain; flex: 0 0 auto; }
/* IRIS is solid uppercase letters — scale it down so it reads ~same size as "AIS" */
.hero__partners-logos img[alt="IRIS"] { height: 26px; }

/* ===================== WHAT IS TARI ===================== */
.why { padding: 0.5in 0; background: var(--indigo); }
.why__lead {
  font-family: var(--serif);
  font-size: var(--type-title);
  color: rgba(255,255,255,.78);
  max-width: 58ch;
  margin: -8px 0 0;
}
/* ===================== TARI FRAMEWORK ===================== */
.framework { padding: 0.5in 0; background: var(--indigo); color: var(--white); }
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.stage {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-top: 4px solid var(--gold);
  border-radius: 12px;
  padding: 26px 24px 28px;
}
.stage__num { font-family: var(--cond); font-weight: 900; font-size: var(--type-title); color: var(--gold); }
.stage__title { font-family: var(--serif); font-weight: 700; color: #fff; font-size: var(--type-title); margin: 6px 0 2px; }
.stage__sub { color: var(--gold); font-weight: 600; font-size: var(--type-body); margin: 0 0 14px; }
.stage__list { list-style: none; margin: 0; padding: 0; }
.stage__list li { color: rgba(255,255,255,.74); font-size: var(--type-body); padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.stage__list li strong { display: block; color: #fff; font-weight: 700; }
.stage__text { color: rgba(255,255,255,.74); font-size: var(--type-body); margin: 0; }

.fw-block { margin-top: 48px; }
.fw-block__title { font-family: var(--serif); font-weight: 700; color: #fff; font-size: var(--type-title); margin: 0 0 18px; }
.fw-block__title span { color: rgba(255,255,255,.5); font-weight: 400; font-size: var(--type-body); }
.fw-block__lead { color: rgba(255,255,255,.78); max-width: 100ch; margin: -6px 0 22px; font-family: var(--serif); }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.chips span {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 9px 18px; font-weight: 600; font-size: var(--type-body); color: #fff;
  text-align: center;
}

.maturity { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: 14px; counter-reset: step; }
.maturity li {
  position: relative;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 18px 16px;
}
.maturity li b { display: block; color: var(--gold); font-family: var(--serif); font-size: var(--type-body); margin-bottom: 6px; }
.maturity li span { color: rgba(255,255,255,.7); font-size: var(--type-body); font-style: italic; }

.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 26px; }
.pillar { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.pillar__id {
  flex: 0 0 auto; font-family: var(--cond); font-weight: 900; font-size: var(--type-body);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245,183,0,.16); color: var(--gold);
}
.pillar h4 { font-family: var(--serif); font-weight: 700; color: #fff; margin: 4px 0 3px; font-size: var(--type-body); }
.pillar p { margin: 0; color: rgba(255,255,255,.7); font-size: var(--type-body); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.stat { border-left: 4px solid var(--gold); padding-left: 22px; }
.stat__num {
  font-family: var(--cond);
  font-weight: 900;
  font-size: var(--type-display);
  line-height: 1.05;
  color: var(--white);
  letter-spacing: -.01em;
}
.stat__unit { font-size: var(--type-body); color: rgba(255,255,255,.6); font-weight: 600; }
.stat__label { font-weight: 600; margin-top: 14px; font-size: var(--type-body); color: var(--white); }
.stat__source { color: rgba(255,255,255,.6); font-size: var(--type-body); font-style: italic; margin-top: 4px; }

/* ===================== DELIVERS ===================== */
.delivers { padding: 0.5in 0; background: var(--indigo); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-top: 4px solid var(--gold);
  border-radius: 12px;
  padding: 26px 22px 28px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.card__title {
  font-family: var(--cond);
  font-weight: 900;
  font-size: var(--type-title);
  letter-spacing: .01em;
  color: var(--white);
  margin: 0;
}
.card__icon { height: 38px; width: 38px; object-fit: contain; opacity: .92; filter: brightness(0) invert(1); }
.card p { margin: 0; color: rgba(255,255,255,.74); font-size: var(--type-body); }

/* ===================== FOUNDERS ===================== */
.founders {
  position: relative;
  z-index: 1;
  padding: 0.5in 0;
  background: transparent;
  color: var(--white);
}
/* Subgrid: the three cards share row tracks so every row (logo, role, each item)
   aligns to the tallest across columns — keeps the 3 boxes perfectly aligned. */
.founders__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 34px;
  row-gap: 28px;
  grid-template-rows: repeat(5, auto);
  margin-top: 8px;
}
.founder {
  grid-row: 1 / span 5;
  display: grid;
  grid-template-rows: subgrid;
  gap: 28px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 28px 26px 30px;
}
.founder__logo {
  height: 56px; display: flex; align-items: center;
}
.founder__logo img { max-height: 46px; width: auto; }
.founder__logo img[alt="IRIS"] { max-height: 30px; }
.founder__role {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--gold);
  font-size: var(--type-body);
  line-height: 1.3;
  margin: 0;
}
.founder__item { margin: 0; }
.founder__item h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: #fff;
  margin: 0;
  font-size: var(--type-body);
}
.founder__item h4.nowrap { white-space: nowrap; }
.founder__item p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.74);
  font-size: var(--type-body);
}

/* ===================== CONTACT ===================== */
.contact { padding: 0.5in 0; background: var(--indigo); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact__intro p { color: rgba(255,255,255,.78); max-width: 46ch; }
.contact__details { list-style: none; padding: 0; margin: 26px 0 30px; }
.contact__details li { margin-bottom: 18px; }
.contact__det-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: var(--type-body);
  color: rgba(255,255,255,.55);
  margin-bottom: 3px;
}
.contact__details a {
  font-family: var(--serif);
  font-size: var(--type-title);
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}
.contact__details a:hover { color: var(--gold); }

.contact__form {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 30px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: var(--type-body); margin-bottom: 7px; color: rgba(255,255,255,.9); }
/* only the required marker is red — the label text is its own span so it can
   be translated without inheriting this colour */
.field label .field__req { color: #d23b3b; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfc9ec;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: var(--type-body);
  background: #fff;
  color: var(--ink);
}
.field input::placeholder, .field textarea::placeholder {
  color: #9a94ad;
  opacity: 1; /* Firefox dims placeholders by default */
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(33,28,68,.12);
}
.field textarea { resize: vertical; }
.form__note { font-size: var(--type-body); margin: 14px 0 0; min-height: 1.2em; }
.form__note.is-error { color: #d23b3b; }
.form__note.is-ok { color: #2e7d32; }

/* ===================== FOOTER ===================== */
.footer { background: var(--indigo-deep); color: rgba(255,255,255,.8); padding: 40px 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.footer__logo { height: 30px; width: auto; margin-bottom: 6px; }
.footer__line { font-family: var(--cond); letter-spacing: .14em; margin: 0; font-size: var(--type-body); }
.footer__partners { margin: 0; font-size: var(--type-body); color: rgba(255,255,255,.5); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; gap: 26px; }
  .stages { grid-template-columns: 1fr; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .maturity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maturity li { padding: 16px 12px; }
  .maturity li b { font-size: var(--type-body); }
  .pillars { grid-template-columns: 1fr; }
  .hero__entries { grid-template-columns: 1fr; }
  .founders__grid { display: flex; flex-direction: column; gap: 34px; }
  .founder { display: block; grid-row: auto; }
  .founder__logo { margin-bottom: 18px; }
  .founder__item + .founder__item { margin-top: 18px; }
  .contact__grid { grid-template-columns: 1fr; gap: 36px; }

  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--indigo-deep);
    padding: 0 24px;
    max-height: 0; overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,.08);
    transition: max-height .28s ease, padding .28s ease;
  }
  /* headroom: Thai link labels can wrap onto a second line, and this site
     carries one more pill than the public landing page (Sign-in Portal) */
  .nav__links.open { max-height: 620px; padding: 12px 24px 22px; }
  .nav__links a { padding: 12px 0; width: 100%; }
  .nav__links a.btn { margin-top: 8px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .entry .btn { align-self: stretch; }
  .nav__actions { gap: 8px; }
  .langswitch { gap: 7px; padding: 4px 10px; }
  .langswitch__track { width: 38px; height: 20px; }
  .langswitch__knob { width: 15px; height: 15px; top: 2.5px; left: 2.5px; transform: translateX(18px); }
  .hero__partners-logos { gap: 18px; }
  .hero__partners-logos img { height: 26px; }
  .hero__partners-logos img[alt="IRIS"] { height: 18px; }
}
@media (max-width: 380px) {
  .hero__partners-logos { gap: 14px; }
  .hero__partners-logos img { height: 22px; }
  .hero__partners-logos img[alt="IRIS"] { height: 16px; }
}

/* ===================== THAI (html.lang-th) =====================
   English is what ships in the markup, so only a Thai visitor waits for the
   swap. The inline <head> script adds .lang-th + .i18n-pending before first
   paint, i18n.js removes .i18n-pending once the copy is in place. The font
   swap itself hangs off html[lang="th"] up top; these are the fixes Thai
   script needs on top of a layout tuned for Latin. */
html.lang-th.i18n-pending body { visibility: hidden; }

/* Thai stacks vowels and tone marks above and below the baseline, so the
   Latin-tuned leading is too tight and letter-spacing splits the clusters. */
.lang-th body { line-height: 1.75; overflow-wrap: break-word; }

/* Sarabun stops at 800. Chromium quietly maps 900 down to it, but pin the
   weight so browsers that would synthesize a faux-bold instead don't. Now that
   Sarabun leads, this covers the Latin-only elements (01/02/03, P1–P8) too. */
.lang-th .card__title,
.lang-th .entry__num,
.lang-th .stage__num,
.lang-th .pillar__id,
.lang-th .stat__num { font-weight: 800; }
.lang-th .eyebrow,
.lang-th .footer__line,
.lang-th .contact__det-label { letter-spacing: normal; }
.lang-th .founder__role { line-height: 1.5; }
.lang-th .stage__list li,
.lang-th .entry__text,
.lang-th .why__lead,
.lang-th .fw-block__lead { line-height: 1.75; }
.lang-th .hero__tagline { line-height: 1.55; }

/* ch units assume Latin metrics — cap the two headline blocks in em instead */
.lang-th .hero__title { line-height: 1.3; max-width: 20em; }
.lang-th .section-title { line-height: 1.38; max-width: 24em; }

/* Thai has no true italic; browsers synthesize an ugly slant */
.lang-th .maturity li span { font-style: normal; }

/* the Latin string fit on one line, a Thai one will not */
.lang-th .founder__item h4.nowrap { white-space: normal; }
