/* ==============================================================
   PAPER BOATS · page styles
   File: /paper-boats/paper-boats.css
   Colours, font and buttons come from /assets/css/site.css.

   Sections:
     1  The river (title and canvas)
     2  The writer (paper sheet with the text box)
     3  Fold animation
   The "How it helps" section uses shared styles in site.css (section 13).
   ============================================================== */


/* --------------------------------------------------------------
   1 · THE RIVER
   The canvas fills the section; the title sits in the sky.
   -------------------------------------------------------------- */
.river {
  position: relative;
  height: clamp(540px, 84svh, 880px);
  overflow: hidden;
  background: var(--c-sky-top);         /* shown until the canvas paints */
}
.river canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.river__intro {
  position: relative;
  z-index: 2;
  padding-top: clamp(1.5rem, 5vw, 3.5rem);
}
.river__title {
  margin-bottom: .3em;
  font-size: var(--step-3);
  font-weight: var(--weight-light);
  letter-spacing: -.025em;
}
.river__lede {
  max-width: 30rem;
  margin-bottom: 1.4rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  line-height: 1.45;
}
.river__note {
  max-width: 30rem;
  margin-top: .9rem;
  font-size: var(--step--1);
  color: var(--muted);
}

@media (max-width: 640px) {
  .river__lede { font-size: 1.1rem; margin-bottom: 1rem; }
  .river__note { display: none; }
}


/* --------------------------------------------------------------
   2 · THE WRITER (a sheet of paper resting on the river bank)
   -------------------------------------------------------------- */
.writer {
  position: relative;
  z-index: 5;
  max-width: 40rem;
  margin: -5rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.writer__label {
  display: block;
  margin-bottom: .75rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
}
.writer textarea {
  display: block;
  width: 100%;
  min-height: 7.2rem;
  resize: vertical;
  padding: .35rem .1rem;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font: var(--weight-regular) 1.1rem/1.8rem var(--font-main);
  /* faint ruled lines, like writing paper */
  background:
    repeating-linear-gradient(to bottom,
      transparent 0, transparent calc(1.8rem - 1px),
      var(--line) calc(1.8rem - 1px), var(--line) 1.8rem) 0 .35rem / 100% 1.8rem local;
}
.writer textarea::placeholder { color: var(--muted); opacity: .85; }
.writer textarea:focus,
.writer textarea:focus-visible { outline: none; border-bottom-color: var(--accent); }

.writer__hint {
  margin-top: .75rem;
  font-size: var(--step--1);
  color: var(--muted);
}
@media (pointer: coarse) { .writer__hint-keys { display: none; } }

.writer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.25rem;
}
.writer__status {
  min-height: 1.65em;
  margin-top: .9rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .writer { margin-inline: .75rem; }
  .writer__actions .btn { flex: 1 1 100%; }
}


/* --------------------------------------------------------------
   3 · FOLD ANIMATION
   A paper note folds into a boat shape (clip-path morph), then
   glides onto the water, where the canvas boat takes over.
   -------------------------------------------------------------- */
.fold {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(20, 30, 36, .25));
  will-change: transform, opacity;
}
.fold__paper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--c-paper);
  clip-path: polygon(0% 0%, 24% 0%, 50% 0%, 76% 0%, 100% 0%, 100% 100%, 0% 100%);
}
.fold__shade {                         /* fold shading, fades in as it folds */
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, transparent 50%, var(--c-paper-shade) 50%);
}
.fold__text {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: 1rem 1.2rem;
  text-align: center;
  color: var(--c-ink);
  font: var(--weight-light) 1.05rem/1.45 var(--font-main);
  overflow-wrap: anywhere;
}
.fold__text.is-long { font-size: .9rem; }
