/* Moonfest — moonfest.emergestudio.ch
   A festival programme printed in two colours, laid on the night square. */

@font-face { font-family: "Moonfest Display"; src: url("fonts/fraunces-soft-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night: #0E1232;
  --night-2: #1B2152;
  --night-3: #262D66;
  --paper: #F7F1E6;
  --paper-2: #EFE6D6;
  --rule: #DCCFB9;
  --ink: #221D38;
  --ink-2: #4A4466;
  --muted: #6A6484;
  --red: #C8303C;
  --red-deep: #A8252F;
  --gold: #F2AE2E;
  --moon: #FFD98A;
  --cream: #F7F0E3;
  --sheet: 1040px;
  --display: "Moonfest Display", "Iowan Old Style", Georgia, serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #0E1232; scrollbar-color: var(--night-3) var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--night-2) 0, var(--night) 760px) var(--night);
  color: var(--ink);
  font: 500 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--red-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red-deep); outline-offset: 3px; border-radius: 6px; }
.plate :focus-visible, .close :focus-visible { outline-color: var(--gold); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 6px; font-weight: 700; z-index: 10; }
.skip:focus { top: 12px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- night margins */
.square { position: relative; padding: 40px 16px 72px; overflow-x: clip; }
.margins { position: absolute; inset: 0; pointer-events: none; }
.rig { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.hang { position: absolute; top: 0; transform-origin: 50% 0; animation: sway 7s ease-in-out infinite alternate; }
.hang::before { content: ""; display: block; width: 2px; margin: 0 auto; height: var(--len); background: linear-gradient(#FFD98A00, #FFD98A99 30%, #FFD98A33); }
.hang img { width: var(--w, 112px); margin-top: -6px; }
.hang:nth-child(2n) { animation-duration: 8.5s; animation-delay: -3s; }
.hang:nth-child(3n) { animation-duration: 6.2s; animation-delay: -1.5s; }
@keyframes sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.garland { display: none; }

@media (max-width: 1239px) {
  .margins { display: none; }
  .square { padding-top: 0; }
  .garland { display: flex; justify-content: space-between; align-items: flex-start; max-width: var(--sheet); margin: 0 auto; padding: 0 6%; height: 96px; position: relative; }
  .garland::before { content: ""; position: absolute; left: -16px; right: -16px; top: 18px; height: 40px; border-top: 2px solid #FFD98A66; border-radius: 50% / 100% 100% 0 0; transform: scaleY(-1); transform-origin: top; }
  .garland .hang { position: relative; }
  .garland .hang img { --w: clamp(48px, 11vw, 76px); width: var(--w); }
}

/* ---------------------------------------------------------------- the sheet */
.sheet {
  position: relative;
  max-width: var(--sheet);
  margin: 0 auto;
  background: var(--paper);
  border-radius: 6px;
  padding: 44px 64px 64px;
  box-shadow: 0 30px 80px -20px #04061A, 0 2px 0 #00000014;
}
.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid var(--ink); }
.masthead a.home { display: block; line-height: 0; border-radius: 6px; }
.masthead img { height: clamp(40px, 6vw, 58px); width: auto; }
.edition { text-align: right; font-weight: 700; font-size: .74rem; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.edition a { color: inherit; text-decoration: none; }
.edition a:hover { color: var(--red); }
.double { border-top: 1px solid var(--ink); margin-top: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.1rem); line-height: 1.03; letter-spacing: -.012em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.08; letter-spacing: -.01em; }
h3 { font-size: 1.35rem; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: var(--ink-2); max-width: 34em; }

/* ---------------------------------------------------------------- opening */
.opening {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "head tickets" "order tickets" "order shot";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 5vw, 64px);
  padding-top: clamp(26px, 3.4vw, 40px);
}
.opening .head { grid-area: head; }
.opening .head .lede { margin: 16px 0 26px; }
.order { grid-area: order; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); counter-reset: item; }
.order li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.order .no { font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--red); }
.order strong { display: block; font-weight: 700; font-size: 1.08rem; line-height: 1.35; }
.order span.d { color: var(--muted); font-size: .95rem; }
.order em { font-style: normal; font-weight: 700; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.box { grid-area: tickets; display: flex; flex-direction: column; gap: 16px; }
.shot { grid-area: shot; margin: 22px 0 0; align-self: start; }
.shot img { width: 100%; aspect-ratio: 300 / 430; object-fit: cover; object-position: top; border-radius: 20px; background: var(--night-2); }
.fine { font-size: .84rem; line-height: 1.45; color: var(--muted); }

/* ---------------------------------------------------------------- tickets (the primary action) */
.ticket {
  --stub: 66px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  min-height: 98px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 10px;
  text-decoration: none;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .5s cubic-bezier(.16, 1, .3, 1);
  box-shadow: 0 2px 0 #0000001a;
}
.ticket::before, .ticket::after { content: ""; position: absolute; right: calc(var(--stub) - 9px); width: 18px; height: 18px; border-radius: 50%; background: var(--paper); z-index: 2; }
.ticket::before { top: -9px; }
.ticket::after { bottom: -9px; }
.ticket .main { padding: 16px 18px 15px 20px; display: flex; flex-direction: column; justify-content: center; }
.ticket small { font-weight: 700; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--moon); }
.ticket b { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1.1; margin-top: 3px; }
.ticket .stub {
  display: grid; place-items: center; white-space: nowrap;
  border-left: 2px dashed #F7F0E355;
  background: var(--ink);
  border-radius: 0 10px 10px 0;
  font-weight: 700; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  writing-mode: vertical-rl;
  transform-origin: 0 0;
  transition: transform .55s cubic-bezier(.16, 1, .3, 1), background .3s;
}
a.ticket:hover, a.ticket:focus-visible { color: var(--cream); transform: translateY(-2px); box-shadow: 0 14px 26px -12px #221D3880; }
a.ticket:hover .stub, a.ticket:focus-visible .stub { transform: translateX(7px) rotate(5deg); background: var(--red-deep); color: var(--cream); }
a.ticket:active { transform: translateY(0); }
/* A store that is not open yet: same ticket, not printed in ink, not a link. */
.ticket.soon { background: transparent; color: var(--ink); box-shadow: none; outline: 2px dashed #221D3866; outline-offset: -2px; }
.ticket.soon small { color: var(--muted); }
.ticket.soon .stub { background: transparent; color: var(--muted); border-left-color: #221D3840; }

/* ---------------------------------------------------------------- sections of the programme */
.act { padding-top: clamp(26px, 3.4vw, 40px); }
.fleuron { display: flex; align-items: center; gap: 16px; margin-top: clamp(44px, 6vw, 72px); color: var(--red); }
.fleuron::before, .fleuron::after { content: ""; flex: 1; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); height: 3px; }
.fleuron svg { width: 22px; height: 22px; flex: none; }
.act > header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(20px, 4vw, 56px); align-items: end; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.act > header p { color: var(--ink-2); max-width: 34em; }
.act > header + .double { margin-bottom: 28px; }

/* scenes: the real screens, as a strip */
.scenes { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 42px) / 3.2); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-color: var(--rule) transparent; }
.scenes figure { margin: 0; scroll-snap-align: start; }
.scenes img { border-radius: 14px; aspect-ratio: 660 / 1434; width: 100%; background: var(--night-2); }

/* house rules */
.rules { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: clamp(28px, 5vw, 64px); }
.rules li { break-inside: avoid; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px 0 14px; border-bottom: 1px solid var(--rule); }
.rules svg { width: 22px; height: 22px; margin-top: 3px; color: var(--red); }
.rules strong { font-weight: 700; }

/* every eye: the twelve lanterns on a night plate */
.plate { background: var(--ink); padding: 36px; color: var(--cream); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink); margin: 5px; }
.plate .bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.plate .bar p { color: #CFCBE6; max-width: 36em; font-size: .95rem; }
.switch { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 50px; height: 30px; border-radius: 15px; background: var(--night-3); box-shadow: inset 0 0 0 1.5px #CFCBE655; position: relative; transition: background .3s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 3px; }
.colours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 10px; }
.colours li { text-align: center; font-size: .84rem; line-height: 1.3; color: #CFCBE6; }
.colours li b { display: block; color: var(--cream); font-weight: 700; font-size: .95rem; }
.colours .pair { display: block; position: relative; aspect-ratio: 164 / 123; margin: 0 auto 8px; max-width: 120px; }
.colours .pair img { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateY(16%); transition: opacity .35s; }
/* The lantern images sit at the top of their box (cap first, for the hanging strings); centred here. */
.colours .sym { opacity: 0; }
.eye:has(#symbols:checked) .colours .sym { opacity: 1; }
.eye:has(#symbols:checked) .colours .plain { opacity: 0; }

/* themes */
.themes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-color: var(--rule) transparent; }
.themes figure { margin: 0; scroll-snap-align: start; }
.themes img { border-radius: 10px; aspect-ratio: 556 / 785; width: 100%; object-fit: cover; object-position: top; background: var(--night-2); }
.themes figcaption { font-family: var(--display); font-size: 1.12rem; margin-top: 10px; line-height: 1.2; }

/* programme notes */
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(28px, 5vw, 64px); margin: 0; }
.notes div { padding: 13px 0 15px; border-bottom: 1px solid var(--rule); }
.notes dt { font-weight: 700; }
.notes dd { margin: 2px 0 0; color: var(--ink-2); }

/* box office */
.office { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.office .write { font-family: var(--display); font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.2; overflow-wrap: anywhere; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 14px 34px 14px 0; font-weight: 700; position: relative; border-radius: 6px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--red); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); max-width: 38em; }

/* the close */
.close { margin: clamp(56px, 8vw, 96px) 5px 5px; background: var(--ink); color: var(--cream); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink); padding: 44px; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 300px); gap: clamp(20px, 4vw, 48px); align-items: center; }
.close img.mark { width: clamp(84px, 11vw, 132px); }
.close h2 { color: var(--cream); }
.close p { color: #CFCBE6; margin-top: 8px; }
.close .box { grid-area: auto; gap: 14px; }
.close .ticket { background: var(--paper); color: var(--ink); }
.close .ticket::before, .close .ticket::after { background: var(--ink); }
.close .ticket small { color: var(--red-deep); }
.close .ticket .stub { background: var(--paper); color: var(--red-deep); border-left-color: #221D3840; }
.close a.ticket:hover, .close a.ticket:focus-visible { color: var(--ink); }
.close a.ticket:hover .stub, .close a.ticket:focus-visible .stub { background: var(--gold); color: var(--ink); }
.close .ticket.soon { background: transparent; color: var(--cream); outline-color: #F7F0E366; }
.close .ticket.soon small { color: #CFCBE6; }
.close .ticket.soon .stub { background: transparent; color: #CFCBE6; border-left-color: #F7F0E340; }

/* colophon */
.colophon { margin-top: clamp(40px, 6vw, 64px); padding-top: 16px; border-top: 3px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; font-size: .95rem; color: var(--muted); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.colophon a { color: var(--ink-2); }

/* ---------------------------------------------------------------- notices (privacy, data) */
.notice { max-width: 46em; padding-top: clamp(26px, 3.4vw, 40px); }
.notice h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.notice .dated { color: var(--muted); margin-top: 10px; }
.notice h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin: 40px 0 10px; }
.notice p, .notice li { color: var(--ink-2); }
.notice p + p { margin-top: 12px; }
.notice ul, .notice ol { padding-left: 1.2em; margin: 10px 0 0; }
.notice li { margin-bottom: 8px; }
.notice li::marker { color: var(--red); }
.notice strong { color: var(--ink); }
.short { margin-top: 26px; padding: 20px 22px; background: var(--paper-2); border-top: 3px solid var(--ink); }
.short p { color: var(--ink); }
.table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); }
.table th { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.table td:first-child { font-weight: 700; color: var(--ink); width: 26%; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1100px) {
  .sheet { padding: 36px 44px 52px; }
}
@media (max-width: 860px) {
  .sheet { padding: 28px 28px 40px; }
  .plate { padding: 26px; }
  .close { padding: 30px; }
  .opening { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "tickets" "order" "shot"; grid-template-rows: none; }
  .box { margin-bottom: 28px; }
  .shot { max-width: 340px; margin: 28px auto 0; }
  .act > header { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; }
  .scenes { grid-auto-columns: 42%; }
  .themes { grid-auto-columns: 40%; }
  .colours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .notes, .office { grid-template-columns: minmax(0, 1fr); }
  .close { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .close .box { max-width: 360px; }
}
@media (max-width: 520px) {
  .square { padding-left: 10px; padding-right: 10px; }
  .sheet { padding: 20px 18px 32px; }
  .plate { padding: 20px 16px; }
  .close { padding: 24px 20px; }
  .edition { font-size: .74rem; letter-spacing: .08em; }
  .edition br, .edition .ed2 { display: none; }
  .order li { grid-template-columns: 38px minmax(0, 1fr); }
  .order em { display: none; }
  .colours { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scenes { grid-auto-columns: 62%; }
  .themes { grid-auto-columns: 56%; }
  .table td:first-child { width: auto; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr:first-child { display: none; }
  .table td { border: 0; padding: 4px 0; }
  .table tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
}

@media (prefers-reduced-motion: reduce) {
  .hang { animation: none; }
  .ticket, .ticket .stub, .switch .track::after, .colours .pair img, .faq summary::after { transition: none; }
  a.ticket:hover, a.ticket:focus-visible, a.ticket:hover .stub, a.ticket:focus-visible .stub { transform: none; }
}
@media print {
  body, html { background: none; }
  .margins, .garland, .close { display: none; }
  .sheet { box-shadow: none; max-width: none; }
}
.nw { white-space: nowrap; }
