:root {
  --orange: #f25714;
  --orange-deep: #d9430d;
  --cream: #fff4df;
  --ink: #181411;
  --paper: #fffaf0;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

/* Author `display` declarations outrank the UA stylesheet's [hidden] rule, so
   without this any styled element toggled via .hidden stays on screen. */
[hidden] { display: none !important; }

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

.gallery-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.gallery-loader__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(242, 87, 20, .18);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: gallery-spin 800ms linear infinite;
}

@keyframes gallery-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .gallery-loader__spinner { animation: none; }
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
a { font: inherit; color: inherit; text-decoration: none; }

.site-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

/* --- the roaming field --------------------------------------------- */

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  background:
    linear-gradient(rgba(242, 87, 20, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 87, 20, .03) 1px, transparent 1px),
    var(--paper);
  background-size: 92px 92px;
}

.viewport.is-dragging { cursor: grabbing; }

/* Cards are positioned in screen space each frame, so this stays at the
   origin -- there is no giant translated world layer to lose precision in. */
.field {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform;
  cursor: pointer;
  background: transparent;
  border: 0;
  outline: 0;
  overflow: hidden;
  transition: opacity 420ms ease;
}

.viewport.is-dragging .card { cursor: grabbing; }

/* The box is already the media's exact native ratio, so this fills it without
   cropping, letterboxing or distortion -- the frame *is* the picture. */
.card picture,
.card img,
.card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  outline: 0;
  background: transparent;
  pointer-events: none;
  -webkit-user-drag: none;
}

.card img {
  opacity: 0;
}
.card.is-ready img { opacity: 1; }

.card--video video {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.card--video.is-playing video { opacity: 1; }

/* Camera motion is already interpolated in JS. A second CSS transform
   transition makes cards lag behind the visibility query during fast pans. */

.card:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

/* Videos autoplay silently and loop; no play affordance, no controls. */
.card video::-webkit-media-controls,
.card video::-webkit-media-controls-play-button,
.card video::-webkit-media-controls-start-playback-button {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
}

.boot-error {
  padding: 24px;
  color: var(--orange-deep);
  font: 600 15px/1.6 var(--sans);
  text-align: center;
}
.boot-error button { padding: 10px 16px; border: 1px solid currentColor; cursor: pointer; }

/* --- fixed chrome ---------------------------------------------------- */

.brand-header {
  position: absolute;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.brand-mark {
  pointer-events: auto;
  display: block;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(118, 41, 11, .14);
  transition: transform 180ms ease;
}

.brand-mark:hover { transform: rotate(-4deg) scale(1.035); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bottom-nav {
  position: absolute;
  z-index: 20;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--paper);
  border: 1px solid rgba(242, 87, 20, .2);
  box-shadow: 0 5px 20px rgba(54, 29, 14, .06);
  pointer-events: auto;
}

.bottom-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px 8px;
  color: var(--orange-deep);
  font: 700 11px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.bottom-nav__link:hover,
.bottom-nav__link:focus-visible {
  background: var(--orange);
  color: var(--cream);
  outline: none;
}

.edge-note {
  position: absolute;
  z-index: 20;
  bottom: max(18px, env(safe-area-inset-bottom));
  color: var(--orange-deep);
  font: 700 10px/1 var(--sans);
  letter-spacing: .11em;
  pointer-events: auto;
}
.edge-note--left { left: max(20px, env(safe-area-inset-left)); }
.edge-note--right { right: max(20px, env(safe-area-inset-right)); }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--orange);
  animation: blink 2s step-end infinite;
}

@keyframes blink { 50% { opacity: .35; } }

.roam-hint {
  position: absolute;
  z-index: 18;
  left: 50%;
  bottom: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px 8px 13px;
  background: var(--ink);
  color: var(--cream);
  font: 700 9px/1 var(--sans);
  letter-spacing: .12em;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 350ms ease, transform 350ms ease;
  pointer-events: none;
}
.roam-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }
.roam-hint.is-gone { opacity: 0; transform: translate(-50%, 8px); }
.roam-cross { font-size: 16px; color: var(--orange); }

.grain {
  position: absolute;
  z-index: 16;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* --- about & contact modals ------------------------------------------ */

.about-modal[hidden],
.contact-modal[hidden] { display: none !important; }

.about-modal,
.contact-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.about-modal__scrim,
.contact-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 17, .65);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  cursor: pointer;
}

.about-modal.is-open .about-modal__scrim,
.contact-modal.is-open .contact-modal__scrim { opacity: 1; }

.about-modal__card,
.contact-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  background: var(--paper);
  border: 1px solid var(--orange);
  box-shadow: 0 24px 64px -12px rgba(24, 20, 17, .35), 0 4px 16px rgba(242, 87, 20, .12);
  padding: 38px 34px 34px;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.about-modal.is-open .about-modal__card,
.contact-modal.is-open .contact-modal__card {
  opacity: 1;
  transform: none;
}

.about-modal__close,
.contact-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--orange-deep);
  background: rgba(242, 87, 20, 0.08);
  border: 1px solid rgba(242, 87, 20, 0.18);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.about-modal__close:hover,
.about-modal__close:focus-visible,
.contact-modal__close:hover,
.contact-modal__close:focus-visible {
  background: var(--orange);
  color: var(--cream);
  border-color: var(--orange);
  outline: none;
  transform: scale(1.05);
}

.about-modal__close svg,
.contact-modal__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-modal__body p {
  margin: 0 0 16px;
  color: #382e27;
  font: 400 15px/1.65 var(--serif);
}

.about-modal__body p:last-child {
  margin-bottom: 24px;
}

.about-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px 11px;
  background: var(--orange);
  color: var(--cream);
  font: 700 11px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 0;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(242, 87, 20, 0.28);
  transition: background 160ms ease, transform 160ms ease;
}

.about-modal__btn:hover,
.about-modal__btn:focus-visible {
  background: var(--orange-deep);
  transform: translateY(-1px);
  outline: none;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form[hidden] { display: none !important; }

.contact-form__error {
  margin: 0;
  color: var(--orange-deep);
  font-size: 14px;
  line-height: 1.5;
}

.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.contact-form__label {
  font: 700 10px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--orange-deep);
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  padding: 11px 13px;
  font: 400 14px/1.4 var(--sans);
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(24, 20, 17, 0.2);
  box-sizing: border-box;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(242, 87, 20, 0.22);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 90px;
}

.contact-form__submit,
.contact-success__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 12px 22px 11px;
  background: var(--orange);
  color: var(--cream);
  font: 700 11px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(242, 87, 20, 0.28);
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible,
.contact-success__btn:hover,
.contact-success__btn:focus-visible {
  background: var(--orange-deep);
  transform: translateY(-1px);
  outline: none;
}

.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.contact-success {
  text-align: center;
  padding: 8px 4px 4px;
}

.contact-success[hidden] { display: none !important; }

.contact-success__icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(242, 87, 20, 0.12);
  color: var(--orange);
  font-size: 20px;
  font-weight: bold;
}

.contact-success__copy {
  margin: 0 0 20px;
  color: #382e27;
  font: 400 15px/1.6 var(--serif);
}

/* --- lightbox -------------------------------------------------------- */

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
}

.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 18, 10, .58);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  opacity: 0;
  transition: opacity 360ms var(--ease-out);
  cursor: zoom-out;
}
.lightbox.is-open .lightbox__scrim { opacity: 1; }

.lightbox__stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  pointer-events: none;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  max-width: 100%;
  pointer-events: auto;
}

/* Sized in JS to the media's exact native ratio: nothing to letterbox. */
.lightbox__media {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  background: transparent;
  border: 0;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, .6),
    0 2px 10px rgba(0, 0, 0, .25);
}

.lightbox__media picture,
.lightbox__media img,
.lightbox__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: 0;
}

.lightbox__caption {
  width: min(100%, 640px);
  margin-top: 18px;
  padding: 0 8px;
  text-align: center;
  color: var(--cream);
}

.lightbox__caption p {
  margin: 0;
  max-width: 56ch;
  margin-inline: auto;
  color: rgba(255, 244, 223, .85);
  font: 400 15px/1.6 var(--serif);
}

.lightbox__link {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 15px 9px;
  background: var(--orange);
  color: var(--cream);
  font: 700 10px/1 var(--sans);
  letter-spacing: .13em;
  transition: background 160ms ease, transform 160ms ease;
}
.lightbox__link:hover { background: var(--orange-deep); transform: translateY(-1px); }

.lightbox__close,
.lightbox__step {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--cream);
  background: rgba(255, 244, 223, .09);
  border: 1px solid rgba(255, 244, 223, .16);
  cursor: pointer;
  opacity: 0;
  transition: opacity 300ms var(--ease-out) 140ms, background 160ms ease, transform 160ms ease;
}
.lightbox.is-open .lightbox__close,
.lightbox.is-open .lightbox__step { opacity: 1; }

.lightbox__close:hover,
.lightbox__step:hover { background: var(--orange); border-color: var(--orange); }
.lightbox__close:focus-visible,
.lightbox__step:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.lightbox__close {
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
}

.lightbox__step { top: 50%; margin-top: -23px; }
.lightbox__step--prev { left: max(16px, env(safe-area-inset-left)); }
.lightbox__step--next { right: max(16px, env(safe-area-inset-right)); }
.lightbox__step--prev:hover { transform: translateX(-2px); }
.lightbox__step--next:hover { transform: translateX(2px); }

.lightbox__close svg,
.lightbox__step svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  .brand-mark { width: 58px; height: 58px; }
  .lightbox__stage { padding: 16px; }
  .lightbox__caption { margin-top: 15px; }
  .lightbox__caption p { font-size: 13px; }
  .lightbox__step { width: 40px; height: 40px; margin-top: -20px; }
  .roam-hint { top: 50%; bottom: auto; white-space: nowrap; transform: translate(-50%, calc(-50% + 8px)); }
  .roam-hint.is-visible { transform: translate(-50%, -50%); }
  .roam-hint.is-gone { transform: translate(-50%, calc(-50% + 8px)); }
  .edge-note { display: none; }
  .about-modal__card,
  .contact-modal__card { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card img,
  .lightbox__scrim,
  .lightbox__close,
  .lightbox__step,
  .about-modal__scrim,
  .about-modal__card,
  .about-modal__close,
  .contact-modal__scrim,
  .contact-modal__card,
  .contact-modal__close { transition-duration: 1ms; }
  .status-dot { animation: none; }
}
