/* ============================================================
   Katya Slepak — katheals.com
   ============================================================ */

:root {
  /* Palette — restrained, warm, high-contrast */
  --bone:      #f6f3ef;
  --ivory:     #ece6de;
  --sand:      #d9cfc2;
  --taupe:     #a5876f;   /* Malaya accent */
  --clay:      #8a6e58;
  --espresso:  #2b2521;
  --black:     #14110f;
  --ink:       #1c1815;
  --ink-soft:  #6f665e;
  --hairline:  rgba(28, 24, 21, 0.12);
  --hairline-light: rgba(255, 255, 255, 0.16);

  /* Type */
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Rhythm */
  --gut: clamp(24px, 5vw, 80px);
  --section-y: clamp(90px, 14vh, 190px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.75;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Film grain overlay ───────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Typography primitives ────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(4rem, 13vw, 11rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 0.08em 0 0;
}
.display em { font-style: italic; font-weight: 300; }

.display-sm {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3rem, 8.5vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0.1em 0 0;
}
.display-sm em { font-style: italic; }

.h-lg {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0.12em 0 0;
}
.h-lg em { font-style: italic; }

.label {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--taupe);
  margin: 0;
}
.label.light { color: rgba(255,255,255,0.62); }

.prose p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 1.35em;
}
.prose p:last-child { margin-bottom: 0; }
.prose a {
  color: var(--ink);
  border-bottom: 1px solid var(--taupe);
  padding-bottom: 1px;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.prose a:hover { color: var(--taupe); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  position: relative;
  display: inline-block;
  padding: 1.05em 2.6em;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.55s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-bd);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.btn:hover::after { transform: translateY(0); }

.btn-light { --btn-fg: #fff; --btn-bd: rgba(255,255,255,0.75); }
.btn-light:hover { color: var(--black); }
.btn-light::after { background: #fff; }

.btn-lg { padding: 1.25em 3.4em; font-size: 0.76rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.7em;
  margin-top: 2rem;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--hairline);
  transition: border-color 0.45s var(--ease), gap 0.45s var(--ease);
}
.link-arrow:hover { border-color: var(--ink); gap: 1.2em; }

/* ── Navigation ───────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.55s var(--ease), border-color 0.55s var(--ease),
              backdrop-filter 0.55s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 2.4vw, 30px) var(--gut);
}

.mark {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  letter-spacing: 0.02em;
  color: #fff;
  transition: color 0.55s var(--ease);
  white-space: nowrap;
}
.mark em { font-style: italic; }
.mark.light { color: #fff; }

.nav-links { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 42px); }
.nav-links a {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.nav-links a:hover { color: #fff; border-color: rgba(255,255,255,0.6); }

.nav-book {
  border: 1px solid rgba(255,255,255,0.5) !important;
  border-radius: 999px;
  padding: 0.7em 1.7em !important;
  transition: background 0.45s var(--ease), color 0.45s var(--ease),
              border-color 0.45s var(--ease) !important;
}
.nav-book:hover { background: #fff; color: var(--black) !important; border-color: #fff !important; }

/* Scrolled state */
.nav.solid {
  background: rgba(246, 243, 239, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--hairline);
}
.nav.solid .mark { color: var(--ink); }
.nav.solid .nav-links a { color: var(--ink-soft); }
.nav.solid .nav-links a:hover { color: var(--ink); border-color: var(--ink); }
.nav.solid .nav-book { border-color: var(--hairline) !important; color: var(--ink) !important; }
.nav.solid .nav-book:hover { background: var(--ink); color: #fff !important; border-color: var(--ink) !important; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.burger span {
  display: block;
  height: 1px;
  width: 100%;
  background: #fff;
  transition: transform 0.45s var(--ease), opacity 0.35s var(--ease), background 0.55s var(--ease);
}
.nav.solid .burger span { background: var(--ink); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gut) clamp(60px, 10vh, 120px);
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; z-index: 0; }

/*  Drop a file at images/katya-hero.jpg and it appears automatically.
    If the file is absent the gradient below simply shows through —
    no broken image. Nudge framing with the first background-position value. */
.hero-placeholder {
  width: 100%; height: 100%;
  background-color: #17130f;
  background-image:
    url('images/katya-hero.jpg'),
    radial-gradient(120% 90% at 72% 18%, #6f5a49 0%, transparent 55%),
    linear-gradient(155deg, #4a3d33 0%, #2a221c 55%, #17130f 100%);
  background-size: cover, auto, auto;
  background-position: 50% 22%, center, center;
  background-repeat: no-repeat;
  animation: slowZoom 24s var(--ease) forwards;
}
@keyframes slowZoom { from { transform: scale(1.08); } to { transform: scale(1); } }

.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  /* Two layers: a left-weighted wash to hold the headline, plus a
     vertical wash that anchors the bottom copy and the top nav. */
  background:
    linear-gradient(to right,
      rgba(10,8,7,0.74) 0%, rgba(10,8,7,0.52) 30%,
      rgba(10,8,7,0.18) 62%, rgba(10,8,7,0.30) 100%),
    linear-gradient(to top,
      rgba(10,8,7,0.66) 0%, rgba(10,8,7,0.10) 42%, rgba(10,8,7,0.52) 100%);
}

.hero-content { position: relative; z-index: 2; max-width: 1000px; color: #fff; }
.hero-content .display { color: #fff; }

.hero-sub {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  font-weight: 200;
  color: rgba(255,255,255,0.8);
  max-width: 30ch;
  margin: 1.6rem 0 0;
}
.hero-cta { margin-top: clamp(2rem, 4vh, 3.2rem); }

.scroll-cue {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px; height: 54px;
  background: rgba(255,255,255,0.22);
  overflow: hidden;
}
.scroll-cue span {
  display: block; width: 100%; height: 40%;
  background: rgba(255,255,255,0.9);
  animation: cue 2.6s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(250%); }
  100% { transform: translateY(250%); }
}

/* ── Statement ────────────────────────────────────────── */
.statement {
  padding: clamp(80px, 15vh, 180px) var(--gut);
  border-bottom: 1px solid var(--hairline);
}
.statement p {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.6vw, 3.1rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 20ch;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
}

/* ── Image placeholders ───────────────────────────────── */
.img-placeholder {
  position: relative;
  background-color: #3b3029;
  background-image:
    radial-gradient(100% 80% at 30% 20%, #8a7160 0%, transparent 60%),
    linear-gradient(150deg, #6b5748 0%, #3b3029 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/*  Real photos: drop the files in and they take over. Missing files
    fall back to the gradient above. Tune framing via background-position. */
.img-placeholder.portrait {
  aspect-ratio: 3 / 4;
  background-image:
    url('images/ingredients-flatlay.jpg'),
    radial-gradient(100% 80% at 30% 20%, #8a7160 0%, transparent 60%),
    linear-gradient(150deg, #6b5748 0%, #3b3029 100%);
  background-size: cover, auto, auto;
  background-position: 50% center, center, center;
}

.img-placeholder.wide {
  aspect-ratio: 4 / 3;
  height: 100%;
  background-image:
    url('images/malaya-still-life.jpg'),
    radial-gradient(100% 80% at 30% 20%, #8a7160 0%, transparent 60%),
    linear-gradient(150deg, #6b5748 0%, #3b3029 100%);
  background-size: cover, auto, auto;
  background-position: center, center, center;
}

/* ── Room ─────────────────────────────────────────────── */
.room {
  position: relative;
  overflow: hidden;
  background: var(--espresso);
}

.room-media {
  width: 100%;
  /* Matches the source photo's own shape (1800x1448), so "cover" needs
     zero crop — the pendant lights at top and the table at bottom both
     stay in frame. A mismatched ratio forces a choice between the two. */
  aspect-ratio: 1800 / 1448;
  max-height: 1300px;
  background-color: #1c140c;
  background-image:
    url('images/treatment-room.jpg'),
    radial-gradient(120% 90% at 60% 15%, #6f5a49 0%, transparent 55%),
    linear-gradient(155deg, #4a3d33 0%, #2a221c 55%, #17130f 100%);
  background-size: cover, auto, auto;
  background-position: center, center, center;
  background-repeat: no-repeat;
}

/* ── Story ────────────────────────────────────────────── */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  padding: var(--section-y) var(--gut);
}
.story-copy .h-lg { margin-bottom: 1.6rem; }

.sig {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.7rem;
  color: var(--taupe);
  margin: 2.2rem 0 0;
}

/* ── Services ─────────────────────────────────────────── */
.services {
  padding: var(--section-y) var(--gut);
  border-top: 1px solid var(--hairline);
}
.services-head { margin-bottom: clamp(50px, 7vh, 90px); }

.service-list { list-style: none; margin: 0; padding: 0; }

.service {
  display: grid;
  grid-template-columns: minmax(70px, 0.5fr) 1fr;
  gap: clamp(20px, 5vw, 70px);
  padding: clamp(34px, 5vh, 58px) 0;
  border-top: 1px solid var(--hairline);
  transition: background 0.6s var(--ease);
}
.service:last-child { border-bottom: 1px solid var(--hairline); }

.num {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  color: var(--sand);
  line-height: 1;
  transition: color 0.6s var(--ease);
}
.service:hover .num { color: var(--taupe); }

.service-body { max-width: 52ch; }
.service-body h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
.service-body p { color: var(--ink-soft); margin: 0; }

/* ── Book ─────────────────────────────────────────────── */
.book {
  position: relative;
  background: var(--black);
  color: #fff;
  padding: clamp(110px, 20vh, 230px) var(--gut);
  text-align: center;
  overflow: hidden;
}
.book::before {
  content: '';
  position: absolute;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: min(1000px, 120vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(165,135,111,0.22) 0%, transparent 62%);
  pointer-events: none;
}
.book-inner { position: relative; max-width: 760px; margin: 0 auto; }
.book .display-sm { color: #fff; }
.book-sub {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 200;
  color: rgba(255,255,255,0.66);
  max-width: 40ch;
  margin: 1.8rem auto 0;
}
.book-action { margin-top: clamp(2.4rem, 5vh, 3.6rem); }
.book-note {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.34);
  margin: 1.6rem 0 0;
  font-style: italic;
}

/* ── Shop ─────────────────────────────────────────────── */
.shop {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  background: var(--ivory);
}
.shop-media { min-height: clamp(340px, 52vh, 640px); }
.shop-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(60px, 10vh, 130px) var(--gut);
}
.shop-copy .h-lg { margin-bottom: 1.5rem; }

/* ── Journal ──────────────────────────────────────────── */
.journal { padding: var(--section-y) var(--gut); }
.journal-head { margin-bottom: clamp(44px, 6vh, 76px); }

.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
}
.j-card {
  padding: clamp(38px, 5vw, 62px);
  background: #fff;
  border: 1px solid var(--hairline);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.j-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 60px -28px rgba(28,24,21,0.28);
}
.j-card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
}
.j-card p { color: var(--ink-soft); margin: 0 0 2rem; max-width: 34ch; }
.j-soon {
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--taupe);
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  background: var(--black);
  color: rgba(255,255,255,0.6);
  padding: clamp(60px, 9vh, 110px) var(--gut) clamp(40px, 6vh, 60px);
  border-top: 1px solid var(--hairline-light);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(20px, 3vw, 40px); }
.footer-links a {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.footer-links a:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.copy { font-size: 0.68rem; letter-spacing: 0.14em; color: rgba(255,255,255,0.3); margin: 0; }

/* ── Scroll reveal ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; gap: 48px; }
  .story-media { max-width: 420px; }
  .shop { grid-template-columns: 1fr; }
  .shop-media { min-height: 320px; }
  .journal-grid { grid-template-columns: 1fr; }

  .burger { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.4rem;
    /* Solid, not backdrop-filter: fixed-position children of a
       backdrop-filtered ancestor get mis-composited in some engines. */
    background: var(--black);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s var(--ease), visibility 0.55s var(--ease);
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a { font-size: 0.86rem; color: rgba(255,255,255,0.85); }
  .nav.solid .nav-links a { color: rgba(255,255,255,0.85); }
  .nav.solid .nav-book { border-color: rgba(255,255,255,0.5) !important; color: #fff !important; }

  /* A backdrop-filtered ancestor becomes the containing block for
     position:fixed children — which would trap the overlay inside the
     70px bar. Drop the bar's own blur while the menu is open. */
  .nav.menu-open {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
  }

  .burger { position: relative; z-index: 2; }
  .nav.menu-open .burger span { background: #fff; }
  .nav.menu-open .mark { position: relative; z-index: 2; color: #fff; }
}

@media (max-width: 560px) {
  .service { grid-template-columns: 1fr; gap: 12px; }
  .num { font-size: 1.1rem; }
  .hero { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
