/* =========================================================================
   MILO — shared structure. shared/roots.css sets the tokens below and the
   layout; this file only carries behaviour-related styling (slides,
   reveals, gallery).
   Tokens: --bg --bg2 --fg --fg2 --line --acc --acc-ink --r --ease --pad
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--fg); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .8s var(--ease), color .8s var(--ease); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:root { --gal-inset: clamp(0px, 2.6vw, 44px); --ease: cubic-bezier(.22, .61, .36, 1); --ease-io: cubic-bezier(.7, 0, .2, 1); --r: 0px; --pad: clamp(20px, 5vw, 88px); --logo: #C10016; }
::selection { background: var(--acc); color: var(--acc-ink, #fff); }
:focus-visible { outline: 1px solid var(--acc); outline-offset: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--fg); color: var(--bg); padding: 10px 14px; text-decoration: none; transition: top .3s; }
.skip:focus { top: 12px; }
[data-m="logo"] { display: inline-block; }
.logomark { height: 100%; width: auto; }
.logomark path { fill: var(--logo); }
[data-m="icon"] svg, .ico svg { width: 1.1em; height: 1.1em; }
[data-m="theme"] svg { width: 20px; height: 20px; }

/* ---------- render slideshow (crossfade + slow zoom) ---------- */
.slides { position: relative; overflow: hidden; background: #0c0b0a; isolation: isolate; }
.slides .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease); }
.slides .slide.is-on { opacity: 1; z-index: 1; }
.slides .slide.was-on { opacity: 0; z-index: 0; }
.slides img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.0); transform-origin: var(--zo, 50% 60%); }
.slides .slide.is-on img, .slides .slide.was-on img { animation: kb 14s linear both; }
@keyframes kb { from { transform: scale(1.0); } to { transform: scale(1.09); } }
.slides-count { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; }
.slides-count .sc-sep { width: 28px; height: 1px; background: currentColor; opacity: .6; }
.grade { position: relative; }
.grade::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; background: url(../img/grain.png); background-size: 180px; mix-blend-mode: overlay; opacity: .16; }

/* ---------- photos ---------- */
img.ph { width: 100%; height: 100%; object-fit: cover; }
.img-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-size: 14px; color: #E9EBE4; background: #2E1212; }

/* ---------- reveals ---------- */
.ready [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease) calc(var(--i, 0) * 90ms), transform 1.2s var(--ease) calc(var(--i, 0) * 90ms); }
.ready [data-reveal].in { opacity: 1; transform: none; }
.ready [data-reveal="mask"] { opacity: 1; transform: none; }
.ready [data-reveal="mask"] > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.4s var(--ease-io) calc(var(--i, 0) * 110ms); }
.ready [data-reveal="mask"].in > * { clip-path: inset(0 0 0 0); }
.ready [data-reveal="line"] { opacity: 1; transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease-io); }
.ready [data-reveal="line"].in { transform: scaleX(1); }
.ready [data-reveal="fade"] { transform: none; }
.ready [data-reveal="lines"] { opacity: 1; transform: none; }
.mask-lines > span { display: block; overflow: hidden; }
.mask-lines > span > span { display: block; transform: translateY(105%); transition: transform 1.2s var(--ease-io) calc(var(--d, 0) * 120ms + 150ms); }
.ready .mask-lines.in > span > span, .mask-lines.in > span > span { transform: none; }

/* ---------- panels / cards (behavioural bits) ---------- */
.panel[hidden] { display: none !important; }
.panel.is-in .panel-head { animation: panel-in .9s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card { cursor: pointer; position: relative; outline: none; }
.card:focus-visible { outline: 1px solid var(--acc); outline-offset: 6px; }
.card-media { position: relative; overflow: hidden; }
.card-media img.ph { position: absolute; inset: 0; transition: transform 1.4s var(--ease); transform-origin: 50% 60%; }
.card:hover .card-media img.ph, .card:focus-visible .card-media img.ph { transform: scale(1.06); }

/* ---------- gallery: expands from the card ---------- */
.gal { position: fixed; inset: 0; z-index: 120; }
.gal[hidden] { display: none; }
.gal-scrim { position: absolute; inset: 0; background: rgba(8, 7, 6, .72); opacity: 0; transition: opacity .8s var(--ease); }
.gal.is-open .gal-scrim { opacity: 1; }
.gal-panel { position: absolute; inset: var(--gal-inset, 0); display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 30%); grid-template-rows: minmax(0, 1fr); background: var(--gal-bg, var(--bg)); color: var(--gal-fg, var(--fg)); clip-path: inset(0); transition: clip-path .9s var(--ease-io); overflow: hidden; border-radius: var(--r); }
.gal-stage { position: relative; overflow: hidden; background: #0c0b0a; touch-action: pan-y; }
.gal-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease); }
.gal-slide.is-on { opacity: 1; }
.gal-slide img.ph { position: absolute; inset: 0; transform: scale(1.04); transition: transform 2.4s var(--ease); }
.gal-slide.is-on img.ph { transform: scale(1); }
.gal-slide::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(26, 0, 0, .35) 0%, rgba(26, 0, 0, 0) 22%, rgba(26, 0, 0, 0) 55%, rgba(26, 0, 0, .78) 100%); }
.gal-slide figcaption { position: absolute; left: clamp(16px, 3vw, 40px); bottom: clamp(70px, 9vh, 96px); z-index: 3; color: #ece4d6; display: flex; gap: 14px; align-items: baseline; max-width: 70%; }
.gal-info { position: relative; display: flex; flex-direction: column; gap: 18px; padding: clamp(28px, 4vw, 56px); padding-top: clamp(72px, 9vh, 104px); overflow-y: auto; border-left: 1px solid var(--line); opacity: 0; transform: translateY(12px); transition: opacity .8s var(--ease) .35s, transform .9s var(--ease) .35s; }
.gal.is-open .gal-info { opacity: 1; transform: none; }
.gal-info .gal-cta { margin-top: auto; display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; }
.gal-info .gal-cta svg { width: 18px; height: 18px; }
.gal-price[hidden] { display: none; }
.gal-ctrl { position: absolute; left: clamp(16px, 3vw, 40px); bottom: clamp(16px, 3vh, 30px); z-index: 4; display: flex; align-items: center; gap: 14px; color: #ece4d6; }
.gal-ctrl button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(236, 228, 214, .35); border-radius: var(--r); transition: background-color .6s var(--ease), border-color .6s var(--ease); }
.gal-ctrl button:hover { border-color: rgba(236, 228, 214, .9); }
.gal-ctrl svg { width: 18px; height: 18px; }
.gal.single .gal-ctrl button { display: none; }
.gal-bars { position: absolute; left: 0; top: 0; z-index: 4; display: flex; gap: 4px; padding: 0; width: calc(100% - 30%); }
.gal-bars i { flex: 1; height: 2px; background: rgba(236, 228, 214, .22); }
.gal-bars i.on { background: rgba(236, 228, 214, .9); }
.gal-close { position: absolute; top: clamp(14px, 2.4vh, 24px); right: clamp(14px, 2vw, 28px); z-index: 5; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 4px; }
.gal-close svg { width: 20px; height: 20px; }
html.gal-open, html.gal-open body { overflow: hidden; }
@media (max-width: 860px) {
  :root { --gal-inset: 0px; }
  .gal-panel { grid-template-columns: 1fr; grid-template-rows: 56vh auto; overflow-y: auto; }
  .gal-info { border-left: 0; border-top: 1px solid var(--line); padding-top: 28px; padding-bottom: 90px; overflow: visible; }
  .gal-bars { width: 100%; }
  .gal-close { color: #ece4d6; background: rgba(12, 11, 10, .55); padding: 0 12px; }
  .gal-slide figcaption { bottom: 72px; max-width: 86%; }
  .gal-ctrl { bottom: auto; top: calc(56vh - 60px); }
}

/* ---------- header (sticky: it stays on screen while the page scrolls) ---------- */
[data-m="header"] { transition: background-color .8s var(--ease), border-color .8s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .slides .slide.is-on img { animation: none; }
  .ready [data-reveal], .ready [data-reveal="mask"] > * { opacity: 1; transform: none; clip-path: none; }
  .mask-lines > span > span { transform: none; }
}
