@font-face { font-family: Cinzel; src: url("fonts/Cinzel-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: SourceSerif; src: url("fonts/SourceSerif4-Regular.ttf") format("truetype"); font-display: swap; }
:root {
  color-scheme: dark;
  --ivory: #fbefd5;
  --gold: #e8bd74;
  --line: #aa8c55;
  --sea: #061c20;
  --gutter: clamp(14px, 2.75vw, 56px);
  --display: Cinzel, Georgia, serif;
  font: 17px/1.4 SourceSerif, Georgia, serif;
  color: var(--ivory);
  background: #061a1d;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 55% 100%, #174542, transparent 65%), #06191d; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid #fff0bd; outline-offset: 3px; }
.masthead {
  font-family: var(--display);
  height: clamp(72px, 8.5svh, 94px); display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter); border-bottom: 1px solid #896f47;
  background: linear-gradient(108deg, #051719, #0a2a2b 55%, #04191b);
}
.brand, nav { display: flex; align-items: center; }
.brand { gap: 16px; font-size: clamp(21px, 1.9vw, 32px); color: #e9cd95; }
.brand img { height: clamp(48px, 6.5svh, 72px); mix-blend-mode: screen; filter: invert(1) grayscale(1) brightness(2.7) sepia(1) saturate(1.35); }
nav { gap: clamp(18px, 3vw, 60px); }
nav button { padding: 12px 2px; font-size: clamp(17px, 1.4vw, 23px); position: relative; }
nav button::after { content: ''; position: absolute; bottom: 5px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: 0; }
nav button:hover::after, nav button:focus-visible::after { opacity: 1; }
.scene {
  position: relative; isolation: isolate; display: grid; grid-template-rows: minmax(355px, 1fr) auto;
  min-height: calc(100svh - clamp(72px, 8.5svh, 94px)); padding: clamp(12px, 1.8vw, 28px) var(--gutter) clamp(18px, 2.4vw, 36px);
  gap: clamp(12px, 1.4vw, 20px);
}
.scene::after, .folio::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 62px;
  background: url(thread.svg) center / 100% 100% no-repeat; pointer-events: none; opacity: .78;
}
.painting, .entry, .folio, .panel { position: relative; isolation: isolate; border: 1px solid var(--line); }
.painting {
  display: flex; align-items: center; min-height: clamp(355px, 58vh, 760px);
  background: linear-gradient(90deg,#04171dea,rgba(4,22,28,.65) 21%,transparent 57%), url(keep.webp) center 12% / cover no-repeat;
  box-shadow: 0 8px 30px #020c1059;
}
.painting::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg,#0519209e,transparent 28%); }
.corners { position: absolute; inset: -1px; pointer-events: none; z-index: 3; --size: 29px; }
.corners i { position: absolute; width: var(--size); height: var(--size); background: url(corner.svg) center / contain; }
.corners i:nth-child(1) { left: 0; top: 0; }
.corners i:nth-child(2) { right: 0; top: 0; transform: rotate(90deg); }
.corners i:nth-child(3) { right: 0; bottom: 0; transform: rotate(180deg); }
.corners i:nth-child(4) { left: 0; bottom: 0; transform: rotate(270deg); }
.painting > .corners { --size: clamp(34px, 3.4vw, 64px); }
.intro { margin: 0 5%; position: relative; padding: 18px 0; }
h1, h2, p { margin: 0; font-weight: 400; }
h1 { font: 400 clamp(72px, 7.2vw, 146px)/.98 var(--display); letter-spacing: -.055em; text-shadow: 0 4px 32px #041318b0; }
.intro p { margin-top: 32px; font-size: clamp(18px, 1.5vw, 26px); font-style: italic; }
.intro::after { content: ''; pointer-events: none; position: absolute; height: 36px; width: 145%; left: -12%; bottom: 39px; background: url(thread.svg) center / 100% 100% no-repeat; }
.entries { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.2vw, 18px); }
.entry {
  display: flex; align-items: center; text-align: left; overflow: hidden;
  min-height: clamp(99px, 13svh, 150px); padding: 12px 7%; gap: 10px;
  background: radial-gradient(ellipse at 72% 20%,#315456, transparent 52%), linear-gradient(110deg,#0b272a,#081c21 65%,#112e31);
}
.entry::before, .panel::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.entry::before { background: linear-gradient(90deg, #0a2329 4%,#092025dd 38%,transparent 65%),url(keep.webp) center 10% / 100% auto; opacity: .15; }
.entry-copy { position: relative; z-index: 1; max-width: 63%; text-shadow: 0 2px 8px #031014; }
.entry-copy strong, .panel-caption strong { display: block; font-size: clamp(27px, 2.6vw, 48px); font-weight: 400; line-height: 1.1; }
.entry-copy > span { display: block; margin-top: 5px; color: #d4d6c9; font-size: clamp(15px, 1.05vw, 19px); }
.entry img { position: absolute; pointer-events: none; transition: transform .3s ease; }
.entry-portrait { right: 10%; height: 168%; top: -9%; mask-image: linear-gradient(90deg,transparent,black 25%,black 78%,transparent); }
.entry-book { right: 8%; width: 28%; top: 50%; transform: translateY(-50%) rotate(-9deg); }
.entry:hover .entry-portrait { transform: translateY(-3px); }
.entry:hover .entry-book { transform: translateY(-52%) rotate(-5deg); }
.arrow { margin-left: auto; font-size: 35px; font-weight: 400; color: var(--gold); z-index: 1; }
.entry:hover, .panel:hover, .panel[aria-pressed="true"] { border-color: #f2cb85; }
dialog {
  padding: 0; border: 0; width: min(1260px, calc(100vw - 6vw)); max-height: 94svh;
  background: transparent; color: var(--ivory); box-shadow: 0 22px 90px #010b10bb;
}
dialog::backdrop { background: #031218ba; backdrop-filter: blur(6px); }
.folio { padding: clamp(18px, 3vw, 46px); background: radial-gradient(ellipse at 44% 5%,#184441,transparent 62%),linear-gradient(145deg,#0a2629,#051a1f 72%,#103234); }
.folio > .corners { --size: 40px; }
.folio::after { height: 55px; }
.dialog-head::after { content: ""; order: 1; flex: 1; height: 46px; margin-inline: 2%; background: url(thread.svg) center / 100% 100% no-repeat; }
.dialog-head form { order: 2; }
.panel[aria-pressed="true"]::after { content: ""; position: absolute; top: 0; left: 15%; right: 15%; height: 1px; background: linear-gradient(90deg,transparent,#ffe6a6,transparent); box-shadow: 0 0 9px #ffbc5b; }
.mobile-detail { display: none; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: clamp(37px, 4.2vw, 68px); line-height: 1.12; letter-spacing: -.04em; }
.close { width: 44px; height: 44px; border: 1px solid #ab8b54; color: #f2d7a6; font: 30px/1 Georgia,serif; }
#detail-copy { margin: 10px 0 clamp(19px, 3vh, 32px); color: #d6dbce; }
.collection { display: flex; gap: 7px; position: relative; z-index: 1; }
.panel { flex: 1 1 0; min-width: 0; height: clamp(290px, 44svh, 510px); overflow: hidden; padding: 0; display: flex; align-items: end; justify-content: center; background: #10252a; transition: flex-grow .34s ease; }
.panel[aria-pressed="true"] { flex-grow: 2.1; }
.panel::before { background: linear-gradient(0deg,#09252a55,#0a282d80),url(keep.webp) 18% 10% / auto 235% no-repeat; opacity: .5; }
.panel:nth-child(even)::before { background-position: 9% 5%; }
.panel .art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.panel img { position: absolute; width: 100%; height: 95%; left: 0; bottom: 0; object-fit: cover; object-position: 50% 5%; }
.panel-caption { width: 100%; padding: 48px 12px 20px; background: linear-gradient(transparent,#06191def 53%,#061a20); }
.panel-caption strong { font-size: clamp(22px,2.3vw,37px); }
.panel .detail { display: none; margin: 6px auto 0; max-width: 34ch; font-size: 16px; color: #e0e1d5; }
.panel[aria-pressed="true"] .detail { display: block; }
.panel:not([aria-pressed="true"]) .art { opacity: .8; }
[data-section=codices] .panel { background: radial-gradient(ellipse at 50% 42%,#324f6b,#11282f 64%,#091b20); }
[data-section=codices] .panel img { width: min(74%, 39svh, 435px); height: auto; left: 50%; top: 40%; bottom: auto; transform: translate(-50%, -50%); }
[data-section=codices] .panel::before { opacity: .19; }
@media(max-width:700px) {
  .masthead { height: 66px; }
  .brand { gap: 8px; }.brand img { height: 43px; }
  .scene { min-height: calc(100svh - 66px); gap: 10px; }
  .painting { align-items: start; background-position: center,53% center; background-image: linear-gradient(165deg,#04171de8,rgba(4,22,28,.48) 20%,transparent 48%),url(keep.webp); }
  .intro { margin: 9% 6%; padding: 0; }.intro p { margin-top: 19px; font-size: 17px; }
  h1 { font-size: clamp(49px,11vw,70px); }.intro::after { height: 21px; bottom: 20px; width: 120%; }
  .entries { gap: 8px; }.entry { min-height: 96px; padding: 14px; align-items: end; }
  .entry-copy { max-width: 87%; }.entry-copy strong { font-size: clamp(22px,4.7vw,32px); }
  .entry-copy > span { font-size: 13px; line-height: 1.25; }.entry img { opacity: .35; }
  .entry-portrait { right: -12%; height: 110%; top: -10%; }.entry-book { right: -3%; width: 50%; top: 37%; }
  .arrow { font-size: 24px; }.entry > .corners { --size: 18px; }
  dialog { width: calc(100vw - 20px); }.folio { padding: 17px 12px 23px; }
  .dialog-head::after { height: 15px; }.dialog-head, #detail-copy { margin-inline: 6px; }#detail-copy { font-size: 15px; }
  .collection { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .panel { height: clamp(137px,21svh,218px); }
  .panel[aria-pressed="true"] .detail { display: none; }
  .mobile-detail { display: block; min-height: 3.35em; padding: 12px 6px 5px; font-size: 15px; line-height: 1.32; }.panel .corners { --size: 20px; }
  .panel-caption { padding: 25px 7px 9px; }.panel .detail { font-size: 13px;line-height: 1.22; }
  [data-section=codices] .panel { height: clamp(215px,31svh,300px); }
  [data-section=codices] .panel img { width: 87%; }
}
@media(max-width:410px) {
  .brand { gap: 6px; font-size: clamp(16px, 4.6vw, 19px); white-space: nowrap; }
  .brand img { height: 36px; }
  nav { gap: 10px; }
  nav button { font-size: 15px; }
}
@media(max-width:370px) {
  .brand img { height: 32px; }
  nav { gap: 6px; }
  .entry-copy > span { font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none !important; } }

.store-action { display: none; }
[data-section=houses] .store-action { display: flex; position: relative; z-index: 1; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; }
.store-action a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #ffe1a4; font-size: 18px; text-decoration-color: #aa8c55; text-underline-offset: 5px; }
.store-action a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.store-action small { color: #e1d9c5; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 var(--gutter); background: #05191d; border-top: 1px solid #6e6449; color: #d3cec0; font-size: 15px; }
.site-footer nav { gap: clamp(18px, 3vw, 48px); }
.site-footer a, .return-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--gold); text-underline-offset: 5px; text-decoration-color: #8f784e; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.scene { min-height: calc(100svh - clamp(72px, 8.5svh, 94px) - 52px); }
.release-page { min-height: 100svh; display: flex; flex-direction: column; }
.release-page .brand { text-decoration: none; }
.release-main { flex: 1; display: grid; padding: var(--gutter); }
.release-main .painting { min-height: 55svh; }
.release-copy { padding: clamp(22px, 5vw, 88px); max-width: 45%; text-shadow: 0 2px 12px #04151a; }
.release-copy h1 { font-size: clamp(48px, 6.5vw, 108px); }
.release-copy p { margin: 22px 0 12px; font-size: clamp(17px, 1.5vw, 24px); }
.return-link { gap: 8px; }
@media(max-width:700px) {
  .scene { min-height: calc(100svh - 118px); }
  .release-copy { max-width: 100%; padding: 23px; }
  .release-main .painting { background-image: linear-gradient(180deg,#03171df2,rgba(4,22,28,.78) 24%,transparent 56%),url(keep.webp); }
}
[data-section=codices] .panel[aria-pressed="true"] { flex-grow: 2.1; }
[data-section=codices] .panel:nth-child(2) { background: radial-gradient(ellipse at 50% 42%,#5d543b,#172d30 64%,#091b20); }
[data-section=codices] .panel:nth-child(3) { background: radial-gradient(ellipse at 50% 42%,#6c4132,#302726 64%,#091b20); }
[data-section=codices] .panel:nth-child(4) { background: radial-gradient(ellipse at 50% 42%,#4b3c59,#182831 64%,#091b20); }
@media (max-width:700px) {
  [data-section=houses] .store-action { margin: 0 6px; justify-content: flex-start; }
  [data-section=codices] .panel { height: clamp(153px,22svh,218px); }
}

