/*
  Home page in the order of the original barnsly.ru home:
  hero → promo banners → store banner → latest blog posts.
  Colours come from the logo and the engraving: --scene, --scene-accent, --engraving-ink (site.css).
*/
.home-page { --tile-radius: 18px; --display-tracking: -.035em; }
.home-page main { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); padding-block-end: clamp(2rem, 4vw, 3.5rem); }
.home-page .home-band { margin: 0; }

/* ---------- Hero: a framed photo under the ordinary header ---------- */
.home-hero { padding-block-start: clamp(.75rem, 1.4vw, 1.25rem); }
.hero-frame {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-block-size: clamp(30rem, 74svh, 46rem);
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: var(--scene);
  color: var(--scene-ink);
}
.hero-photo { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 30% 50%; transform: scaleX(-1); }
.hero-frame::after {
  position: absolute; z-index: -1; inset: 0; content: "";
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--scene) 88%, transparent), color-mix(in srgb, var(--scene) 40%, transparent) 40%, transparent 62%),
    linear-gradient(90deg, color-mix(in srgb, var(--scene) 55%, transparent), transparent 50%);
}
.hero-copy { display: grid; gap: 1rem; max-width: 56rem; padding: clamp(1.5rem, 4.5vw, 3.5rem); }
.hero-copy h1 { margin: 0; font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.5rem); font-weight: 700; line-height: 1; letter-spacing: var(--display-tracking); }
.hero-copy h1 span { display: block; color: var(--scene-accent); }
.hero-copy p { color: var(--scene-muted); font-size: clamp(1rem, .9rem + .3vw, 1.2rem); max-width: 40ch; }
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-block-start: .5rem; max-width: 52rem; }
.hero-button {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 3.25rem; padding-inline: 1.1rem 1rem;
  border: 1px solid rgb(255 255 255 / .3); border-radius: 12px;
  background: rgb(255 255 255 / .08); color: var(--scene-ink);
  font-weight: 600; font-size: 1rem;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-button--primary { border-color: var(--scene-accent); background: var(--scene-accent); color: var(--scene); }
.hero-button .icon { width: 1.1rem; height: 1.1rem; }
@media (min-width: 720px) {
  .hero-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-button { white-space: nowrap; }
  .hero-copy h1 { text-wrap: nowrap; }
}
@media (max-width: 719px) {
  .hero-photo { object-position: 18% 50%; }
  .hero-button { min-height: 3rem; padding-inline: .9rem .75rem; font-size: .9375rem; line-height: 1.15; }
  .hero-frame::after { background: linear-gradient(0deg, color-mix(in srgb, var(--scene) 94%, transparent), color-mix(in srgb, var(--scene) 70%, transparent) 50%, transparent 80%); }
}
@media (hover: hover) and (pointer: fine) {
  .hero-button:hover { border-color: rgb(255 255 255 / .7); background: rgb(255 255 255 / .16); }
  .hero-button--primary:hover { border-color: var(--scene-ink); background: var(--scene-ink); color: var(--scene); }
}

/* ---------- Promo slider (pattern from carbonara-premium.ru) ---------- */
.promo-stage {
  --promo-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  isolation: isolate;
  display: grid;
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: var(--scene);
  color: var(--scene-ink);
  touch-action: pan-y pinch-zoom;
}
.promo-track { display: grid; min-block-size: clamp(19rem, 36svh, 24rem); }
.promo-slide { position: relative; grid-area: 1 / 1; display: grid; visibility: hidden; min-width: 0; }
.promo-slide[data-state="active"] { visibility: visible; z-index: 2; }
.promo-slide[data-state="leaving"] { visibility: visible; z-index: 1; }
.promo-slide[data-slide="silver"], .promo-slide[data-slide="h200"] { --promo-accent: var(--scene-accent); }
.promo-slide[data-slide="powerrail"] { --promo-accent: #f08a3c; }
.promo-slide[data-slide="ren"] { --promo-accent: #f2a27a; }
.promo-art { position: absolute; inset: 0; overflow: clip; background: var(--scene); }
.promo-scene {
  position: absolute; inset: 0 0 0 auto; width: 74%; height: 100%; max-width: none; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%); mask-image: linear-gradient(90deg, transparent, #000 24%);
}
/* A slide without a photo: the product name set as a large outlined wordmark. */
.promo-type {
  position: absolute; inset: auto 4% 26% auto;
  font-size: clamp(4.5rem, 12vw, 11rem); font-weight: 800; line-height: .85; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--promo-accent) 75%, transparent);
}
.promo-card {
  position: relative; align-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem;
  width: min(26rem, calc(100% - 2rem)); margin: 1rem; margin-block-end: 5.25rem; padding: 1.15rem 1.4rem 1.3rem; gap: .45rem;
  border-radius: 14px; background: var(--scene); box-shadow: 0 18px 48px rgb(0 0 0 / .28);
}
.promo-kicker { color: var(--promo-accent); font-size: .8125rem; font-weight: 600; }
.promo-title { margin: 0; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: var(--display-tracking); }
.promo-lead { font-size: 1.0625rem; font-weight: 600; color: var(--promo-accent); }
.promo-text { color: var(--scene-muted); font-size: .9375rem; }
.promo-cta {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-block-start: .35rem; padding-inline: 1.3rem;
  border-radius: 999px; background: var(--promo-accent); color: var(--scene); font-weight: 650; font-size: .9375rem;
  transition: scale var(--dur-fast) var(--ease-out);
}
.promo-cta .icon { width: 1rem; height: 1rem; }
.promo-controls {
  position: absolute; z-index: 3; inset: auto 1rem 1rem 1rem;
  display: flex; align-items: center; gap: .75rem;
  padding: .45rem .45rem .45rem 1rem; border-radius: 14px;
  background: color-mix(in srgb, var(--scene) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.promo-tabs { display: flex; flex: 1; gap: .5rem; min-width: 0; }
.promo-tab {
  display: grid; gap: .4rem; flex: 1 1 0; min-width: 0; min-height: 2.75rem; align-content: center;
  border: 0; background: none; color: color-mix(in srgb, var(--scene-ink) 60%, transparent);
  font: 500 .8125rem/1.2 var(--sans); text-align: start; cursor: pointer;
}
.promo-tab[aria-current] { color: var(--scene-ink); font-weight: 650; }
.promo-tab-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.promo-tab-bar { position: relative; display: block; height: 2px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--scene-ink) 18%, transparent); }
.promo-tab-bar i { position: absolute; inset: 0; background: var(--scene-accent); transform: scaleX(0); transform-origin: 0; }
.promo-tab[aria-current] .promo-tab-bar i { transform: scaleX(1); }
.promo-buttons { display: flex; flex: none; gap: .25rem; }
.promo-button {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid color-mix(in srgb, var(--scene-ink) 22%, transparent); border-radius: 999px;
  background: none; color: var(--scene-ink); cursor: pointer;
}
.promo-button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.promo-button[aria-pressed="true"] { background: color-mix(in srgb, var(--scene-ink) 14%, transparent); }
.promo-stage :focus-visible { outline: 2px solid var(--scene-ink); outline-offset: 2px; }
.home-promo .preview-note { margin: 0 0 .75rem; }

@media (min-width: 800px) {
  .promo-card { margin: 1.25rem; width: min(26rem, 38%); }
  .promo-text { display: none; }
  .promo-controls { inset: auto 1.25rem 1.25rem auto; max-width: calc(100% - min(26rem, 38%) - 4rem); }
  .promo-tab { width: 5.5rem; flex: 0 1 auto; }
}
@media (max-width: 799px) {
  .promo-scene { width: 100%; height: 62%; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
  .promo-track { min-block-size: 30rem; }
  .promo-card { margin-block-end: 4.75rem; box-shadow: none; background: none; padding: 1rem .25rem; }
  .promo-text, .promo-tab-label { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .promo-cta:hover { scale: 1.03; }
  .promo-button:hover { background: color-mix(in srgb, var(--scene-ink) 14%, transparent); }
  .promo-tab:hover { color: var(--scene-ink); }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes promo-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes promo-wipe-next { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
  @keyframes promo-wipe-prev { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
  @keyframes promo-frame-in { from { translate: var(--promo-shift) 0; scale: 1.05; } }
  @keyframes promo-rise { from { opacity: 0; translate: 0 .75rem; } }
  .promo-stage { --promo-shift: 4%; }
  .promo-stage[data-dir="prev"] { --promo-shift: -4%; }
  .promo-stage[data-run] .promo-tab[aria-current] .promo-tab-bar i { animation: promo-progress 8s linear forwards; }
  .promo-stage[data-hold] .promo-tab[aria-current] .promo-tab-bar i { animation-play-state: paused; }
  .promo-stage[data-moved] .promo-slide[data-state="active"] .promo-art { animation: promo-wipe-next .8s cubic-bezier(.77, 0, .175, 1) both; }
  .promo-stage[data-moved][data-dir="prev"] .promo-slide[data-state="active"] .promo-art { animation-name: promo-wipe-prev; }
  .promo-stage[data-moved] .promo-slide[data-state="active"] :is(.promo-scene, .promo-type) { animation: promo-frame-in 1.3s var(--promo-ease) both; }
  .promo-stage[data-moved] .promo-slide[data-state="active"] .promo-card > * { animation: promo-rise .55s var(--promo-ease) both; animation-delay: calc(.3s + var(--i, 0) * 55ms); }
  .promo-card > :nth-child(2) { --i: 1; }
  .promo-card > :nth-child(3) { --i: 2; }
  .promo-card > :nth-child(4) { --i: 3; }
  .promo-card > :nth-child(5) { --i: 4; }
  .promo-slide[data-state="leaving"] .promo-card { opacity: 0; transition: opacity .2s ease-out; }
}

/* ---------- Tiles: the store banner and the blog feed ---------- */
.tile-card {
  position: relative; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto; gap: .75rem;
  min-block-size: 15rem; height: 100%; padding: clamp(1.15rem, 1.8vw, 1.75rem);
  overflow: hidden; border-radius: var(--tile-radius);
  background: var(--scene); color: var(--scene-ink);
}
.tile-media { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tile-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; font-size: .8125rem; font-weight: 500; }
.tile-label b { font-size: .875rem; font-weight: 800; letter-spacing: .2em; }
.tile-title { align-self: center; margin: 0; font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem); font-weight: 700; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
.tile-text { opacity: .8; max-width: 44ch; }
.tile-cta { display: inline-flex; align-items: center; gap: .5rem; width: fit-content; font-size: .9375rem; font-weight: 650; }
.tile-cta .icon { width: 1rem; height: 1rem; }
.tile-domain { margin-block-start: .6rem; padding-inline: .1rem; color: var(--muted-foreground); font-size: .875rem; }
.tile-card:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

/* Store banner: one wide tile, the product on a pale studio wall. */
.store-card { min-block-size: clamp(13rem, 20vw, 17rem); grid-template-rows: auto auto auto 1fr; background: linear-gradient(110deg, var(--secondary) 15%, var(--accent)); color: var(--heading); }
.store-card .tile-title { align-self: start; max-width: 18ch; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); }
.store-card .tile-cta { align-self: end; color: var(--link); }
.store-card .tile-media { inset: 50% 4% auto auto; width: min(34%, 22rem); height: 88%; translate: 0 -50%; object-fit: contain; filter: drop-shadow(0 18px 18px rgb(0 0 0 / .2)); }
.store-card > :not(.tile-media) { max-width: 60%; }

/* Blog feed: photo posts on the scene colour, brand posts on a pale plate, the show post in brand colour. */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.post .tile-card { block-size: 17rem; }
.post .tile-title { font-size: clamp(1.15rem, .95rem + .6vw, 1.45rem); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.post-photo .tile-card::after {
  position: absolute; z-index: -1; inset: 0; content: "";
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--scene) 72%, transparent), transparent 34%),
    linear-gradient(0deg, color-mix(in srgb, var(--scene) 92%, transparent), color-mix(in srgb, var(--scene) 55%, transparent) 50%, color-mix(in srgb, var(--scene) 20%, transparent));
}
.post-logo .tile-card, .post-product .tile-card { background: linear-gradient(125deg, var(--card) 10%, var(--secondary)); color: var(--heading); box-shadow: inset 0 0 0 1px var(--border); }
.post-logo .tile-media { inset: 1.1rem 1.25rem auto auto; width: 5.25rem; height: auto; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1); opacity: .75; }
:root.dark .post-logo .tile-media { mix-blend-mode: screen; filter: grayscale(1) invert(1) brightness(1.2); }
.post-logo .tile-cta, .post-product .tile-cta { color: var(--link); }
.post-product .tile-media { inset: auto 1rem .75rem auto; width: 36%; height: auto; max-height: 62%; object-fit: contain; filter: drop-shadow(0 12px 14px rgb(0 0 0 / .22)); }
.post-product .tile-title, .post-product .tile-label { max-width: 62%; }
.post-brand .tile-card { background: var(--primary); color: var(--primary-foreground); }
.tile-rings {
  position: absolute; z-index: -1; top: 50%; right: -18%; width: min(75%, 22rem); aspect-ratio: 1; border-radius: 50%; translate: 0 -50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--primary-foreground) 22%, transparent) 0 14%, transparent 14.5%),
    repeating-radial-gradient(circle, transparent 0 12px, color-mix(in srgb, var(--primary-foreground) 16%, transparent) 12px 13.5px);
}

@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  /* Every post card has the same size, whatever its content: three equal columns, one height. */
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.125rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .tile-media, .tile-rings { transition: scale 700ms var(--ease-out), filter 700ms var(--ease-out), opacity 300ms var(--ease-out); }
  .tile-cta .icon, .hero-button .icon { transition: translate var(--dur) var(--ease-out); }
  @media (hover: hover) and (pointer: fine) {
    .tile-card:hover .tile-media { scale: 1.045; }
    .post-logo .tile-card:hover .tile-media { filter: none; opacity: 1; }
    :root.dark .post-logo .tile-card:hover .tile-media { filter: grayscale(1) invert(1) brightness(1.4); }
    .tile-card:hover .tile-rings { scale: 1.08; }
    :is(.tile-card, .hero-button):hover .icon { translate: 4px 0; }
  }
  .hero-photo { animation: hero-settle 1.6s var(--ease-out) both; }
  .hero-copy > * { animation: rise-in 800ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 100ms; }
  .hero-copy > :nth-child(3) { animation-delay: 200ms; }
  @keyframes hero-settle { from { scale: 1.05; } }
}
@media (forced-colors: active) {
  .tile-card, .promo-stage, .hero-frame { border: 1px solid CanvasText; }
  .tile-rings { display: none; }
}
