/* home.css - the home page (js/home.js). Brand colours only: cream, coral, ink (tokens from huadorr.css).
   Structure comes from hairline rules and type, not from cards and shadows. Corners stay small.
   Loads after the other stylesheets, so it wins over the older home rules in style.css and public-v2.css. */

/* ---------- hero ---------- */
#root .hm-hero { padding: 56px 0 8px; }
#root .hm-hero > * { animation: none; }

.hm-tag { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font: 600 13px/1 var(--font-b); color: var(--t2); letter-spacing: .02em; }
.hm-tag b { font-family: var(--font-d); font-weight: 800; color: var(--t1); letter-spacing: .04em; }
.hm-tag span { padding-left: 10px; border-left: 1px solid var(--line); }

.hm-h1 { margin: 0; font-family: var(--font-d); font-weight: 800; color: var(--t1);
  font-size: clamp(46px, 7.6vw, 116px); line-height: .98; letter-spacing: -.035em; }
html:lang(th) .hm-h1 { line-height: 1.14; letter-spacing: -.01em; font-size: clamp(44px, 8vw, 124px); }
.hm-h1 span { display: block; white-space: nowrap; }
.hm-h1 .hm-l2 { color: var(--acc-t); }
/* the second line starts a little in: reads as one phrase over two lines, not a stack of words */
@media (min-width: 900px) { .hm-h1 .hm-l2 { padding-left: .9em; } }

.hm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 48px; align-items: start;
  margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); }
.hm-lead { margin: 0 0 26px; max-width: 30em; font-size: 18px; line-height: 1.65; color: var(--t2); }
.hm-hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hm-hero .cta .btn { width: auto; min-height: 50px; padding: 0 22px; border-radius: 10px; }
/* the live numbers from public-v2.js: one quiet line instead of pills */
.hm-hero .lstat { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hm-hero .lstat .ls-item { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; font-size: 14px; color: var(--t2); }
.hm-hero .lstat .ls-item b { color: var(--t1); }

/* ---------- the match sheet ---------- */
.hm-sheet { margin: 0; background: var(--s1); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); font: 600 13px/1.2 var(--font-b); }
.hm-lbl { color: var(--t2); letter-spacing: .02em; }
.hm-st { position: relative; display: grid; justify-items: end; color: var(--t1); }
.hm-st > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.hm-st-a i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); animation: hmBlink 1s ease-in-out infinite; }
.hm-st-a { animation: hmOut .25s 2.6s forwards; }
.hm-st-b { opacity: 0; color: #1E8A57; animation: hmIn .3s 2.7s forwards; }

/* rank ladder: the duo marker searches along the ranks and settles one tier above you */
.hm-ladder { padding: 26px 22px 18px; border-bottom: 1px solid var(--line); }
.hm-track { --n: 9; position: relative; height: 2px; margin: 70px 4px 12px; background: var(--line); }
.hm-track > b { position: absolute; top: -4px; left: calc(var(--i) / (var(--n) - 1) * 100%); width: 2px; height: 10px; margin-left: -1px; background: var(--line); }
.hm-span { position: absolute; top: -1px; height: 4px; background: var(--acc);
  left: calc(var(--a) / 8 * 100%); width: calc((var(--b) - var(--a)) / 8 * 100%); transform-origin: left; transform: scaleX(0); animation: hmGrow .45s 2.1s cubic-bezier(.2, .7, .2, 1) forwards; }
.hm-pin { position: absolute; bottom: 8px; left: calc(var(--i) / 8 * 100%); transform: translateX(-50%); }
.hm-pin em { display: block; font: 700 12px/1 var(--font-b); font-style: normal; padding: 6px 9px; border-radius: 5px; white-space: nowrap; }
.hm-pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 2px; height: 9px; margin-left: -1px; background: currentColor; }
.hm-you { color: var(--t1); } .hm-you em { background: var(--t1); color: var(--bg); }
.hm-duo { color: var(--acc-t); left: 0; bottom: 40px; animation: hmSeek 1.9s .35s cubic-bezier(.65, 0, .25, 1) forwards; }
.hm-duo::after { bottom: -41px; height: 41px; }
.hm-duo em { background: var(--acc); color: #1B1A2E; }
.hm-ranks { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin: 0 -14px; font: 500 11px/1.2 var(--font-b); color: var(--t3); text-align: center; }
.hm-ranks span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-ranks span:nth-child(4), .hm-ranks span:nth-child(5) { color: var(--t1); font-weight: 700; }

/* criteria table */
.hm-rows { padding: 4px 0; }
.hm-row { display: grid; grid-template-columns: 1fr 1.1fr 1.1fr 1.5fr; align-items: center; gap: 10px; padding: 11px 22px; font-size: 14.5px; }
.hm-row + .hm-row { border-top: 1px solid var(--line); }
.hm-hd { padding-top: 12px; padding-bottom: 8px; font: 600 12px/1 var(--font-b); color: var(--t3); }
.hm-hd + .hm-row { border-top: 0; }
.hm-k { color: var(--t2); }
.hm-row:not(.hm-hd) > span:nth-child(2), .hm-row:not(.hm-hd) > span:nth-child(3) { color: var(--t1); font-weight: 600; }
.hm-ok { display: inline-flex; align-items: center; gap: 6px; color: #1E8A57; font-weight: 600; font-size: 13.5px;
  opacity: 0; transform: translateX(-4px); animation: hmIn .35s calc(2.3s + var(--r) * .14s) forwards; }
.hm-ok svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-foot { padding: 13px 22px 15px; border-top: 1px solid var(--line); background: var(--s2); font-size: 13.5px; color: var(--t2); }

@keyframes hmSeek { 0% { left: 0; } 55% { left: calc(7 / 8 * 100%); } 100% { left: calc(4 / 8 * 100%); } }
@keyframes hmGrow { to { transform: scaleX(1); } }
@keyframes hmIn { to { opacity: 1; transform: none; } }
@keyframes hmOut { to { opacity: 0; } }
@keyframes hmBlink { 50% { opacity: .25; } }

/* ---------- sections below ---------- */
#root .hm-sec { margin-top: 96px !important; }
#root .hm-sec > h2 { margin: 0 0 26px; font-family: var(--font-d); font-weight: 800; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -.02em; }
html:lang(th) #root .hm-sec > h2 { letter-spacing: 0; line-height: 1.3; }
.hm-sub { margin: -12px 0 22px; color: var(--t2); max-width: 40em; }

.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.hm-steps li { padding-top: 18px; border-top: 2px solid var(--t1); }
.hm-steps li:first-child { border-top-color: var(--acc); }
.hm-n { display: block; font: 700 14px/1 var(--font-d); color: var(--acc-t); margin-bottom: 14px; }
.hm-steps h3, .hm-feats h3 { margin: 0 0 6px; font-family: var(--font-d); font-weight: 700; font-size: 19px; line-height: 1.35; }
.hm-steps p, .hm-feats p { margin: 0; color: var(--t2); font-size: 15.5px; line-height: 1.6; }

.hm-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hm-feats > div { padding: 22px 28px 24px 0; border-bottom: 1px solid var(--line); }
.hm-feats > div:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--line); }

.hm-faq .hm-qs { max-width: 780px; border-top: 1px solid var(--line); }
.hm-faq .fq summary { font-size: 17px; }
.hm-faq .fq p { margin: 0; padding: 0 0 18px; color: var(--t2); line-height: 1.65; }

/* closing band: ink, left aligned, one action */
/* band colours: --band-bg / --band-fg, set per mode here and per season in the season stylesheets */
:root { --band-bg: #1B1A2E; --band-fg: #FBF6EE; --band-sub: rgba(251, 246, 238, .72); }
:root[data-theme="dark"] { --band-bg: #26223A; --band-fg: #F6EFE4; --band-sub: rgba(246, 239, 228, .7); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) { --band-bg: #26223A; --band-fg: #F6EFE4; --band-sub: rgba(246, 239, 228, .7); }
}
#root .hm-band { margin-top: 110px !important; background: var(--band-bg); color: var(--band-fg); text-align: left; border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; padding: 64px max(24px, calc(50vw - 590px)) !important; }
#root .hm-band h2 { margin: 0; color: var(--band-fg); font-size: clamp(32px, 4.6vw, 60px); line-height: 1.1; letter-spacing: -.02em; }
.hm-bt { min-width: 0; }
.hm-bt p { margin: 10px 0 0; font-size: 16px; color: var(--band-sub); }
html:lang(th) #root .hm-band h2 { letter-spacing: 0; line-height: 1.25; }
#root .hm-band .btn { width: auto; min-height: 54px; padding: 0 28px; border-radius: 10px; background: var(--acc); color: #1B1A2E; }

/* ---------- laptop / tablet / phone ---------- */
@media (max-width: 1100px) {
  .hm-grid { gap: 36px; }
  .hm-row { grid-template-columns: .9fr 1fr 1fr 1.4fr; padding: 11px 18px; }
}
@media (max-width: 900px) {
  #root .hm-hero { padding-top: 32px; }
  .hm-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 30px; padding-top: 24px; }
  .hm-lead { font-size: 17px; }
  .hm-steps { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 640px) {
  .hm-tag { margin-bottom: 16px; }
  .hm-h1, html:lang(th) .hm-h1 { font-size: clamp(38px, 11.6vw, 54px); }
  .hm-hero .cta .btn { flex: 1 1 100%; }
  .hm-ladder { padding: 20px 14px 14px; }
  /* phone: only the ends and the two players' ranks are named, so nothing gets cut off */
  .hm-ranks { font-size: 11px; margin: 0 -10px; }
  .hm-ranks span { visibility: hidden; overflow: visible; }
  .hm-ranks span:nth-child(1), .hm-ranks span:nth-child(4), .hm-ranks span:nth-child(5), .hm-ranks span:nth-child(9) { visibility: visible; }
  .hm-bar { padding: 12px 14px; }
  /* table becomes: criterion on top, you / duo / result in one line */
  /* phone: You / Duo header stays, each row = criterion, the two values, then the result */
  .hm-row { grid-template-columns: 1fr 1fr; gap: 3px 10px; padding: 12px 14px; }
  .hm-hd > span:first-child, .hm-hd > span:last-child { display: none; }
  .hm-row .hm-k { grid-column: 1 / -1; font-size: 12.5px; }
  .hm-ok { grid-column: 1 / -1; }
  .hm-foot { padding: 12px 14px; }
  .hm-feats { grid-template-columns: minmax(0, 1fr); }
  .hm-feats > div, .hm-feats > div:nth-child(even) { padding: 18px 0 20px; border-left: 0; }
  #root .hm-sec { margin-top: 64px !important; }
  #root .hm-band { padding: 48px 18px !important; }
  #root .hm-band .btn { width: 100%; max-width: none; flex: 1 1 100%; }
  #root .hm-band h2 { font-size: 30px; }
  .hm-bt { flex: 1 1 100%; }
  .hm-bt p { font-size: 15px; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-duo { animation: none; left: calc(4 / 8 * 100%); }
  .hm-span { animation: none; transform: none; }
  .hm-ok, .hm-st-b { animation: none; opacity: 1; transform: none; }
  .hm-st-a { animation: none; opacity: 0; }
  .hm-st-a i { animation: none; }
}
/* the full-width band uses 100vw, which includes the scrollbar: never let it cause a sideways scroll */
html:has(.hm-band), body:has(.hm-band) { overflow-x: clip; }
/* small laptops: the panel is narrow too, so name only the ends and the two players' ranks */
@media (min-width: 901px) and (max-width: 1180px) {
  .hm-ranks span { visibility: hidden; overflow: visible; }
  .hm-ranks span:nth-child(1), .hm-ranks span:nth-child(4), .hm-ranks span:nth-child(5), .hm-ranks span:nth-child(9) { visibility: visible; }
}

/* ---------- big screens: use more of the width (header, hero and sections move together) ---------- */
@media (min-width: 1280px) {
  .wrap.wide:has(.hm-hero) { max-width: 1320px; padding-left: 40px; padding-right: 40px; }
  html:lang(th) .hm-h1 { font-size: clamp(44px, 8vw, 136px); }
  .hm-h1 { font-size: clamp(46px, 8.4vw, 132px); }
  .hm-grid { gap: 72px; }
  .hm-lead { font-size: 19px; }
}
@media (min-width: 1600px) {
  .wrap.wide:has(.hm-hero) { max-width: 1440px; }
}
/* plan cards: keep the "best value" ribbon clear of the plan name */
.pm-card:has(.pm-rib) h3 { padding-right: 84px; }
