/* ==========================================================================
   OoO — Out of Ordinary · shared styles
   Tokens mirror the Figma file (Foundations — Color & Type)
   ========================================================================== */

:root {
  --paper: #f8f7f6;
  --surface: #f8f7f6;
  --ink: #1b1313;
  --wine: #4a1212;
  --burgundy: #6b1f1f;
  --cocoa: #3b2420;
  --rose: #d8bcb6;
  --blue: #a9bcd4;
  --line: #ddd8d2;
  --muted: #6f6560;
  --navy: #2f3b5a;
  --footer: #430b0e;

  --f-sans: "Outfit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-serif: "Italiana", "Outfit", serif;
  --f-script: "Mrs Saint Delafield", cursive;
  --f-thai: "IBM Plex Sans Thai", "Outfit", sans-serif;

  --gutter: clamp(20px, 3.9vw, 56px);
  --max: 1440px;

  /* Neumorphic effects (Figma effect styles Neu/*) */
  --neu-raised: -12px -12px 30px #fff, 12px 12px 30px rgba(110, 87, 79, .15);
  --neu-raised-sm: -7px -7px 16px #fff, 7px 7px 16px rgba(110, 87, 79, .18);
  --neu-raised-wine: -5px -5px 14px rgba(255, 255, 255, .9), 7px 7px 16px rgba(74, 18, 18, .3);
  --neu-sunken: inset 3px 4px 9px rgba(110, 87, 79, .22), inset -3px -3px 6px rgba(255, 255, 255, .55);
  --neu-sunken-deep: inset 5px 5px 10px rgba(110, 87, 79, .26), inset -4px -4px 8px #fff;
  --card-shadow: 0 10px 28px rgba(27, 19, 19, .14);

  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.5, 0, .5, 1);
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; overflow: hidden; overflow: clip; }

/* ---------- Type (Figma text styles) ---------- */
.label { font: 400 12px/1.3 var(--f-sans); letter-spacing: .08em; text-transform: uppercase; }
.label--muted { color: var(--muted); }
.label--rose { color: var(--rose); }
.h1 { font: 300 clamp(44px, 5vw, 72px)/1.02 var(--f-sans); letter-spacing: -.015em; }
.h2 { font: 300 clamp(36px, 3.4vw, 48px)/1.1 var(--f-sans); letter-spacing: -.01em; }
.h2-xl { font: 300 clamp(36px, 3.9vw, 56px)/1.02 var(--f-sans); letter-spacing: -.015em; }
.h3 { font: 400 clamp(22px, 2vw, 28px)/1.25 var(--f-sans); }
.serif { font-family: var(--f-serif); font-weight: 400; }
.serif-title { font: 400 clamp(44px, 4.45vw, 64px)/1.05 var(--f-serif); color: var(--wine); }
.serif-xl { font: 400 clamp(56px, 6.7vw, 96px)/1 var(--f-serif); color: var(--wine); }
.serif-sm { font: 400 36px/1.15 var(--f-serif); }
.body-l { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.body-m { font-size: 16px; line-height: 1.6; }
.body-s { font-size: 14px; line-height: 1.55; }
.script { font: 400 clamp(32px, 2.8vw, 40px)/1.1 var(--f-script); }
.thai { font-family: var(--f-thai); font-weight: 300; line-height: 1.5; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.paper { color: var(--paper); }
.rose { color: var(--rose); }
.wine { color: var(--wine); }
.burgundy { color: var(--burgundy); }
.upper { text-transform: uppercase; }

/* ---------- Buttons ----------
   Default raised · hover sinks in · press sinks deeper (Figma State=Hover/Pressed) */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-shadow: var(--neu-raised-sm);
  --btn-shadow-hover: var(--neu-sunken);
  --btn-shadow-press: var(--neu-sunken-deep);
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px 16px 28px;
  border-radius: 100px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: var(--btn-shadow);
  font: 500 13px/1.3 var(--f-sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: box-shadow .22s var(--ease-out), background-color .22s var(--ease-out), transform .22s var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform .25s var(--ease-out); }
.btn:hover { box-shadow: var(--btn-shadow-hover); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { box-shadow: var(--btn-shadow-press); transform: scale(.985); }

.btn--primary {
  --btn-bg: var(--burgundy); --btn-fg: var(--paper);
  --btn-shadow: var(--neu-raised-wine);
  --btn-shadow-hover: inset 3px 4px 10px rgba(0, 0, 0, .3), inset -2px -2px 6px rgba(255, 255, 255, .1);
  --btn-shadow-press: inset 4px 6px 14px rgba(0, 0, 0, .45), inset -3px -3px 8px rgba(255, 255, 255, .18);
}
.btn--primary:hover { background: #5c1a1a; }
.btn--primary:active { background: #541717; }
.btn--light { --btn-bg: var(--paper); --btn-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.btn--glass {
  --btn-bg: rgba(255, 255, 255, .14); --btn-fg: #f7f7f5;
  --btn-shadow: none;
  --btn-shadow-hover: inset 3px 4px 10px rgba(0, 0, 0, .38), inset -2px -2px 6px rgba(255, 255, 255, .12);
  --btn-shadow-press: inset 4px 6px 14px rgba(0, 0, 0, .55), inset -2px -2px 6px rgba(255, 255, 255, .08);
  border: 1px solid #f7f7f5;
  padding: 15px 21px 15px 27px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn--glass:hover { background: rgba(255, 255, 255, .06); }
.btn--glass:active { background: rgba(255, 255, 255, .02); }

.icon-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface); box-shadow: var(--neu-raised-sm);
  transition: box-shadow .22s var(--ease-out), transform .22s var(--ease-out);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { box-shadow: var(--neu-sunken); }
.icon-btn:active { box-shadow: var(--neu-sunken-deep); transform: scale(.97); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(88px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
  transition: height .35s var(--ease-out), background-color .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
/* Sticky nav: once the page scrolls, it gets a frosted paper bar so it reads over any section */
.nav.is-scrolled {
  height: calc(72px + env(safe-area-inset-top, 0px));
  /* thin liquid glass: mostly blur, a breath of paper tint, light caught on the rims */
  background: linear-gradient(180deg, rgba(248, 247, 246, .52), rgba(248, 247, 246, .36));
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(255, 255, 255, .35), 0 8px 24px rgba(27, 19, 19, .06);
}
.nav.is-scrolled .nav__links { box-shadow: -5px -5px 12px #fff, 5px 5px 12px rgba(110, 87, 79, .14); }
.nav--light.is-scrolled .nav__logo .logo-dark { display: block; }
.nav--light.is-scrolled .nav__logo .logo-light { display: none; }
/* over a dark section the glass takes a smoky tint and the logo turns light */
.nav.is-scrolled.is-on-dark { background: linear-gradient(180deg, rgba(27, 12, 12, .34), rgba(27, 12, 12, .22)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .1), 0 8px 24px rgba(0, 0, 0, .12); }
.nav.is-scrolled.is-on-dark .nav__logo .logo-dark { display: none; }
.nav.is-scrolled.is-on-dark .nav__logo .logo-light { display: block; }
.nav.is-scrolled.is-on-dark .nav__links { box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
html { scroll-padding-top: 96px; }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo img { width: 116px; height: auto; }
.nav__links {
  display: flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--neu-raised-sm);
}
.nav__links a {
  padding: 10px 20px; border-radius: 100px;
  font: 400 12px/1.3 var(--f-sans); letter-spacing: .08em; text-transform: uppercase;
  transition: box-shadow .18s var(--ease-out), background-color .18s var(--ease-out);
}
.nav__links a:hover { background: rgba(110, 87, 79, .07); box-shadow: inset 2px 3px 8px rgba(110, 87, 79, .28), inset -2px -2px 6px rgba(255, 255, 255, .9); }
.nav__links a:active { background: rgba(110, 87, 79, .12); box-shadow: inset 3px 5px 12px rgba(110, 87, 79, .42), inset -2px -2px 6px rgba(255, 255, 255, .7); }
.nav__toggle { display: none; }
.nav--light .nav__logo .logo-dark { display: none; }
.nav__logo .logo-light { display: none; }
.nav--light .nav__logo .logo-light { display: block; }

.mobile-menu { display: none; }

@media (max-width: 1100px) {
  .nav__cta { display: none; }
}
@media (max-width: 840px) {
  .nav { height: calc(72px + env(safe-area-inset-top, 0px)); }
  .nav__links, .nav__cta { display: none; }
  .nav__logo img { width: 96px; }
  .nav__toggle {
    display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--surface); box-shadow: var(--neu-raised-sm);
  }
  .nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
    display: block; width: 18px; height: 1.4px; background: var(--ink); position: relative; transition: transform .3s var(--ease-out), opacity .2s;
  }
  .nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
  .nav__toggle span::before { top: -6px; }
  .nav__toggle span::after { top: 6px; }
  body.menu-open .nav__toggle span { background: transparent; }
  body.menu-open .nav__toggle span::before { transform: translateY(6px) rotate(45deg); }
  body.menu-open .nav__toggle span::after { transform: translateY(-6px) rotate(-45deg); }

  .mobile-menu {
    display: flex; flex-direction: column; justify-content: center; gap: 8px;
    position: fixed; inset: 0; z-index: 40; padding: 96px var(--gutter) 48px;
    background: var(--paper);
    opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility .35s;
  }
  .mobile-menu a.mobile-menu__link { font: 400 44px/1.25 var(--f-serif); color: var(--wine); }
  .mobile-menu .btn { margin-top: 28px; align-self: flex-start; }
  body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav { position: fixed; }
  body.menu-open .nav--light .nav__logo .logo-dark { display: block; }
  body.menu-open .nav--light .nav__logo .logo-light { display: none; }
}

/* ---------- Footer ---------- */
.footer { background: var(--footer); color: var(--paper); }
.footer__top { display: flex; gap: 80px; padding-top: 96px; padding-bottom: 72px; }
.footer__brand { flex: 1; display: flex; flex-direction: column; gap: 28px; }
.footer__brand img { width: 116px; }
.footer__col { width: 200px; display: flex; flex-direction: column; gap: 14px; }
.footer__col a, .footer__col p { font-size: 16px; line-height: 1.6; }
.footer__col a { transition: color .2s; }
.footer__col a:hover { color: var(--rose); }
.footer__bar { border-top: 1px solid #8e5558; }
.footer__bar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 20px; }
.footer__bar p { font-size: 14px; line-height: 1.55; color: var(--rose); }
.footer__bar a:hover { color: var(--rose); }
@media (max-width: 1200px) {
  .footer__top { flex-wrap: wrap; gap: 40px; padding-top: 72px; padding-bottom: 56px; }
  .footer__brand { flex-basis: 100%; }
  .footer__col { width: auto; min-width: 140px; flex: 1; }
}
@media (max-width: 560px) {
  .footer__brand .serif-sm { font-size: 30px; }
  .footer__col:nth-child(3) { order: -1; flex-basis: 100%; }
  .footer__bar .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- Marquee ---------- */
.marquee { position: relative; overflow: hidden; height: 56px; width: 100%; }
.marquee__track { display: flex; width: max-content; height: 100%; animation: marquee 32s linear infinite; }
.marquee__group { display: flex; align-items: center; gap: 120px; padding-right: 120px; flex: none; }
.marquee__group img { flex: none; transition: transform .3s var(--ease-out); }
.marquee__group img:hover { transform: scale(1.06); }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 1; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--paper), rgba(248, 247, 246, 0)); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--paper), rgba(248, 247, 246, 0)); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (max-width: 680px) {
  .marquee { height: 40px; }
  .marquee__group { gap: 64px; padding-right: 64px; }
  .marquee__group img { zoom: .72; }
  .marquee::before, .marquee::after { width: 56px; }
}

/* ---------- FAQ accordion (shared) ---------- */
.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 0; text-align: left;
  font: 400 clamp(18px, 1.6vw, 22px)/1.35 var(--f-sans);
}
.faq__icon { position: relative; width: 16px; height: 16px; flex: none; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.4px; background: currentColor;
  transform: translate(-50%, -50%); transition: transform .35s var(--ease-out);
}
.faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__item.is-open .faq__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.faq__a > div { overflow: hidden; }
.faq__a p { padding-bottom: 28px; max-width: 760px; color: var(--muted); }
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }

/* ---------- Scroll reveal ----------
   Each section plays once when it enters the viewport.
   fade-up +36px · 0.85s ease-out (web motion spec from the Figma timeline) */
.js [data-reveal] { opacity: 0; transition: opacity .85s var(--ease-out), transform .85s var(--ease-out); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js [data-reveal="up"] { transform: translateY(36px); }
.js [data-reveal="down"] { transform: translateY(-36px); }
.js [data-reveal="left"] { transform: translateX(-80px); }
.js [data-reveal="right"] { transform: translateX(120px); }
.js [data-reveal="zoom"] { transform: scale(1.08); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="drop"] { transform: translateY(-60px) rotate(var(--rot-from, 0deg)); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="drop"].is-in { transform: rotate(var(--rot, 0deg)); }

/* Headlines: each word rises out of its own masked slot (editorial pull-up) */
.stagger .wm { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .06em .18em; margin: -.08em -.06em -.18em; }
.stagger .w { display: inline-block; }
.js .stagger .w { transform: translateY(112%); transition: transform 1.15s var(--ease-expo); transition-delay: calc(var(--i) * 70ms + var(--d, 0s)); }
.js .stagger.is-in .w { transform: none; }

/* Scroll-lit text: words start dim and light up with scroll (driven by main.js) */
.scroll-words .w { transition: opacity .25s linear; }
.js .scroll-words .w { opacity: .16; }

/* Stacking step cards — desktop only; mobile keeps the page's own layout */
@media (min-width: 981px) {
  .section .container.stack { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
  .stack .stack__head { position: sticky; top: 140px; margin-bottom: 0; }
  .stack .stack__list { display: flex; flex-direction: column; gap: 0; }
  .stack .stack__list > li {
    position: sticky; top: calc(130px + var(--si, 0) * 22px);
    flex: none; min-height: 240px; margin-bottom: 22vh; padding: 40px 44px;
    border: 0; border-radius: 28px; background: var(--surface); box-shadow: var(--neu-raised);
    transform-origin: 50% 0;
  }
  .stack .stack__list > li:last-child { margin-bottom: 0; }
  .stack .stack__list > li .h3 { font-size: clamp(28px, 2.5vw, 36px); }
}

/* Paper grain over the whole page — barely there, kills the flat digital look */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .45;
  background-size: 200px 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js .stagger .w, .js .scroll-words .w { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee__track { animation: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px; border-radius: 100px;
  background: var(--ink); color: var(--paper); box-shadow: 0 14px 40px rgba(27, 19, 19, .25);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Nav: Services → Packages dropdown ---------- */
.nav__item { position: relative; display: flex; }
.nav__menu {
  position: absolute; left: 50%; top: calc(100% + 14px); z-index: 60;
  min-width: 240px; padding: 10px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); box-shadow: 0 2px 6px rgba(27, 19, 19, .06), 0 18px 40px rgba(27, 19, 19, .16);
  opacity: 0; visibility: hidden; translate: -50% -6px;
  transition: opacity .25s var(--ease-out), translate .25s var(--ease-out), visibility .25s;
}
.nav__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; } /* hover bridge */
.nav__caret { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-right: 1.2px solid currentColor; border-bottom: 1.2px solid currentColor; rotate: 45deg; translate: 0 -3px; transition: rotate .25s var(--ease-out), translate .25s var(--ease-out); }
.nav__item:hover .nav__caret, .nav__item:focus-within .nav__caret { rotate: 225deg; translate: 0 1px; }
.nav__links .nav__menu a { padding: 10px 14px; border-radius: 14px; font: 300 15px/1.4 var(--f-sans); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.nav__item:hover .nav__menu, .nav__item:focus-within .nav__menu { opacity: 1; visibility: visible; translate: -50% 0; }
.mobile-menu__sub { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 10px 4px; }
.mobile-menu__sub a { font-size: 17px; color: var(--muted); }
body.menu-open .nav.is-on-dark .nav__logo .logo-dark { display: block; }
body.menu-open .nav.is-on-dark .nav__logo .logo-light { display: none; }
body.menu-open .nav.is-scrolled { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav.is-scrolled.is-on-dark .nav__cta:not(:hover) { box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
