:root {
  --ink: #241f1c;
  --muted: #5e5852;
  --paper: #f6f3ee;
  --wash: #faf5ef;
  --face: #7f3c24;
  --line: #7f3c24;
  /* Text and icons that sit on the hexagon. */
  --on-face: #fbf6ee;
  --sans: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* How far the hex centre sits past the left edge, as a share of its width. */
  --hex-shift: 0.27;
  /* At that shift the screen edge cuts the hex at (1 - shift) of its height,
     so this height makes the cut exactly fill the screen. */
  --hex-h: calc(100vh / (1 - var(--hex-shift)));
  /* Width of a regular pointy-top hex. The drawing fills this box. */
  --hex-w: calc(var(--hex-h) * 0.8660254);
  /* How much of the right-hand echo hex shows, as a share of its width. */
  --echo-peek: 0.09;
  /* Resting angle of the hex; phones turn it a quarter so a flat edge faces up. */
  --hex-base: 0deg;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 5;
  padding: 0.35rem 0.55rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.stage {
  position: relative;
  min-height: 100vh;
  background: var(--wash);
}

.hex-slot {
  position: fixed;
  z-index: 3;
  left: calc(var(--hex-w) * var(--hex-shift) * -1);
  top: 50%;
  width: var(--hex-w);
  height: var(--hex-h);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hex-echo {
  position: fixed;
  z-index: 3;
  left: calc(100% - var(--hex-w) * var(--echo-peek));
  top: 50%;
  width: var(--hex-w);
  height: var(--hex-h);
  transform: translateY(-50%);
  pointer-events: none;
}

.hex-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hex {
  /* The pivot is the hex centre in viewBox units; view-box percentages measure from 0,0, not from the viewBox's min-x. */
  transform-box: view-box;
  transform-origin: 100px 100px;
  will-change: transform;
}

.hex-outline {
  fill: var(--face);
  stroke: color-mix(in oklch, var(--face) 70%, black);
  stroke-width: 0.28vh;
  vector-effect: non-scaling-stroke;
}

.nav {
  position: absolute;
  z-index: 1;
  left: calc((0.52 + var(--hex-shift)) * 100%);
  top: 27%;
  width: calc((0.475 - var(--hex-shift)) * 100%);
  height: 46%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 0;
  pointer-events: auto;
  background: transparent;
  border: none;
}

.turn {
  display: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: stretch;
  width: 100%;
  max-height: 100%;
  overflow: auto;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-item a {
  color: var(--on-face);
  font-size: clamp(0.72rem, 1.65vh, 0.98rem);
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
}

.nav-item a.is-current {
  border-bottom: 2px solid var(--on-face);
}

.open-tab {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  color: var(--on-face);
}

.open-tab svg {
  width: 0.95rem;
  height: 0.95rem;
}

.panel {
  padding: 1.5rem 8vw 4rem calc(var(--hex-w) * (0.5 - var(--hex-shift)) + 2.5rem);
}

.slide {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(16rem, 0.9fr);
  gap: 2rem 2.5rem;
  align-items: center;
}

.frame {
  position: relative;
  display: grid;
  min-height: 16rem;
  aspect-ratio: 4 / 3;
  place-items: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--face) 45%, white);
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 12%;
}

.frame img.shot {
  object-position: center 28%;
}

.frame-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.visit {
  display: inline-block;
  margin-top: 1.35rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.visit:hover {
  background: var(--ink);
  color: var(--paper);
}

.copy h1,
.copy h2 {
  margin: 0 0 0.75rem;
  color: var(--face);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
}

.tagline {
  margin: 0;
  font-size: 1.2rem;
  font-style: italic;
}

.contact-line {
  margin-top: 0.85rem;
}

.copy p {
  max-width: 34rem;
  margin: 0.35rem 0 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.hex-slot :focus-visible {
  outline-color: var(--on-face);
}

/* The dial takes over wheel, touch, and keys, so the page itself never scrolls. */
.is-dial,
.is-dial body {
  overflow: hidden;
  overscroll-behavior: none;
}

.is-dial .stage {
  position: fixed;
  inset: 0;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
}

.is-dial .panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Equal top and bottom padding keeps the image centred on the hex axis. */
  padding: 7vh calc(var(--hex-w) * var(--echo-peek) + 2.5rem) 7vh
    calc(var(--hex-w) * (0.5 - var(--hex-shift)) + 2.5rem);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: rotate(var(--panel-turn, 0deg));
  transform-origin: calc(var(--hex-w) * var(--hex-shift) * -1) 50%;
  will-change: transform, opacity;
}

/* Even sections belong to the right hex: they pivot on its centre, turn the
   opposite way, and mirror the slide so the image sits beside that hex. */
.is-dial .panel:nth-of-type(even) {
  transform: rotate(calc(var(--panel-turn, 0deg) * -1));
  transform-origin: calc(100% + var(--hex-w) * (0.5 - var(--echo-peek))) 50%;
}

.is-dial .panel:nth-of-type(even) .slide {
  grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.05fr);
}

.is-dial .panel:nth-of-type(even) .slide > :first-child {
  order: 2;
}

.is-dial .panel:nth-of-type(even) .copy {
  justify-self: end;
  text-align: right;
}

.is-dial .panel:nth-of-type(even) .copy p {
  margin-left: auto;
}

.is-dial .panel:nth-of-type(even) .frame {
  clip-path: polygon(0 0, 86% 0, 100% 14%, 100% 100%, 14% 100%, 0 86%);
}

.is-dial .panel.is-active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Phones: the hex is turned a quarter so a flat edge faces up, and sits
   below the screen so only a band shows along the bottom. */
@media (max-width: 800px) {
  :root {
    --band: min(36vw, 27svh);
    /* Circumradius at which the screen's bottom edge cuts the hex across exactly the full width. */
    --hex-r: calc(100vw - var(--band) * 1.1547005);
    --hex-h: calc(var(--hex-r) * 2);
    --hex-w: calc(var(--hex-h) * 0.8660254);
    /* How far the centre sits below the screen. */
    --hex-drop: calc(var(--hex-w) / 2 - var(--band));
    --hex-base: 90deg;
  }

  .hex-echo {
    display: none;
  }

  .hex-slot {
    top: auto;
    left: 50%;
    bottom: calc(var(--hex-drop) * -1);
    transform: translate(-50%, 50%);
  }

  /* The band's top edge in the slot's own box, which is not turned. */
  .nav {
    top: calc((var(--hex-h) - var(--hex-w)) / 2 + 0.6rem);
    left: 50%;
    width: var(--hex-r);
    height: calc(var(--band) - 1.2rem);
    transform: translateX(-50%);
  }

  /* The block padding leaves room for the current item's underline, which otherwise triggers a scrollbar. */
  .nav-list {
    align-items: center;
    gap: 0.7rem;
    padding-block: 0.2rem;
  }

  .nav-item a {
    font-size: 1rem;
  }

  .nav-item {
    position: relative;
    max-width: 100%;
  }

  /* Out of the flow so the name itself sits on the centre line. */
  .nav-item .open-tab {
    position: absolute;
    left: 100%;
  }

  .copy h1,
  .copy h2 {
    text-align: center;
  }

  .copy .visit {
    display: block;
    width: fit-content;
    margin-inline: auto;
  }

  .turn {
    position: absolute;
    top: calc((var(--hex-h) - var(--hex-w)) / 2 + var(--band) / 2);
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--on-face);
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    pointer-events: auto;
    transform: translateY(-50%);
  }

  .turn-prev {
    left: calc(50% - var(--hex-r) / 2 - 1.75rem);
  }

  .turn-next {
    left: calc(50% + var(--hex-r) / 2 - 0.25rem);
  }

  .panel,
  .is-dial .panel {
    padding: 1.25rem 1.25rem calc(var(--band) + 1.25rem);
  }

  /* Swipes go sideways between sections; up and down scrolls within one. */
  .is-dial .panel,
  .is-dial .panel:nth-of-type(even) {
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    transform: rotate(var(--panel-turn, 0deg));
    transform-origin: 50% calc(100% + var(--hex-drop));
  }

  /* Auto margins centre the slide but fall to zero when it overflows, so the top stays reachable. */
  .is-dial .slide {
    margin-block: auto;
  }

  .slide,
  .is-dial .panel:nth-of-type(even) .slide {
    grid-template-columns: 1fr;
  }

  .is-dial .panel:nth-of-type(even) .slide > :first-child {
    order: 0;
  }

  .is-dial .panel:nth-of-type(even) .copy {
    justify-self: stretch;
    text-align: left;
  }

  /* The height cap used to shrink the frame and leave the spare width on the right. */
  .frame-link,
  .slide > .frame {
    width: min(100%, calc(32svh * 4 / 3));
    justify-self: center;
  }

  .frame {
    min-height: 10rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .is-dial .stage,
  .is-dial .nav {
    transition: background-color 220ms linear;
  }
}

