/* Utstillingen: Christian Halvorsens arbeider som en museumssal.
   Grunnversjonen er et vanlig, loddrett galleri. script.js legger på klassen
   .is-3d og bygger salen rundt de samme elementene. */

:root {
  --wall: #1f4235;
  --wall-hi: #27503f;
  --wall-lo: #19372c;
  --deep: #0b1813;
  --vinyl: #f3ecdc;
  --vinyl-soft: #d5d6c4;
  --gilt: #c9a24b;
  --gilt-hi: #f0d68d;
  --card: #f4f0e5;
  --ink: #1c1b18;
  --ink-soft: #55524a;
  --dot: #d5512b;
  --serif: 'Boska', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --wall-h: 760px;
  --fs: .62;
  --wall-bg:
    linear-gradient(to top, #0a1611 0, #0a1611 26px, #14291f 26px, #14291f 29px, rgba(0, 0, 0, .3) 29px, rgba(0, 0, 0, 0) 84px),
    linear-gradient(to bottom, #d9d1bd 0, #d9d1bd 7px, #0e1f19 7px, #0e1f19 9px, rgba(255, 240, 200, .1) 9px, rgba(255, 240, 200, 0) 30%),
    linear-gradient(180deg, #25493b, #1f4235 55%, #1a382d);
  --planks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='720'%3E%3Crect width='256' height='720' fill='%23916538'/%3E%3Crect width='64' height='420' fill='%2395683a'/%3E%3Crect y='420' width='64' height='300' fill='%238b5f33'/%3E%3Crect x='64' width='64' height='180' fill='%238b5f33'/%3E%3Crect x='64' y='180' width='64' height='420' fill='%239a6c3d'/%3E%3Crect x='64' y='600' width='64' height='120' fill='%238b5f33'/%3E%3Crect x='128' width='64' height='300' fill='%239b6d3e'/%3E%3Crect x='128' y='300' width='64' height='420' fill='%238f6336'/%3E%3Crect x='192' width='64' height='90' fill='%238a5e32'/%3E%3Crect x='192' y='90' width='64' height='420' fill='%2393663a'/%3E%3Crect x='192' y='510' width='64' height='210' fill='%238a5e32'/%3E%3Cpath d='M0 0V720M64 0V720M128 0V720M192 0V720M0 420H64M64 180H128M64 600H128M128 300H192M192 90H256M192 510H256M0 0H64M128 0H192' stroke='%23553616' stroke-width='1.6' opacity='.7' fill='none'/%3E%3C/svg%3E");
}

@media (min-width: 860px) {
  :root { --fs: 1; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--vinyl);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid #ffdc8f;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(11, 24, 19, .9);
}

.skip {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 50;
  padding: 12px 16px;
  background: var(--card);
  color: var(--ink);
}
.skip:focus { top: 8px; }

[hidden] { display: none !important; }

/* ---------- Topplinje ---------- */

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  background: var(--deep);
}

.mark, .back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--vinyl);
}

.mark {
  font: 500 1.75rem/1 var(--serif);
  align-items: baseline;
  padding-top: 6px;
}

.mark__dot {
  width: .25em;
  height: .25em;
  margin-left: .05em;
  border-radius: 50%;
  background: var(--dot);
}

.back { font: 500 .875rem/1 var(--sans); letter-spacing: .01em; }
.back:hover { text-decoration: underline; }

/* ---------- Plan (grunnversjon: en enkel lenkeliste) ---------- */

.plan { background: var(--deep); padding: 0 12px 12px; }

.plan__list { display: flex; flex-wrap: wrap; gap: 0 4px; }

.plan__list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  font-size: .9375rem;
  text-decoration: none;
  color: var(--vinyl-soft);
}
.plan__list a:hover { color: var(--vinyl); text-decoration: underline; }
.plan__no { color: var(--gilt-hi); font-variant-numeric: tabular-nums; }

/* ---------- Veggene (grunnversjon) ---------- */

.stop {
  position: relative;
  background: var(--wall-bg);
}

.stop::after {
  content: '';
  display: block;
  height: 54px;
  background:
    linear-gradient(180deg, rgba(8, 20, 15, .6), rgba(8, 20, 15, 0) 60%),
    repeating-linear-gradient(180deg, #96693a 0, #96693a 15px, #5b3b19 15px, #5b3b19 16px, #8a5e31 16px, #8a5e31 35px, #5b3b19 35px, #5b3b19 36px);
}

.stop__inner {
  position: relative;
  width: min(1240px, 100% - 32px);
  margin-inline: auto;
  padding: 72px 0 96px;
}

/* Vegglys */
.stop--work::before,
.stop--artist::before,
.stop--creed::before,
.stop--shop::before,
.stop--end::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 95% 36% at 50% 24%, rgba(255, 229, 172, .2), rgba(255, 229, 172, 0) 72%);
}
.stop--creed::before,
.stop--shop::before,
.stop--end::before,
.stop--artist::before {
  background: radial-gradient(ellipse 110% 60% at 50% 42%, rgba(255, 229, 172, .13), rgba(255, 229, 172, 0) 74%);
}

/* ---------- Inngang ---------- */

.stop--beam .stop__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62vh;
  text-align: center;
}

.title {
  font: 500 clamp(2.9rem, 14.6vw, 3.75rem)/.98 var(--serif);
  letter-spacing: -.012em;
}
.title span { display: block; }

.title__ex {
  margin-top: 12px;
  font: italic 400 clamp(1.3rem, 2.3vw, 2rem)/1.2 var(--serif);
  color: var(--gilt-hi);
}

.title__sub {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--vinyl-soft);
}

@media (min-width: 860px) {
  .title { font-size: clamp(3.4rem, 6vw, 5.75rem); }
  .title span { display: inline; }
  .title__ex { margin-top: 14px; }
}

/* ---------- Rammer ---------- */

.frame {
  --fw: 22px;
  --mw: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: calc(var(--fw) * var(--fs)) solid;
  border-color: #f0d68d #c39a42 #876319 #d3ad55;
  background: #f1ebdc;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .5),
    inset 0 0 0 1px rgba(0, 0, 0, .45),
    0 24px 30px -12px rgba(0, 0, 0, .65),
    0 3px 7px rgba(0, 0, 0, .45);
}

/* profil midt i listverket */
.frame::before {
  content: '';
  position: absolute;
  inset: calc(var(--fw) * var(--fs) * -.6);
  border: calc(2px * var(--fs) + 1px) solid var(--f-line, rgba(110, 78, 18, .75));
  box-shadow: 0 0 0 1px rgba(255, 240, 190, .25);
  pointer-events: none;
}

.mat {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: calc(var(--mw) * var(--fs));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 2px 5px rgba(0, 0, 0, .22);
}

.mat img, .frame > img {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: 50% 0;
  outline: 1px solid rgba(0, 0, 0, .28);
}

/* varmt lys ovenfra på bildet */
.mat::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 233, 180, .13), rgba(255, 233, 180, 0) 42%, rgba(0, 0, 0, .05));
}

.frame--walnut {
  --fw: 24px;
  --mw: 12px;
  --f-line: rgba(214, 174, 86, .8);
  border-color: #6f482b #54341d #33200f #5d3a21;
  background: #ece5d3;
}

.frame--black {
  --fw: 11px;
  --mw: 40px;
  --f-line: rgba(255, 255, 255, .12);
  border-color: #33322f #1d1c1a #0b0b0a #262523;
  background: #f8f5ed;
}

.frame--oak {
  --fw: 17px;
  --mw: 22px;
  --f-line: rgba(120, 84, 40, .55);
  border-color: #d2aa73 #b18851 #8a6535 #c19a62;
  background: #f3eee2;
}

.frame--liner {
  --fw: 15px;
  --mw: 9px;
  border-color: #f0d68d #c39a42 #876319 #d3ad55;
  background: #191713;
}

.frame--small { --fw: 16px; }

/* ---------- Verk ---------- */

.stop--work .stop__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 26px;
}

/* bildelampe i messing */
.work::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -22px;
  width: min(42%, 250px);
  height: 8px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(180deg, #f5df9b, #b88a2e 55%, #6d4c12);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .5), 0 10px 22px 4px rgba(255, 226, 160, .28);
}
.work::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -16px;
  width: 4px;
  height: 16px;
  margin-left: -2px;
  background: linear-gradient(90deg, #8a651c, #e3c36d, #8a651c);
}

/* ---------- Etiketter ---------- */

.label {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 16px 6px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 18px -12px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .45);
}

.label__kat {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: .8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.label__title {
  padding-right: 52px;
  font: 600 1.25rem/1.2 var(--sans);
  letter-spacing: -.005em;
}
.label__title span { font-weight: 400; }

.label__medium { color: var(--ink-soft); }
.label__text { margin-top: 8px; }
.label__note { margin-top: 6px; color: var(--ink-soft); }
.label__role { margin-top: 6px; }

.label__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 2px;
}

.label__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(28, 27, 24, .45);
}
.label__links a:hover { text-decoration-color: var(--dot); color: #000; }

.label a:focus-visible { outline-color: var(--ink); box-shadow: none; }

/* ---------- Kunstneren ---------- */

.stop--artist .stop__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portrait {
  display: grid;
  grid-template-columns: minmax(104px, 34%) 1fr;
  gap: 14px;
  align-items: end;
  flex: 0 1 auto;
  min-height: 0;
}

.portrait .frame { height: 176px; }
.portrait img { height: 100%; }

.label--small { padding-bottom: 14px; }
.label--small .label__title { padding-right: 0; font-size: 1.0625rem; }
.label--small .label__text { margin-top: 6px; }

.walltext h2,
.stop--creed h2,
.contact h2 {
  font: 500 clamp(1.9rem, 8.4vw, 2.3rem)/1.04 var(--serif);
  letter-spacing: -.01em;
  text-wrap: balance;
}

.walltext p {
  margin-top: 10px;
  max-width: 62ch;
  line-height: 1.5;
}

/* ---------- Tre ting ---------- */

.stop--creed .stop__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.creed {
  display: grid;
  gap: 18px;
}

.creed li {
  padding-top: 14px;
  border-top: 1px solid rgba(243, 236, 220, .32);
}

.creed h3 {
  font: 500 1.4rem/1.14 var(--serif);
  color: var(--gilt-hi);
}

.creed p { margin-top: 6px; max-width: 46ch; }

/* ---------- Museumsbutikken ---------- */

.stop--shop .stop__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.board {
  padding: 12px 16px 4px;
  border: 9px solid;
  border-color: #c9a06b #a98049 #83602f #b88f57;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0, rgba(255, 255, 255, .035) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 7px),
    #14110e;
  color: #f6f1e4;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 22px 28px -14px rgba(0, 0, 0, .7);
}

.board__head {
  font: 500 1.5rem/1.1 var(--serif);
  padding-bottom: 8px;
}

.board__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid rgba(246, 241, 228, .16);
  font-weight: 500;
}
.board__list li span:last-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--gilt-hi);
}

.board__foot {
  padding-top: 8px;
  border-top: 1px solid rgba(246, 241, 228, .16);
  font-size: .9375rem;
  color: #cfc9ba;
}

.board__links { display: flex; flex-wrap: wrap; gap: 0 22px; }

.board__links a, .ticket a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

.ticket {
  position: relative;
  padding: 12px 22px 4px 26px;
  background: var(--card);
  color: var(--ink);
  line-height: 1.4;
  -webkit-mask:
    radial-gradient(circle 9px at 0 50%, rgba(0, 0, 0, 0) 97%, #000) 0 0 / 51% 100% no-repeat,
    radial-gradient(circle 9px at 100% 50%, rgba(0, 0, 0, 0) 97%, #000) 100% 0 / 51% 100% no-repeat;
  mask:
    radial-gradient(circle 9px at 0 50%, rgba(0, 0, 0, 0) 97%, #000) 0 0 / 51% 100% no-repeat,
    radial-gradient(circle 9px at 100% 50%, rgba(0, 0, 0, 0) 97%, #000) 100% 0 / 51% 100% no-repeat;
}

.ticket::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 10px;
  bottom: 10px;
  border-left: 2px dotted rgba(28, 27, 24, .35);
}

.ticket__tag {
  font-size: .8125rem;
  font-weight: 600;
  color: #a33a1c;
}

.ticket h3 { font: 600 1.25rem/1.2 var(--sans); }
.ticket p + p, .ticket h3 + p { margin-top: 4px; }
.ticket a:focus-visible { outline-color: var(--ink); box-shadow: none; }

/* ---------- Utgang ---------- */

.stop--end .stop__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.contact p { margin-top: 8px; max-width: 40ch; }

.contact__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 500 1.3rem/1.1 var(--sans);
  color: var(--vinyl);
  text-decoration-color: var(--gilt);
}
.contact__links a:hover { color: var(--gilt-hi); }

.bydoor { display: grid; gap: 14px; }

.label--colophon .label__title { padding-right: 0; font-size: 1.0625rem; }
.label--colophon .label__text { margin-top: 4px; }
.label--colophon .label__role { color: var(--ink-soft); }

.signs {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.sign {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  line-height: 1.25;
}

.sign--dogs {
  background: #fbf9f3;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 0 0 3px #fbf9f3, 0 10px 14px -8px rgba(0, 0, 0, .7);
  margin: 3px;
}
.sign--dogs svg { color: var(--dot); margin-bottom: 2px; }
.sign--dogs strong { font-weight: 600; }
.sign--dogs span { font-size: .875rem; color: var(--ink-soft); }

.sign--exit {
  min-height: 44px;
  background: #1c8a57;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85), 0 0 26px rgba(70, 230, 150, .4);
  margin: 3px 3px 3px 0;
}
.sign--exit strong { font: 600 1.25rem/1 var(--sans); }
.sign--exit span { font-size: .9375rem; text-decoration: underline; }
.sign--exit:hover { background: #20a065; }

/* ---------- Skrivebord: bilde til venstre, etikett til høyre ---------- */

@media (min-width: 860px) {
  .stop__inner { width: min(1340px, 100% - 96px); padding: 96px 0 120px; }

  .stop--work::before {
    background: radial-gradient(ellipse 44% 62% at 34% 46%, rgba(255, 229, 172, .22), rgba(255, 229, 172, 0) 72%);
  }

  .stop--work .stop__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
    column-gap: clamp(32px, 5vw, 76px);
    align-items: end;
    align-content: center;
  }

  .work {
    justify-self: center;
    width: min(100%, calc((var(--wall-h) * .7 - 96px) * 1.4177 + 96px));
    margin-top: 34px;
  }
  .work::before { top: -32px; height: 10px; }
  .work::after { top: -24px; height: 24px; }

  .label { max-width: 410px; padding: 18px 20px 8px; }
  .label__kat { top: 20px; right: 20px; }

  .stop--artist .stop__inner {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 620px);
    column-gap: clamp(48px, 7vw, 110px);
    align-items: center;
    align-content: center;
    justify-content: center;
  }

  .portrait { display: block; }
  .portrait .frame { height: auto; }
  .portrait img { height: auto; }
  .label--small { margin-top: 22px; }

  .walltext h2 { font-size: clamp(2.5rem, 3.6vw, 3.4rem); }
  .stop--creed h2 { font-size: clamp(2.8rem, 4.4vw, 4.2rem); }
  .contact h2 { font-size: clamp(3rem, 5vw, 4.6rem); line-height: 1; }
  .walltext p { margin-top: 16px; font-size: 1.125rem; line-height: 1.55; }

  .stop--creed .stop__inner { gap: clamp(28px, 5vh, 52px); }
  .creed { grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 60px); }
  .creed li { padding-top: 20px; }
  .creed h3 { font-size: clamp(1.7rem, 2.6vw, 2.5rem); line-height: 1.08; text-wrap: balance; }
  .creed p { margin-top: 14px; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.5; }

  .stop--shop .stop__inner {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(290px, 400px);
    column-gap: clamp(36px, 5vw, 80px);
    align-items: center;
    align-content: center;
    justify-content: center;
  }

  .board { padding: 22px 28px 10px; border-width: 13px; }
  .board__head { font-size: 2.1rem; padding-bottom: 14px; }
  .board__list li { padding: 11px 0; font-size: 1.125rem; }
  .board__foot { padding-top: 12px; }

  .ticket { padding: 20px 28px 10px 34px; }
  .ticket::before { left: 16px; }
  .ticket h3 { font-size: 1.4rem; }
  .ticket h3 + p { margin-top: 8px; }

  .stop--end .stop__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 400px);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: center;
    align-content: center;
  }

  .contact p { margin-top: 18px; font-size: 1.125rem; }
  .contact__links { margin-top: 10px; }
  .contact__links a { font-size: clamp(1.3rem, 1.9vw, 1.7rem); min-height: 52px; }
  .bydoor { gap: 20px; }
}

/* =====================================================================
   3D: salen. Alt under gjelder bare når script.js har satt .is-3d.
   ===================================================================== */

html.is-3d body { background: var(--deep); }

.is-3d .walk {
  position: relative;
  height: calc(var(--step) * (var(--n) - 1) + 100vh);
  height: calc(var(--step) * (var(--n) - 1) + 100lvh);
}

.is-3d .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: var(--deep);
}

/* .world er øyet: nullpunktet står i øyehøyde midt i bildet, og perspektivet går ut herfra */
.is-3d .world {
  position: absolute;
  z-index: 0;
  left: var(--ox);
  top: var(--eye);
  width: 0;
  height: 0;
  perspective: var(--p);
  perspective-origin: 0 0;
}

/* litt mørkere ut mot kantene, som i en sal med lys fra taket */
.is-3d .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 78% at 50% 46%, rgba(4, 12, 9, 0) 60%, rgba(4, 12, 9, .34) 100%);
}

.is-3d .stop {
  position: absolute;
  z-index: 1;
  background: none;
  will-change: transform;
  transition: opacity .3s linear;
}
.is-3d .stop::after { display: none; }
.is-3d .stop.is-off { opacity: 0; pointer-events: none; }
.is-3d .stop:not(.is-here) { cursor: pointer; }

.is-3d .stop__inner {
  position: absolute;
  inset: 0;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 16px 16px var(--pad-b, 16px);
}

/* dekor: vegger, gulv, tak */
.pl {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.pl--wall, .pl--end { background: var(--wall-bg); }

.pl--pil {
  background:
    linear-gradient(to top, #0a1611 0, #0a1611 26px, #14291f 26px, #14291f 29px, rgba(0, 0, 0, .3) 29px, rgba(0, 0, 0, 0) 84px),
    linear-gradient(90deg, #214638, #1b3b2f);
}
.pl--pil-in {
  background:
    linear-gradient(to top, #0a1611 0, #0a1611 26px, rgba(0, 0, 0, 0) 26px),
    linear-gradient(90deg, #132b22, #183428);
}
.pl--soffit, .pl--pil, .pl--pil-in { z-index: 2; }
.pl--soffit { background: linear-gradient(180deg, #0f231c, #15302669), #122920; }

.pl--ceil {
  background-image:
    linear-gradient(180deg, rgba(84, 74, 52, .42) 0, rgba(84, 74, 52, .42) 2px, rgba(84, 74, 52, 0) 2px),
    linear-gradient(90deg, #8f8873 0%, #b3ab96 22%, #c3bba6 29.6%, #5f5947 30.4%, #5f5947 31%, #fff0cf 31.4%, #fffaec 50%, #fff0cf 68.6%, #5f5947 69%, #5f5947 69.6%, #c3bba6 70.4%, #b3ab96 78%, #8f8873 100%);
  background-repeat: repeat-y, no-repeat;
}

/* bjelken over inngangen bærer tittelen */
.is-3d .stop--beam {
  background:
    linear-gradient(to top, rgba(0, 0, 0, .42) 0, rgba(0, 0, 0, 0) 16px),
    linear-gradient(to bottom, #d9d1bd 0, #d9d1bd 7px, #0e1f19 7px, #0e1f19 9px, rgba(255, 240, 200, .1) 9px, rgba(255, 240, 200, 0) 60%),
    radial-gradient(ellipse 46% 120% at 50% 40%, #2b5745, #214537 70%, #1c3c30);
  z-index: 3;
  cursor: default;
}

.is-3d .stop--beam .stop__inner {
  right: auto;
  left: 50%;
  width: var(--vw-in);
  margin-left: calc(var(--vw-in) / -2);
  padding: 12px 16px 6px;
}

.is-3d .stop--work .stop__inner { padding-top: 14px; }
.is-3d .work { min-height: 130px; }

.is-3d .stop--artist .stop__inner { justify-content: center; }

/* trange skjermer: samme innhold, mindre luft */
@media (max-width: 859px) {
  .is-tight.is-3d .stop__inner { padding-top: 10px; }
  .is-tight.is-3d .stop--work .stop__inner { gap: 10px; }
  .is-tight.is-3d .work { margin-top: 22px; min-height: 104px; }
  .is-tight.is-3d .label { padding: 10px 14px 2px; line-height: 1.36; }
  .is-tight.is-3d .label__kat { top: 12px; right: 14px; }
  .is-tight.is-3d .label--small { padding-bottom: 10px; }
  .is-tight.is-3d .stop--artist .stop__inner { gap: 12px; }
  .is-tight.is-3d .portrait .frame { height: 150px; }
  .is-tight.is-3d .walltext p { line-height: 1.42; margin-top: 8px; }
  .is-tight.is-3d .stop--creed .stop__inner { gap: 12px; }
  .is-tight.is-3d .creed { gap: 10px; }
  .is-tight.is-3d .creed li { padding-top: 8px; }
  .is-tight.is-3d .stop--shop .stop__inner,
  .is-tight.is-3d .stop--end .stop__inner { gap: 10px; }
  .is-tight.is-3d .board { padding: 8px 12px 0; border-width: 7px; }
  .is-tight.is-3d .board__head { padding-bottom: 4px; font-size: 1.35rem; }
  .is-tight.is-3d .board__list li { padding: 2px 0; }
  .is-tight.is-3d .board__foot { padding-top: 6px; line-height: 1.35; }
  .is-tight.is-3d .ticket { padding: 8px 14px 0 22px; }
  .is-tight.is-3d .ticket::before { left: 10px; }
  .is-tight.is-3d .ticket__tag { display: none; }
  .is-tight.is-3d .contact p { margin-top: 4px; }
  .is-tight.is-3d .bydoor { gap: 10px; }
  .is-tight.is-3d .label--colophon .label__links { gap: 0 14px; }
  .is-tight.is-3d .sign { padding: 8px 10px; }
  .is-tight.is-3d .sign--dogs svg { display: none; }
}

@media (min-width: 860px) {
  .is-3d .stop__inner {
    left: 50%;
    right: auto;
    width: min(1340px, 100% - 96px);
    transform: translateX(-50%);
    padding: 0;
  }
  .is-3d .stop--beam .stop__inner { transform: none; padding: 10px 24px 0; }
  .is-3d .stop--work .stop__inner { padding-top: 0; }
  .is-3d .stop--end .stop__inner { width: min(1120px, 100% - 120px); }
}

/* ---------- 3D: topplinje ---------- */

.is-3d .bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  padding: 2px 6px;
  background: none;
  pointer-events: none;
}
.is-3d .mark, .is-3d .back {
  pointer-events: auto;
  background: rgba(11, 24, 19, .88);
  box-shadow: 0 0 0 1px rgba(243, 236, 220, .16);
}
.is-3d .mark { padding: 4px 13px 0; align-items: center; }
.is-3d .mark__dot { align-self: center; margin-top: .42em; }

/* ---------- 3D: plan med prikk ---------- */

.is-3d .plan {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 0;
  background: none;
}

.plan__step, .plan__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  font: 500 .9375rem/1 var(--sans);
  color: var(--vinyl);
  background: rgba(11, 24, 19, .9);
  box-shadow: 0 0 0 1px rgba(243, 236, 220, .18);
  cursor: pointer;
}
.plan__step:disabled { color: rgba(243, 236, 220, .3); cursor: default; }
.plan__step:not(:disabled):hover, .plan__toggle:hover { background: #12271f; }

.plan__toggle {
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  min-width: 0;
}

.plan__now { flex: 1 1 auto; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan__open { flex: 0 0 auto; color: var(--gilt-hi); text-decoration: underline; text-underline-offset: 3px; }

.plan__mini { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.plan__mini i { width: 5px; height: 5px; border-radius: 50%; background: rgba(243, 236, 220, .32); }
.plan__mini i.is-now { background: var(--dot); box-shadow: 0 0 0 2px rgba(213, 81, 43, .3); }

.is-3d .plan__list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 6px;
  background: rgba(11, 24, 19, .97);
  box-shadow: 0 0 0 1px rgba(243, 236, 220, .18), 0 -18px 40px rgba(0, 0, 0, .5);
}
.is-3d .plan.is-open .plan__list { display: flex; }

.is-3d .plan__list a {
  display: flex;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 1rem;
  color: var(--vinyl);
}
.is-3d .plan__list a[aria-current] { background: rgba(243, 236, 220, .1); }
.is-3d .plan__list a[aria-current] .plan__no { color: #ff8a66; }
.is-3d .plan__no { min-width: 1.4em; text-align: right; }

.hint {
  position: fixed;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  z-index: 29;
  transform: translateX(-50%);
  padding: 8px 14px 8px 34px;
  font: 500 .9375rem/1.2 var(--sans);
  white-space: nowrap;
  color: var(--vinyl);
  background: rgba(11, 24, 19, .88);
  box-shadow: 0 0 0 1px rgba(243, 236, 220, .16);
  transition: opacity .4s;
}
.hint::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -7px;
  border-right: 2px solid var(--gilt-hi);
  border-bottom: 2px solid var(--gilt-hi);
  transform: rotate(45deg);
}
.hint.is-gone { opacity: 0; pointer-events: none; }

@media (min-width: 860px) {
  .is-3d .bar { padding: 5px 14px; }

  .is-3d .plan {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    align-items: center;
    gap: 0;
    background: rgba(11, 24, 19, .9);
    box-shadow: 0 0 0 1px rgba(243, 236, 220, .18);
  }

  .plan__toggle { display: none; }
  .plan__step { background: none; box-shadow: none; }

  /* plantegning: salen sett ovenfra, verkene som streker på veggene */
  .is-3d .plan__list {
    display: flex;
    position: relative;
    inset: auto;
    flex-direction: row;
    padding: 0;
    background: none;
    box-shadow: inset 0 0 0 1px rgba(243, 236, 220, .34);
  }

  .is-3d .plan__list li { position: relative; }

  .is-3d .plan__list a {
    position: relative;
    justify-content: center;
    width: 50px;
    height: 44px;
    padding: 0;
    font-size: .875rem;
    color: var(--vinyl-soft);
    text-decoration: none;
  }
  .is-3d .plan__list a[aria-current] { background: none; color: var(--vinyl); }
  .is-3d .plan__no { min-width: 0; color: inherit; }
  .is-3d .plan__list a[aria-current] .plan__no { color: #fff; }

  /* verket på veggen */
  .is-3d .plan__list a::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 18px;
    height: 3px;
    margin-left: -9px;
    background: var(--gilt);
  }
  .is-3d .plan__list li:nth-child(even) a::before { top: 1px; }
  .is-3d .plan__list li:nth-child(odd) a::before { bottom: 1px; }
  .is-3d .plan__list li:first-child a::before { top: 8px; bottom: 8px; left: 1px; width: 3px; height: auto; margin: 0; }
  .is-3d .plan__list li:last-child a::before { top: 8px; bottom: 8px; left: auto; right: 1px; width: 3px; height: auto; margin: 0; }

  /* du er her */
  .is-3d .plan__list a[aria-current]::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 0 3px rgba(213, 81, 43, .28);
  }
  .is-3d .plan__list li:nth-child(even) a[aria-current]::after { bottom: 5px; }
  .is-3d .plan__list li:nth-child(odd) a[aria-current]::after { top: 5px; }

  .is-3d .plan__name {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 6px 10px;
    white-space: nowrap;
    font-size: .875rem;
    color: var(--vinyl);
    background: rgba(11, 24, 19, .94);
    box-shadow: 0 0 0 1px rgba(243, 236, 220, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
  }
  .is-3d .plan__list a[aria-current] .plan__name,
  .is-3d .plan__list a:hover .plan__name,
  .is-3d .plan__list a:focus-visible .plan__name { opacity: 1; z-index: 2; }
  .is-3d .plan__list li:first-child a[aria-current]:not(:hover):not(:focus-visible) .plan__name,
  .is-3d .plan__list:hover a[aria-current]:not(:hover) .plan__name,
  .is-3d .plan__list:focus-within a[aria-current]:not(:focus-visible) .plan__name { opacity: 0; }

  .hint { bottom: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-3d .stop, .hint, .is-3d .plan__name { transition: none; }
}
