:root {
  --teal: #175248;
  --teal-deep: #123f38;
  --cream: #FBF6DE;
  --blue: #BCE3EC;
  --green: #CDEBB4;
  --yellow: #F4EFC0;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Google Sans", "Google Sans Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute is what JS toggles to swap the form for the ticket.
   The browser's own `[hidden] { display: none }` loses to any author `display`
   rule below (e.g. #regForm is flex), so state it here. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--teal);
  font-family: var(--sans);
  overflow-x: hidden;
}

::selection { background: var(--teal); color: var(--cream); }

/* ---------- floating gradient blobs ---------- */

.blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* the artwork from the invite — already soft and grained, so no blur here */
.blob {
  position: absolute;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  will-change: transform;
}

/* PNG first so browsers without image-set() still get artwork */
.blob-a { background-image: url("/img/3asset.png");
  background-image: image-set(url("/img/3asset.webp") type("image/webp"), url("/img/3asset.png") type("image/png")); }
.blob-b { background-image: url("/img/1asset.png");
  background-image: image-set(url("/img/1asset.webp") type("image/webp"), url("/img/1asset.png") type("image/png")); }
.blob-c { background-image: url("/img/4asset.png");
  background-image: image-set(url("/img/4asset.webp") type("image/webp"), url("/img/4asset.png") type("image/png")); }
.blob-d { background-image: url("/img/3asset.png");
  background-image: image-set(url("/img/3asset.webp") type("image/webp"), url("/img/3asset.png") type("image/png")); }
.blob-e { background-image: url("/img/2asset.png");
  background-image: image-set(url("/img/2asset.webp") type("image/webp"), url("/img/2asset.png") type("image/png")); }

/* echoes the vertical chain of shapes on the invite, but kept sparse so the
   cream stays the dominant colour the way it is on the printed piece */
.blob-a { width: 44vmax; height: 44vmax; top: -14vmax; right: -12vmax; opacity: .85; }
.blob-b { width: 30vmax; height: 42vmax; top: 30%;  left: -13vmax; opacity: .5; }
.blob-c { width: 36vmax; height: 36vmax; top: 52%;  right: -15vmax; opacity: .6; }
.blob-d { width: 46vmax; height: 46vmax; bottom: -20vmax; left: -8vmax; opacity: .7; }
.blob-e { width: 26vmax; height: 36vmax; top: 6%;   left: 30%; opacity: .3; }

/* ---------- layout sheet ---------- */

.sheet {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 44px) clamp(20px, 4vw, 44px);
  --topbar-h: 58px;
}

/* ---------- sticky section nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 calc(-1 * clamp(20px, 4vw, 44px));
  padding: 0 clamp(20px, 4vw, 44px);
  transition: background .25s ease, box-shadow .25s ease;
}

.topbar.scrolled {
  background: rgba(251, 246, 222, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(23, 82, 72, .18);
}

/* the wordmark only earns its place once the real title has scrolled away */
.topbar-brand {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--teal);
  text-decoration: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.topbar-brand .it { font-style: italic; }
.topbar.scrolled .topbar-brand { opacity: 1; transform: none; pointer-events: auto; }

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 22px);
  margin-left: auto;
}

.topnav a {
  font-size: clamp(12px, 2.7vw, 14px);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.topnav a:hover { border-bottom-color: var(--teal); }
.topnav a.active { border-bottom-color: var(--teal); }

.topnav a.nav-cta {
  background: var(--teal);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  padding: 8px clamp(12px, 2.6vw, 18px);
}
.topnav a.nav-cta:hover { background: var(--teal-deep); }

/* keep anchored sections clear of the sticky bar */
[id] { scroll-margin-top: calc(var(--topbar-h) + 14px); }

/* ---------- hero / flyer ---------- */

/* the printed piece is one composition, so the whole thing — down to the
   speakers, address and CTA — should land inside the first screen */
.hero {
  position: relative;
  min-height: calc(100vh - var(--topbar-h)); /* fallback */
  min-height: calc(100svh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  padding-bottom: clamp(8px, 1.6svh, 20px);
}

.logos {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

/* official lockups, cropped to their artwork. Big 3 is a wide horizontal
   lockup and CraveFX a stacked one, so they're matched on optical weight
   rather than on a shared height. */
.logo-big3 { width: auto; height: clamp(24px, min(5vw, 3.2svh), 32px); }
/* the supplied CraveFX file is a stacked lockup; the invite sets it
   horizontally, so mark and wordmark are cropped out of it separately */
.logo-crave { display: inline-flex; align-items: center; gap: clamp(5px, 1.2vw, 8px); }
.crave-mark { width: auto; height: clamp(21px, min(4.4vw, 2.8svh), 28px); }
.crave-word { width: auto; height: clamp(12px, min(2.6vw, 1.7svh), 16px); }
.logo-x { font-size: clamp(15px, 2.6vw, 20px); font-weight: 300; opacity: .75; }

.title {
  margin: clamp(6px, 1.6svh, 26px) 0 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.005em;
  user-select: none;
}

/* the flyer mixes italic and roman letterforms within the word */
.mag-letter.it { font-style: italic; }
.mag-letter.rm { font-style: normal; }

/* every hero size is capped against viewport *height* as well as width, so the
   composition still fits the fold on short laptop screens */
.title-line { display: block; white-space: nowrap; }
.line-un { font-size: clamp(50px, min(20vw, 13.2svh), 140px); }
.line-hinged { font-size: clamp(50px, min(20vw, 13.2svh), 140px); margin-left: clamp(28px, 9vw, 88px); }

/* per-letter spans: authored in the HTML for the title, injected by JS elsewhere */
.mag-letter {
  display: inline-block;
  text-indent: 0;
  will-change: transform;
  transition: none;
}

.subtitle {
  margin: clamp(6px, 1.4svh, 16px) 0 0;
  text-align: right;
  font-size: clamp(16px, min(4.5vw, 3.2svh), 34px);
  font-weight: 500;
}
.byline {
  margin: 2px 0 0;
  text-align: right;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, min(5.2vw, 3.9svh), 44px);
  letter-spacing: .02em;
}
.subtitle-inner, .byline-inner { display: inline-block; }

/* schedule + speakers */

.hero-mid {
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 4svh, 52px);
  margin-top: clamp(14px, 3svh, 44px);
}

/* side by side once there's width for it — recovers the vertical room the
   portrait flyer could afford to spend */
@media (min-width: 620px) {
  .hero-mid { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 26px; }
  .hero-mid .speakers { align-self: flex-end; }
}

.schedule { display: flex; gap: 18px; align-items: stretch; }

.schedule-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-size: clamp(12px, min(2.6vw, 2svh), 20px);
  font-weight: 500;
  letter-spacing: 4px;
  border-left: 2.5px solid var(--teal);
  padding-left: 0;
  border-right: 0;
}
/* rotated 180: the visual right edge is the element's left border */

.schedule-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, .9svh, 12px);
  font-size: clamp(12px, min(2.9vw, 2.05svh), 18px);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.schedule-items span { text-transform: none; letter-spacing: .5px; }
.schedule-items li { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.schedule-items li.in { opacity: 1; transform: none; }

.speakers { display: flex; justify-content: flex-end; }
.speakers ul {
  list-style: none;
  margin: 0;
  padding: 0 18px 0 0;
  border-right: 2.5px solid var(--teal);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, .9svh, 11px);
  font-size: clamp(13px, min(3vw, 2.2svh), 20px);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.speakers li { opacity: 0; transform: translateX(16px); transition: opacity .6s ease, transform .6s ease; }
.speakers li.in { opacity: 1; transform: none; }

/* address / cta / datetime */

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-top: auto; /* pin the address + CTA to the bottom of the fold */
  padding-top: clamp(10px, 2.2svh, 34px);
}

.address { display: flex; gap: 12px; align-items: flex-start; }
.pin { width: clamp(26px, 5vw, 34px); height: auto; flex-shrink: 0; margin-top: 4px; }
.address p { margin: 0; font-size: clamp(13px, min(3vw, 2.1svh), 18px); font-weight: 500; line-height: 1.55; }

.register-cta {
  flex-shrink: 0;
  display: inline-block;
  text-align: center;
  background: var(--teal);
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(14px, 3vw, 18px);
  line-height: 1.3;
  padding: clamp(10px, 1.8svh, 18px) clamp(16px, 3.4vw, 24px);
  border-radius: 999px;
  transform: rotate(-4deg);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
  box-shadow: 0 4px 0 var(--teal-deep);
}
.register-cta:hover { transform: rotate(2deg) scale(1.06); box-shadow: 0 7px 0 var(--teal-deep); }

.datetime {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: clamp(10px, 2.2svh, 32px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, min(9.5vw, 6.4svh), 76px);
  letter-spacing: .01em;
}

/* Short viewports (older phones, short laptops) need another notch down to
   keep the whole composition — names, address, CTA — above the fold. */
@media (max-height: 700px) {
  .logos { padding-top: 4px; }
  .title { margin-top: clamp(4px, 1svh, 18px); }
  .line-un, .line-hinged { font-size: clamp(40px, min(18vw, 12svh), 120px); }
  .subtitle { font-size: clamp(14px, min(4.2vw, 2.9svh), 30px); }
  .byline { font-size: clamp(18px, min(4.8vw, 3.5svh), 40px); }
  .hero-mid { margin-top: clamp(10px, 2.2svh, 30px); gap: clamp(14px, 2.6svh, 32px); }
  .schedule-items { font-size: clamp(10.5px, min(2.7vw, 1.9svh), 16px); gap: clamp(3px, .7svh, 9px); }
  .speakers ul { font-size: clamp(11px, min(2.8vw, 2svh), 18px); gap: clamp(3px, .7svh, 9px); }
  .address p { font-size: clamp(11.5px, min(2.8vw, 1.9svh), 16px); }
  .hero-bottom { padding-top: clamp(8px, 1.6svh, 24px); }
  .datetime { margin-top: clamp(8px, 1.8svh, 24px); font-size: clamp(26px, min(8.5vw, 5.8svh), 64px); }
  .hero { padding-bottom: 6px; }
}

/* ---------- shared section bits ---------- */

section:not(.hero) { margin-top: clamp(70px, 14vw, 130px); }

.section-heading {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 44px);
  margin: 0 0 18px;
  letter-spacing: .5px;
}
.section-heading em {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

/* ---------- map ---------- */

#map {
  position: relative;
  height: clamp(300px, 55vw, 430px);
  border: 2.5px solid var(--teal);
  border-radius: 22px;
  overflow: hidden;
  z-index: 1; /* keep leaflet panes under nothing weird */
  isolation: isolate; /* contain the blend below so it can't tint the page */
}

/* Recolour the tiles by blending hue+saturation over them, which keeps the
   original luminance — so roads and buildings stay legible. A contrast()
   filter would do the opposite here: these tiles are nearly white, so
   contrast pushes them further toward white and erases the detail. */
#map::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 350; /* above the tile pane (200), below markers (600) */
  background: #1E6B5E;
  mix-blend-mode: color;
  opacity: .75;
  pointer-events: none;
}

.map-tiles { filter: brightness(.94) saturate(1.1); }

.map-caption {
  margin: 12px 2px 0;
  font-size: clamp(12.5px, 2.8vw, 15px);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.map-caption a { color: var(--teal); font-weight: 700; }

.leaflet-container { background: var(--cream); font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--cream); color: var(--teal);
  border: 2px solid var(--teal);
}
.leaflet-popup-content { font-family: var(--sans); font-weight: 500; line-height: 1.5; }

.venue-marker svg { filter: drop-shadow(0 3px 3px rgba(18, 63, 56, .35)); }
.venue-marker .pulse {
  transform-origin: 50% 50%;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .8; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- registration ---------- */

.register-blurb {
  margin: 0 0 26px;
  font-size: clamp(14.5px, 3.2vw, 17px);
  line-height: 1.6;
  max-width: 46ch;
}

#regForm { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.field-row { display: flex; gap: 18px; }

.field label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.field label em { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-size: 14px; }

.field input, .field textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--teal);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
  transition: background .2s ease, box-shadow .2s ease;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(23, 82, 72, .45); }
.field input:focus, .field textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(188, 227, 236, .8);
}

.submit-btn {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--cream);
  background: var(--teal);
  border: none;
  border-radius: 999px;
  padding: 16px 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--teal-deep);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, opacity .2s;
}
.submit-btn:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 6px 0 var(--teal-deep); }
.submit-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--teal-deep); }
.submit-btn[disabled] { opacity: .6; cursor: wait; transform: none; }

.form-error {
  margin: 0;
  font-weight: 500;
  color: #a3373c;
}

/* ---------- footer ---------- */

.footer {
  margin-top: clamp(70px, 14vw, 120px);
  padding: 22px 2px 10px;
  border-top: 2.5px solid var(--teal);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 1px;
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .field-row { flex-direction: column; }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .register-cta { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .schedule-items li, .speakers li { transition: none; opacity: 1; transform: none; }
  .venue-marker .pulse { animation: none; }
}
