/* =========================================================
   CUSTOM FONTS
========================================================= */

@font-face {
  font-family: "Rascal";
  src: url("assets/fonts/RASCAL__.TTF") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "XanhMono-Regular";
  src: url("assets/fonts/XanhMono-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "PinyonScript-Regular";
  src: url("assets/fonts/PinyonScript-Regular.ttf") format("truetype");
  font-display: swap;
}

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

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

/* =========================================================
   SITE VARIABLES
========================================================= */

:root {
  --background: #111111;
  --background-image: none;

  --text: #222625;          /* page text */
  --nav-text: #eeeeea;      /* navigation only */
  --paper: #f3f0e8;
  --paper-text: #252525;
  --accent: #b7c7d8;

  --nav-height: 72px;
  --page-padding: clamp(12px, 2.8vw, 46px);
  --page-heading-size: 84px;
  --content-width: 1500px;

  --body-font: "Courier New", Courier, monospace;
  --display-font: Georgia, "Times New Roman", serif;

  --shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
  --artboard-scale: 1;
}

/* =========================================================
   GLOBAL
========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  min-height: 100vh;

  color: var(--text);
  background: var(--background);

  font-family: var(--body-font);

  overflow-x: hidden;
}

/* =========================================================
   FIXED BACKGROUND
========================================================= */

.site-background {
  position: fixed;
  inset: 0;
  z-index: -2;

  background-color: var(--background);

  background-image:
    linear-gradient(
      rgba(0, 0, 0, 0.08),
      rgba(0, 0, 0, 0.08)
    ),
    var(--background-image);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.site-background::after {
  content: "";

  position: absolute;
  inset: 0;

  pointer-events: none;
  opacity: 0.18;

  background-image:
    radial-gradient(
      circle at 20% 15%,
      rgba(255, 255, 255, 0.09) 0 1px,
      transparent 1.5px
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(255, 255, 255, 0.06) 0 1px,
      transparent 1.5px
    );

  background-size: 12px 12px, 17px 17px;
  mix-blend-mode: soft-light;
}

/* =========================================================
   PAGE STRUCTURE
========================================================= */

.site-shell {
  width: 100%;
}

.page {
  width: 100%;
  min-height: 100svh;

  scroll-margin-top: 0;
  scroll-snap-align: start;
}

/* =========================================================
   CANVAS / ARTBOARD PAGES
========================================================= */

.page-canvas {
  height: 100svh;

  padding:
    var(--page-padding)
    var(--page-padding)
    calc(var(--nav-height) + var(--page-padding));

  display: grid;
  place-items: center;

  overflow: hidden;
}

.artboard-viewport {
  width: 100%;
  height: 100%;

  min-width: 0;
  min-height: 0;

  display: grid;
  place-items: center;

  overflow: hidden;
}

.artboard-frame {
  position: relative;
  flex: none;

  overflow: visible;
}

.artboard {
  position: absolute;
  left: 0;
  top: 0;

  transform-origin: top left;

  overflow: visible;
}

/* =========================================================
   ARTBOARD HEADINGS
========================================================= */

.artboard-heading {
  position: absolute;
  left: 80px;
  top: 55px;

  z-index: 90;

  margin: 0;

  font-family: var(--display-font);
  font-size: var(--page-heading-size);
  font-weight: 400;
  line-height: 0.95;

  text-shadow: 0px 0.9px 0 #008BDA;
}

.artboard-intro {
  position: absolute;
  left: 82px;
  top: 145px;

  z-index: 90;

  width: 760px;
  margin: 0;

  font-size: 18px;
  line-height: 1.6;
}

/* =========================================================
   CANVAS ITEMS
========================================================= */

.canvas-item {
  position: absolute;

  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--w, 300px);

  transform:
    translate(-50%, -50%)
    rotate(var(--rotate, 0deg));

  z-index: var(--z, 1);
}

.canvas-item img {
  display: block;

  width: 100%;
  height: auto;
}

/* =========================================================
   SHADOWS
========================================================= */

.paper,
.photo,
.button-card {
  filter: drop-shadow(var(--shadow));
}

/* =========================================================
   PAPER OBJECTS
========================================================= */

.paper {
  position: relative;

  padding: 46px;

  color: var(--paper-text);

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.17),
      rgba(255, 255, 255, 0.17)
    ),
    var(--paper);

  border: 1px solid rgba(0, 0, 0, 0.08);
}

.paper.crumpled {
  background-image:
    linear-gradient(
      125deg,
      rgba(0, 0, 0, 0.035),
      transparent 27%
    ),
    linear-gradient(
      35deg,
      transparent 62%,
      rgba(0, 0, 0, 0.03)
    ),
    radial-gradient(
      circle at 30% 22%,
      rgba(255, 255, 255, 0.8),
      transparent 33%
    );
}

.paper-title {
  margin: 0 0 20px;

  font-family: var(--display-font);
  font-size: 54px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.paper-body {
  white-space: pre-line;

  font-size: 20px;
  line-height: 1.42;
  letter-spacing: 0.04em;
}

.paper a,
.link-list a,
.button-card a {
  color: inherit;
}

/* =========================================================
   PHOTOS AND DECORATIVE IMAGES
========================================================= */

.photo {
  margin: 0;

  padding:
    10px
    10px
    28px;

  background: #f7f7f3;
}

.photo img {
  display: block;

  width: 100%;
  height: auto;

  object-fit: cover;
}

.image-only img {
  object-fit: contain;
  max-height: 760px;
}

.canvas-item.has-item-blur .image-only img,
.canvas-item.has-item-blur .photo img {
  filter: blur(var(--blur, 0px));
}

/* =========================================================
   PAPER LINKS
========================================================= */

.link-list {
  list-style: none;

  padding: 0;
  margin: 20px 0 0;

  font-size: 20px;
}

.link-list li + li {
  margin-top: 13px;
}

/* =========================================================
   RSVP BUTTON OBJECT
========================================================= */

.button-card {
  display: grid;
  place-items: center;

  min-height: 280px;

  padding: 40px;

  color: var(--paper-text);
  background: transparent;

  text-align: center;
}

.button-card a {
  font-size: 20px;
}

/* =========================================================
   RECOMMENDATIONS PAGE
========================================================= */

.page-cards {
  padding:
    clamp(70px, 8vw, 120px)
    var(--page-padding)
    calc(var(--nav-height) + 50px);
}

.cards-page-inner {
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.page-heading {
  margin: 0 0 28px;

  font-family: var(--display-font);

  font-size:
    calc(
      var(--page-heading-size) *
      var(--artboard-scale)
    );

  font-weight: 400;
  line-height: 0.95;

  text-align: center;

  text-shadow:
    calc(2px * var(--artboard-scale))
    calc(2px * var(--artboard-scale))
    0
    #e9e0d9ff;
}

.cards-grid {
  display: grid;

  grid-template-columns:
    repeat(
      var(--columns, 3),
      minmax(0, 1fr)
    );

  gap: clamp(18px, 2vw, 35px);

  align-items: stretch;
}

.info-card {
  min-height: 260px;

  padding: clamp(22px, 2.6vw, 38px);

  color: var(--paper-text);
  background: var(--paper);

  box-shadow: var(--shadow);
}

.info-card h3 {
  margin: 0 0 20px;

  font-family: var(--display-font);
  font-size: clamp(1.8rem, 3vw, 3.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.info-card p {
  margin: 0;

  white-space: pre-line;

  line-height: 1.55;
}

/* =========================================================
   INTERACTIVE RECOMMENDATIONS MAP
========================================================= */

.recommendation-map-shell {
  width: min(100%, 1180px);
  margin: 0 auto clamp(34px, 5vw, 64px);
  padding: clamp(18px, 2.5vw, 30px);
  color: var(--paper-text);
  background: color-mix(in srgb, var(--paper) 50%, transparent);
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: var(--shadow);
}

.map-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.map-title {
  margin: 0 0 5px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.map-help {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.map-reset,
.map-filter {
  border: 1px solid rgba(34, 38, 37, 0.45);
  border-radius: 999px;
  color: var(--paper-text);
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.map-reset {
  flex: 0 0 auto;
  padding: 8px 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
}

.map-filter {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.map-filter[aria-pressed="true"] {
  color: var(--paper);
  background: var(--paper-text);
}

.map-filter:hover,
.map-reset:hover {
  transform: translateY(-1px);
}

.map-filter:focus-visible,
.map-reset:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.recommendation-map {
  position: relative;
  width: 100%;
  height: clamp(400px, 56vh, 590px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(34, 38, 37, 0.2);
  background: #d8ddd8;;
}

.recommendation-map.map-unavailable::before {
  content: "Interactive map unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--paper-text);
  background: var(--paper);
  text-align: center;
}

.map-fallback {
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.recommendation-marker-wrap {
  background: transparent;
  border: 0;
}

.recommendation-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #c76969;
  font-family: Georgia, serif;
  font-size: 31px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 80%;
  transition: transform 150ms ease;
}

.leaflet-marker-icon:hover .recommendation-marker,
.leaflet-marker-icon:focus .recommendation-marker {
  transform: scale(1.18);
}

.leaflet-container {
  font-family: var(--body-font);
}

.leaflet-control-zoom a {
  color: var(--paper-text);
}

.leaflet-control-attribution a[href*="leaflet"] {
    display: none;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--paper-text);
  background: var(--paper);
}

.leaflet-popup-content-wrapper {
  border-radius: 1px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content {
  margin: 18px 20px;
  line-height: 1.42;
}

.map-popup-content h4 {
  margin: 0 0 8px;
  font-family: var(--display-font);
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.map-popup-category {
  margin: 0 0 7px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-popup-description,
.map-popup-neighborhood {
  margin: 0 0 9px;
  font-size: 0.88rem;
}

.map-popup-neighborhood {
  opacity: 0.7;
}

.map-popup-content a {
  color: inherit;
  font-size: 0.85rem;
  text-underline-offset: 3px;
}

/* =========================================================
   FIXED BOTTOM NAVIGATION
========================================================= */

.site-nav {
  position: fixed;

  left: 0;
  right: 0;
  bottom: 0;

  z-index: 1000;

  min-height: var(--nav-height);

  display: flex;
  justify-content: center;
  align-items: center;

  gap: clamp(16px, 4vw, 70px);

  padding:
    16px
    max(var(--page-padding), env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    max(var(--page-padding), env(safe-area-inset-left));

  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.82),
      rgba(0, 0, 0, 0.35) 60%,
      transparent
    );

  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: 0 0 auto;

  color: var(--nav-text);

  font-size: clamp(0.72rem, 1vw, 0.95rem);
  text-underline-offset: 4px;

  white-space: nowrap;
}

.site-nav a[aria-current="page"] {
  opacity: 0.55;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {
  :root {
    --nav-height: 62px;
    --page-padding: 10px;
  }

  html {
    /*
      Proximity snapping preserves section snapping without
      forcing the long Recommendations page back to Registry.
    */
    scroll-snap-type: y proximity;
  }

  /* ---------------- Canvas pages ---------------- */

  .page-canvas {
    height: 100svh;

    padding:
      8px
      8px
      calc(var(--nav-height) + 8px);
  }

  .artboard-heading {
    left: 24px;
    top: 25px;

    max-width: 380px;

    font-size: 52px;
  }

  .artboard-intro {
    left: 25px;
    top: 88px;

    width: 375px;

    font-size: 16px;
  }

  .canvas-item {
    left: var(--mx, var(--x, 50%));
    top: var(--my, var(--y, 50%));
    width: var(--mw, var(--w, 300px));
    z-index: var(--mz, var(--z, 1));

    transform:
      translate(-50%, -50%)
      rotate(var(--mrotate, var(--rotate, 0deg)));
  }

  .canvas-item.has-item-blur .image-only img,
  .canvas-item.has-item-blur .photo img {
  filter: blur(var(--mblur, var(--blur, 0px)));
  } 

  /* ---------------- Mobile papers ---------------- */

  .paper {
    padding: 25px;
  }

  .paper-title {
    margin-bottom: 12px;

    font-size: 33px;
  }

  .paper-body,
  .link-list {
    font-size: 16px;
    line-height: 1.34;
  }

  .link-list {
    margin-top: 13px;
  }

  .link-list li + li {
    margin-top: 8px;
  }

  /* ---------------- Mobile RSVP button ---------------- */

  .button-card {
    min-height: 210px;

    padding: 30px;
  }

  .button-card a {
    font-size: 18px;
  }

  /* ---------------- Mobile navigation ---------------- */

  .site-nav {
    justify-content: center;
    gap: 18px;
    width: 100%;
  }

  /* ---------------- Mobile recommendations map ---------------- */

  .recommendation-map-shell {
    width: min(350px, 92vw);
    margin-bottom: 30px;
    padding: 14px;
  }

  .map-heading-row {
    align-items: flex-start;
    gap: 12px;
  }

  .map-title {
    font-size: 2rem;
  }

  .map-help {
    max-width: 230px;
    font-size: 0.78rem;
  }

  .map-reset {
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .map-filters {
    gap: 6px;
  }

  .map-filter {
    padding: 6px 9px;
    font-size: 0.7rem;
  }

  .recommendation-map {
    height: 430px;
    min-height: 430px;
    touch-action: pan-x pan-y;
  }

  /* ---------------- Recommendations page ---------------- */

  .page-cards {
    min-height: auto;

    scroll-snap-align: start;

    padding:
      75px
      12px
      calc(var(--nav-height) + 30px);
  }

  .cards-page-inner {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    margin: 0 auto;
  }

  .page-heading {
    width: 100%;

    margin:
      0
      0
      28px;

    font-size:
      calc(
        52px *
        var(--artboard-scale)
      );

    text-align: center;
  }

  .cards-grid {
    display: grid;

    /*
      This is the primary mobile Recommendations width.
      Reduce 325px if you want still-smaller paper cards.
    */
    width: min(325px, 84vw);

    grid-template-columns: 1fr;

    gap: 18px;
  }

  .info-card {
    width: 100%;

    min-height: 0;

    padding:
      18px
      20px;
  }

  .info-card h3 {
    margin:
      0
      0
      12px;

    font-size: 2rem;
    line-height: 1;
  }

  .info-card p {
    font-size: 16px;
    line-height: 1.4;
  }
}

/* =========================================================
   TABLET RECOMMENDATIONS
========================================================= */

@media (min-width: 701px) and (max-width: 1100px) {
  .cards-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

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

/* =========================================================
   PRINTING
========================================================= */

@media print {
  .site-nav {
    display: none;
  }

  .page-canvas {
    height: 100vh;

    padding: 0;

    break-after: page;
  }

  .page-cards {
    break-before: page;
  }
}