.heritage {
  --heritage-art: url('assets/heritage-reference.webp');
  --cream: #ffe6ab;
  --amber: #ffbd1b;
  --serif: Georgia, 'Times New Roman', serif;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  border-radius: 1.2cqw;
  background: #100905;
  color: var(--cream);
}

.heritage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border: 1cqw solid transparent;
  border-image: var(--heritage-art) 10 stretch;
  border-radius: inherit;
}

.heritage-header {
  position: absolute;
  inset: 0 1.2% auto;
  height: 6.6%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3cqw;
  padding: 0 2cqw;
  background: linear-gradient(90deg,#130b05,#090603 42%,#130b05);
  border-bottom: .06cqw solid #a47b36;
}

.heritage .heritage-nav {
  display: flex;
  align-items: center;
  gap: 3.3cqw;
  font: 900 1.36cqw/1 var(--serif);
  text-transform: uppercase;
  color: var(--cream);
}

.heritage .heritage-nav a { padding: .55em 0; font: inherit; white-space: nowrap; }
.heritage-nav a[aria-current] { color: var(--amber); box-shadow: 0 2px var(--amber); }
.heritage-tools { display: flex; align-items: center; gap: 1.1cqw; }
.heritage-tools .icon-button { color: var(--cream); }
.heritage-tools .icon { width: 1.9cqw; height: auto; }
.heritage-tools .menu-button { display: none; }

.heritage .studio-film {
  position: absolute;
  inset: 6.6% 0 10.5%;
  border: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.heritage .studio-screen { position: absolute; inset: 0; aspect-ratio: auto; }
.heritage .studio-screen > :is(img, video) { object-fit: fill; object-position: center; }
.heritage .studio-screen::after {
 content:'';
 position:absolute;
 inset:0;
 background:linear-gradient(90deg,#0007,transparent 65%);
 pointer-events:none;
}

.heritage .studio-caption {
  position: absolute;
  bottom: 14%;
  right: 2.8%;
  z-index: 3;
  background: none;
  border: 0;
  padding: 0;
}

.heritage .studio-toggle { background: #110a05e8; color: var(--cream); min-height: 36px; }
.heritage-art, .heritage-vinyl {
  position: absolute;
  inset: 0;
  background: var(--heritage-art) center / 100% 100% no-repeat;
  pointer-events: none;
}

.heritage-art {
  clip-path: polygon(0 6.6%,56% 6.6%,56% 48.5%,14.6% 48.5%,14.6% 70%,0 70%);
  mask-image: linear-gradient(90deg,#000 44%,transparent 55%),
              linear-gradient(180deg,#000 45%,transparent 52%);
  mask-composite: intersect;
}

.heritage-vinyl {
  clip-path: polygon(0 48%,13% 48%,15.5% 69.5%,16% 71%,27.5% 75%,28% 89%,0 89%);
  mask-image: linear-gradient(90deg,#000 24%,transparent 28%);
}

.heritage-crest { position: absolute; margin: 0; }
.heritage-copy {
  position: absolute;
  top: 49%;
  left: 15%;
  width: 33%;
  text-align: center;
  text-transform: uppercase;
}

.heritage-copy p {
  margin: 0;
  color: var(--cream);
  font: italic 900 3.27cqw/.91 'Times New Roman',serif;
  letter-spacing: -.045em;
  white-space: nowrap;
  transform: scaleX(.86);
  text-shadow: .06cqw .18cqw #160a03;
}

.heritage-kicker {
  margin: .35em 0 .4em;
  font: italic 900 1.85cqw/1.1 var(--serif);
  letter-spacing: .24em;
}

.heritage-kicker::before, .heritage-kicker::after {
  content: '';
  display: inline-block;
  width: 10%;
  height: .06cqw;
  margin: 0 .4em .26em;
  background: var(--amber);
}

.heritage-actions { display: flex; justify-content: center; gap: 1.15cqw; }
.heritage-actions a, .heritage-view {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .48em .6em;
  border: .12cqw solid var(--cream);
  border-radius: .36cqw;
  background: #100b06;
  font: 800 1.28cqw/1.02 'Barlow Condensed', sans-serif;
  color: var(--cream);
  text-transform: uppercase;
  white-space: nowrap;
}

.heritage-actions a:first-child { background: var(--amber); border-color: var(--amber); color: #1b1003; }
.heritage :is(.heritage-actions,.heritage-features,.heritage-releases) a:hover { text-decoration: underline; }
.heritage :is(.heritage-actions,.heritage-releases) .icon { width: 1.05em; height: 1.05em; }

.heritage-features {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  align-items: center;
  inset: 78% 1.7% 11% 28.5%;
  background: linear-gradient(0deg,#0b0704 4%,#0b0704e8 67%,transparent);
}

.heritage-features a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55em;
  border-inline-end: .06cqw solid #dca24f;
  color: var(--cream);
  text-transform: uppercase;
  font: 800 1.34cqw/1 'Barlow Condensed',sans-serif;
}

.heritage-features a:last-child { border: 0; }
.heritage-features small { display: block; margin-top: .22em; font-size: .72em; font-weight: 600; }
.heritage-features a > :is(span,.icon) { color: var(--amber); font-size: 2em; }
.heritage-features a > .icon { width: 1em; height: 1em; }

.heritage-releases {
  position: absolute;
  inset: 89% 0 0;
  display: grid;
  grid-template-columns: 1.22fr repeat(4, 1fr) 1.05fr;
  align-items: center;
  gap: .6cqw;
  padding: .65cqw 2.8cqw .85cqw 1.7cqw;
  border-top: .18cqw double #76401d;
  background: radial-gradient(ellipse at top,#ffe2a1,transparent 80%),linear-gradient(10deg,#d88c48,#ffd097 40%,#f1ae64);
  color: #1d0f06;
}

.heritage-releases h2 {
  margin: 0;
  padding: .32em .42em;
  background: #861d0c;
  color: #fff0be;
  font: italic 900 1.62cqw/1 var(--serif);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-3deg);
}

.heritage-release {
  display: flex;
  gap: .6em;
  align-items: center;
  border-right: .06cqw solid #8e562b;
  padding-right: .4em;
  color: inherit;
  font: 800 1.19cqw/1 'Barlow Condensed',sans-serif;
  text-transform: uppercase;
}

.heritage-release img { width: 4.35cqw; height: 4.35cqw; border-radius: 50%; object-fit: cover; background: #21140a; }
.heritage-release small { display: block; margin-top: .2em; font-size: .76em; }
.heritage-view { background: transparent; color: #1d0f06; border-color: #422109; }
.heritage :is(button,a):focus-visible { outline: 2px solid #fff3c2; outline-offset: 2px; }
.heritage-releases a:focus-visible { outline-color: #422109; }



/* One complete source frame at every viewport size. */
body[data-page="home"] { margin:0; min-height:0; }
body[data-page="home"] #main { width:100%; height:100dvh; }
.heritage { width:100%; height:100%; aspect-ratio:auto; container-type:size; border-radius:0; }
.heritage::after { border-width:min(.55cqw,.85cqh); }
.heritage .heritage-nav {
 position:static; display:flex; flex-direction:row; padding:0; border:0;
 background:none; gap:3.3cqw; min-width:0;
}
.heritage .heritage-nav a { color:var(--cream); }
.heritage .heritage-nav a[aria-current] { color:var(--amber); box-shadow:0 .12cqw var(--amber); }
.heritage-tools .icon-button { position:relative; flex:none; width:3cqw; height:3cqw; padding:.3cqw; gap:0; justify-content:center; }
.heritage-tools .icon { flex:none; }
.heritage-tools .count {
 position:absolute; top:0; right:-.2cqw; width:1.15cqw; height:1.15cqw;
 font-size:.72cqw; line-height:1; background:#c61912; color:#fff;
}
.heritage-art { display:none; }
.heritage .heritage-crest {
 left:20.5%; top:7%; width:25%; height:auto;
 background:url('assets/heritage-reference.webp') 26% 11.3% / 402% 233.5% no-repeat;
}
.heritage-vinyl { clip-path:ellipse(13% 10.3% at 13.2% 79.5%); mask-image:none; }
.heritage-copy { top:49.6%; left:15.5%; width:32%; }
.heritage-copy p { line-height:.96; }
.heritage-actions { width:100%; display:grid; grid-template-columns:1.16fr 1fr; gap:1.15cqw; }
.heritage-actions a { height:2.85cqw; min-width:0; padding:.3em .4em; font-size:1.1cqw; }
.heritage-actions a > :is(span,svg) { flex:none; }
.heritage .studio-film { box-shadow:none; }
.heritage .studio-screen > :is(img,video) {
 inset:0; width:100%; height:100%; object-fit:fill; mask-image:none; transform:none;
}
.heritage .studio-caption { inset:auto 2.8% 14% auto; min-height:0; flex-wrap:nowrap; padding:0; gap:0; font-size:.72cqw; line-height:1; }
.heritage .studio-controls { flex-wrap:nowrap; gap:.36cqw; }
.heritage .studio-toggle { min-height:2.15cqw; padding:.3cqw .6cqw; font-size:.72cqw; border-width:.06cqw; line-height:1; }
.heritage-features a, .heritage-releases > * { min-width:0; }
.heritage-release img { flex:none; padding:.8cqw; background:repeating-radial-gradient(circle,#171713 0,#070707 .08cqw,#1a1915 .13cqw); }
.heritage-view { height:3.1cqw; padding:.3em; font-size:1.18cqw; }
.home-links { position:relative; background:#000; padding:8px 12px; }
.home-links nav { display:flex; justify-content:center; flex-wrap:wrap; gap:4px 16px; color:#e2c98f; font:500 11px/1.5 var(--body); }
.home-links a:hover { text-decoration:underline; }
@media(max-width:760px) {
 .heritage { --heritage-art:url('assets/heritage-reference-mobile.webp'); }
 .heritage .heritage-crest { background-image:url('assets/heritage-reference-mobile.webp'); }
}
/* A shaped source-art cutout excludes the former button pixels above the record. */
svg.heritage-vinyl { inset:auto auto 11% 0; width:28%; height:auto; background:none; clip-path:none; mask-image:none; }
.heritage-record-scene { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.heritage-nav a[aria-label="Home"] .icon { width:1.5em; height:1.5em; }

/* The original studio film supplies the entire scene, without artwork patches. */
.heritage .studio-screen::after, .heritage::after { display:none; }

/* Share the full top strip evenly between navigation and utility controls. */
.heritage-header { justify-content:space-between; gap:2cqw; }
.heritage .heritage-nav { flex:1; justify-content:space-between; gap:1.2cqw; }
.heritage .heritage-nav a { flex:none; white-space:nowrap; }
.heritage-tools { flex:none; }

/* Readable controls share the existing strip; the studio frame stays intact. */
.heritage-home,.heritage-menu { display:none; }
.heritage .studio-toggle {
 min-height:44px; padding:8px 12px; font:600 12px/1.25 var(--body);
 border:1px solid #a47b36; background:#120c05e8; color:var(--cream);
}
.heritage .studio-controls { gap:8px; }
.heritage .studio-caption { right:12px; bottom:calc(10% + 12px); }
.heritage :is(a,button):focus-visible { outline:2px solid var(--cream); outline-offset:3px; }
@media(max-width:1024px) {
 .heritage-header { inset:0 0 auto; height:56px; padding:0 12px; gap:12px; }
 .heritage-home { display:grid; place-items:center; width:44px; height:44px; flex:none; }
 .heritage-home .icon { width:24px; height:24px; }
 .heritage .heritage-tools { display:flex; align-items:center; gap:8px; margin-left:auto; }
 .heritage-tools .icon-button { width:44px; height:44px; padding:10px; }
 .heritage-tools .icon { width:22px; height:22px; }
 .heritage-tools .count { top:2px; right:0; width:17px; height:17px; font-size:10px; }
 .navigation-ready .heritage-menu { display:flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:8px 10px; font:600 14px/1.2 var(--body); color:var(--cream); background:transparent; border:1px solid #a47b36; }
 .heritage .heritage-nav { position:absolute; inset:56px 0 auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:12px; background:#100a04fa; border-bottom:1px solid #a47b36; max-height:calc(100dvh - 56px); overflow-y:auto; }
 .heritage .navigation-ready .heritage-nav:not(.open) { display:none; }
 .heritage .heritage-nav a { display:flex; align-items:center; min-height:44px; padding:8px 12px; white-space:normal; font-size:15px; line-height:1.3; }
 .heritage .heritage-nav a[aria-current] { box-shadow:none; background:#d4aa521a; }
 .heritage .studio-caption { right:10px; left:10px; justify-content:flex-end; }
 .heritage .studio-controls { flex-wrap:wrap; justify-content:flex-end; }
}

/* Phones: show the studio film in its true 16:9 shape (never stretched), with the
   releases strip and site links stacked directly underneath. Desktop is unchanged. */
@media(max-width:760px) {
 body[data-page="home"] #main { height:auto; }
 .heritage { height:auto; aspect-ratio:auto; container-type:inline-size; display:flex; flex-direction:column; overflow:visible; }
 .heritage-header { position:relative; inset:auto; flex:none; }
 .heritage .studio-film { position:relative; inset:auto; flex:none; width:100%; aspect-ratio:16 / 9; }
 .heritage .studio-screen > :is(img,video) { object-fit:cover; }
 .heritage-releases { position:relative; inset:auto; flex:none; }
 /* Smaller film controls tucked into the corner so they don't cover the lathe. */
 .heritage .studio-caption { left:auto; right:8px; bottom:8px; }
 .heritage .studio-controls { gap:6px; flex-wrap:nowrap; }
 .heritage .studio-toggle { min-height:32px; padding:5px 9px; font-size:11px; }
}

/* Home page: the page background matches the black footer strip, so the space under the social icons is the same black (phones). */
body[data-page="home"] { background:#000; }
