/* FRUPPIE landing page: the presentation slides with live, editable words. */
:root {
  --forest: #173a28;
  --forest-soft: #4a6354;
  --cream: #f7eedc;
  --paper: #fcf8ee;
  --red: #d7262e;
  --red-ink: #b3141c;
  --line: rgba(23, 58, 40, 0.28);
  --serif: 'Source Serif 4', 'Source Serif Pro', Caladea, Georgia, serif;
  --sans: Montserrat, Inter, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--forest);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- top navigation ---------- */

:root { --nav-h: 64px; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(252, 248, 238, 0.94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.nav.is-scrolled {
  border-bottom-color: rgba(23, 58, 40, 0.12);
  box-shadow: 0 6px 20px -16px rgba(23, 58, 40, 0.5);
}

.nav__inner {
  max-width: 1600px;
  margin-inline: auto;
  min-height: var(--nav-h);
  padding-inline: max(16px, 2vw);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav__brand { display: block; flex-shrink: 0; border-radius: 6px; }
.nav__brand img { display: block; height: 42px; width: auto; }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  min-width: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: block;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  color: var(--forest);
  font: 600 0.84rem/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(var(--red), var(--red)) 50% calc(100% - 4px) / 0 2px no-repeat;
  transition: background-size 220ms ease, color 150ms ease;
}

.nav__link:hover { background-size: calc(100% - 1.1rem) 2px; }
.nav__link[aria-current='true'] { background-size: calc(100% - 1.1rem) 2px; color: #0c2a1b; }

.nav__cta {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font: 700 0.84rem/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease;
}

.nav__cta:hover { transform: translateY(-1px); }

.nav__toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  cursor: pointer;
  position: relative;
}

.nav__bars,
.nav__bars::before,
.nav__bars::after {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  margin-left: -9px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav__bars { top: 50%; margin-top: -1px; }
.nav__bars::before, .nav__bars::after { content: ''; }
.nav__bars::before { top: -6px; }
.nav__bars::after { top: 6px; }
.nav.is-open .nav__bars { background: transparent; }
.nav.is-open .nav__bars::before { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Below wide desktop: a menu button with a drop-down panel. */
@media (max-width: 87.99em) {
  .nav__toggle { display: block; }

  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 0.75rem max(16px, 4vw) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid rgba(23, 58, 40, 0.12);
    box-shadow: 0 18px 30px -20px rgba(23, 58, 40, 0.45);
  }

  .nav.is-open .nav__menu { display: flex; }

  .nav__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.15rem 1rem;
  }

  .nav__link {
    padding: 0.7rem 0.4rem;
    font-size: 1rem;
    background-position: 0.4rem calc(100% - 6px);
  }

  .nav__link:hover, .nav__link[aria-current='true'] { background-size: 2.2rem 2px; }
  .nav__cta { align-self: flex-start; font-size: 0.95rem; }
}

@media (max-width: 30em) {
  :root { --nav-h: 56px; }
  .nav__brand img { height: 34px; }
}

/* ---------- slides ---------- */

#main { overflow-x: clip; }

.slide {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  aspect-ratio: 1304 / 978;
  container-type: inline-size;
  --u: calc(100cqw / 1304);
  overflow: hidden;
}

/* Soft seams: each slide tucks a little under the one above and its top edge
   fades into it, so the pictures blend instead of meeting in a hard line.
   22 slide-px is less than the gap between any slide edge and its words. */
.slide { isolation: isolate; }
.slide + .slide {
  margin-top: calc(min(100%, 1600px) * -22 / 1304);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.55) 1.1%, #000 2.25%);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.55) 1.1%, #000 2.25%);
}

/* Gentle entrance as each slide scrolls into view (added by landing.js). */
.slide.is-waiting {
  opacity: 0;
  transform: translateY(1.8%); /* under the seam overlap, so no gap shows */
}
.slide.is-revealing {
  transition:
    opacity 900ms ease-out,
    transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .slide.is-waiting { opacity: 1; transform: none; }
}

.slide__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.slide__text { position: absolute; inset: 0; pointer-events: none; }
.slide__text .t { pointer-events: auto; }

/* ---------- pouches that pop up on hover ---------- */

.pops { position: absolute; inset: 0; }

.pop {
  position: absolute;
  height: auto;
  max-width: none;
  /* Grow from the base: the bigger pouch always fully covers its original in the photo. */
  transform-origin: 50% 100%;
  transition:
    transform 420ms cubic-bezier(0.34, 1.45, 0.64, 1),
    filter 320ms ease;
  z-index: var(--z, 10);
  will-change: transform;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Hover keeps the photo's own stacking (a pouch behind another stays behind it). */
.pop:hover,
.pop.is-up {
  z-index: calc(var(--z, 10) + 4);
  transform: scale(1.07);
  filter: drop-shadow(0 calc(var(--u) * 14) calc(var(--u) * 16) rgba(40, 30, 10, 0.30)) saturate(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .pop:hover, .pop.is-up { transform: none; filter: drop-shadow(0 0 calc(var(--u) * 10) rgba(40, 30, 10, 0.35)); }
}

/* Logos grow from their centre and get a soft lift. */
.pop--logo { transform-origin: 50% 50%; }
.pop--logo:hover,
.pop--logo.is-up {
  transform: scale(1.08);
  filter: drop-shadow(0 calc(var(--u) * 8) calc(var(--u) * 10) rgba(23, 58, 40, 0.28));
}

/* The word FRUPPIE in the text. */
.fw {
  display: inline-block;
  transform-origin: 50% 60%;
  transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 300ms ease;
  cursor: default;
}

.fw:hover {
  transform: translateY(-14%) scale(1.04);
  text-shadow: 0 0.12em 0.22em rgba(23, 58, 40, 0.22);
}

.is-editing .fw { transition: none; }
.is-editing .fw:hover { transform: none; text-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .pop--logo:hover, .pop--logo.is-up, .fw:hover { transform: none; }
}

/* While editing words, pouches stay still. */
.is-editing .pop { pointer-events: none; }

/* Text is placed once its size has been fitted to the deck. */
html:not(.is-fitted) .slide__text { visibility: hidden; }

.t {
  position: absolute;
  margin: 0;
  white-space: nowrap;
  font-kerning: normal;
  font-synthesis: none;
}

.t--center { transform: translateX(-50%); text-align: center; }

.t--display, .t--display-heavy, .t--serif, .t--serif-semi, .t--serif-bold { font-family: var(--serif); }
.t--display { font-weight: 700; }
.t--display-heavy { font-weight: 800; }
.t--serif { font-weight: 400; }
.t--serif-semi { font-weight: 600; }
.t--serif-bold { font-weight: 700; }
.t--label { font-family: var(--sans); font-weight: 600; }
.t--label-heavy { font-family: var(--sans); font-weight: 800; }

.t b { font-weight: 700; }
.t--bold-sans b { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

.t .r { color: var(--red); }

/* ---------- contact ---------- */

.contact {
  background: var(--forest);
  color: var(--cream);
  padding: clamp(3.5rem, 9vw, 7rem) max(16px, 5vw);
}

.contact__inner {
  max-width: 72rem;
  margin-inline: auto;
  display: grid;
  gap: 2.5rem;
}

.contact__intro h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.contact__intro p {
  margin: 0;
  max-width: 24rem;
  font-size: 1.2rem;
  line-height: 1.5;
  color: #e3dac6;
}

.form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 24px;
  background: var(--paper);
  color: var(--forest);
  font-family: var(--sans);
}

.field { display: grid; gap: 0.4rem; min-width: 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
.opt { font-weight: 400; color: var(--forest-soft); }

.field input, .field select, .field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--forest);
  font: 1rem/1.4 var(--sans);
}

.field textarea { min-height: 8rem; resize: vertical; }
.field [aria-invalid='true'] { border-color: var(--red); }
.field__error { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--red-ink); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.btn {
  min-height: 3rem;
  padding: 0.75rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font: 700 1rem/1 var(--sans);
  cursor: pointer;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.form__status { margin: 0; flex: 1 1 16rem; font-size: 0.95rem; }
.form__status:empty { display: none; }
.form__status--off { padding: 0.75rem 1rem; border-radius: 12px; background: #efe4cc; }
.form__status--ok { font-weight: 600; }
.form__status--err { font-weight: 600; color: var(--red-ink); }

@media (min-width: 40em) {
  .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .full { grid-column: 1 / -1; }
}

@media (min-width: 64em) {
  .contact__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 5rem; }
}

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

.footer {
  padding: 3.5rem max(16px, 5vw) 2.5rem;
  background: var(--paper);
  text-align: center;
}

.footer__inner { display: grid; justify-items: center; gap: 1rem; }
.footer__logo { width: clamp(9rem, 22vw, 12rem); height: auto; }
.footer__tag { margin: 0; font: 700 1rem/1.3 var(--sans); letter-spacing: 0.16em; color: var(--forest); }
.footer__meta { margin: 0; font: 0.95rem/1.6 var(--sans); color: var(--forest-soft); }

/* ---------- focus & motion ---------- */

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.contact :focus-visible { outline-color: #f2c14e; }
.nav__link:focus-visible, .nav__cta:focus-visible, .nav__brand:focus-visible, .nav__toggle:focus-visible { outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- word editor (preview only) ---------- */

.ed__launch, .ed__bar, .ed__note { position: fixed; z-index: 100; font-family: var(--sans); }

.ed__launch {
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  min-height: 2.9rem;
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font: 700 0.95rem/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(23, 58, 40, 0.7);
}

.ed__bar, .ed__note {
  left: 0; right: 0; bottom: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 16px calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 -10px 30px -18px rgba(23, 58, 40, 0.8);
}

.ed__note { justify-content: center; font-size: 0.95rem; }
.ed__hint { margin: 0; flex: 1 1 16rem; font-size: 0.95rem; }
.ed__actions { display: flex; gap: 0.5rem; }

.ed__btn {
  min-height: 2.6rem;
  padding: 0.5rem 1.15rem;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: var(--cream);
  color: var(--forest);
  font: 700 0.95rem/1 var(--sans);
  cursor: pointer;
}

.ed__btn--quiet { background: transparent; color: var(--cream); }
.ed__btn:disabled { opacity: 0.5; cursor: not-allowed; }

.is-editing body { padding-bottom: 5.5rem; }

.is-editing #root [data-id] {
  outline: 1.5px dashed rgba(215, 38, 46, 0.75);
  outline-offset: 2px;
  cursor: text;
}

.is-editing #root [data-id]:focus {
  outline: 2.5px solid var(--red);
}
