/* Orchestra Books homepage motion: a lyre that plays, a moving shelf, a page that inks in. */
:root { --ob-ease: cubic-bezier(.16, 1, .3, 1); }

.ob-progress { position: fixed; inset: 0 0 auto; z-index: 1100; height: 2px; background: linear-gradient(90deg, var(--ob-gold-dark), var(--ob-gold-light)); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; pointer-events: none; }

/* Hero */
.ob-home-hero {
  overflow: hidden;
  background-image: radial-gradient(52% 74% at 74% 44%, rgba(199,156,82,.15), transparent 72%), linear-gradient(90deg, rgba(16,11,9,.95), rgba(16,11,9,.80) 55%, rgba(16,11,9,.70)), url('../brand/leather-tile.webp');
  background-size: auto, auto, 620px;
  background-position: center;
}
.ob-home-hero__inner { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr); gap: clamp(20px, 4vw, 64px); align-items: center; padding: 64px 0 150px; }
.ob-home-hero__copy { max-width: none; }

.ob-rise-word { display: inline-block; overflow: hidden; padding-bottom: .16em; margin-bottom: -.16em; vertical-align: top; }
.ob-rise-word > span { display: inline-block; animation: ob-word 1s var(--ob-ease) calc(.1s + var(--i) * 55ms) both; }
.ob-home-hero .ob-eyebrow { animation: ob-rise .9s var(--ob-ease) both; }
.ob-home-hero__copy > p:not(.ob-eyebrow) { animation: ob-rise .9s var(--ob-ease) .42s both; }
.ob-home-hero .ob-button-row { animation: ob-rise .9s var(--ob-ease) .54s both; }

.ob-lyre { position: relative; justify-self: center; width: min(100%, 500px, 66vh); aspect-ratio: 1300 / 1249; touch-action: pan-y; cursor: pointer; animation: ob-lyre-in 1.4s var(--ob-ease) .15s both; }
.ob-lyre__glow { position: absolute; inset: -6% -10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(231,193,119,.34), rgba(231,193,119,.08) 62%, transparent); opacity: .5; pointer-events: none; }
.ob-lyre__body { position: absolute; inset: 0; will-change: transform; }
.ob-lyre__frame { display: block; width: 100%; height: 100%; filter: drop-shadow(2px 3px 0 #6f4c20) drop-shadow(0 24px 30px rgba(0,0,0,.5)); }
.ob-lyre__sheen { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(158deg, rgba(255,233,184,.42), transparent 48%, rgba(64,36,10,.42)); -webkit-mask: url('../brand/lyre-frame.webp') center / 100% 100% no-repeat; mask: url('../brand/lyre-frame.webp') center / 100% 100% no-repeat; pointer-events: none; }
.ob-lyre__sheen::before { content: ""; position: absolute; inset: -10% auto -10% 0; width: 42%; background: linear-gradient(100deg, transparent, rgba(255,244,216,.9) 50%, transparent); transform: translateX(-130%) skewX(-14deg); animation: ob-sheen 10s ease-in-out 2.2s infinite; }
.ob-lyre__strings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ob-lyre__string { fill: none; stroke: #dcb56c; stroke-width: 15; stroke-dasharray: 1; animation: ob-draw 1.1s var(--ob-ease) calc(.55s + var(--o) * 80ms) both; }
.ob-lyre__blur { fill: #f0cf8c; opacity: 0; }
.ob-lyre__sound { position: absolute; right: -3%; bottom: -2%; z-index: 2; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 11px; border: 1px solid rgba(231,193,119,.46); border-radius: 999px; background: rgba(16,11,9,.74); color: var(--ob-gold-light); font-size: 13px; font-weight: 700; letter-spacing: .02em; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; animation: ob-sound-hint 2.6s ease-out 3s 3; }
.ob-lyre__sound[hidden], .ob-river__pause[hidden] { display: none; }
.ob-lyre__sound svg { flex: none; width: 19px; height: 19px; fill: currentColor; }
.ob-lyre__sound-wave { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: .42; transition: opacity .2s ease; }
.ob-lyre__sound:hover { border-color: var(--ob-gold-light); background: rgba(31,22,17,.94); }
.ob-lyre__sound:focus-visible { outline: 2px solid var(--ob-gold-light); outline-offset: 3px; }
.ob-lyre__sound[aria-pressed="true"] { border-color: transparent; background: linear-gradient(135deg, var(--ob-gold-light), var(--ob-gold)); color: var(--ob-leather-deep); animation: none; }
.ob-lyre__sound[aria-pressed="true"] .ob-lyre__sound-wave { opacity: 1; }

/* Moving shelf */
.ob-river { position: relative; z-index: 2; margin-top: -132px; background: linear-gradient(transparent 132px, var(--ob-paper) 132px); }
.ob-river__track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; padding-block: 18px 40px; scroll-behavior: auto; scrollbar-width: none; }
.ob-river__track::-webkit-scrollbar { display: none; }
.ob-river__group { flex: none; display: flex; gap: 24px; margin: 0; padding: 0 12px; list-style: none; }
.ob-river li { flex: none; width: 156px; margin: 0; }
.ob-river a { position: relative; display: block; color: var(--ob-ink); text-decoration: none; }
.ob-river img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 5px 5px 2px; background: #2a1d14; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 16px 26px rgba(16,11,9,.34), 0 3px 7px rgba(16,11,9,.26); transition: transform .5s var(--ob-ease), box-shadow .5s var(--ob-ease); }
.ob-river a::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 2 / 3; border-radius: 2px 5px 5px 2px; background: linear-gradient(90deg, rgba(0,0,0,.24), rgba(255,255,255,.16) 3%, rgba(0,0,0,.05) 6%, transparent 11%); pointer-events: none; transition: transform .5s var(--ob-ease); }
.ob-river__title { position: absolute; left: 0; right: 0; top: calc(100% + 8px); overflow: hidden; color: var(--ob-ink); font-size: 12.5px; font-weight: 700; line-height: 1.3; text-align: center; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .25s ease; }
.ob-river a:hover img, .ob-river a:focus-visible img { transform: translateY(-12px) rotate(-1.4deg) scale(1.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 30px 38px rgba(16,11,9,.40), 0 6px 12px rgba(16,11,9,.28); }
.ob-river a:hover::after, .ob-river a:focus-visible::after { transform: translateY(-12px) rotate(-1.4deg) scale(1.04); }
.ob-river a:hover .ob-river__title, .ob-river a:focus-visible .ob-river__title { opacity: 1; }
.ob-river a:focus-visible { outline: 2px solid var(--ob-gold); outline-offset: 4px; }
.ob-river__pause { position: absolute; right: max(14px, calc((100vw - var(--ob-shell)) / 2)); bottom: 6px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(113,77,34,.34); border-radius: 50%; background: var(--ob-paper); color: var(--ob-gold-dark); cursor: pointer; transition: background .2s ease, color .2s ease; }
.ob-river__pause:hover { background: var(--ob-leather); color: var(--ob-gold-light); }
.ob-river__pause:focus-visible { outline: 2px solid var(--ob-gold); outline-offset: 2px; }
.ob-river__pause svg { width: 16px; height: 16px; fill: currentColor; }
.ob-river__icon-play, .ob-river__pause[aria-pressed="true"] .ob-river__icon-pause { display: none; }
.ob-river__pause[aria-pressed="true"] .ob-river__icon-play { display: block; }

/* Scroll reveals; the classes are only ever added by JavaScript to content below the fold. */
.ob-reveal { opacity: 0; transform: translateY(32px); }
.ob-reveal.is-in { opacity: 1; transform: none; transition: opacity .9s var(--ob-ease) var(--d, 0s), transform 1.05s var(--ob-ease) var(--d, 0s); }
.ob-ink-word { color: rgba(41,35,30,.24); transition: color .45s ease; }
.ob-ink-word.is-inked { color: inherit; }

/* Section strings */
.ob-string-rule { position: relative; z-index: 3; height: 0; }
.ob-string-rule svg { position: absolute; left: 0; top: -24px; width: 100%; height: 48px; overflow: visible; pointer-events: none; }
.ob-string-rule path { fill: none; stroke: var(--ob-gold); stroke-width: 1.2; opacity: .8; }

/* Subject cards: ink rises from the bottom of the card. */
.ob-field-card { position: relative; overflow: hidden; isolation: isolate; }
.ob-field-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, var(--ob-leather), var(--ob-leather-deep)); transform: translateY(101%); transition: transform .6s var(--ob-ease); }
.ob-field-card :is(span, h3, p) { transition: color .35s ease, transform .6s var(--ob-ease); }
.ob-field-card:is(:hover, :focus-visible)::before { transform: none; }
.ob-field-card:is(:hover, :focus-visible) h3 { color: var(--ob-cream); transform: translateY(-6px); }
.ob-field-card:is(:hover, :focus-visible) p { color: #eadfce; transform: translateY(-6px); }
.ob-field-card:is(:hover, :focus-visible) span { color: var(--ob-gold-light); }

/* Catalogue: a cover opens slightly towards the reader. */
.ob-home-product-grid .obc-book-card { transition: transform .5s var(--ob-ease), box-shadow .5s var(--ob-ease); }
.ob-home-product-grid .obc-book-card__media { perspective: 900px; }
.ob-home-product-grid .obc-book-card__img { transform-origin: 0 50%; transition: transform .6s var(--ob-ease), filter .6s var(--ob-ease); }
@media (hover: hover) and (pointer: fine) {
  .woocommerce .ob-home-product-grid li.product.obc-book-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(31,22,17,.13); }
  .ob-home-product-grid .obc-book-card:hover .obc-book-card__img { transform: rotateY(-13deg) scale(1.03); filter: drop-shadow(10px 12px 12px rgba(31,22,17,.3)); }
}

/* Digital development: a gold line runs along the top of the card. */
.ob-digital-card { position: relative; transition: background .35s ease; }
.ob-digital-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--ob-gold-dark), var(--ob-gold-light)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s var(--ob-ease); }
.ob-digital-card:is(:hover, :focus-within)::before { transform: scaleX(1); }
.ob-digital-card:is(:hover, :focus-within) { background: #fff; }
.ob-text-link span { transition: transform .35s var(--ob-ease); }
.ob-digital-card:hover .ob-text-link span, .ob-service-grid article:hover .ob-text-link span { transform: translateX(6px); }

/* Closing band and gold buttons */
.ob-home-cta::before { inset: -130px; animation: ob-drift 46s ease-in-out infinite alternate; }
.ob-button--gold { position: relative; overflow: hidden; isolation: isolate; }
.ob-button--gold::after { content: ""; position: absolute; inset: -20% auto -20% 0; z-index: -1; width: 38%; background: linear-gradient(100deg, transparent, rgba(255,247,226,.75), transparent); transform: translateX(-180%) skewX(-16deg); animation: ob-shine 7s ease-in-out 2.6s infinite; }

@keyframes ob-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ob-word { from { transform: translateY(116%); } to { transform: none; } }
@keyframes ob-lyre-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ob-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ob-sheen { 0% { transform: translateX(-130%) skewX(-14deg); } 32%, 100% { transform: translateX(300%) skewX(-14deg); } }
@keyframes ob-shine { 0% { transform: translateX(-180%) skewX(-16deg); } 22%, 100% { transform: translateX(360%) skewX(-16deg); } }
@keyframes ob-sound-hint { from { box-shadow: 0 0 0 0 rgba(231,193,119,.5); } to { box-shadow: 0 0 0 15px rgba(231,193,119,0); } }
@keyframes ob-drift { from { transform: translate3d(-44px, -22px, 0); } to { transform: translate3d(44px, 22px, 0); } }

@media (max-width: 1040px) {
  .ob-home-hero { min-height: 0; }
  .ob-home-hero__inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); padding: 52px 0 150px; }
}
@media (max-width: 780px) {
  .ob-home-hero { background-image: radial-gradient(70% 34% at 50% 20%, rgba(199,156,82,.16), transparent 72%), linear-gradient(rgba(16,11,9,.84), rgba(16,11,9,.90)), url('../brand/leather-tile.webp'); }
  .ob-home-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 30px 0 124px; }
  .ob-lyre { order: -1; width: min(52vw, 210px); }
  .ob-lyre__sound { right: -27%; bottom: 3%; width: 40px; height: 40px; min-height: 0; justify-content: center; padding: 0; }
  .ob-lyre__sound span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ob-river { margin-top: -102px; background: linear-gradient(transparent 102px, var(--ob-paper) 102px); }
  .ob-river li { width: 112px; }
  .ob-river__group { gap: 16px; padding: 0 8px; }
  .ob-river__track { padding-block: 12px 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .ob-rise-word > span, .ob-home-hero .ob-eyebrow, .ob-home-hero__copy > p:not(.ob-eyebrow), .ob-home-hero .ob-button-row, .ob-lyre, .ob-lyre__string, .ob-lyre__sheen::before, .ob-home-cta::before, .ob-button--gold::after, .ob-lyre__sound { animation: none; }
  .ob-lyre__string { stroke-dasharray: none; }
  .ob-lyre__sheen::before, .ob-button--gold::after { display: none; }
  .ob-river img, .ob-river a::after, .ob-field-card::before, .ob-field-card :is(span, h3, p), .ob-home-product-grid .obc-book-card, .ob-home-product-grid .obc-book-card__img, .ob-digital-card::before { transition: none; }
}
@media print {
  .ob-reveal { opacity: 1; transform: none; }
  .ob-ink-word { color: inherit; }
  .ob-river, .ob-progress, .ob-string-rule { display: none; }
}
