/* The Academy's own front: the bar and the footer on every page, and the
   index page between them: a card for each side under the headline, then
   Erawan Cloud's section and Erawan Solution's. At the end, the
   Thai fixes a lesson page needs from the same fonts.

   Every colour is a token read off `site.css`, so the page follows the
   theme toggle like the rest of the site: paper by default, lacquer when the
   reader chose it. The few colours `site.css` has no token for — the pale
   band behind Erawan Solution, the cards' wash — are set here
   per theme. Every class is `ac-` because `site.css` already styles `.hero`,
   `.lang` and friends for the landing.

   Headings are selected through `.ac` on purpose: `site.css` sets Thai
   headings with `body[data-lang="th"] h1`, which a single class loses to. */

.ac {
  --ac-paper: var(--lacquer);
  --ac-card: var(--panel);
  --ac-ink: var(--ivory);
  --ac-muted: var(--quiet);
  --ac-green: var(--gold);
  --ac-line: var(--rule);
  --ac-orange: var(--tea);
  --ac-band: #e9eee8;
  --ac-band-edge: #d6ded3;
  --ac-feature: #edf1e9;
  --ac-feature-edge: #cbd6cb;
  /* Plex Mono has no Thai: naming Trirong before the generic family is what
     sends a Thai label there instead of to the system's monospace. */
  --ac-mono: 'IBM Plex Mono', Trirong, monospace;
  --ac-serif: var(--serif);
  color: var(--ac-ink);
}
html[data-theme='dark'] .ac {
  /* `--quiet` is for captions on lacquer; a paragraph needs `--text`. */
  --ac-muted: var(--text);
  --ac-band: var(--panel);
  --ac-band-edge: var(--rule);
  --ac-feature: var(--lift);
  --ac-feature-edge: var(--rule);
}

.ac a {
  color: inherit;
  text-decoration: none;
}
.ac a:focus-visible,
.ac button:focus-visible,
.ac input:focus-visible {
  outline: 3px solid var(--ac-orange);
  outline-offset: 3px;
}
.ac img {
  display: block;
  max-width: 100%;
}
.ac-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ac-skip {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 99;
  padding: 10px 16px;
  background: #112e27;
  color: #fff;
}
.ac-skip:focus {
  top: 12px;
}
.ac-shell {
  width: min(100% - 72px, 1320px);
  margin-inline: auto;
}
.ac .ac-eyebrow {
  font: 500 11px/1.5 var(--ac-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ac-green);
}
.ac .ac-small-link {
  font: 500 12px/1.3 var(--ac-mono);
  letter-spacing: 0.02em;
  color: var(--ac-green);
}
.ac .ac-small-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The small mono lines that carry Thai — a side's lesson count, a topic's
   name, a lesson's minutes, the links. (The kicker and the section eyebrows went on
   2026-10-07: each only said its own heading again.) Tracking pulls a Thai cluster apart (the tone
   mark drifts off its consonant), and 11px is below where Trirong's loops
   read. */
body[data-lang='th'] .ac .ac-eyebrow,
body[data-lang='th'] .ac .ac-small-link,
body[data-lang='th'] .ac-fork-foot,
body[data-lang='th'] .ac .ac-topic-name,
body[data-lang='th'] .ac-topic-time {
  letter-spacing: 0;
  font-size: 13px;
}

/* ── The bar ── */
.ac-topbar {
  border-bottom: 1px solid var(--ac-line);
  background: color-mix(in srgb, var(--ac-paper) 86%, transparent);
}
.ac-topbar-inner {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 42px;
}
/* The lockup is the brand kit's and web/site.css's, in both languages:
   Trirong 400 tracked .01em, the mark 1.8em square and lifted .01em, a .45em
   gap. The word's ink then centres on the elephant's body, and Erawan and
   เอราวัณ are the same picture here as on the landing. */
.ac .ac-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  white-space: nowrap;
  font: 400 23px/1 Trirong, Georgia, serif;
  letter-spacing: 0.01em;
  color: var(--ac-ink);
}
.ac-mark {
  width: 1.8em;
  height: 1.8em;
  flex: none;
  transform: translateY(-0.01em);
  color: var(--ac-green);
}
.ac-brand i {
  height: 21px;
  width: 1px;
  background: var(--ac-line);
  margin: 0 3px 0 7px;
}
.ac-brand .ac-word {
  font: 500 11px/1 var(--ac-mono);
  letter-spacing: 0.14em;
  color: var(--ac-green);
}
.ac-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 31px;
  font-size: 14px;
}
.ac .ac-nav a:hover {
  color: var(--ac-green);
}
.ac .ac-nav .ac-nav-cta {
  border: 1px solid var(--ac-ink);
  border-radius: 5px;
  padding: 9px 15px;
  font-weight: 600;
}
.ac .ac-nav .ac-nav-cta:hover {
  background: var(--ac-ink);
  color: var(--ac-paper);
}
.ac .ac-lang {
  font: 500 11px/1 var(--ac-mono);
  padding: 8px 9px;
  border: 1px solid var(--ac-line);
  border-radius: 4px;
}
.ac-theme {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -30px;
  padding: 0;
  border: 1px solid var(--ac-line);
  border-radius: 4px;
  background: transparent;
  color: var(--ac-muted);
}
.ac-theme:hover {
  color: var(--ac-green);
}
.ac-theme svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Phosphor's icons (icons.tsx), at the size of the words beside them and in
   their colour. Not a font's arrows: iOS draws those as emoji tiles. */
.ac-icon {
  flex: none;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

/* ── Hero ── */
.ac-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--ac-line);
  /* The paper under the glow: with the doors in it the hero runs past the
     page's own wash, which otherwise ends in a line across both doors. */
  background:
    radial-gradient(
      circle at 75% 25%,
      color-mix(in srgb, var(--ac-green) 9%, transparent) 0,
      transparent 44%
    ),
    var(--ac-paper);
}
.ac-hero-inner {
  position: relative;
  display: grid;
  gap: 44px;
  padding: 52px 0 80px;
}
.ac .ac-h1 {
  font: 500 clamp(40px, 4.55vw, 72px) / 1.3 var(--ac-serif);
  letter-spacing: -0.058em;
  color: var(--ac-ink);
  margin: 0 0 20px;
}
.ac .ac-h1 em {
  font-style: normal;
  font-weight: inherit;
  color: var(--ac-green);
}
/* Thai has no word spaces for `balance` to choose from — site.css has the
   measurement — and no negative tracking either: the marks above and below
   the line run into each other. */
body[data-lang='th'] .ac .ac-h1 {
  letter-spacing: -0.01em;
  line-height: 1.38;
  text-wrap: wrap;
}
.ac .ac-lead {
  font-size: clamp(16px, 1.33vw, 19px);
  line-height: 1.85;
  max-width: 62ch;
  color: var(--ac-muted);
  margin: 0;
}
.ac .ac-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 54px;
  padding: 10px 22px;
  border-radius: 5px;
  background: var(--ac-orange);
  color: #1d231c;
  font-weight: 600;
  transition:
    transform 0.2s,
    filter 0.2s;
}
.ac .ac-button:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}
.ac .ac-button:active {
  transform: translateY(1px);
}

/* ── Section headings ── */
.ac section {
  scroll-margin-top: 28px;
}
.ac .ac-h2 {
  font: 500 clamp(29px, 3vw, 42px) / 1.35 var(--ac-serif);
  letter-spacing: -0.05em;
  color: var(--ac-ink);
  margin: 7px 0 0;
}
body[data-lang='th'] .ac .ac-h2 {
  letter-spacing: -0.01em;
}

/* ── The two sides ──
   Erawan Cloud and Erawan Solution, kept apart all the way down (the
   founder's call, 2026-10-19). A card each under the headline, the same size,
   then a section each: Cloud on the page's paper, Solution on the band, so
   scrolling from one into the other is crossing over. Neither is the other's
   footnote. */
.ac-fork {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}
.ac .ac-fork-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    'icon name'
    'line line'
    'foot foot';
  align-items: center;
  column-gap: 14px;
  padding: 26px 30px 22px;
  border: 1px solid var(--ac-feature-edge);
  border-radius: 11px;
  background: var(--ac-feature);
  box-shadow: 14px 16px 0 color-mix(in srgb, var(--ac-green) 8%, transparent);
  transition: transform 0.2s;
}
.ac .ac-fork-card:hover {
  transform: translateY(-3px);
}
.ac-fork-card .ac-door-icon {
  grid-area: icon;
}
.ac-door-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--ac-green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ac-green);
}
.ac-door-icon .ac-icon {
  width: 24px;
  height: 24px;
}
.ac-fork-name {
  grid-area: name;
  font: 500 clamp(24px, 2.2vw, 31px) / 1.3 var(--ac-serif);
  letter-spacing: -0.03em;
  color: var(--ac-ink);
}
.ac-fork-line {
  grid-area: line;
  margin: 18px 0 22px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ac-muted);
}
.ac-fork-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--ac-feature-edge);
  font: 500 12px/1.4 var(--ac-mono);
  color: var(--ac-green);
}
.ac-fork-foot .ac-icon {
  width: 18px;
  height: 18px;
}
body[data-lang='th'] .ac-fork-name {
  letter-spacing: -0.01em;
}

.ac-side {
  padding: 84px 0 96px;
  border-bottom: 1px solid var(--ac-line);
}
/* Its own paper, not the page's: site.css's wash behind the body ends a
   screen down, and drew a line across the top of this section. */
.ac-side-cloud {
  background: var(--ac-paper);
}
.ac-side-solution {
  background: var(--ac-band);
  border-bottom-color: var(--ac-band-edge);
}
.ac-side-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: end;
  gap: 18px 56px;
  margin-bottom: 44px;
}
.ac .ac-side-head .ac-h2 {
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.25;
  margin: 0;
}
.ac .ac-side-head p {
  max-width: 56ch;
  margin: 0;
  color: var(--ac-muted);
  font-size: 17px;
  line-height: 1.8;
  /* No last line of one word ("โค้ด" alone under the rest). */
  text-wrap: pretty;
}

/* The question this side's reader comes with, and the answers as buttons:
   which AI they already use, or what their business needs. */
.ac-choose {
  margin-bottom: 60px;
}
.ac .ac-choose-q {
  margin: 0 0 16px;
  font: 500 21px/1.5 var(--ac-serif);
  color: var(--ac-ink);
}
.ac .ac-choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.ac-choices li > * {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--ac-line);
  border-radius: 7px;
  background: var(--ac-card);
  color: var(--ac-ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
}
.ac .ac-choices a {
  transition:
    border-color 0.2s,
    color 0.2s,
    transform 0.2s;
}
.ac .ac-choices a:hover {
  border-color: var(--ac-green);
  color: var(--ac-green);
  transform: translateY(-2px);
}
.ac-choices .ac-icon {
  width: 18px;
  height: 18px;
  color: var(--ac-green);
}
/* Not published yet: the same place, nothing to press. The badge goes under
   the name, so the name has the whole width and is not cut mid-word. */
.ac-choices li > span {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  background: transparent;
  color: var(--ac-muted);
}
.ac-soon {
  flex: none;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--ac-orange);
  color: #1d231c;
  font: 500 10px/1 var(--ac-mono);
}
.ac .ac-choose-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

/* Every lesson on this side, a column per topic: four for Cloud, three for
   Solution, read off the lessons. */
.ac-topics {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 36px;
}
.ac .ac-topic-name {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ac-ink);
  font: 500 12px/1.4 var(--ac-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac-green);
}
.ac .ac-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ac .ac-topic-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ac-line);
}
.ac-side-solution .ac-topic-list a {
  border-bottom-color: var(--ac-band-edge);
}
.ac-topic-title {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ac-ink);
  transition: color 0.2s;
}
.ac .ac-topic-list a:hover .ac-topic-title {
  color: var(--ac-green);
}
.ac-topic-time {
  flex: none;
  font: 400 12px/1.5 var(--ac-mono);
  color: var(--ac-muted);
}

/* ── Footer ── */
.ac-footer {
  border-top: 1px solid var(--ac-line);
  padding: 24px 0 34px;
}
.ac-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--ac-muted);
  font-size: 13px;
}
.ac .ac-footer a:hover {
  color: var(--ac-green);
}
.ac-footer-links {
  display: flex;
  gap: 22px;
}

@media (max-width: 1050px) {
  .ac-hero-inner {
    gap: 40px;
  }
  .ac-side-head {
    grid-template-columns: 1fr;
  }
  .ac-topics {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 32px;
  }
}
@media (max-width: 750px) {
  .ac-shell {
    width: min(100% - 32px, 600px);
  }
  .ac-topbar-inner {
    height: 65px;
    gap: 15px;
  }
  .ac .ac-brand {
    font-size: 19px;
  }
  .ac-brand i,
  .ac-brand .ac-word {
    display: none;
  }
  .ac-nav {
    gap: 13px;
    font-size: 12px;
  }
  /* Both sides' names go together or not at all: the cards under the
     headline do their job on a phone. */
  .ac-nav a:not(.ac-nav-cta) {
    display: none;
  }
  .ac .ac-nav .ac-nav-cta {
    padding: 8px 10px;
  }
  .ac-lang {
    display: none;
  }
  .ac-theme {
    margin-left: 0;
  }
  .ac-hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 0 56px;
    gap: 32px;
  }
  .ac-fork {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ac .ac-fork-card {
    padding: 20px 20px 18px;
    box-shadow: 8px 10px 0 color-mix(in srgb, var(--ac-green) 8%, transparent);
  }
  .ac-fork-line {
    margin: 14px 0 16px;
    font-size: 16px;
  }
  .ac .ac-h1 {
    font-size: clamp(35px, 9vw, 55px);
  }
  .ac .ac-lead {
    font-size: 16px;
  }
  .ac-side {
    padding: 56px 0 64px;
  }
  .ac-side-head {
    margin-bottom: 32px;
  }
  .ac .ac-side-head .ac-h2 {
    font-size: 34px;
  }
  .ac .ac-side-head p {
    font-size: 16px;
  }
  .ac-choose {
    margin-bottom: 44px;
  }
  .ac .ac-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .ac-choices li > * {
    padding: 13px 14px;
    font-size: 15px;
  }
  .ac-topics {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ac-footer-inner {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 500px) {
  .ac-topbar-inner {
    gap: 8px;
  }
  .ac-nav {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ac *,
  .ac *::before,
  .ac *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ── A lesson's own mono lines, in Thai ──
   The same failure as the index's labels, on `site.css`'s lesson rules: the
   kicker is tracked .16em, the byline .06em, and a Thai prompt in a copy line
   falls through to the system's monospace. */
body[data-lang='th'] .post .kicker,
body[data-lang='th'] .post .byline,
body[data-lang='th'] .post .paste {
  font-family: var(--ac-mono, 'IBM Plex Mono', Trirong, monospace);
  letter-spacing: 0;
}
body[data-lang='th'] .post .kicker {
  font-size: 13px;
}
