/* Ikigai Spa — one stylesheet. The look and its rules: docs/DESIGN.md. */

@font-face { font-family: "Belleza"; src: url(/fonts/belleza.woff) format("woff"); font-display: swap; }
@font-face { font-family: "Work Sans"; src: url(/fonts/work-sans.woff) format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Trirong"; src: url(/fonts/trirong.woff) format("woff"); font-display: swap; unicode-range: U+0E01-0E5B; }
@font-face { font-family: "Noto Sans Thai"; src: url(/fonts/noto-sans-thai.woff) format("woff"); font-weight: 100 900; font-display: swap; unicode-range: U+0E01-0E5B; }

:root {
  --paper: #f4efec;      /* 60% */
  --taupe: #c5b9ac;      /* 20% */
  --ink: #2d2a26;        /* 20% */
  --sand: #e9e2dc;       /* paper, one step down: quiet panels */
  --soft: #6b645d;       /* secondary text on paper */
  --line: rgba(45, 42, 38, .18);
  --leaf: #dbe0c3;       /* secondary: promotions only */
  --amber: #e3c7a0;      /* secondary: promotions only */
  --display: "Belleza", "Trirong", "Optima", "Candara", serif;
  --body: "Work Sans", "Noto Sans Thai", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(72px, 11vw, 168px);
  --ease: cubic-bezier(.22, .61, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure, address, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
::selection { background: var(--taupe); color: var(--ink); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 880px; }

/* Type */
.display, .h1, .h2, .h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-wrap: balance; }
.display { font-size: clamp(44px, 7.2vw, 108px); line-height: 1.02; }
.h1 { font-size: clamp(38px, 5.4vw, 76px); line-height: 1.06; }
.h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.12; }
.h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; }
.eyebrow { font: 500 12px/1.4 var(--body); letter-spacing: .2em; text-transform: uppercase; }
.lede { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.55; }
.prose { max-width: 58ch; }
.prose p + p { margin-top: 1.1em; }
.quiet { color: var(--soft); }
.on-ink .quiet { color: var(--taupe); }

/* Links and buttons */
.link { display: inline-block; font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; padding: 8px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .5s var(--ease); }
.link:hover { background-size: 0 1px; background-position: 100% 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 30px; border: 1px solid currentColor; border-radius: 999px; font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn.sm { min-height: 40px; padding: 0 22px; }
.on-ink .btn:hover, .on-photo .btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.on-ink .btn.solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.on-ink .btn.solid:hover { background: transparent; color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }

/* Header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 84px; padding: 0 var(--gutter); color: var(--ink); transition: background .5s var(--ease), color .5s var(--ease), transform .5s var(--ease), border-color .5s; border-bottom: 1px solid transparent; }
.site-header.solid { background: rgba(244, 239, 236, .94); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.site-header.hide { transform: translateY(-100%); }
.has-hero .site-header:not(.solid) { color: var(--paper); }
.menu-open .site-header { color: var(--ink); background: var(--paper); transform: none; }
.nav { display: flex; gap: clamp(20px, 2.6vw, 40px); }
.nav a { font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; padding: 10px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.nav a:hover, .nav a[aria-current] { background-size: 100% 1px; }
.logo svg { width: 150px; height: auto; }   /* brandbook 2.3: never under 150 px wide */
.header-end { display: flex; justify-content: flex-end; align-items: center; gap: 28px; }
.has-hero .site-header:not(.solid) .btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.menu-btn { display: none; align-items: center; gap: 12px; font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; height: 44px; }
.menu-btn i { position: relative; width: 22px; height: 9px; border-top: 1px solid; border-bottom: 1px solid; transition: transform .4s var(--ease); }
.menu-open .menu-btn i { height: 0; border-bottom: 0; transform: rotate(45deg); }
.menu-open .menu-btn i::after { content: ""; position: absolute; left: 0; top: -1px; width: 22px; border-top: 1px solid; transform: rotate(90deg); }
.menu { position: fixed; inset: 0; z-index: 30; background: var(--paper); padding: 132px var(--gutter) 40px; display: flex; flex-direction: column; justify-content: space-between; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s; }
.menu.open { opacity: 1; visibility: visible; }
.menu ul a { display: block; font: 400 clamp(38px, 11vw, 60px)/1.25 var(--display); }
.menu-foot { display: grid; gap: 10px; font-size: 15px; color: var(--soft); }
.menu-foot a:first-child { color: var(--ink); font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; padding-bottom: 10px; }
.menu-open { overflow: hidden; }

/* Bands */
.band { padding: var(--section) 0; }
.band.tight { padding: calc(var(--section) * .6) 0; }
.on-taupe { background: var(--taupe); }
.on-sand { background: var(--sand); }
.on-ink { background: var(--ink); color: var(--paper); --line: rgba(244, 239, 236, .22); }
.horizon { width: 100%; height: clamp(28px, 4vw, 60px); overflow: visible; }
.horizon path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .55; }
.stone-line { overflow: visible; }
.stone-line path { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.stone-line .thick { stroke-width: 2.2; opacity: .75; }

/* Photos */
.media { position: relative; overflow: hidden; background: var(--sand); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.r-45 { aspect-ratio: 4 / 5; } .r-34 { aspect-ratio: 3 / 4; } .r-32 { aspect-ratio: 3 / 2; } .r-11 { aspect-ratio: 1; } .r-169 { aspect-ratio: 16 / 9; } .r-219 { aspect-ratio: 21 / 9; }
.media.stone { aspect-ratio: 600 / 492; background: none; -webkit-mask: url(/img/stone.svg) center / contain no-repeat; mask: url(/img/stone.svg) center / contain no-repeat; }
figcaption { margin-top: 14px; font-size: 14px; color: var(--soft); }
.on-ink figcaption { color: var(--taupe); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; color: var(--paper); background: var(--ink); overflow: hidden; }
.hero .media { position: absolute; inset: 0; background: var(--ink); }
.hero .media img { animation: drift 24s var(--ease) both; }
.hero .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(45, 42, 38, .42) 0%, rgba(45, 42, 38, 0) 28%, rgba(45, 42, 38, 0) 46%, rgba(45, 42, 38, .66) 100%); }
.hero-text { position: relative; padding: 0 var(--gutter) clamp(44px, 7vw, 96px); max-width: 1360px; width: 100%; margin: 0 auto; }
.hero-text .eyebrow { margin-bottom: 22px; }
.hero-text .actions { margin-top: 36px; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }

/* Page head (pages without a photo hero) */
.page-head { padding: clamp(150px, 19vw, 250px) 0 clamp(40px, 6vw, 80px); }
.page-head .eyebrow { margin-bottom: 20px; color: var(--soft); }
.page-head .lede { margin-top: 28px; max-width: 46ch; }

/* Layouts */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 5vw, 80px) clamp(20px, 3vw, 48px); align-items: center; }
.split > .a { grid-column: 1 / span 5; } .split > .b { grid-column: 7 / span 6; }
.split.flip > .a { grid-column: 8 / span 5; order: 2; } .split.flip > .b { grid-column: 1 / span 6; }
.split.top { align-items: start; }
.stack > * + * { margin-top: 24px; }
.stack > .eyebrow + * { margin-top: 20px; }
.stack > .actions { margin-top: 36px; }
.intro { position: relative; }
.intro .stone-line { position: absolute; width: min(74vw, 880px); right: -8%; top: 50%; transform: translateY(-50%); color: var(--taupe); pointer-events: none; }
.intro .wrap { position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 56px); }

/* Rail of cards */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(250px, 26vw, 360px); gap: clamp(14px, 1.6vw, 24px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 8px; scroll-padding-left: var(--gutter); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.card { scroll-snap-align: start; display: block; }
.card .media img { transition: transform 1.4s var(--ease); }
.card:hover .media img { transform: scale(1.04); }
.card h3 { margin-top: 18px; }
.card p { margin-top: 4px; font-size: 14px; color: var(--soft); }

/* Mosaic */
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); align-items: end; }
.mosaic > :nth-child(1) { grid-column: 1 / span 5; } .mosaic > :nth-child(2) { grid-column: 6 / span 4; } .mosaic > :nth-child(3) { grid-column: 10 / span 3; }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px) clamp(14px, 1.6vw, 24px); }
.gallery > * { grid-column: span 6; }
.gallery > .wide { grid-column: span 12; } .gallery > .third { grid-column: span 4; } .gallery > .two-thirds { grid-column: span 8; }
.gallery > .inset { grid-column: 3 / span 8; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px clamp(20px, 3vw, 48px); border-top: 1px solid var(--line); padding-top: 32px; }
.facts h2, .facts h3 { font: 500 12px/1.4 var(--body); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; color: var(--soft); }
.on-ink .facts h2, .on-ink .facts h3, .on-taupe .facts h2, .on-taupe .facts h3 { color: inherit; opacity: .7; }
.facts a { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; overflow-wrap: anywhere; }
.facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Treatment menu */
.menu-nav { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.menu-nav a { font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; padding: 8px 0; color: var(--soft); transition: color .3s; }
.menu-nav a:hover { color: var(--ink); }
.menu-group { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px clamp(20px, 3vw, 48px); padding: clamp(48px, 6vw, 88px) 0; border-bottom: 1px solid var(--line); }
.menu-head { position: sticky; top: 112px; align-self: start; }
.treatment { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) auto; gap: 12px 24px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); }
.treatment:first-child { border-top: 0; padding-top: 0; }
.treatment h3 { font: 400 clamp(20px, 1.7vw, 24px)/1.25 var(--display); letter-spacing: .01em; }
.treatment .about { margin-top: 6px; font-size: 14px; color: var(--soft); max-width: 40ch; }
.lengths { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 12px 12px; }
.lengths li { display: grid; gap: 2px; }
.len { font-size: 12px; letter-spacing: .08em; color: var(--soft); text-transform: uppercase; }
.price { font-size: 16px; font-variant-numeric: tabular-nums; }
.treatment:target h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

/* Booking sheet */
.sheet { border: 0; padding: clamp(32px, 5vw, 56px); width: min(520px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border-radius: 0; }
.sheet::backdrop { background: rgba(45, 42, 38, .55); }
.sheet p { margin-top: 14px; }
.sheet-for strong { font-weight: 500; }
.sheet-actions { display: grid; gap: 12px; margin-top: 28px; }
.sheet-close { position: absolute; top: 12px; right: 16px; font-size: 28px; line-height: 1; width: 44px; height: 44px; }

/* Footer */
.site-footer { background: var(--sand); padding-top: clamp(40px, 6vw, 80px); }
.site-footer .horizon { color: var(--ink); }
.footer-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 48px clamp(20px, 3vw, 48px); padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(48px, 6vw, 88px); }
.footer-logo svg { width: 150px; height: auto; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px clamp(20px, 3vw, 48px); font-size: 15px; }
.footer-cols h2 { font: 500 12px/1.4 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--soft); margin-bottom: 14px; }
.footer-cols li + li, .footer-cols p + p, .footer-cols address + p { margin-top: 6px; }
.footer-cols a { overflow-wrap: anywhere; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.footer-cols a:hover { background-size: 100% 1px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--soft); }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in, .no-js .reveal { opacity: 1; transform: none; }
.media.reveal { transform: none; }
.media.reveal img { transform: scale(1.06); transition: transform 1.8s var(--ease); }
.media.reveal.in img { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .media.reveal img { opacity: 1; transform: none; transition: none; }
  .hero .media img { animation: none; }
}

/* Smaller screens */
@media (max-width: 960px) {
  .site-header { height: 76px; grid-template-columns: 1fr auto 1fr; }
  .site-header .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .menu-btn span { display: none; }
  .menu { padding-top: 108px; }
  .split > .a, .split > .b, .split.flip > .a, .split.flip > .b { grid-column: 1 / -1; order: 0; }
  .split.flip > .b { order: -1; }
  .intro .stone-line { width: 120vw; right: -40%; opacity: .7; }
  .menu-group, .footer-top { grid-template-columns: minmax(0, 1fr); }
  .menu-head { position: static; }
  .treatment { grid-template-columns: minmax(0, 1fr) auto; }
  .treatment .lengths { grid-column: 1 / -1; grid-row: 2; }
  .facts, .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mosaic > :nth-child(1) { grid-column: 1 / span 12; } .mosaic > :nth-child(2) { grid-column: 1 / span 7; } .mosaic > :nth-child(3) { grid-column: 8 / span 5; }
  .gallery > *, .gallery > .third, .gallery > .two-thirds, .gallery > .inset { grid-column: span 12; }
  .gallery > .third { grid-column: span 6; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-auto-columns: 74vw; }
  .btn { padding: 0 24px; }
  .header-end .btn.sm { padding: 0 16px; min-height: 36px; }
}

/* Home */
.hero.home .media img { object-position: 74% 50%; }
.intro { overflow: hidden; }
.hero.home .media::after { background: linear-gradient(90deg, rgba(45, 42, 38, .34) 0%, rgba(45, 42, 38, 0) 55%), linear-gradient(180deg, rgba(45, 42, 38, .42) 0%, rgba(45, 42, 38, 0) 28%, rgba(45, 42, 38, 0) 46%, rgba(45, 42, 38, .6) 100%); }
/* Brandbook 2.5: never compromise the logo's contrast on a photo, so every photo hero darkens behind the header. */
.hero .media::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; z-index: 1; background: linear-gradient(180deg, rgba(45, 42, 38, .55), rgba(45, 42, 38, 0)); }
/* Phones */
@media (max-width: 960px) {
  .intro .stone-line { top: auto; bottom: 1%; transform: none; width: 116vw; right: -22%; opacity: 1; }
}
@media (max-width: 520px) {
  .hero.home .media img { object-position: 86% 50%; }   /* keeps the whole name on the stone sign in view */
  .band { padding: 72px 0; }
  .page-head { padding-top: 132px; }
}
.menu-open #header { color: var(--ink); background: var(--paper); border-bottom-color: transparent; }
@media (max-width: 520px) { .facts.two { grid-template-columns: minmax(0, 1fr); } }
