:root {
  --paper: #f3f0e8;
  --ink: #0a6fa6;
  --brand: #008eca;
  --wash: #e9a23b;
  --ink-soft: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Instrument Serif", Georgia, serif;
  --band: #0a6fa6;
  --saffron: #f3bd5b;
  --band-top: 96px;
  --band-bottom: 150px;
  --fell: "IM Fell English", Georgia, serif;
  --fell-sc: "IM Fell English SC", Georgia, serif;
  --gutter: clamp(16px, 2.4vw, 36px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }
canvas#fort { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: grab; }
canvas#fort:active { cursor: grabbing; }
canvas#fort.is-venue { cursor: pointer; }

/* labels projected from the model */
.labels { position: fixed; inset: 0; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; transition: opacity .3s; }
.lbl--venue { --lift: 0px; font-family: var(--fell); font-style: italic; font-size: 15px; line-height: 1; color: var(--ink); padding-bottom: calc(20px + var(--lift)); }
.lbl--venue .txt { display: block; background: var(--paper); padding: 3px 7px 4px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.lbl--venue::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: calc(20px + var(--lift)); background: currentColor; opacity: .8; }
.lbl--venue .n { font-style: normal; font-family: var(--fell-sc); font-size: 12px; margin-right: 5px; opacity: .8; }
.lbl--venue.is-on { font-weight: 700; }
.lbl--venue.is-on .txt { background: color-mix(in srgb, var(--wash) 30%, var(--paper)); }
.lbl--venue.is-on::before { content: ""; position: absolute; left: 50%; bottom: -4px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--wash); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wash) 30%, transparent); }
.lbl--venue.is-focus { font-size: 19px; }
.lbl--bastion { font-family: var(--fell-sc); font-size: 11px; letter-spacing: .14em; color: var(--ink); }
.lbl--bastion .txt { display: block; padding: 1px 4px; background: color-mix(in srgb, var(--paper) 82%, transparent); }
.lbl.is-hidden { opacity: 0; }

/* masthead */
.mast { position: fixed; top: var(--gutter); left: var(--gutter); display: flex; align-items: center; gap: 18px; }
.rooster { display: block; width: 150px; aspect-ratio: 498 / 273; background: var(--ink); -webkit-mask: url(glf-logo.png) center / contain no-repeat; mask: url(glf-logo.png) center / contain no-repeat; transform-origin: 30% 80%; }
.rooster.crow { animation: crow 1.1s cubic-bezier(.3,.7,.2,1); }
@keyframes crow { 0% { transform: none; } 18% { transform: translateY(-5px) rotate(-3deg); } 36% { transform: translateY(0) rotate(1.5deg); } 52% { transform: translateY(-3px) rotate(-1.5deg); } 100% { transform: none; } }
.mast__dates { display: grid; gap: 4px; border-left: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); padding-left: 18px; }
.mast__when { font-family: var(--display); font-size: 27px; letter-spacing: .005em; }
.mast__where { font-family: var(--fell); font-style: italic; font-size: 15px; opacity: .85; }

/* clock */
.clock { position: fixed; right: var(--gutter); top: var(--gutter); text-align: right; margin: 0; pointer-events: none; }
.clock p { margin: 0; }
.clock__day { font-family: var(--fell-sc); font-size: 15px; letter-spacing: .12em; }
.clock__time { font-family: var(--display); font-size: clamp(44px, 6vw, 84px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; margin-top: 2px !important; }
.clock__phase { font-family: var(--fell); font-style: italic; font-size: .36em; vertical-align: .55em; margin-left: .15em; }
.clock__sun { font-family: var(--fell); font-style: italic; font-size: 14px; opacity: .8; margin-top: 6px !important; }

/* on now */
.onnow { position: fixed; right: var(--gutter); top: 190px; width: min(360px, 34vw); max-height: calc(100vh - 190px - 170px); overflow: auto; padding: 18px 20px 14px; background: color-mix(in srgb, var(--paper) 88%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); backdrop-filter: blur(3px); scrollbar-width: thin; }
.onnow__head { margin: 0 0 10px; font-family: var(--fell-sc); font-weight: 400; font-size: 14px; letter-spacing: .14em; }
.onnow__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.onnow__list li { display: grid; grid-template-columns: 76px 1fr; gap: 2px 12px; cursor: pointer; }
.onnow__list li:hover .t { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.onnow__list .h { grid-row: span 3; font-family: var(--fell); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.onnow__list .t { font-family: var(--serif); font-size: 19px; line-height: 1.18; }
.onnow__list .s { font-family: var(--fell); font-style: italic; font-size: 14px; opacity: .85; }
.onnow__list .v { font-family: var(--fell-sc); font-size: 12px; letter-spacing: .1em; opacity: .75; }
.onnow__note { margin: 12px 0 0; font-family: var(--fell); font-style: italic; font-size: 14px; opacity: .8; }
.onnow__note:empty { display: none; }

/* dial */
.dial { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + 18px); height: 96px; outline: none; touch-action: none; cursor: ew-resize; user-select: none; }
.dial:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.dial__track { position: absolute; inset: 0 60px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid currentColor; }
.day { position: relative; border-left: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); }
.day:first-child { border-left-color: currentColor; }
.day__name { position: absolute; left: 8px; top: 6px; font-family: var(--fell-sc); font-size: 13px; letter-spacing: .12em; }
.day svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.day .path { fill: none; stroke: currentColor; stroke-width: 1; opacity: .75; vector-effect: non-scaling-stroke; }
.day .area { fill: currentColor; opacity: .07; }
.day .tick { stroke: var(--wash); stroke-width: 2; vector-effect: non-scaling-stroke; }
.day .hr { stroke: currentColor; opacity: .35; vector-effect: non-scaling-stroke; }
.dial__head { position: absolute; top: -9px; bottom: -12px; width: 0; border-left: 1.5px solid currentColor; pointer-events: none; }
.dial__sun { position: absolute; top: -8px; left: -9px; width: 17px; height: 17px; border-radius: 50%; background: var(--wash); border: 1.5px solid currentColor; }
.dial__play { position: absolute; right: 0; top: 30px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid currentColor; background: transparent; color: inherit; font-family: var(--fell-sc); font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.dial__play[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.attrib { position: fixed; left: var(--gutter); bottom: 4px; margin: 0; font-family: var(--fell); font-style: italic; font-size: 12px; opacity: .7; }

/* the blue bands: header and footer in the festival's blue, everything on them in white */
.band { position: fixed; left: 0; right: 0; background: var(--band); pointer-events: none; }
.band--top { top: 0; height: var(--band-top); }
.band--bottom { bottom: 0; height: var(--band-bottom); }
.embed .band { display: none; }
html:not(.embed) .mast { top: 0; height: var(--band-top); color: #fff; }
html:not(.embed) .rooster { background: #fff; }
html:not(.embed) .mast__dates { border-left-color: rgb(255 255 255 / .4); }
html:not(.embed) .clock { top: 0; height: var(--band-top); display: grid; align-content: center; color: #fff; }
html:not(.embed) .clock__time { font-size: 58px; margin-top: 0 !important; }
html:not(.embed) .clock__sun { display: none; }
html:not(.embed) .onnow { top: calc(var(--band-top) + 22px); max-height: calc(100vh - var(--band-top) - var(--band-bottom) - 44px); }
html:not(.embed) .dial { color: #fff; bottom: 40px; }
html:not(.embed) .dial:focus-visible { box-shadow: 0 0 0 2px var(--band), 0 0 0 4px #fff; }
html:not(.embed) .day { border-left-color: rgb(255 255 255 / .35); }
html:not(.embed) .day:first-child { border-left-color: #fff; }
html:not(.embed) .day .tick { stroke: var(--saffron); }
html:not(.embed) .day .area { opacity: .12; }
html:not(.embed) .dial__sun { background: var(--saffron); border-color: #fff; }
html:not(.embed) .dial__play[aria-pressed="true"] { background: #fff; color: var(--band); }
html:not(.embed) .attrib { color: #fff; opacity: .78; bottom: 10px; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  :root { --band-top: 66px; --band-bottom: 124px; }
  html:not(.embed) .clock { top: calc(var(--band-top) + 10px); height: auto; color: var(--ink); }
  html:not(.embed) .clock__time { font-size: 38px; }
  html:not(.embed) .onnow { top: auto; bottom: calc(var(--band-bottom) + 12px); max-height: 26vh; }
  html:not(.embed) .dial { bottom: 30px; }
  .rooster { width: 92px; }
  .mast { top: 14px; gap: 12px; }
  .mast__dates { padding-left: 12px; }
  .mast__when { font-size: 16px; }
  .mast__where { font-size: 13px; }
  .clock { top: 76px; left: var(--gutter); right: auto; text-align: left; }
  .clock__day { font-size: 12px; }
  .clock__time { font-size: 34px; }
  .clock__sun { display: none; }
  .onnow { left: var(--gutter); right: var(--gutter); top: auto; bottom: 116px; width: auto; max-height: 27vh; padding: 12px 14px 10px; }
  .onnow__list { gap: 10px; }
  .onnow__list li { grid-template-columns: 52px 1fr; }
  .onnow__list .t { font-size: 15px; }
  .dial { height: 70px; bottom: 26px; }
  .dial__track { right: 54px; }
  .dial__play { top: 14px; width: 42px; height: 42px; }
  .day__name { font-size: 10px; left: 3px; letter-spacing: .06em; }
  .attrib { right: var(--gutter); font-size: 10px; bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lbl--venue { font-size: 13px; }
  .lbl--bastion { display: none; }
}

/* inside the mobile app: the app has the masthead */
.embed .mast { display: none; }
.embed .clock { top: 12px; bottom: auto; left: var(--gutter); right: auto; text-align: left; }
.embed .clock__sun { display: none; }
@media (max-width: 760px) {
  .embed .onnow { bottom: 112px; max-height: 30vh; }
}
