/* Palette, typeface and composition taken from the
   "Pelham Girl Scout Mariners: Making Waves" slide deck. */

@font-face {
  font-family: "Gotu";
  src: url("fonts/gotu-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:  #FAFAFA;  /* slide background      */
  --navy:   #0C2E6E;  /* title text            */
  --teal:   #197397;  /* secondary text        */
  --chip:   #CFE3EA;  /* filled box on slide   */
  --chip-deep: #B4D4DF;
  --sea:    #60B5B9;

  --stack: "Gotu", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

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

/* ---------- watercolour backdrop ---------- */

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

.wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.corner {
  position: absolute;
  width: clamp(190px, 42%, 660px);
  height: auto;
}

.corner--tl { top: 0; left: 0; }
.corner--tr { top: 0; right: 0; }
.corner--bl { bottom: 0; left: 0; }
.corner--br { bottom: 0; right: 0; }

/* ---------- content ---------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 5vh, 3.25rem);
  padding: max(2.5rem, env(safe-area-inset-top)) 1.5rem max(2.5rem, env(safe-area-inset-bottom));
  text-align: center;
}

h1 {
  margin: 0;
  font-weight: 700;              /* synthesised, as in the deck */
  font-size: 3rem;
  font-size: clamp(2.15rem, 7.2vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.005em;
  max-width: 17ch;
  text-wrap: balance;
}

.actions { margin: 0; }

.guide {
  display: inline-block;
  padding: 0.85rem 2.4rem;
  background: var(--chip);
  color: var(--navy);
  font-size: 1.25rem;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 160ms ease, transform 160ms ease;
}

.guide:hover,
.guide:focus-visible {
  background: var(--chip-deep);
  transform: translateY(-1px);
}

.guide:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.guide:active { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- one quiet entrance ---------- */

h1, .actions {
  animation: rise 700ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.actions { animation-delay: 140ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- adaptations ---------- */

/* portrait screens are narrower than the slide, so the corner art
   needs a larger share of the width to still frame the type */
@media (orientation: portrait) {
  .corner { width: clamp(200px, 52%, 460px); }
}

/* short landscape viewports: keep the corners off the type */
@media (max-height: 520px) {
  .corner { width: clamp(150px, 30%, 400px); }
  h1 { font-size: clamp(1.8rem, 5.4vh, 3rem); }

  /* the QR page has more to fit, so size it off the height instead */
  .stage--qr {
    gap: 0.7rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .qr-frame { width: min(42vh, 280px); padding: 0.5rem; }
  .qr-heading { font-size: 1.1rem; }
  .qr-url { font-size: 1rem; }
  .qr-actions { gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  h1, .actions { animation: none; }
  .guide { transition: none; }
  .guide:hover, .guide:focus-visible { transform: none; }
}

@media (prefers-contrast: more) {
  .guide { outline: 2px solid var(--navy); }
}

/* ======================================================================
   QR page (qr.html)
   ====================================================================== */

.stage--qr {
  gap: clamp(1.1rem, 2.6vh, 1.9rem);
}

.qr-heading {
  font-weight: 700;
  font-size: 1.75rem;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  line-height: 1;
  margin: 0;
  color: var(--teal);
}

.qr-frame {
  width: 320px;
  width: clamp(230px, 58vmin, 400px);
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--chip);
  border-radius: 6px;
}

.qr {
  display: block;
  width: 100%;
  height: auto;
}

.qr-url {
  margin: 0;
  font-size: 1.1rem;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.qr-url a {
  color: var(--navy);
  text-decoration-color: var(--sea);
  text-underline-offset: 0.28em;
  text-decoration-thickness: 2px;
}

.qr-url a:hover { text-decoration-color: var(--teal); }

.qr-actions {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.qr-files {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.qr-files a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid var(--chip-deep);
  padding-bottom: 2px;
}

.qr-files a:hover,
.qr-files a:focus-visible { border-bottom-color: var(--teal); }

.qr-files a:focus-visible,
.qr-url a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

/* the QR is the one loud element here — no entrance animation competing */
.page-qr h1,
.page-qr .actions { animation: none; }

/* ---------- printing: just the code and the address ---------- */

@media print {
  @page { margin: 14mm; }

  .backdrop,
  .qr-actions { display: none !important; }

  html, body { height: auto; background: #fff; }

  .stage--qr {
    min-height: auto;
    padding: 0;
    gap: 10mm;
  }

  .qr-heading { display: none; }

  .qr-frame {
    width: 115mm;
    max-width: 100%;
    padding: 0;
    border: 0;
  }

  .qr-url {
    font-size: 16pt;
    color: #0C2E6E;
  }

  .qr-url a {
    color: #0C2E6E;
    text-decoration: none;
  }
}
