@font-face {
  font-family: Firgine;
  src: url("/assets/fonts/firgine.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url("assets/fonts/instrument.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url("assets/fonts/instrument-ext.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0100-02BA, U+0304, U+0308, U+0329, U+1E00-1E9F;
}

@font-face {
  font-family: Instrument Serif;
  src: url("assets/fonts/instrument-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #1c1718;
  --wine: #411514;
  --silver: #cbcfcd;
  --dark-rule: rgb(28 23 24 / .23);
  --site-font: "Firgine", "Instrument Serif", Georgia, serif;
  --gutter: clamp(24px, 5.2vw, 100px);
  --navbar-height: 69px;
  --badge-crop: .13;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--silver);
  color: var(--ink);
  font-family: var(--site-font);
}

button, a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

h1, h2, p, figure { margin: 0; }

.skip-link {
  background: var(--silver);
  color: var(--ink);
  inset: 12px auto auto 12px;
  padding: 12px 16px;
  position: fixed;
  transform: translateY(calc(-100% - 20px));
  z-index: 10;
}

.skip-link:focus { transform: none; }

.home-page { --showcase-inset: clamp(24px, 4.1vw, 84px); position: relative; }

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100svh;
  overflow: hidden;
}

.wheel-showcase, .selected-preview {
  min-height: 0;
  min-width: 0;
  position: relative;
}

.wheel-showcase {
  --wheel-width: min(200cqw, 193cqh, 1680px);
  --panel-width: calc(var(--wheel-width) * .28);
  --panel-height: calc(var(--panel-width) * 9 / 16);
  container-type: size;
  margin-top: var(--navbar-height);
}

.preview-photo {
  display: block;
  height: 100%;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.preview-photo .hero-picture { inset: 0; position: absolute; }

.hero-picture, .hero-picture img {
  display: block;
  height: 100%;
  width: 100%;
}

.hero-picture img { object-fit: cover; }

.wheel-caption {
  /* Allow for the perspective scale of the front cards when placing the caption. */
  font-family: var(--site-font);
  font-size: clamp(22px, 2.4vw, 35px);
  font-weight: 500;
  inset-inline: var(--showcase-inset) 8px;
  letter-spacing: -.035em;
  line-height: 1.1;
  position: absolute;
  top: min(calc(50% + var(--panel-height) * .59 + clamp(14px, 2.2vh, 24px)), calc(100% - 42px));
}

.preview-action {
  bottom: clamp(13px, 3.5svh, 38px);
  inset-inline-end: var(--gutter);
  position: absolute;
}

.project-cta {
  align-items: center;
  background-color: transparent;
  color: #fff;
  display: inline-flex;
  font: 400 14px var(--site-font);
  min-height: 41px;
  padding: 0 13px;
  text-shadow: 0 1px 3px #000, 0 0 9px rgb(0 0 0 / .75);
}

.project-cta:is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: .3em;
}

.render-frame {
  container-type: size;
  overflow: hidden;
  position: relative;
}

.render-frame > .render-image {
  /* The location badge is embedded near the top edge of the original render. */
  --visible-ratio: calc(var(--source-ratio, 1) / (1 - var(--badge-crop)));
  --fit-height: calc(100cqh * var(--visible-ratio));
  --view-width: max(100cqw, var(--fit-height));
  --source-height: calc(var(--view-width) / var(--source-ratio, 1));
  --crop-offset: calc(var(--source-height) * var(--badge-crop) / 2);
  clip-path: inset(calc(var(--badge-crop) * 100%) 0 0);
  display: block;
  height: var(--source-height);
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, calc(-50% - var(--crop-offset)));
  width: var(--view-width);
}

.wheel-stage {
  cursor: grab;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.wheel-stage.is-dragging { cursor: grabbing; }

.wheel-camera {
  --radius: calc(var(--wheel-width) * .33);
  height: 100%;
  left: 0;
  perspective: calc(var(--wheel-width) * 3.1);
  perspective-origin: center;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: var(--wheel-width);
}

.wheel-ring {
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  width: 100%;
}

.panel {
  height: var(--panel-height);
  left: calc(50% - var(--panel-width) / 2);
  position: absolute;
  top: calc(50% - var(--panel-height) / 2);
  transform: rotateY(var(--angle)) translateZ(var(--radius)) rotateY(-90deg);
  transform-style: preserve-3d;
  width: var(--panel-width);
}

.panel-face {
  backface-visibility: hidden;
  background: var(--silver);
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.panel-face:first-child { transform: translateZ(.35px); }
.panel-face:last-child { transform: rotateY(180deg) translateZ(.35px); }

.panel-face::after {
  background: var(--tile-image, url("/assets/hero/wheel.35e59340d054.webp")) var(--tile-position, center) / var(--tile-size, cover);
  content: "";
  filter: grayscale(1);
  inset: 0;
  opacity: .55;
  position: absolute;
}

.showcase--empty {
  align-content: center;
  display: grid;
  gap: 17px;
  grid-template: auto auto / 1fr;
  min-height: 65svh;
  padding: var(--navbar-height) var(--gutter);
}

.showcase--empty h1 { font: 400 clamp(46px, 6vw, 84px)/1 var(--site-font); }
.showcase--empty a { width: fit-content; }

.panel.is-active .panel-face::after {
  filter: none;
  opacity: 1;
}

.masthead {
  align-items: center;
  background-color: rgb(239 240 239 / var(--masthead-opacity, 0));
  color: var(--ink);
  display: flex;
  gap: clamp(18px, 2.4vw, 38px);
  height: var(--navbar-height);
  justify-content: flex-start;
  padding-inline: var(--gutter);
  position: sticky;
  top: 0;
  transition: background-color .18s ease-out;
  z-index: 5;
}

:is(.home-page, .case-page) .masthead {
  inset: 0 0 auto;
  position: fixed;
}

.home-page .masthead { padding-inline: var(--showcase-inset); }

.brand, .menu-toggle {
  align-items: center;
  display: inline-flex;
}

.brand { flex: none; }

.brand-logo {
  aspect-ratio: 480 / 172;
  display: block;
  height: auto;
  object-fit: cover;
  object-position: top;
  width: 123px;
}

.masthead > .brand { align-self: stretch; }
.masthead .brand-logo { transform: translateY(2px); }

.site-links {
  align-items: center;
  display: flex;
  font-family: var(--site-font);
  font-size: clamp(12px, 1.2vw, 17px);
  font-weight: 500;
  gap: clamp(18px, 2.6vw, 48px);
  letter-spacing: .025em;
}

.site-links a {
  align-items: center;
  display: inline-flex;
  min-height: 40px;
  white-space: nowrap;
}

.site-links a:hover {
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.menu-toggle {
  background: transparent;
  border: 0;
  display: none;
  font: 400 14px var(--site-font);
  gap: 9px;
  min-height: 40px;
  padding: 0;
}

.menu-icon {
  border-block: 1px solid currentColor;
  display: block;
  height: 9px;
  width: 18px;
}

.site-footer {
  background: var(--wine);
  color: #f5f2ec;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.35;
}

.footer-main, .footer-bottom {
  margin-inline: auto;
  max-inline-size: 1620px;
  padding-inline: var(--gutter);
}

.footer-main {
  display: grid;
  gap: 30px clamp(18px, 3.45vw, 60px);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) minmax(0, 1.2fr) minmax(0, .6fr);
  padding-block: clamp(37px, 5.7vw, 87px) clamp(30px, 4.8vw, 63px);
}

.footer-brand {
  display: inline-block;
  font-size: clamp(28px, 3.45vw, 50px);
  line-height: 1.1;
  margin-bottom: 9px;
}

.footer-enquiry { display: inline-block; margin-block-start: 16px; }
.footer-column { align-content: start; display: grid; gap: 8px; overflow-wrap: anywhere; }

.site-footer .footer-column h2 {
  color: #e4cfc5;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .02em;
  margin-block-end: 5px;
}

.site-footer address { font-style: normal; }
.site-footer a:hover {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: .16em;
}

.footer-bottom {
  align-items: center;
  border-block-start: 1px solid rgb(245 242 236 / .22);
  color: #e4cfc5;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 10px 24px;
  justify-content: space-between;
  padding-block: 15px;
}

.footer-bottom small { font-size: inherit; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

@media (max-width: 750px) {
  .footer-main {
    gap: 26px;
    grid-template-columns: minmax(0, 1fr);
    padding-block: 32px;
  }

  .footer-intro {
    border-block-end: 1px solid rgb(245 242 236 / .22);
    padding-block-end: 20px;
  }

  .footer-enquiry {
    align-items: center;
    display: inline-flex;
    margin-block-start: 8px;
    min-height: 40px;
    text-decoration: underline;
    text-underline-offset: .24em;
  }

  .footer-column { gap: 0 16px; }
  nav.footer-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer .footer-column h2 {
    grid-column: 1 / -1;
    margin-block-end: 6px;
  }

  .footer-column a, .footer-bottom nav a {
    align-content: center;
    display: grid;
    justify-self: start;
    min-height: 36px;
    padding-block: 4px;
  }

  .footer-column address { max-inline-size: 38ch; }

  .footer-bottom {
    align-items: start;
    display: grid;
    gap: 2px;
    justify-content: start;
    padding-block: 18px 22px;
  }

  .footer-bottom nav { gap: 0 18px; }
}

@media (max-width: 960px) {
  .home-page { --showcase-inset: var(--gutter); }
  .masthead { gap: 12px; }
  .menu-toggle { display: inline-flex; }
  .site-links {
    align-items: stretch;
    background: color-mix(in srgb, var(--silver) 45%, white);
    display: none;
    font-size: 14px;
    gap: 0;
    inset-inline: var(--gutter) auto;
    min-width: 208px;
    padding: 8px 14px;
    position: absolute;
    top: 100%;
  }
  .menu-toggle[aria-expanded="true"] + .site-links,
  html:not(.has-menu) .site-links { display: grid; }
  html:not(.has-menu) .menu-toggle { display: none; }
}

@media (max-width: 740px) {
  .home-page .masthead { justify-content: space-between; }
  .home-page .site-links { inset-inline: auto var(--showcase-inset); }

  .showcase:not(.showcase--empty) {
    grid-template: auto auto / minmax(0, 1fr);
    height: auto;
    padding-top: var(--navbar-height);
  }

  .selected-preview {
    grid-row: 1;
    height: clamp(240px, 49svh, 460px);
  }

  .preview-photo::after {
    background: linear-gradient(transparent, rgb(0 0 0 / .34));
    content: "";
    height: 90px;
    inset: auto 0 0;
    pointer-events: none;
    position: absolute;
  }

  .preview-action {
    bottom: 10px;
    inset-inline-end: var(--showcase-inset);
  }

  .project-cta {
    font-size: 16px;
    min-height: 44px;
    padding-inline: 10px;
  }

  .wheel-showcase {
    --wheel-width: min(152cqw, 940px);
    --panel-width: calc(var(--wheel-width) * .34);
    container-type: inline-size;
    display: flex;
    flex-direction: column-reverse;
    grid-row: 2;
    margin-top: 0;
    padding-block: 14px 10px;
  }

  .wheel-caption {
    font-size: clamp(28px, 7.5vw, 40px);
    min-height: 1.6em;
    padding-inline: var(--showcase-inset);
    position: static;
  }

  .wheel-stage {
    height: calc(var(--panel-height) * 1.2 + 12px);
  }

  .wheel-camera { left: calc(50% - var(--wheel-width) * .29); }

  .panel { transition: transform .24s ease-out; }

  .panel.is-active {
    transform: rotateY(var(--angle)) translateZ(var(--radius)) rotateY(-90deg)
      translate3d(calc(var(--wheel-width) * .16), 0, calc(var(--wheel-width) * .18)) rotateY(30deg);
  }
}

@media (max-width: 580px) {
  :root { --gutter: 20px; --navbar-height: 60px; }

  .brand-logo { width: clamp(85px, 26vw, 113px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
