/* The Butler Club: one stylesheet for every page. No external requests: fonts are served from /assets/fonts. */

@font-face { font-family: "Kodchasan"; src: url("/assets/fonts/Kodchasan-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Kodchasan"; src: url("/assets/fonts/Kodchasan-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Mali"; src: url("/assets/fonts/Mali-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fbf8ff;
  --surface: #ffffff;
  --line: #e7dff6;
  --ink: #2b2140;
  --soft: #5f547a;
  --accent: #5a3ec2;
  --tile-a: #8e72e3;
  --tile-b: #5a3ec2;
  --butter: #ffe08c;
  --leaf: #c4efa4;
  --pink-soft: #ffe8ee;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1626;
    --surface: #2a2440;
    --line: #463d68;
    --ink: #f5f0ff;
    --soft: #c8bee0;
    --accent: #cdbdff;
    --pink-soft: #55263a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.75 "Kodchasan", -apple-system, "Sukhumvit Set", "Noto Sans Thai", system-ui, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.hand { font-family: "Mali", "Kodchasan", system-ui, sans-serif; font-weight: 700; line-height: 1.35; }

/* header / footer */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { width: 28px; height: 28px; flex: none; }
.top nav { display: flex; gap: 16px; font-size: 15px; }
.top nav a, .brand { white-space: nowrap; }
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 24px 0 40px; color: var(--soft); font-size: 14px; }
.foot p { margin: 4px 0; }

/* home */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(34px, 8vw, 54px); margin: 0 0 12px; }
.hero p { color: var(--soft); font-size: 19px; margin: 0; max-width: 34em; }
.hero .en { font-size: 16px; margin-top: 8px; }

.promise { margin-top: 56px; }
.promise h2 { font-size: 24px; margin: 0 0 8px; }
.promise ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.promise li { padding-left: 28px; position: relative; }
.promise li::before { content: ""; position: absolute; left: 4px; top: 0.7em; width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); border: 2px solid var(--tile-a); }

/* app page */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 28px; }
.features div { background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 16px; }
.features h3 { margin: 0 0 4px; font-size: 18px; }
.features p { margin: 0; color: var(--soft); font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-weight: 700; }

/* documents (privacy, support) */
.doc h1 { font-size: 30px; margin: 24px 0 4px; }
.doc h2 { font-size: 20px; margin: 28px 0 6px; }
.doc .meta { color: var(--soft); font-size: 14px; }
.doc ul { padding-left: 20px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

@media (max-width: 420px) {
  .top nav { gap: 12px; font-size: 14px; }
  .hero p { font-size: 17px; }
}

/* ─── character system (home) ─────────────────────────────────────────────
   Full-bleed color blocks, members on ruled height lines, a spec sheet per member,
   and an animated story of what each member does. Block colors stay the same in dark mode, like printed stickers. */
:root {
  --block-club: #6a4bd6;
  --block-butter: #ffd95a;
  --block-coral: #ff8a65;
  --block-leaf: #8fd46b;
  --block-sky: #8cc8f5;
  --block-lilac: #c8b8ff;
  --block-mint: #8fe0bf;
  --block-pink: #ffadc2;
  --block-ink: #2b2140;
}
.bleed { width: 100%; overflow: hidden; }
.bleed .wrap { position: relative; }
.wordmark { font-family: "Mali", "Kodchasan", system-ui, sans-serif; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; margin: 0; }

.club-hero { background: var(--block-club); color: #fff; }
.club-hero .top a, .club-hero .brand { color: #fff; }
.club-hero .inner { position: relative; min-height: clamp(460px, 78vw, 640px); padding-top: 24px; }
.club-hero .kicker { font-size: 15px; opacity: 0.85; margin: 24px 0 8px; }
.club-hero .wordmark { font-size: clamp(54px, 15vw, 132px); }
.club-hero .lede { max-width: min(30em, 58%); margin: 16px 0 0; font-size: 18px; opacity: 0.92; }
.club-hero .peek { position: absolute; right: -4%; bottom: -14%; width: clamp(220px, 46vw, 420px); transform: rotate(-8deg); }

.overview { text-align: center; padding-top: 56px; padding-bottom: 8px; }
.overview p { max-width: 36em; margin: 0 auto 12px; color: var(--soft); }
.overview h2 { font-size: 26px; margin: 0 0 12px; }

.lineup { margin-top: 32px; padding-bottom: 8px; position: relative;
  background: repeating-linear-gradient(to top, var(--line) 0 1.5px, transparent 1.5px 44px); }
.lineup .row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(24px, 10vw, 96px); min-height: 264px; }
.lineup figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lineup figcaption { font-size: 14px; color: var(--soft); background: var(--bg); padding: 0 8px; border-radius: 8px; }
.lineup .eatie { width: clamp(150px, 34vw, 220px); }
.silhouette { width: clamp(120px, 26vw, 170px); height: clamp(190px, 42vw, 250px); border: 3px dashed var(--soft);
  border-radius: 48% 48% 22% 22%; display: grid; place-items: center; color: var(--soft);
  font: 700 56px "Mali", system-ui, sans-serif; background: var(--bg); }

.member .inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding-top: 48px; padding-bottom: 48px; min-height: 440px; }
.member.flip .art { order: -1; }
.member .art { display: grid; place-items: center; }
.member .art > img { width: min(100%, 380px); }
.member .wordmark { font-size: clamp(52px, 11vw, 96px); }
.member .spirit { font: 700 clamp(20px, 4vw, 26px)/1.3 "Mali", system-ui, sans-serif; margin: 6px 0 16px; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 20px; font-size: 16px; }
.spec dt { font-weight: 700; }
.spec dd { margin: 0; }
.member .cta { display: inline-block; font-weight: 700; padding: 10px 18px; border-radius: 999px; text-decoration: none; }
.member.eatie { background: var(--block-butter); color: var(--block-ink); }
.member.eatie .cta { background: var(--block-ink); color: var(--block-butter); }
.member.next { background: var(--block-sky); color: var(--block-ink); }
.member.next .silhouette { border-color: var(--block-ink); color: var(--block-ink); background: transparent; opacity: 0.7; }

@media (max-width: 640px) {
  .member .inner { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 32px; min-height: 0; }
  .member.flip .art { order: 0; }
  .member .art > img { width: min(80%, 300px); }
  .club-hero .peek { right: -10%; bottom: -10%; }
  .club-hero .lede { max-width: 100%; }
  .club-hero .inner { min-height: 620px; }
}

/* app page hero: the member block with the site header inside it */
.app-hero .top a, .app-hero .brand { color: var(--block-ink); }
.app-hero .inner { padding-top: 8px; }
.app-hero .tile { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 12px; box-shadow: 0 8px 24px rgba(43, 33, 64, 0.2); }
.app-hero p { margin: 0 0 8px; }
.club-hero .brand img { filter: brightness(0) invert(1); }

/* ─── motion ────────────────────────────────────────────────────────────────
   CSS only (the CSP allows no script). The un-animated state of every element is the
   finished scene, so prefers-reduced-motion just switches the animations off. */

/* big faint น้องอีท behind a member block */
.watermark { position: relative; overflow: hidden; }
.watermark::before {
  content: ""; position: absolute; pointer-events: none;
  width: clamp(420px, 95vw, 900px); aspect-ratio: 1;
  right: -18%; top: 50%; transform: translateY(-50%) rotate(-10deg);
  background: url("/assets/eatie-mark.svg") center / contain no-repeat;
}
.watermark > * { position: relative; }

.club-hero .peek { animation: peek 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes peek {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-12px); }
}
.lineup .eatie { animation: bob 2.4s ease-in-out infinite alternate; }
.lineup .silhouette { animation: wait 2.8s ease-in-out infinite; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes wait { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* the story: หลับ → เจอสลิป → กิน → จดลงสมุด, 12 s loop, each scene a quarter */
.story { --cycle: 12s; width: 100%; max-width: 400px; justify-self: center; }
.story-lg { max-width: 520px; }
.stage { position: relative; aspect-ratio: 1; }
.stage > * { position: absolute; }
.st-bob { left: 14%; bottom: 4%; width: 72%; aspect-ratio: 240 / 220; animation: bob 1.6s ease-in-out infinite alternate; }
.st-bob img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: var(--cycle) linear infinite; }
.st-bob .s1 { animation-name: scene1; }
.st-bob .s2 { animation-name: scene2; }
.st-bob .s3 { animation-name: scene3; }
.st-bob .s4 { opacity: 1; animation-name: scene4; }
@keyframes scene1 { 0%, 23% { opacity: 1; } 25%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes scene2 { 0%, 23% { opacity: 0; } 25%, 48% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes scene3 { 0%, 48% { opacity: 0; } 50%, 73% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes scene4 { 0%, 73% { opacity: 0; } 75%, 97% { opacity: 1; } 100% { opacity: 0; } }

.st-zz { right: 14%; top: 18%; font: 700 clamp(22px, 5vw, 34px) "Mali", system-ui, sans-serif; color: var(--block-ink); opacity: 0; animation: zz var(--cycle) ease-out infinite; }
.st-zz span { display: inline-block; }
.st-zz span:nth-child(2) { transform: translateY(-14px) scale(0.8); }
.st-zz span:nth-child(3) { transform: translateY(-26px) scale(0.6); }
@keyframes zz { 0% { opacity: 0; translate: 0 10px; } 6%, 18% { opacity: 1; translate: 0 0; } 23%, 100% { opacity: 0; translate: 0 -16px; } }

.st-slip { width: 15%; top: var(--y); left: var(--x); opacity: 0; animation: slip var(--cycle) ease-in-out infinite; animation-delay: var(--d, 0s); }
.st-slip.a { --x: 10%; --y: 8%; --r: -12deg; --tx: 140%; --ty: 300%; }
.st-slip.b { --x: 42%; --y: 2%; --r: 6deg; --tx: 0%; --ty: 330%; --d: 0.25s; }
.st-slip.c { --x: 74%; --y: 10%; --r: 14deg; --tx: -140%; --ty: 290%; --d: 0.5s; }
@keyframes slip {
  0%, 25% { opacity: 0; transform: translateY(-30px) rotate(var(--r)); }
  31%, 52% { opacity: 1; transform: translateY(0) rotate(var(--r)); }
  64% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); }
}

.st-book {
  right: 2%; top: 4%; width: 54%; padding: 10px 12px; border-radius: 16px;
  background: #fff; color: var(--block-ink); box-shadow: 0 10px 28px rgba(43, 33, 64, 0.18);
  font-size: clamp(11px, 2.6vw, 14px); line-height: 1.5; animation: book var(--cycle) ease-out infinite;
}
.st-book b { display: block; font: 700 1.1em "Mali", system-ui, sans-serif; margin-bottom: 2px; }
.st-book p { display: flex; justify-content: space-between; gap: 8px; margin: 0; border-top: 1px solid #efe9fb; padding-top: 2px; }
@keyframes book { 0%, 74% { opacity: 0; transform: translateY(16px); } 80%, 96% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }

.story-steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.story-steps li {
  counter-increment: step; font-size: 14px; line-height: 1.35; padding: 8px; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, 0.55); opacity: 1; animation: var(--cycle) linear infinite;
}
.story-steps li::before { content: counter(step); display: block; font: 700 18px "Mali", system-ui, sans-serif; }
.story-steps li:nth-child(1) { animation-name: step1; }
.story-steps li:nth-child(2) { animation-name: step2; }
.story-steps li:nth-child(3) { animation-name: step3; }
.story-steps li:nth-child(4) { animation-name: step4; }
@keyframes step1 { 0%, 24% { opacity: 1; background: #fff; } 25%, 99% { opacity: 0.45; } }
@keyframes step2 { 0%, 24% { opacity: 0.45; } 25%, 49% { opacity: 1; background: #fff; } 50%, 100% { opacity: 0.45; } }
@keyframes step3 { 0%, 49% { opacity: 0.45; } 50%, 74% { opacity: 1; background: #fff; } 75%, 100% { opacity: 0.45; } }
@keyframes step4 { 0%, 74% { opacity: 0.45; } 75%, 99% { opacity: 1; background: #fff; } }

/* sections rise in as they scroll into view, where the browser supports scroll timelines */
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  @keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 640px) {
  .story-steps { grid-template-columns: repeat(2, 1fr); }
  .watermark::before { right: -40%; top: 62%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
.member.how { background: var(--block-lilac); color: var(--block-ink); }
.member.how p { margin: 0 0 10px; }
/* eatslips "how it works": one column, the story as the centrepiece */
.member.how .inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; }
.member.how .inner > div:first-child { max-width: 36em; }
.member.how .story-lg { max-width: 560px; }
.member.how .art { width: 100%; }
