/*
 * Experience layer: motion and interaction. The look (type, colour, layout) is in luxury.css.
 * Motion is progressive: nothing here hides content unless JS has added `.motion` to <html>,
 * and everything is disabled under prefers-reduced-motion.
 */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Header: glass, hides while reading down, returns on the way up ---------- */
.site-header { transition: transform .5s var(--ease-out), background-color .3s ease, border-color .3s ease; }
.site-header.is-tucked { transform: translateY(-101%); }
.site-header:focus-within { transform: none; }

/* ---------- Links: arrows lean forward ---------- */
.ohia-arrow { display: inline-block; margin-left: .5em; transition: transform .45s var(--ease-out); }
a:hover .ohia-arrow, a:focus-visible .ohia-arrow, button:hover .ohia-arrow { transform: translateX(.3em); }

/* ---------- Ecosystem: focus one relationship at a time ---------- */
.ecosystem__item { transition: transform .5s var(--ease-out), opacity .4s ease, border-color .3s ease; }
@media (hover: hover) {
  .ecosystem:has(.ecosystem__item:hover) .ecosystem__item:not(:hover) { opacity: .42; }
}
.ecosystem__item:hover .ecosystem__number { color: var(--color-ink); }

/* ---------- Services: crossfading preview ---------- */
.service-preview { transition: background-image .7s ease; }
.service-preview.is-changing .service-preview__title, .service-preview.is-changing .service-preview__copy { animation: ohia-preview-in .6s var(--ease-out) both; }
.service-preview.is-changing .service-preview__number { animation: ohia-number-in .9s var(--ease-out) both; }
@keyframes ohia-preview-in { from { opacity: 0; transform: translateY(.9rem); } }
@keyframes ohia-number-in { from { opacity: 0; transform: translateY(-.15em); } }
.service-grid__item .eyebrow { transition: transform .45s var(--ease-out); }
.service-grid__item.is-active .eyebrow { transform: translateX(.35rem); }

/* ---------- Scroll-lit statements (words brighten as you read) ---------- */
.lit-word { transition: opacity .35s linear, color .35s linear; }
.motion .is-lit-ready .lit-word { opacity: .2; }
.motion .is-lit-ready .lit-word.is-lit { opacity: 1; }

/* ---------- Reveal system (only when JS opts in) ---------- */
.motion [data-reveal] { opacity: 0; transform: translate3d(0, 1.6rem, 0); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--reveal-delay, 0) * 1ms); }
main { overflow-x: clip; }
@media (min-width: 769px) {
  .motion [data-reveal="left"] { transform: translate3d(-4vw, 0, 0); }
  .motion [data-reveal="right"] { transform: translate3d(4vw, 0, 0); }
}
.motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Headlines rise word by word from behind a mask. Padding keeps italic overhangs and descenders unclipped. */
.split-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .14em; margin: 0 -.08em -.14em; }
.split-word { display: inline-block; will-change: transform; }
.motion .is-splitting .split-word { transform: translate3d(0, 108%, 0) rotate(2deg); transition: transform 1.15s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms + var(--split-delay, 0ms)); }
.motion .is-splitting.is-in .split-word { transform: none; }

/* Images unveil: a curtain the colour of the section lifts away, then the photo settles and drifts. */
.motion [data-unveil] { position: relative; overflow: hidden; }
.motion [data-unveil]::before { content: ""; position: absolute; inset: 0; z-index: 3; background: var(--unveil-color, var(--color-paper)); transform-origin: top; transition: transform 1.4s var(--ease-in-out); pointer-events: none; }
.motion [data-unveil].is-in::before { transform: scaleY(0); }
.motion [data-unveil] img { transform: scale(1.14) translate3d(0, var(--drift, 0px), 0); transition: transform 2.4s var(--ease-out); }
.motion [data-unveil].is-in img { transform: scale(1.08) translate3d(0, var(--drift, 0px), 0); }
.motion [data-unveil].is-settled img { transition: transform .25s linear; }
.motion .home-hero > .hero-visual { animation: none; }
.motion .home-hero h1 { animation: none; }

/* ---------- Page arrival: each page settles in gently ---------- */
.motion main { animation: ohia-page-in .7s var(--ease-out) both; }
@keyframes ohia-page-in { from { opacity: 0; transform: translateY(1rem); } }

/* ---------- Tools page: Wine Studio feature ---------- */
.tools-feature { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 5rem) 0; align-items: center; }
.tools-feature__copy { grid-column: 1 / 6; }
.tools-feature__copy h2 { font-size: clamp(3.6rem, 6.4vw, 7.4rem); line-height: .92; max-width: 10ch; margin-bottom: 2rem; }
.tools-feature__copy h2 em { color: var(--color-forest); }
.tools-feature__copy > p:not(.eyebrow) { max-width: 31rem; color: #4d534b; font-size: .98rem; line-height: 1.8; }
.tools-feature__points { list-style: none; margin: 2.2rem 0 2.6rem; padding: 0; border-top: 1px solid var(--journal-line); max-width: 31rem; }
.tools-feature__points li { display: grid; grid-template-columns: 2.4rem 1fr; padding: .95rem 0; border-bottom: 1px solid var(--journal-line); font-size: .9rem; }
.tools-feature__points li span { color: var(--color-lehua); font-size: .7rem; font-weight: 600; letter-spacing: .12em; padding-top: .15rem; }
.tools-feature__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; }
.tools-feature__actions .button { text-decoration: none; display: inline-flex; color: var(--color-paper); }
.tools-feature__visual { grid-column: 7 / 13; position: relative; margin: 0; min-height: clamp(30rem, 46vw, 44rem); background: #20241f; overflow: hidden; isolation: isolate; }
.tools-feature__visual::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url('../brand-generated/ohia-service-mise-en-place-v2.webp') center / cover; opacity: .55; }
.tools-feature__visual::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(32,36,31,.2), rgba(32,36,31,.85)); }
.wine-sheet { position: absolute; left: 50%; top: 52%; width: min(74%, 25rem); padding: 2.4rem 2.2rem 2.6rem; background: #fbf9f4; color: var(--color-ink); box-shadow: 0 2.5rem 5rem rgba(8, 10, 8, .45), 0 .4rem 1rem rgba(8, 10, 8, .25); transform: translate(-50%, -50%) rotate(-2.2deg); transition: transform 1s var(--ease-out); }
.tools-feature__visual:hover .wine-sheet { transform: translate(-50%, -52%) rotate(-.6deg); }
.wine-sheet__venue { text-align: center; font: 500 1.6rem/1 var(--font-display); letter-spacing: .02em; margin: 0; }
.wine-sheet__title { text-align: center; font-size: .5rem; letter-spacing: .32em; color: var(--color-stone); margin: .7rem 0 1.6rem; }
.wine-sheet h3 { font: italic 500 1.05rem/1 var(--font-display); color: var(--color-forest); letter-spacing: 0; margin: 1.3rem 0 .5rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(23,24,21,.18); }
.wine-sheet dl { margin: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .38rem 1rem; font-size: .62rem; line-height: 1.35; }
.wine-sheet dt, .wine-sheet dd { margin: 0; padding: 0; line-height: 1.35; }
.wine-sheet dt small { display: block; color: var(--color-stone); font-size: .54rem; }
.wine-sheet dd { margin: 0; font-variant-numeric: tabular-nums; }
.tools-feature__caption { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.3rem; display: flex; justify-content: space-between; color: rgba(250,248,243,.8); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; }
.tools-more { border-top: 1px solid var(--journal-line); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); padding-top: 2rem; }
.tools-more p { grid-column: 1 / 7; margin: 0; color: var(--color-stone); font-size: .9rem; }
.tools-more a { grid-column: 9 / 13; justify-self: end; }
@media (max-width: 900px) {
  .tools-feature { display: block; }
  .tools-feature__visual { margin-top: 3.5rem; min-height: 32rem; }
  .tools-more { display: block; }
  .tools-more a { margin-top: 1rem; }
}
@media (max-width: 550px) {
  .tools-feature__visual { min-height: 27rem; margin-inline: calc(-1 * var(--journal-gutter)); }
  .wine-sheet { width: 82%; padding: 1.8rem 1.4rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header.is-tucked { transform: none; transition: none; }
  .wine-sheet, .ohia-arrow, .ecosystem__item { transition: none; }
}
.tools-section--more { padding-top: 0; }
.service-preview__title { max-width: 12ch; overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (max-width: 768px) { .service-preview__title { font-size: clamp(2rem, 8vw, 2.6rem); max-width: none; } }
/* Long words can't break inside word masks, so keep the largest headings within narrow screens. */
@media (max-width: 550px) {
  .content-section h2, .ohia-page-who-we-serve .content-section h2 { font-size: clamp(2.9rem, 12.5vw, 4.3rem); }
}
