@font-face {
  font-family: "Cormorant Garamond"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond"; font-weight: 300; font-style: italic; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2");
}

:root {
  /* Colours follow nickygabris.com: deep green on warm cream. */
  --paper: #fefaf6;
  --ink: #25302b;
  --soft: #7c857f;
  --line: #e6e1d6;
  --accent: #284f3f;
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --edge: clamp(1.25rem, 6vw, 5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 300 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
p { margin: 0 0 1.1em; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0; color: var(--accent); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); text-transform: uppercase; letter-spacing: .16em; margin-bottom: 2.75rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.quiet { color: var(--soft); }

.top { padding: 1.75rem var(--edge); font: 400 .95rem var(--serif); text-transform: uppercase; letter-spacing: .16em; color: var(--accent); }
.top a { text-decoration: none; }

/* The stamp: full screen on arrival, then it settles into the header as you
   scroll (motion.js sets its size and position). */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mast { text-align: center; padding: 2.5rem var(--edge) 0; }
.brand { display: inline-block; position: relative; width: min(60vw, 16rem); aspect-ratio: 1; }
.brand img { position: absolute; inset: 0; width: 100%; height: 100%; }
.walker { position: absolute; inset: 0; }
.hero { display: none; }
.js .mast { position: fixed; inset: 0 0 auto 0; z-index: 4; height: 4.25rem; padding: 0; pointer-events: none;
  transition: background-color .3s; }
.js .mast.docked { background: var(--paper); }
/* The header line runs through the middle of the docked stamp, leaving a small gap either side of it. */
.js .mast::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; opacity: 0; transition: opacity .3s;
  background: linear-gradient(to right, var(--line) calc(50% - 72px), transparent calc(50% - 72px), transparent calc(50% + 72px), var(--line) calc(50% + 72px)); }
.js .mast.docked::after { opacity: 1; }
.js .brand { position: absolute; left: 50%; top: 0; transform-origin: 50% 0; pointer-events: auto; will-change: transform;
  background: var(--paper); border-radius: 50%; } /* the docked stamp hangs below the bar, over the page */
.js .hero { display: block; height: 100vh; height: 100svh; }
.js main > section, .js .foot { scroll-margin-top: 9.5rem; }

/* The four pages behind the menu share the header; their stamp is always docked. */
.sub main { padding-top: 6rem; }
.sub .about { padding-top: clamp(3rem, 7vw, 5rem) !important; }
.sub main > section:first-of-type { padding-top: clamp(3rem, 7vw, 5rem); }
.sub h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); text-transform: uppercase; letter-spacing: .16em; text-align: center; margin-bottom: 2.75rem; }
.facts { max-width: 40rem; margin: 0 auto; }
.gallery { max-width: 46rem !important; }
.gallery figure { margin-bottom: 4rem; }
.gallery figcaption { font-size: .95rem; }
.contact { text-align: center; }
.contact p { margin-left: auto; margin-right: auto; max-width: 34rem; }
.contact .big { font: 300 clamp(1.35rem, 2.5vw, 1.85rem)/1.45 var(--serif); }

/* The menu: a row of links without JavaScript. With it, three lines top right
   open a sheet of foggy glass down the right-hand side: clear at its left
   edge, solid at the right, no borders. */
.menu { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.75rem; margin-top: 1.5rem; }
.menu a { font: 400 1.05rem var(--serif); text-transform: uppercase; letter-spacing: .16em; color: var(--accent); text-decoration: none; padding: .55rem 0; }
.menu a:hover, .menu a[aria-current] { text-decoration: underline; }
.menu-btn { display: none; }
.js .menu-btn { display: block; position: absolute; z-index: 2; right: calc(var(--edge) - .5rem); top: .75rem; width: 2.75rem; height: 2.75rem;
  padding: .8rem .5rem; background: none; border: 0; cursor: pointer; pointer-events: auto; }
.menu-btn span { display: block; height: 1px; background: var(--accent); transition: transform .3s, opacity .3s; }
.menu-btn span + span { margin-top: .5rem; }
.mast.open .menu-btn span:nth-child(1) { transform: translateY(calc(.5rem + 1px)) rotate(45deg); }
.mast.open .menu-btn span:nth-child(2) { opacity: 0; }
.mast.open .menu-btn span:nth-child(3) { transform: translateY(calc(-.5rem - 1px)) rotate(-45deg); }
.js .menu { position: fixed; inset: 0 0 0 auto; z-index: 1; width: max-content; margin: 0; padding: 6.5rem var(--edge) 2rem clamp(3.75rem, 9vw, 6rem);
  flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-end; gap: .35rem; pointer-events: auto;
  background: linear-gradient(to right, rgb(254 250 246 / 0), rgb(254 250 246 / .5) 3rem, rgb(254 250 246 / .82) 60%, var(--paper));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3.5rem); mask-image: linear-gradient(to right, transparent, #000 3.5rem);
  transform: translateX(100%); visibility: hidden; transition: transform .55s cubic-bezier(.2, .7, .2, 1), visibility .55s; }
.js .mast.open .menu { transform: none; visibility: visible; }

/* The stegosaur walks in from the left, gives a little hop on its front legs,
   and the ring appears around it as it lands. While it moves, the still
   drawing is swapped for sheets of 24 drawn frames (6 across by 4 down) laid
   exactly over it: one loop of walking, then the hop. motion.js works out how
   many loops fit the distance (--n) and how long each takes (--loop), so the
   feet land where the ground is and do not slide. */
.steps, .hop { position: absolute; left: .673%; width: 87.948%; opacity: 0; background: 0 0 / 600% 400% no-repeat; }
.steps { top: 24.189%; height: 50.666%; background-image: url(/images/dino-walk.webp); }
.hop { top: 17.497%; height: 57.358%; background-image: url(/images/dino-hop.webp); }
.brand { --n: 4; --loop: 1.5s; --walk: calc(var(--n) * var(--loop)); --hop: 1.25s; --land: calc(var(--walk) + var(--hop) * .7); }
.brand.wait .walker, .brand.wait .ring { visibility: hidden; }
.brand.walk .walker { animation: walk-in var(--walk) linear both; }
.brand.walk .dino { animation: hide calc(var(--walk) + var(--hop)) linear; }
.brand.walk .steps { animation: frames-x calc(var(--loop) / 4) steps(6, jump-none) calc(var(--n) * 4), frames-y var(--loop) steps(4, jump-none) var(--n), show var(--walk) linear; }
.brand.walk .hop { animation: frames-x calc(var(--hop) / 4) steps(6, jump-none) var(--walk) 4, frames-y var(--hop) steps(4, jump-none) var(--walk) 1, show var(--hop) linear var(--walk); }
.brand.walk .ring { animation: ring-in .7s cubic-bezier(.2, 1.3, .4, 1) var(--land) both; }
@keyframes walk-in { from { transform: translateX(var(--from, -120vw)); } to { transform: none; } }
@keyframes frames-x { from { background-position-x: 0; } to { background-position-x: 100%; } }
@keyframes frames-y { from { background-position-y: 0; } to { background-position-y: 100%; } }
@keyframes ring-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes show { from, to { opacity: 1; } }
@keyframes hide { from, to { opacity: 0; } }

/* Things rise into place as their section comes into view. */
.js [data-reveal] .rise { opacity: 0; transform: translateY(4.5rem); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].in .rise { opacity: 1; transform: none; }
.js [data-reveal] .rise:nth-child(2) { transition-delay: .22s; }
.js [data-reveal] .rise:nth-child(3) { transition-delay: .44s; }
.js [data-reveal] .rise:nth-child(4) { transition-delay: .6s; }

main > section { padding: clamp(4rem, 10vw, 8rem) var(--edge); max-width: 74rem; margin: 0 auto; }

/* Three paintings in a line */
/* Bottom edges of the paintings share one line, whatever the caption length. */
.works { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto auto; column-gap: clamp(.6rem, 3vw, 2.75rem); }
figure { margin: 0; }
.works figure { display: grid; grid-template-rows: subgrid; grid-row: span 2; }
.works img { align-self: end; }
figcaption { margin-top: .9rem; font-size: .85rem; color: var(--soft); }
@media (max-width: 34rem) { figcaption { font-size: .7rem; margin-top: .5rem; } }

.about { text-align: center; padding-top: 0 !important; }
.intro { font: 300 clamp(1.35rem, 2.5vw, 1.85rem)/1.45 var(--serif); margin: 0 auto 1.5rem; max-width: 34em; }
.sign { font: italic 300 1.5rem var(--serif); color: var(--accent); margin: 0; }

/* Classes: one month at a time, days side by side */
.classes h2 { text-align: center; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-bottom: 2.5rem; }
.pager h3 { font: italic 300 1.6rem var(--serif); margin: 0; min-width: 11rem; text-align: center; }
.pager button { font: 300 2rem/1 var(--serif); width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--accent); cursor: pointer; }
.pager button[disabled] { color: var(--line); cursor: default; }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6.25rem, 1fr); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 1rem; border-top: 1px solid var(--line); }
.days > p { padding-top: 1.5rem; }
.day { scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 1.5rem .5rem .5rem; border-left: 1px solid var(--line); }
.day:first-child { border-left: 0; }
.day .dow { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); }
.day .num { font: 300 2.4rem/1 var(--serif); margin-bottom: .5rem; }
.days.turn-next { animation: turn-next .45s ease both; }
.days.turn-prev { animation: turn-prev .45s ease both; }
@keyframes turn-next { from { opacity: 0; transform: translateX(2.5rem); } to { opacity: 1; transform: none; } }
@keyframes turn-prev { from { opacity: 0; transform: translateX(-2.5rem); } to { opacity: 1; transform: none; } }
.slot {
  font: inherit; color: inherit; background: none; border: 0; padding: .1rem 0; cursor: pointer;
  border-bottom: 1px solid var(--ink);
}
.slot:hover { color: var(--accent); border-color: var(--accent); }
.slot[aria-pressed="true"] { color: var(--accent); border-bottom: 2px solid var(--accent); font-weight: 400; }
.slot[disabled] { color: var(--soft); border-color: transparent; text-decoration: line-through; cursor: default; }
.slot small { display: block; font-size: .75rem; color: var(--accent); }
.notice { border-left: 2px solid var(--accent); padding-left: 1rem; margin-bottom: 2.5rem; }

/* Nicky */
.nicky { display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
@media (min-width: 56rem) { .nicky { grid-template-columns: 1fr 1.1fr; } }
.nicky div { max-width: 30rem; }

.foot { padding: 4rem var(--edge) 9rem; max-width: 74rem; margin: 0 auto; font-size: .95rem; border-top: 1px solid var(--line); }
.foot p { max-width: 34rem; }
.foot p:last-child { margin-top: 2rem; color: var(--soft); }

/* Booking bar */
.bar {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
  padding: 1rem var(--edge) calc(1rem + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--accent);
}
.bar p { margin: 0; flex: 1 1 10rem; font: 300 1.35rem var(--serif); }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: none; color: inherit; font-size: 1.2rem; cursor: pointer; }
.stepper button:hover:not([disabled]) { border-color: var(--ink); }
.stepper button[disabled] { opacity: .35; cursor: default; }
.stepper output { min-width: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.btn {
  font: 400 1rem var(--sans); color: #fff; background: var(--accent);
  border: 0; padding: .85rem 1.75rem; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { background: #1b3a2d; color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Thanks and privacy */
.page { max-width: 38rem; margin: 0 auto; padding: clamp(3rem, 10vw, 7rem) var(--edge); }
.page h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 300; margin-bottom: 2rem; }
.page h2 { font-size: 1.05rem; margin: 2.75rem 0 .75rem; }
.ticket { margin: 2.5rem 0; display: grid; grid-template-columns: auto 1fr; gap: .9rem 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 0; }
.ticket dt { color: var(--soft); }
.ticket dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] .rise { opacity: 1; transform: none; transition: none; }
  .js .menu, .menu-btn span { transition: none; }
  .brand.walk .walker, .brand.walk .dino, .brand.walk .steps, .brand.walk .hop, .brand.walk .ring, .days.turn-next, .days.turn-prev { animation: none; }
}
