/* YenCup shared styles. Tokens come from DESIGN.md. */
:root {
  --dusk: #231C38;          /* deep twilight, dark bands and text on light */
  --dusk-2: #342A52;
  --lavender: #C9BCEB;
  --lavender-soft: #ECE6F8;
  --peach: #F6C29B;
  --sea: #3D5A7A;
  --paper: #F7F3FA;
  --card: #FFFFFF;
  --ink: #221B33;
  --muted: #5D5573;
  --line-soft: #E3DCEF;
  --line-strong: #8C84A3;
  --primary: #00843A;       /* LINE order buttons */
  --primary-hover: #006B2F;
  --line-brand: #06C755;
  --star: #B07D00;
  --on-dark: #F4EFFB;
  --on-dark-muted: #C8BFDD;
  --logo-green: #62A644;      /* the logo's own green */
  --logo-green-ink: #4C8A31;  /* slightly deeper for the header on light paper */

  --r-sm: 4px; --r-md: 8px; --r-btn: 10px; --r-card: 14px; --r-full: 999px;
  --s-xs: 4px; --s-base: 8px; --s-sm: 12px; --s-md: 24px; --s-lg: 40px; --s-xl: 72px;

  --display: "Instrument Serif", "Noto Serif Thai", Georgia, serif;
  --body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141018;
    --card: #241C26;
    --ink: #F4EEF2;
    --muted: #BFB2BC;
    --line-soft: #362B37;
    --line-strong: #7A6B78;
    --lavender-soft: #1D171F;
    --star: #F2B705;
    --logo-green-ink: #7CC25B;
  }
}
:root[data-theme="dark"] {
  --paper: #141018;
  --card: #241C26;
  --ink: #F4EEF2;
  --muted: #BFB2BC;
  --line-soft: #362B37;
  --line-strong: #7A6B78;
  --lavender-soft: #1D171F;
  --star: #F2B705;
  --logo-green-ink: #7CC25B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.65;
  background: var(--paper); color: var(--ink); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.nw { white-space: nowrap; }
section, main { scroll-margin-top: 76px; }

/* Language: show only the active language's text */
html[lang="th"] .en, html[lang="en"] .th { display: none !important; }

/* Type */
.display {
  font-family: var(--display); font-weight: 400; font-stretch: 70%;
  line-height: 1.1; letter-spacing: -0.01em;
}
html[lang="en"] .display { line-height: 0.95; text-transform: uppercase; }
.display i, .display em { font-style: italic; text-transform: none; }
h2.display { font-size: clamp(34px, 6vw, 64px); }
h3 { font-size: 18px; line-height: 1.45; font-weight: 600; }
.mono {
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  letter-spacing: 0.08em; text-transform: uppercase;
}
/* Letter-spacing pulls Thai vowels and tone marks off their consonants */
html[lang="th"] .mono { letter-spacing: 0; font-size: 13px; }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--r-btn);
  font: 600 15px/22px var(--body); text-decoration: none; border: 0; cursor: pointer;
  transition: background-color 150ms ease-in-out;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.line-mark {
  width: 22px; height: 22px; flex: none; border-radius: 6px;
  background: #fff; color: var(--line-brand); display: grid; place-items: center;
}
.line-mark svg { width: 18px; height: 18px; }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  transition: background-color 200ms ease, color 200ms ease;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); height: 68px; }
.site-header.on-scene { color: #fff; }
/* Dark fade behind the header so white text stays readable over the sky */
.site-header.on-scene::before {
  content: ""; position: absolute; inset: 0 0 -48px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(35, 28, 56, 0.6), rgba(35, 28, 56, 0));
}
.site-header.solid { background: color-mix(in srgb, var(--paper) 94%, transparent); color: var(--ink); border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(10px); }
/* The real YenCup logo, used as a mask so it can take any color */
.brand { display: block; text-decoration: none; color: inherit; }
.logo-mark {
  display: block; height: 36px; aspect-ratio: 1995 / 900; background: currentColor;
  -webkit-mask: url(img/logo-word.png) center / contain no-repeat;
  mask: url(img/logo-word.png) center / contain no-repeat;
}
.logo-full {
  display: block; width: 200px; aspect-ratio: 1995 / 1110; background: var(--logo-green);
  -webkit-mask: url(img/logo.png) center / contain no-repeat;
  mask: url(img/logo.png) center / contain no-repeat;
}
.site-header.solid .logo-mark { background: var(--logo-green-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-nav { display: none; gap: var(--s-md); }
.site-nav a { text-decoration: none; opacity: 0.85; }
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.head-actions { display: flex; align-items: center; gap: var(--s-base); }
.lang {
  text-decoration: none; display: inline-block;
  background: transparent; color: inherit; border: 0; box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: var(--r-md); padding: 6px 11px; font: 500 12px/18px var(--mono); cursor: pointer; opacity: 0.9;
}
.talk {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 7px 14px; border-radius: var(--r-full); font: 600 13px/18px var(--body);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.menu-btn { background: transparent; border: 0; color: inherit; font: 500 12px/18px var(--mono); letter-spacing: 0.08em; cursor: pointer; padding: 6px 4px; }
.mobile-nav {
  display: none; position: fixed; inset: 68px 0 auto 0; z-index: 39;
  background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line-soft);
  padding: var(--s-sm) 16px var(--s-md);
}
.mobile-nav.open { display: grid; gap: 2px; }
.mobile-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.mobile-nav a { text-decoration: none; font-family: var(--display); font-stretch: 70%; font-size: 30px; line-height: 1.4; padding: 4px 0; }

/* Immersive hero (home) */
.scene { position: relative; height: 100svh; min-height: 620px; overflow: hidden; background: linear-gradient(#5E5A8C, #E9967A 58%, #3D5A7A 60%, #22304B); color: #fff; }
.scene canvas, .banner canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-copy {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 0 clamp(28px, 6vh, 64px); pointer-events: none;
  background: linear-gradient(rgba(25, 22, 45, 0), rgba(25, 22, 45, 0.55) 45%, rgba(25, 22, 45, 0.7));
}
.scene-copy .wrap { display: grid; gap: var(--s-sm); }
.scene-tag { max-width: 360px; text-shadow: 0 1px 10px rgba(35, 28, 56, 0.55); }
html[lang="th"] .scene-title .lines { padding-left: 0; }
.scene-title { font-size: clamp(42px, 7vw, 104px); text-shadow: 0 2px 30px rgba(35, 28, 56, 0.35); }
.scene-title .lead-word { display: block; font-size: 0.8em; margin-bottom: 0.04em; }
.scene-title .lines { display: block; padding-left: clamp(0px, 14vw, 220px); }
.scene-actions { display: flex; gap: var(--s-sm); flex-wrap: wrap; margin-top: var(--s-sm); pointer-events: auto; }
.scene-actions .btn-outline { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75); }
.scene-actions .btn-outline:hover { box-shadow: inset 0 0 0 1.5px #fff; }

/* Static dusk banner (inner pages) */
.banner {
  position: relative; overflow: hidden; color: #fff; padding: 150px 0 64px; min-height: 420px;
  background: linear-gradient(180deg, #5E5A8C 0%, #A98FBF 40%, #E9967A 70%, #3D5A7A 78%, #22304B 100%);
}
/* Dark fade so the white banner text passes contrast over the sunset */
.banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(25, 22, 45, 0.35), rgba(25, 22, 45, 0.55) 60%, rgba(25, 22, 45, 0.7));
}
.banner .wrap { position: relative; z-index: 1; }
.banner h1 { font-size: clamp(48px, 10vw, 120px); text-shadow: 0 2px 26px rgba(35, 28, 56, 0.3); }
.banner p { max-width: 560px; margin-top: var(--s-sm); font-size: 18px; color: #fff; text-shadow: 0 1px 12px rgba(35, 28, 56, 0.4); }

/* Sections */
.section { padding: var(--s-xl) 0; }
.section.tint { background: var(--lavender-soft); }
.section-head { display: grid; gap: var(--s-sm); margin-bottom: var(--s-lg); }
.section-head .mono { color: var(--muted); }
.section-head p { max-width: 620px; }

.box { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-card); }

/* Stat strip */
.stats { background: var(--dusk); color: var(--on-dark); padding: var(--s-lg) 0; }
.stats .wrap { display: grid; gap: var(--s-md); }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-stretch: 70%; font-size: clamp(44px, 8vw, 76px); line-height: 1; }
.stat span { color: var(--on-dark-muted); }

/* Products */
.products { display: grid; gap: var(--s-sm); grid-template-columns: repeat(2, 1fr); }
.product { display: flex; flex-direction: column; padding: var(--s-sm); }
.product img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border-radius: var(--r-sm); }
.product .num { margin-top: var(--s-sm); color: var(--muted); }
.product h3 { margin-top: 2px; }
.product .desc { font-size: 14px; color: var(--muted); margin-bottom: var(--s-sm); }
.product .btn { margin-top: auto; padding: 10px 12px; font-size: 14px; }
.products.large { gap: var(--s-md); }
.products.large .product h3 { font-size: 22px; }

.more-row { margin-top: var(--s-md); padding: var(--s-md); display: flex; flex-wrap: wrap; gap: var(--s-sm) var(--s-md); align-items: center; justify-content: space-between; }

/* Steps: one box, steps divided by rules rather than separate cards */
.steps { display: grid; counter-reset: step; list-style: none; overflow: hidden; }
.steps li { padding: var(--s-md); display: grid; gap: var(--s-xs); align-content: start; }
.steps li + li { border-top: 1px solid var(--line-soft); }
.steps li::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--display); font-size: 44px; line-height: 1; color: var(--sea);
}
:root[data-theme="dark"] .steps li::before { color: var(--lavender); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .steps li::before { color: var(--lavender); } }

/* Reviews */
.reviews { display: grid; gap: var(--s-sm); }
.review { padding: var(--s-md); }
.review .stars { color: var(--star); letter-spacing: 2px; font-size: 15px; margin-bottom: var(--s-xs); }
.review.big p { font-family: var(--display); font-stretch: 75%; font-size: clamp(24px, 3.6vw, 34px); line-height: 1.3; }
.review cite { display: block; margin-top: var(--s-sm); font-style: normal; font-weight: 600; font-size: 14px; color: var(--muted); }
.reviews .small { display: grid; gap: var(--s-sm); }

/* Split blocks */
.split { display: grid; gap: var(--s-md); align-items: center; }
.split img { width: 100%; border-radius: var(--r-card); aspect-ratio: 4 / 3; object-fit: cover; }
.split .copy { display: grid; gap: var(--s-sm); }

/* Chips list */
.chips { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-base); }
.chips li { padding: var(--s-sm) var(--s-md); background: var(--lavender-soft); border-radius: var(--r-md); font-weight: 600; }

/* Contact */
.contact { display: grid; gap: var(--s-sm); }
.contact > .box { padding: var(--s-md); }
.contact dl { display: grid; gap: var(--s-sm); margin-bottom: var(--s-md); }
.contact dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact dd a { text-decoration: none; }
.qr { display: flex; gap: var(--s-md); align-items: center; }
.qr img { width: 140px; height: 140px; object-fit: contain; border-radius: var(--r-sm); background: #fff; padding: 6px; flex: none; }
.map { width: 100%; height: 340px; border: 0; border-radius: var(--r-card); display: block; }

/* Closing CTA band */
.cta-band { background: var(--dusk); color: var(--on-dark); padding: var(--s-xl) 0; }
.cta-band .wrap { display: grid; gap: var(--s-md); }
.cta-band h2 { color: var(--on-dark); }
.cta-band p { color: var(--on-dark-muted); max-width: 560px; }

/* Footer */
.site-footer { background: #17122A; color: var(--on-dark); padding: var(--s-lg) 0 104px; }
.site-footer .wrap { display: grid; gap: var(--s-md); }
.site-footer .brand { font-size: 40px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: var(--s-md) var(--s-lg); }
.footer-cols a { text-decoration: none; opacity: 0.85; }
.footer-cols a:hover { opacity: 1; text-decoration: underline; }
.footer-cols div { display: grid; gap: 4px; }
.site-footer small { color: var(--on-dark-muted); }

.footer-hours { color: var(--on-dark-muted); font-size: 14px; margin-top: var(--s-base); }
.footer-legal { grid-column: 1 / -1; padding-top: var(--s-md); border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-sm) var(--s-md); font-size: 14px; }
.footer-legal a, .footer-legal button { color: var(--on-dark-muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.footer-legal a:hover, .footer-legal button:hover { color: var(--on-dark); text-decoration: underline; }

/* Short banner for legal pages */
.banner.banner-short { min-height: 300px; padding-bottom: 40px; }

/* Legal pages */
.legal { max-width: 820px; padding: var(--s-lg) var(--s-md); display: grid; gap: var(--s-sm); }
.legal h2 { font-size: 20px; line-height: 1.4; margin-top: var(--s-md); }
.legal ul { padding-left: 1.2em; display: grid; gap: var(--s-base); }

/* FAQ */
.faq { display: grid; gap: var(--s-sm); max-width: 860px; }
.faq-item { padding: 0; }
.faq-item summary { cursor: pointer; list-style: none; padding: var(--s-md); display: flex; justify-content: space-between; gap: var(--s-sm); align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--muted); flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary h2 { font-size: 17px; line-height: 1.5; font-weight: 600; }
.faq-item p { padding: 0 var(--s-md) var(--s-md); color: var(--muted); }

/* Map waiting for consent */
.map-placeholder { display: grid; place-items: center; align-content: center; gap: var(--s-sm); text-align: center; padding: var(--s-md); color: var(--muted); }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-soft); border-radius: var(--r-card);
  padding: var(--s-md); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.45); display: grid; gap: var(--s-sm);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: 14px; }
.cookie-banner .actions { display: flex; flex-wrap: wrap; gap: var(--s-base); }

/* Language suggestion */
.lang-hint {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 45;
  background: var(--dusk); color: var(--on-dark); border-radius: var(--r-full);
  padding: 8px 10px 8px 18px; display: flex; align-items: center; gap: 10px; font-size: 14px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); white-space: nowrap;
}
.lang-hint a { color: #fff; font-weight: 600; }
.lang-hint button { background: none; border: 0; color: var(--on-dark-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 6px; }

/* Floating order button (phones) */
.float-order {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.5);
}
/* On the home page it waits until the hero (with its own LINE button) is passed */
.float-order.hidden { display: none; }

@media (max-width: 759px) {
  .talk { display: none; }
  /* keep the floating LINE button visible under the cookie banner */
  .cookie-banner { bottom: 80px; }
}
@media (min-width: 760px) {
  .site-nav { display: flex; }
  .logo-mark { height: 44px; }
  .site-footer .logo-full { width: 260px; }
  .menu-btn { display: none; }
  .stats .wrap { grid-template-columns: repeat(3, 1fr); }
  .products { grid-template-columns: repeat(4, 1fr); gap: var(--s-md); }
  .products.large { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps.four { grid-template-columns: repeat(4, 1fr); }
  .steps li + li { border-top: 0; border-left: 1px solid var(--line-soft); }
  .mobile-nav { display: none !important; }
  .reviews { grid-template-columns: 1.3fr 1fr; gap: var(--s-md); }
  .reviews .small { gap: var(--s-md); }
  .split { grid-template-columns: 1fr 1fr; gap: var(--s-xl); }
  .split.flip .copy { order: 2; }
  .contact { grid-template-columns: 1.2fr 1fr; gap: var(--s-md); }
  .cta-band .wrap { grid-template-columns: 1.4fr 1fr; align-items: end; }
  .float-order { display: none; }
  .site-footer { padding-bottom: var(--s-lg); }
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: end; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
