/* ADD [Claude AI - Opus 5.5] (2026-11-28 05:55:00): L2 Piya landing page styles. Light/dark via [data-theme], mobile first. */

:root {
  --gold-1: #fff1c4;
  --gold-2: #e9c46a;
  --gold-3: #b8862b;
  --blue: #5aa9ff;
  --radius: 14px;
  --font: "Kanit", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-en: "Cinzel", "Kanit", serif;
}
/* ADD [Claude AI - Opus 5.5] (2026-11-28 07:30:00): Noto font for scripts Kanit lacks (loaded only on that page). */
html[lang="km"] { --font: "Kanit", "Noto Sans Khmer", system-ui, sans-serif; }
html[lang="my"] { --font: "Kanit", "Noto Sans Myanmar", system-ui, sans-serif; }
html[lang="lo"] { --font: "Kanit", "Noto Sans Lao", system-ui, sans-serif; }

[data-theme="dark"] {
  --menu: rgba(14, 18, 34, .94);
  --menu-hover: rgba(233, 196, 106, .14);
  --gold-cur: #e9c46a;
  color-scheme: dark;
  --text: #f3efe6;
  --muted: #b9b4a8;
  --card: rgba(14, 18, 34, .72);
  --card-hover: rgba(22, 28, 52, .85);
  --line: rgba(233, 196, 106, .35);
  --bar: rgba(6, 9, 20, .55);
  --off-text: #8d8a83;
  --off-card: rgba(30, 32, 40, .62);
  --off-line: rgba(255, 255, 255, .1);
}

[data-theme="light"] {
  --menu: rgba(255, 252, 245, .97);
  --menu-hover: rgba(184, 134, 43, .14);
  --gold-cur: #8a5f12;
  color-scheme: light;
  --text: #2a2116;
  --muted: #6b5d48;
  --card: rgba(255, 252, 245, .82);
  --card-hover: rgba(255, 255, 255, .95);
  --line: rgba(184, 134, 43, .45);
  --bar: rgba(255, 250, 240, .6);
  --off-text: #9a958c;
  --off-card: rgba(235, 232, 226, .75);
  --off-line: rgba(0, 0, 0, .08);
}

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

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: color .3s;
}

/* Fixed background art + shade. The castle sits right of centre, so phones keep it in view. */
/* FIX [Claude AI - Opus 5.5] (2026-11-28 06:33:10): one picture for both themes (user ask), so the scene never changes on a switch.
   .bg = the light art, always. ::before = light cream shade (light mode). ::after = dark night overlay (dark mode):
   a blue night tint, a vignette that keeps the castle centre brighter, and a dark bottom for the buttons.
   Only the two overlays' opacity animates. bg-dark.webp is no longer used. */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("assets/bg-light.webp") 62% center / cover no-repeat, #0b0e1a;
}
.bg::before, .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
}
.bg::before {
  background: linear-gradient(180deg, rgba(255, 250, 240, .35) 0%, rgba(255, 250, 240, .15) 35%, rgba(255, 247, 232, .82) 72%, rgba(255, 247, 232, .96) 100%);
}
.bg::after {
  background:
    linear-gradient(180deg, rgba(6, 9, 20, .25) 0%, rgba(6, 9, 20, 0) 30%, rgba(6, 9, 20, .7) 72%, rgba(6, 9, 20, .95) 100%),
    radial-gradient(ellipse 75% 70% at 62% 38%, rgba(6, 9, 20, .15) 0%, rgba(6, 9, 20, .5) 60%, rgba(6, 9, 20, .85) 100%),
    linear-gradient(rgba(16, 26, 64, .38), rgba(16, 26, 64, .38));
}
[data-theme="light"] .bg::before, [data-theme="dark"] .bg::after { opacity: 1; }

/* ---------- top bar ---------- */
/* FIX [Claude AI - Opus 5.5] (2026-11-28 07:30:00): own layer above the hero, so the open language menu is never under the logo. */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  background: var(--bar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
}
/* FIX [Claude AI - Opus 5.5] (2026-11-28 06:15:00): emblem has a transparent background, so no box or border. */
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45)); }

.controls { display: flex; align-items: center; gap: 10px; }

/* FIX [Claude AI - Opus 5.5] (2026-11-28 07:30:00): language dropdown (9 SEA languages) with flags. <details> works without JS. */
.lang { position: relative; }
.lang summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: 500 .85rem var(--font);
  cursor: pointer;
  user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.lang[open] .chev { transform: rotate(180deg); }
.flag { flex: none; width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  min-width: 210px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--menu);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.lang li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font: 400 .95rem var(--font), system-ui, sans-serif;
}
.lang li a:hover { background: var(--menu-hover); }
.lang li a[aria-current="page"] { color: var(--gold-cur); font-weight: 500; }
.lang li a[aria-current="page"]::after { content: ""; margin: 0 4px 3px auto; width: 5px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.theme {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme .i-moon { fill: currentColor; stroke: none; }
/* Show the icon of the mode you switch TO. */
[data-theme="dark"] .theme .i-moon,
[data-theme="light"] .theme .i-sun { display: none; }

.lang summary:focus-visible, .lang li a:focus-visible, .theme:focus-visible, .act:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 28px;
}

.logo { margin: 0; width: min(640px, 100%); line-height: 0; }
.logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .55));
}

/* ADD [Claude AI - Opus 5.5] (2026-11-28 07:30:00): "SEA Server" badge under the logo. */
.sea {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 0;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(246, 220, 147, .75);
  background: linear-gradient(180deg, rgba(40, 28, 6, .78), rgba(20, 14, 4, .82));
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 241, 196, .25);
  color: var(--gold-1);
  font: 700 .95rem var(--font-en);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.sea svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-2); stroke-width: 1.8; }

.tagline {
  margin: 0;
  text-align: center;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 400;
  color: var(--text);
  text-wrap: balance;
  text-shadow: 0 0 6px var(--card), 0 1px 14px var(--card), 0 0 2px var(--card);
}

/* ---------- the 4 buttons ---------- */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}

.act {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font: 500 1.08rem/1.3 var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.act > svg:first-child {
  flex: none;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.act .label { flex: 1; }

/* Gold main button (member site). */
.act.primary {
  color: #2a1d05;
  border-color: #f6dc93;
  background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 50%, var(--gold-3) 100%);
  box-shadow: 0 6px 24px rgba(184, 134, 43, .45), inset 0 1px 0 rgba(255, 255, 255, .7);
  font-weight: 600;
}
.act.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(233, 196, 106, .6), inset 0 1px 0 rgba(255, 255, 255, .7); }
.act.primary:active { transform: translateY(0); }
.act .ext { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

/* Greyed out (not open yet). */
.act:disabled {
  cursor: not-allowed;
  color: var(--off-text);
  background: var(--off-card);
  border-color: var(--off-line);
  filter: grayscale(1);
}
.soon {
  flex: none;
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--off-line);
  color: var(--off-text);
  white-space: nowrap;
}

.foot {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  padding: 10px 20px max(16px, env(safe-area-inset-bottom));
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .brand span { display: none; }
  .hero { justify-content: center; gap: 14px; padding: 24px 16px 20px; }
  .actions { grid-template-columns: 1fr; gap: 10px; }
  .act { min-height: 64px; padding: 12px 16px; font-size: 1rem; gap: 12px; }
  .soon { font-size: .68rem; padding: 2px 8px; } /* FIX [Claude AI - Opus 5.5] (2026-11-28 06:50:00): smaller pill so EN labels fit one line */
  .sea { font-size: .8rem; padding: 5px 14px; margin-top: -4px; }
  .act.primary { order: -1; } /* the only open button goes first on phones */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
