:root {
  color-scheme: light;
  /* Brand */
  --sky: #5FA0EE;
  --haze: #B0D8FA;
  --cloud: #E0F0FE;
  --feather: #F8FCFF;
  --navy: #1E2A5A;
  --deep: #2A66C4;
  /* Roles: these are what dark mode swaps */
  --bg: var(--feather);
  --surface: #fff;
  --text: var(--navy);
  --muted: #4C5A86;
  --accent: var(--deep);
  --line: var(--cloud);
  --chip: var(--cloud);
  --chip-hover: var(--haze);
  --chip-on-bg: var(--navy);
  --chip-on-text: #fff;
  --tile: #fff;
  --tile-text: var(--navy);
  --light-btn-bg: #fff;
  --light-btn-text: var(--deep);
  --nav-stuck: rgba(248, 252, 255, .92);
  --shadow: rgba(42, 102, 196, .1);
  --hero-bg: linear-gradient(180deg, #BFE0FC 0%, #DDEFFE 46%, var(--feather) 100%);
  --cloud-puff: #fff;
  --cloud-opacity: .9;
  --sky-line: rgba(255, 255, 255, 1);
  --footer-bg: var(--navy);
  --footer-text: #DCE8FF;
  --play-bg: rgba(255, 255, 255, .92);
  --play-icon: var(--deep);
  --backdrop: rgba(30, 42, 90, .72);
  --disc: radial-gradient(circle at 50% 38%, #86BDF5 0%, var(--haze) 55%, var(--cloud) 100%);
  --blush: #F6DCE8;
  --particle: var(--haze);
  --particle-hero: #fff;
  --sparkle-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0q2 10 12 12q-10 2-12 12q-2-10-12-12q10-2 12-12z'/%3E%3C/svg%3E");
  --feather-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 2C12 2 5 7 5 15c0 1 .1 2 .4 2.8L2.500 21l1.400 1.300 3-3C8 20 9 20 10 20c8 0 12-8 11-18z'/%3E%3C/svg%3E");

  --gutter: clamp(16px, 5vw, 72px);
  --heading: Mitr, "Noto Sans Thai", sans-serif;
  --body: Anuphan, "Noto Sans Thai", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151D42;
  --surface: var(--navy);
  --text: var(--feather);
  --muted: #C6D8F5;
  --accent: var(--haze);
  --line: rgba(176, 216, 250, .22);
  --chip: rgba(176, 216, 250, .14);
  --chip-hover: rgba(176, 216, 250, .26);
  --chip-on-bg: var(--feather);
  --chip-on-text: var(--navy);
  --tile: rgba(176, 216, 250, .14);
  --tile-text: var(--feather);
  --light-btn-bg: rgba(248, 252, 255, .12);
  --light-btn-text: var(--feather);
  --nav-stuck: rgba(21, 29, 66, .92);
  --shadow: rgba(5, 9, 30, .45);
  --hero-bg: radial-gradient(900px 560px at 50% 40%, #2F4A92 0%, var(--navy) 58%, #151D42 100%);
  --cloud-puff: #3A5AA8;
  --cloud-opacity: .22;
  --sky-line: rgba(176, 216, 250, .4);
  --footer-bg: #10173A;
  --play-bg: rgba(21, 29, 66, .86);
  --play-icon: var(--feather);
  --backdrop: rgba(8, 12, 34, .8);
  --disc: radial-gradient(circle at 50% 38%, #4A74CC 0%, #2F4A92 60%, var(--navy) 100%);
  --particle: rgba(176, 216, 250, .55);
  --particle-hero: rgba(224, 240, 254, .7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--body);
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--heading); font-weight: 500; line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  background: var(--surface); padding: 10px 18px; border-radius: 99px;
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 26px;
  border: 0; border-radius: 99px;
  font-weight: 500; text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { background: #2259AE; box-shadow: 0 10px 24px rgba(42, 102, 196, .25); }
.btn-light { background: var(--light-btn-bg); color: var(--light-btn-text); }
.btn-soft { background: var(--chip); color: var(--text); width: 100%; }
.btn-soft:hover { background: var(--chip-hover); }

/* Navigation */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: -96px; height: 96px;
  padding: 0 var(--gutter);
  transition: background-color .25s ease, box-shadow .25s ease, height .25s ease;
}
.site-nav.is-stuck {
  background: var(--nav-stuck);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px var(--shadow);
  height: 76px;
}
.nav-logo {
  display: grid; place-items: center; flex: none; margin-right: auto;
  width: 56px; height: 56px;
  background: var(--tile); border-radius: 18px;
}
/* The P's weight sits up and left of its box, so nudge it to look centred in the tile. */
.nav-logo img { width: auto; height: 34px; transform: translate(5.5%, 3%); }
.site-nav nav { display: flex; align-items: center; gap: 34px; font-weight: 500; }
.site-nav nav a:not(.btn) { text-decoration: none; padding: 10px 0; }
.site-nav nav a:not(.btn):hover { color: var(--accent); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-left: 10px;
  border: 0; border-radius: 50%;
  background: var(--tile); color: var(--tile-text);
  transition: transform .2s ease;
}
.theme-btn:hover { transform: rotate(12deg); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.menu-btn {
  display: none; min-height: 44px; padding: 8px 20px;
  border: 0; border-radius: 99px;
  background: var(--tile); color: var(--tile-text); font-weight: 500;
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); column-gap: 24px; align-items: center;
  min-height: 880px;
  padding: 96px max(var(--gutter), calc((100vw - 1440px) / 2 + 72px)) 0;
  background: var(--hero-bg);
}
.cloud { position: absolute; border-radius: 50%; background: var(--cloud-puff); filter: blur(38px); opacity: var(--cloud-opacity); }
.cloud-a { width: 620px; height: 210px; left: -120px; top: 360px; }
.cloud-b { width: 540px; height: 190px; right: -90px; top: 250px; }
.cloud-c { width: 900px; height: 220px; left: 50%; margin-left: -450px; bottom: -80px; }
:root[data-theme="dark"] .cloud-c { display: none; } /* its clipped edge shows on navy */
.sky-lines { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--sky-line); }
.spark { transform-box: fill-box; transform-origin: center; animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.72); opacity: .65; } }
.hero-content { position: relative; z-index: 1; padding-bottom: 40px; }
.hero-character { position: relative; z-index: 1; align-self: end; justify-self: center; width: 100%; max-width: 640px; }
.hero-character::before {
  content: ""; position: absolute; left: 0; right: 0; top: 8%;
  aspect-ratio: 1; border-radius: 50%; background: var(--disc);
}
.hero-character img {
  position: relative; width: 116%; max-width: none; margin-left: -8%;
  -webkit-mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
}
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 20px; border-radius: 99px;
  background: var(--light-btn-bg); font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 24px var(--shadow);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hero-logo { width: min(600px, 100%); margin: 26px 0 14px; }
.hero h1 { font-size: clamp(30px, 4vw, 40px); }
.lead { max-width: 560px; margin: 14px 0 28px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Sections */
.section { max-width: 1440px; margin: 0 auto; padding: 90px var(--gutter) 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 18px 32px; margin-bottom: 34px;
}
.section-head h2 { font-size: clamp(32px, 4vw, 44px); }
.eyebrow { color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.head-note { color: var(--muted); font-size: 15px; }

/* Works */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  min-height: 44px; padding: 8px 20px;
  border: 0; border-radius: 99px;
  background: var(--chip); font-size: 15px; font-weight: 500;
  transition: background-color .2s ease;
}
.tab:hover { background: var(--chip-hover); }
.tab[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--chip-on-text); }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; }
.work { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.work-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: 22px; background: var(--chip);
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.work:hover .work-thumb img { transform: scale(1.04); }
.work-play {
  position: absolute; right: 14px; bottom: 14px;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--play-bg);
}
.work-play::before {
  content: ""; margin-left: 4px;
  border-left: 13px solid var(--play-icon);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.work-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; margin-top: 13px;
  font-size: 16.5px; font-weight: 500; line-height: 1.4;
}
.work-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 14.5px; }

/* Packages */
.package-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; align-items: stretch; }
.package {
  display: flex; flex-direction: column;
  padding: 36px 34px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 30px;
  box-shadow: 0 18px 50px var(--shadow);
}
.package h3 { font-size: 26px; }
.package h3 small { display: block; margin-top: 2px; color: var(--muted); font: 500 15px var(--body); }
.price { margin: 12px 0 2px; color: var(--accent); font: 500 34px/1.25 var(--heading); }
.price span { font-size: 20px; }
.package-meta { color: var(--muted); font-size: 15px; }
.package ul {
  flex: 1; list-style: none;
  margin: 20px 0 24px; padding: 20px 0 0;
  border-top: 1px solid var(--line);
}
.package li { position: relative; padding: 5px 0 5px 24px; font-size: 16px; }
.package li::before {
  content: ""; position: absolute; left: 2px; top: 15px;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--sky); transform: rotate(45deg);
}

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px;
  list-style: none; counter-reset: step; margin: 0; padding: 0;
}
.steps li { counter-increment: step; padding: 28px 30px; background: var(--chip); border-radius: 26px; }
.steps li::before { content: counter(step); display: block; margin-bottom: 8px; color: var(--accent); font: 500 34px/1 var(--heading); }
.steps h3 { font-size: 21px; margin-bottom: 4px; }

/* Rules */
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; align-items: start; }
.panel { padding: 36px 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; }
.panel h3 { font-size: 24px; margin-bottom: 18px; }
.panel dl { margin: 0; }
.panel dt { margin-top: 18px; font-weight: 600; }
.panel dd { margin: 2px 0 0; color: var(--muted); }
.panel ul { margin: 0; padding-left: 20px; }
.note { margin-top: 10px; font-size: 15px; }

/* Footer */
.site-footer { --chibi: 240px; position: relative; margin-top: 150px; background: var(--footer-bg); color: #fff; }
/* The art ends at 78.4% of its canvas height; this lifts the box slightly above the footer's edge. */
.chibi { position: absolute; right: max(var(--gutter), calc((100vw - 1440px) / 2 + 72px)); top: calc(var(--chibi) * -.84); width: var(--chibi); height: auto; pointer-events: none; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px;
  max-width: 1440px; margin: 0 auto; padding: 52px var(--gutter);
}
.footer-inner img { width: 210px; }
.footer-inner h2 { margin-top: 14px; font-size: 26px; }
.footer-mail { margin-top: 4px; color: var(--footer-text); overflow-wrap: anywhere; }
.contact-list { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; list-style: none; margin: 0; padding: 0; }
.contact-list a {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(220, 232, 255, .12); color: var(--footer-text);
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.contact-list a:hover { transform: translateY(-3px); background: #fff; color: var(--navy); }
.site-footer :focus-visible { outline-color: #fff; }

/* Video player */
.player { width: min(1040px, calc(100vw - 32px)); padding: 16px; border: 0; border-radius: 26px; background: var(--surface); color: var(--text); }
.player::backdrop { background: var(--backdrop); }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding-left: 6px; }
.player-bar h2 { font: 500 16.5px/1.4 var(--body); }
.player-close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--chip); }
.player-frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: var(--navy); }
.player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-link { display: inline-block; margin: 10px 6px 2px; padding: 4px 0; color: var(--accent); font-weight: 500; }

/* Moving background */
.sky-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; --particle: var(--particle-hero); }
.particle {
  position: absolute; left: var(--x); bottom: -30px;
  width: var(--size); height: var(--size);
  background: var(--particle); opacity: 0;
  animation: rise var(--duration) linear var(--delay) infinite;
  will-change: transform, opacity;
}
@keyframes rise {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  12% { opacity: var(--peak); }
  85% { opacity: var(--peak); }
  100% { transform: translate(var(--drift), -112vh) rotate(var(--spin)); opacity: 0; }
}
.is-dot { border-radius: 50%; }
.is-sparkle {
  -webkit-mask: var(--sparkle-shape) center / contain no-repeat;
  mask: var(--sparkle-shape) center / contain no-repeat;
}
.is-feather {
  -webkit-mask: var(--feather-shape) center / contain no-repeat;
  mask: var(--feather-shape) center / contain no-repeat;
}
.particle.is-dot { width: calc(var(--size) * .5); height: calc(var(--size) * .5); }
.particle.is-feather { width: calc(var(--size) * 1.3); height: calc(var(--size) * 1.3); }
.cloud { will-change: transform; animation: drift 34s ease-in-out infinite alternate; }
.cloud-b { animation-duration: 42s; animation-direction: alternate-reverse; }
.cloud-c { animation-duration: 50s; }
@keyframes drift { from { transform: translateX(-46px); } to { transform: translateX(46px); } }
.orbit-sway { transform-box: fill-box; transform-origin: center; animation: sway 26s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }

/* Click pop */
.pop { position: fixed; z-index: 50; width: 0; height: 0; pointer-events: none; }
.pop-ring {
  position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  border: 2px solid var(--sky); border-radius: 50%;
  animation: pop-ring .45s ease-out both;
}
@keyframes pop-ring { from { transform: scale(.2); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.pop-bit {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px;
  background: var(--bit-color);
  animation: pop-bit .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.pop-bit.is-dot { left: -3px; top: -3px; width: 6px; height: 6px; }
@keyframes pop-bit {
  0% { transform: rotate(var(--angle)) translateY(0) scale(.2); opacity: 1; }
  65% { transform: rotate(var(--angle)) translateY(calc(var(--reach) * -1)) scale(1); opacity: 1; }
  100% { transform: rotate(var(--angle)) translateY(calc(var(--reach) * -1.2)) scale(0); opacity: 0; }
}
/* A small squish on anything pressable */
.work, .tab, .menu-btn, .nav-logo, .player-close { transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), background-color .2s ease; }
.btn:active, .tab:active, .theme-btn:active, .menu-btn:active, .nav-logo:active, .player-close:active, .contact-list a:active { transform: scale(.92); }
.work:active { transform: scale(.98); }

/* Tablet */
@media (max-width: 1040px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .package-grid, .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .site-nav nav { gap: 20px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 112px; text-align: center; }
  .hero-content { padding-bottom: 24px; }
  .hero-logo { margin: 26px auto 14px; }
  .lead { margin: 14px auto 28px; }
  .hero-actions { justify-content: center; }
  .hero-character { max-width: 520px; }
  .site-footer { margin-top: 190px; }
}

/* Phone */
@media (max-width: 720px) {
  html { scroll-padding-top: 84px; }
  .site-nav, .site-nav.is-stuck { height: 72px; margin-bottom: -72px; }
  .nav-logo { width: 48px; height: 48px; border-radius: 15px; }
  .nav-logo img { height: 29px; }
  .theme-btn { width: 44px; height: 44px; margin-left: 0; }
  .menu-btn { display: block; }
  .site-nav nav {
    display: none; position: absolute; top: 72px; left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px; background: var(--surface); border-radius: 22px;
    box-shadow: 0 18px 44px var(--shadow);
  }
  .site-nav nav.is-open { display: flex; }
  .site-nav nav a:not(.btn) { padding: 11px 14px; }
  .hero { padding: 96px 16px 0; }
  .hero-character { max-width: 340px; }
  .cloud-a { width: 300px; left: -120px; }
  .cloud-b { width: 280px; right: -120px; }
  .cloud-c { width: 520px; margin-left: -260px; }
  .lead { font-size: 17px; }
  .section { padding-top: 68px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: calc(100vw - 16px); padding-bottom: 4px; scrollbar-width: none; }
  .tab { flex: none; }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .package, .panel { padding: 28px 22px; border-radius: 26px; }
  .site-footer { --chibi: 170px; margin-top: 140px; }
  .chibi { right: 16px; }
  .footer-inner { padding: 40px 16px; }
  .player { padding: 10px; border-radius: 20px; }
}

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