/* Home page (docs/HOME-DESIGN.md). The piece counter hero, manifesto, two ways in, the display ladder,
   the DF partner section, the prebuilt rail and the bench card. Builds on the tokens in base.css. */
.page-home .site-main { padding-top: 0; }
.page-home .container { --pad: clamp(20px, 4vw, 64px); }

/* ---------------------------------------------------------------- hero: piece counter */
.bh { position: relative; min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; padding-top: clamp(40px, 6vh, 72px); overflow-x: clip; }
.bh__top { display: grid; gap: var(--s-5) var(--s-7); align-items: end; }
@media (min-width: 1024px) { .bh__top { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr); } }
.bh__eyebrow { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.bh__eyebrow::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 2px; background: var(--accent); vertical-align: 1px; }
.bh__title { font-size: clamp(48px, 7.4vw, 116px); line-height: 0.92; letter-spacing: -0.045em; max-width: none; }
.bh__line { display: block; overflow: hidden; padding-bottom: 0.06em; white-space: nowrap; }
.bh__line > * { display: inline-block; }
.bh__title em { color: var(--muted); letter-spacing: -0.025em; padding-right: 0.06em; }
@media (max-width: 599px) { .bh__line { white-space: normal; } }
.bh__side { display: flex; flex-direction: column; gap: var(--s-5); padding-bottom: 0.6em; }
.bh__lede { color: var(--ink-2); font-size: 17px; line-height: 1.55; max-width: 36ch; }
.bh__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bh__cta { gap: 10px; }
.bh__arrow { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: -10px; border-radius: 50%; background: #14120E; color: var(--accent); font-size: 13px; transition: transform 300ms var(--ease-out); }
.bh__cta:hover .bh__arrow { transform: translateX(3px) rotate(-45deg); }

.bh__plate { position: relative; flex: 1 0 auto; min-height: clamp(260px, 38vh, 420px); margin-top: clamp(28px, 4vh, 48px); }
.bh__studs { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bh__readout { position: relative; height: 100%; min-height: inherit; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-5); padding-bottom: var(--s-5); pointer-events: none; }
.bh__readout a { pointer-events: auto; }
.bh__count { display: flex; align-items: baseline; gap: 14px; max-width: none; line-height: 0.8; text-shadow: 0 10px 40px rgba(20, 18, 14, 0.9); }
.bh__num { paint-order: stroke fill; -webkit-text-stroke: 0.09em #14120E; font-family: var(--font-display); font-weight: 300; font-size: clamp(96px, 17vw, 260px); letter-spacing: -0.06em; font-variant-numeric: tabular-nums; color: var(--ink); }
.bh__unit { paint-order: stroke fill; -webkit-text-stroke: 8px #14120E; font-family: var(--font-accent); font-style: italic; font-size: clamp(24px, 2.6vw, 40px); color: var(--muted); }
.bh__tier { min-width: 260px; max-width: 340px; padding: 20px 22px; border-radius: 20px; background: rgba(20, 18, 14, 0.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(244, 239, 228, 0.12); display: flex; flex-direction: column; gap: 6px; }
.bh__tiername { font-family: var(--font-accent); font-style: italic; font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.bh__price { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bh__per { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.bh__meta { font-size: 14px; color: var(--muted); line-height: 1.45; }
.bh__book { margin-top: 8px; align-self: flex-start; font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.bh__book:hover { color: var(--ink); }

.bh__ruler { display: grid; gap: 10px; padding-bottom: clamp(28px, 5vh, 56px); }
.bh__label { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.bh__label span { font-weight: 400; color: var(--muted); }
.bh__range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: ew-resize; touch-action: pan-y;
  --tick: repeating-linear-gradient(90deg, rgba(244, 239, 228, 0.28) 0 1px, transparent 1px 1%); }
.bh__range::-webkit-slider-runnable-track { height: 18px; border-radius: 0; background: var(--tick), linear-gradient(90deg, var(--accent) 0 var(--fill, 23%), rgba(244, 239, 228, 0.08) var(--fill, 23%)); background-size: 100% 8px, 100% 2px; background-position: 0 0, 0 100%; background-repeat: no-repeat; }
.bh__range::-moz-range-track { height: 18px; background: var(--tick), linear-gradient(90deg, var(--accent) 0 var(--fill, 23%), rgba(244, 239, 228, 0.08) var(--fill, 23%)); background-size: 100% 8px, 100% 2px; background-position: 0 0, 0 100%; background-repeat: no-repeat; }
.bh__range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -5px; border-radius: 6px; background: var(--accent); border: 0; box-shadow: 0 0 0 5px rgba(20, 18, 14, 1), 0 6px 18px rgba(0, 0, 0, 0.5); background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.55) 0 4px, transparent 5px); transition: transform 200ms var(--ease-state); }
.bh__range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); border: 0; box-shadow: 0 0 0 5px rgba(20, 18, 14, 1), 0 6px 18px rgba(0, 0, 0, 0.5); }
.bh__range:active::-webkit-slider-thumb { transform: scale(1.12); }
.bh__range:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.bh__ticks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.bh__ticks li { border-left: 1px solid var(--rule); padding-left: 8px; }
.bh__static { display: none; }
.bh__tick-short { display: none; }
/* No script: hide the live counter, show the plain list instead. */
html:not(.js) .bh__plate, html:not(.js) .bh__ruler { display: none; }
html:not(.js) .bh__static { display: grid; gap: 1px; margin-top: var(--s-7); margin-bottom: var(--s-7); }
.bh__static a { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
@media (max-width: 599px) {
  .bh__plate { min-height: 0; margin-top: var(--s-6); }
  .bh__studs { bottom: auto; height: 200px; }
  .bh__readout { flex-direction: column; align-items: stretch; gap: var(--s-4); padding-top: 112px; padding-bottom: var(--s-4); }
  .bh__num { font-size: 104px; }
  .bh__tier { max-width: none; padding: 16px 18px; border-radius: 16px; }
  .bh__tiername { font-size: 34px; }
  .bh__tick-full { display: none; }
  .bh__tick-short { display: inline; }
  .bh__ticks { font-size: 10px; letter-spacing: 0.08em; }
  .bh__ticks li { padding-left: 5px; }
}

/* entrance: masked rise. Rest state is visible; home.js adds .is-entering only when motion is welcome. */
.is-entering [data-rise] { opacity: 0; transform: translateY(105%); }
.bh__side[data-rise], .bh__eyebrow[data-rise] { transition: none; }
.is-entering .bh__side[data-rise], .is-entering .bh__eyebrow[data-rise] { transform: translateY(24px); }
.is-in [data-rise] { opacity: 1; transform: none; transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out); }
.is-in .bh__line:nth-child(2) [data-rise] { transition-delay: 120ms; }
.is-in .bh__side[data-rise] { transition-delay: 320ms; }

/* ---------------------------------------------------------------- manifesto */
.bm { padding: clamp(96px, 16vh, 176px) 0; border-top: 1px solid var(--rule); }
.bm__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-5); }
.bm__text { font-size: clamp(30px, 4.4vw, 64px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 500; max-width: 22ch; color: var(--ink); }
.bm__text .hl { color: var(--accent); }
.bm__text .sp { opacity: 0.16; transition: opacity 120ms linear; }

/* ---------------------------------------------------------------- two ways in */
.bways { padding-bottom: clamp(80px, 12vh, 140px); }
.bways__label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); line-height: 1.3; margin-bottom: var(--s-4); }
.way { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 8px var(--s-5); padding: clamp(24px, 4vh, 40px) 0; border-top: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.way:last-child { border-bottom: 1px solid var(--rule); }
.way__idx { font-family: var(--font-mono); font-size: 12px; color: var(--muted); align-self: start; padding-top: 0.9em; }
.way__title { font-size: clamp(44px, 7.4vw, 120px); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; transition: transform 500ms var(--ease-out), color 300ms var(--ease-state); }
.way__title em { font-family: var(--font-accent); font-weight: 400; letter-spacing: -0.02em; color: var(--muted); transition: color 300ms var(--ease-state); }
.way__note { grid-column: 2; max-width: 46ch; color: var(--muted); font-size: 15px; }
.way__go { grid-column: 3; grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(244, 239, 228, 0.2); display: grid; place-items: center; font-size: 22px; transition: background 300ms var(--ease-state), color 300ms var(--ease-state), transform 400ms var(--ease-out), border-color 300ms; }
.way:hover .way__title { transform: translateX(12px); }
.way:hover .way__title em { color: var(--accent); }
.way:hover .way__go { background: var(--accent); border-color: var(--accent); color: #14120E; transform: rotate(-45deg); }
.way__peek { display: none; position: absolute; top: 50%; left: 0; width: 280px; height: 210px; object-fit: cover; border-radius: 16px; pointer-events: none; opacity: 0; z-index: 2; transform: translate3d(var(--px, 60vw), -50%, 0) scale(0.9) rotate(-3deg); transition: opacity 300ms var(--ease-state), transform 600ms var(--ease-out); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); background: #fff; }
@media (hover: hover) and (min-width: 1024px) {
  .way__peek { display: block; }
  .way:hover .way__peek { opacity: 1; transform: translate3d(var(--px, 60vw), -50%, 0) scale(1) rotate(-3deg); }
}
@media (max-width: 599px) {
  .way { grid-template-columns: minmax(0, 1fr) 48px; }
  .way__idx { display: none; }
  .way__note { grid-column: 1; }
  .way__go { grid-column: 2; width: 48px; height: 48px; }
}

/* ---------------------------------------------------------------- display ladder: stacking cards */
.bl { padding: clamp(80px, 12vh, 140px) 0 0; background: var(--surface); border-top: 1px solid var(--rule); }
.bl__head { display: flex; flex-direction: column; gap: var(--s-3); }
.bl__stack { position: relative; padding-bottom: 12vh; }
.bl__slot { position: sticky; top: 0; height: 88vh; display: flex; justify-content: center; align-items: flex-start; padding: calc(var(--header-h) + 32px) var(--gutter) 0; }
.bl__card { position: relative; top: calc(var(--i) * 28px); width: min(1200px, 100%); transform-origin: top center; will-change: transform; display: grid; gap: var(--s-6); align-items: center; padding: clamp(20px, 3vw, 40px); border-radius: clamp(28px, 4vw, 48px); background: #1B1914; border: 1px solid rgba(244, 239, 228, 0.1); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35); }
@media (min-width: 900px) { .bl__card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.bl__copy { display: flex; flex-direction: column; gap: var(--s-3); padding: clamp(8px, 2vw, 24px); }
.bl__num { font-family: var(--font-accent); font-style: italic; font-size: clamp(56px, 7vw, 96px); line-height: 0.8; color: var(--accent); }
.bl__title { font-size: clamp(36px, 4.4vw, 64px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.bl__text { color: var(--ink-2); max-width: 38ch; }
.bl__price { font-weight: 600; font-size: 18px; }
.bl__link { color: var(--ink); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; min-height: 44px; display: inline-flex; align-items: center; }
.bl__media { margin: 0; border-radius: clamp(20px, 3vw, 32px); overflow: hidden; background: #fff; aspect-ratio: 4 / 3; }
.bl__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) { .bl__slot { height: auto; position: relative; padding-top: var(--s-5); } .bl__card { top: 0; } }

/* ---------------------------------------------------------------- DF partner */
.bdf { padding: clamp(96px, 14vh, 160px) 0; }
.bdf__grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 1024px) { .bdf__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.bdf__copy { display: flex; flex-direction: column; gap: var(--s-4); }
.bdf__lede { color: var(--ink-2); font-size: 17px; max-width: 42ch; }
.bdf__finder { margin-top: var(--s-3); padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: var(--s-3); }
.bdf__finder-label { font-weight: 600; }
.bdf__gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.bdf__img { margin: 0; border-radius: 28px; overflow: hidden; background: #fff; aspect-ratio: 3 / 4; }
.bdf__img:nth-child(2) { transform: translateY(var(--s-8)); }
.bdf__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.bdf__img:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------------- prebuilt rail */
.brail { padding: clamp(80px, 12vh, 140px) 0; border-top: 1px solid var(--rule); }
.brail__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-5); margin-bottom: var(--s-6); }
.brail__head > div { display: flex; flex-direction: column; gap: var(--s-3); }
.brail__track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 23%); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) var(--s-4); scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); scrollbar-width: thin; scrollbar-color: #3A352D transparent; }
.brail__track > * { scroll-snap-align: start; }
.brail__track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 599px) { .brail__track { grid-auto-columns: 78%; } }
.brail__gifts { margin-top: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }

/* ---------------------------------------------------------------- bench card (the light flip) */
.bcard { background: #F4EFE4; color: #14120E; padding: clamp(96px, 14vh, 160px) 0; --ink: #14120E; --ink-2: #3D372E; --muted: #6A6255; --rule: #D8D0C0; }
.bcard h2 { color: #14120E; }
.bcard__grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 1024px) { .bcard__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); } }
.bcard__intro { display: flex; flex-direction: column; gap: var(--s-4); }
.bcard__intro p:last-child { color: #3D372E; max-width: 40ch; font-size: 17px; }
.bcard__card { margin: 0; background: #FFFDF8; border-radius: 6px; padding: clamp(24px, 3vw, 40px); transform: rotate(-1.5deg); box-shadow: 0 1px 2px rgba(20, 18, 14, 0.08), 0 12px 40px rgba(20, 18, 14, 0.14); border: 1px solid #E6DECD; display: flex; flex-direction: column; gap: var(--s-4); background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(47, 91, 82, 0.12) 31px 32px); }
.bcard__top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #6A6255; border-bottom: 2px solid #14120E; padding-bottom: 12px; }
.bcard__rows { display: grid; gap: 10px; }
.bcard__rows div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.bcard__rows dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #6A6255; padding-top: 4px; }
.bcard__rows dd { font-family: var(--font-accent); font-style: italic; font-size: 24px; line-height: 1.2; color: #14120E; }
.bcard__note p { font-family: var(--font-accent); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; color: #14120E; max-width: none; }
.bcard__sign { font-size: 14px; color: #6A6255; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bcard__sign a { color: #14120E; font-weight: 600; text-decoration-color: #B8860B; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- shared reveal */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .is-entering [data-rise], .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .way__title, .way__go, .bdf__img img { transition: none; }
  .bm__text .sp { transition: none; }
}
