/*! PLUME — a subscribe button that folds into the paper plane it throws — © 2026 Hasib (OVERSHOOT). All rights reserved. Licensed to nazario.deletteriis@gmail.com (order INS-FC0B7C1B), not sold: see LICENSE.md. */
/* Adattamento Mondo Segnaletica (footer newsletter, skin `plume--neon` 1:1).
   Rispetto all'originale: tolta la pagina demo e le skin non usate; i token del :root spostati su .plume
   (non sporcano le variabili globali del tema); Inter self-hosted al posto di Google Fonts; niente blocco
   html:not(.js) (il markup del tema non ha data-state finche' lo script non lo monta, quindi senza JS il
   pulsante e' gia' pieno); consenso newsletter sotto il campo; input a 16px sui telefoni. */
/* =========================================================================
   PLUME — app.css (co-located with this folder's index.html)

   Contract with app.js: the script writes `data-state` on .plume and seven
   continuous numbers as custom properties — --px, --py, --ang, --ps, --pa,
   --k and --turn — plus four sets of polygon points, four computed fills and
   one dash path. It writes no class names and no inline visibility. Every
   other look lives here, which is why the no-JS page and the reduced-motion
   page are this same page with different defaults.

   Sizing is one token. --u is the field's height in px; every other
   dimension on the component is derived from it, so the hero and the two
   small skins below it are the same CSS at two sizes and the reel rig can
   mount it at any scale without a second stylesheet.
   ========================================================================= */

/* Inter (OFL, assets/fonts/OFL-Inter.txt): stesso file servito da Google Fonts, qui self-hosted. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/inter-latin-wght.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.plume {
  /* ---- palette, sampled off the reference -------------------------------
     Text tones measured against the composited page:
       --text        14.6 : 1
       --text-dim     8.4 : 1
       --text-faint   5.4 : 1   (eyebrow, colophon — the smallest type)
     Paper on ink 17.9 : 1. The accent is non-text on the button face, where
     it only has to clear 3:1 against the paper it sits on: 4.4 : 1. */
  --bg:          #eef2fb;
  --paper:       #ffffff;
  --ink:         #0f1420;
  --text:        #0f1420;
  --text-dim:    #414b5f;
  --text-faint:  #5d6779;
  --hair:        #d6dfef;
  --hair-soft:   #e6ecf7;
  /* 4.6 : 1 on the white field. A placeholder is text. */
  --placeholder: #68738a;
  --warn:        #b4340a;   /* 6.0 : 1 on the page, 4.9 : 1 on the paper */

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* --ease is the page's one curve; --ease-fold is the crease, which has to
     leave fast and arrive slow or the paper reads as rubber. */
  --ease:      cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --ease-fold: cubic-bezier(.32, .9, .18, 1);
}

/* =========================================================================
   PLUME — the component

   Sizes. Everything below is a multiple of --u (the field's height), so the
   whole control scales off one number.
   ========================================================================= */

.plume {
  --u:    60px;                     /* the field's height */
  --bh:   calc(var(--u) * .733);    /* the button's height */
  /* --bw, the button's width, is written by app.js after layout. Until
     then this is what the input reserves — the fallback has to exist or
     the no-JS page puts its placeholder under the button. */
  --bw-guess: calc(var(--u) * 1.95);
  --gap:  calc(var(--u) * .1);      /* face-to-field breathing room */
  --pad:  calc(var(--u) * .38);     /* the input's own left padding */
  --btn-r: calc(var(--u) * .19);    /* the button's corner */
  --fld-r: calc(var(--u) * .30);    /* and the field's, kept in step */

  /* A SKIN OWNS ITS SURFACE, not just its accent. These default to the
     light page's tokens, so nothing changes for the three light skins — but
     a dark skin can now redefine the field it is drawn on, which a skin that
     only carried an accent could not. */
  --field:        var(--paper);
  --field-ink:    var(--text);
  --field-hair:   var(--hair);
  --field-holder: var(--placeholder);
  --field-msg:    var(--text-faint);
  --field-msg-lit:var(--text-dim);
  --cast:         rgba(15, 20, 32, .04);
  --cast-deep:    rgba(15, 20, 32, .3);
  /* the label's colour once the control is live — paper on cobalt, but ink
     on anything bright enough that paper would vanish on it */
  --on-ink:       var(--paper);

  /* A skin is two colours. */
  --accent:     #2454fd;
  --accent-off: #9da8c5;
  /* The word on the muted face is INK, not paper.

     The reference sets white on this lavender, which measures 2.35:1 — and a
     button that is aria-disabled rather than disabled is a live control, so
     it is not exempt: it can still be pressed, and pressing it does
     something. Ink on the same face is 6.6:1 and reads better as "not yet"
     anyway, which makes the flip to white-on-blue the moment it arms. */
  --off-ink:    #232a3d;

  /* THE PAPER IS TWO TONES AND A LIGHT.

     app.js computes each facet's normal and shades between these, so the
     fold's colours are its geometry rather than three values somebody
     picked — which is also why the tent reads as three-dimensional while it
     is still face-on. Both must be literal hex: the script reads them back
     and parses them, and a color-mix() does not resolve in computed style
     for a fill. */
  --paper-lit:  #5478ff;
  --paper-dark: #1c3fd0;
  --wake-ink:   #c3d2ff;

  position: relative;
  display: grid; justify-items: stretch; gap: 10px;
  width: min(560px, 100%);
  text-align: left;
}
.plume { font-family: var(--font-body); }
/* MS: il volo esce dal campo verso destra. Nella demo lo tagliava body { overflow-x: hidden }; qui lo taglia
   il footer, largo quanto la pagina: niente scroll orizzontale, e in verticale l'aereo resta libero. */
.ms-footer { overflow-x: clip; }

/* NEON — the same component on a dark surface.

   The one skin that redefines the field as well as the accent, and the
   reason --field-* exist at all. Measured against its own surface: input
   15.8:1, placeholder 6.1:1, the label 6.2:1 while it is dim and 14.4:1
   once it is live, the warning 7.9:1. Paper on this accent would be 1.4:1,
   so --on-ink goes to ink — which is also why the arming reads hardest on
   this skin: the button does not brighten, it INVERTS. */
/* Mondo Segnaletica: colori del sito (giallo --ms-yellow, neri --ms-dark-*). Contrasti sul campo #131317:
   accento 10,4:1, ala in ombra 5,0:1, scia 3,3:1, segnaposto 6,6:1; testo nero sul giallo 11:1. */
.plume--neon {
  --field:         #131317;
  --field-ink:     #F5F4F0;
  --field-hair:    rgba(255, 180, 0, .22);
  --field-holder:  #9A9AA2;
  --field-msg:     #9A9AA2;
  --field-msg-lit: #C4C4CA;
  --cast:          rgba(0, 0, 0, .5);
  --cast-deep:     rgba(0, 0, 0, .85);
  --on-ink:        #0B0B0C;
  --warn:          #ff8a6b;

  --accent:     #FFB400;
  --accent-off: #26262A;
  --off-ink:    #B4B4BA;
  /* the paper is the accent lit and the accent in shadow. The shadowed tone
     is kept off the floor on purpose, so the far wing stays visible. */
  --paper-lit:  #FFB400;
  --paper-dark: #B07A00;
  --wake-ink:   #8A6000;
}

/* ---- the field ---------------------------------------------------------
   The one box. overflow stays visible so the plane can leave it; the input
   inside does its own clipping. */
.plume__field {
  position: relative;
  height: var(--u);
  border-radius: var(--fld-r);
  background: var(--field);
  box-shadow:
    0 0 0 1px var(--field-hair),
    0 1px 2px var(--cast),
    0 10px 24px -18px var(--cast-deep);
  transition: box-shadow .2s var(--ease-soft);
}

/* Focus is on the field, not the input, because the button is inside it.
   Two rings from one shadow stack: the border thickens to the accent and a
   soft halo appears outside it. */
.plume__field:focus-within {
  box-shadow:
    0 0 0 1.6px var(--accent),
    0 0 0 5.4px color-mix(in oklab, var(--accent) 13%, transparent),
    0 10px 24px -18px var(--cast-deep);
}
/* Once it has been pressed the field stays lit for the rest of the exchange,
   whether or not the caret is still in it — the conversation is open until it
   is answered. Everything that is not idle or armed is "open". */
/* [data-state]: senza JS l'attributo non c'e' e il campo non resta acceso */
.plume[data-state]:not([data-state='idle']):not([data-state='ready']) .plume__field {
  box-shadow:
    0 0 0 1.6px var(--accent),
    0 0 0 5.4px color-mix(in oklab, var(--accent) 13%, transparent),
    0 10px 24px -18px var(--cast-deep);
}

.plume__input {
  width: 100%; height: 100%;
  /* The button is seated on the right, so the input is padded to clear it.
     --bw is measured once; the button's layout box never changes, so this
     cannot go stale mid-flight. */
  padding: 0 calc(var(--bw, var(--bw-guess)) + var(--gap) * 2 + var(--pad)) 0 calc(var(--pad) + 4px);
  border: 0; border-radius: inherit;
  background: none; color: var(--field-ink);
  font: inherit;
  font-size: calc(var(--u) * .245);
  letter-spacing: -.005em;
  outline: none;
  text-overflow: ellipsis;
}
.plume__input::placeholder { color: var(--field-holder); }
.plume__input:disabled,
.plume__input[readonly] { color: var(--field-msg-lit); cursor: default; }

/* ---- the seat ----------------------------------------------------------
   The button and the verdict share it, so the answer arrives exactly where
   the question was asked. */
.plume__seat {
  position: absolute;
  top: var(--gap); right: var(--gap); bottom: var(--gap);
  display: grid; place-items: center;
  pointer-events: none;
}
.plume__seat > * { grid-area: 1 / 1; }

.plume__btn {
  position: relative;
  height: var(--bh);
  padding: 0 calc(var(--u) * .27);
  border: 0;
  /* Real corners, because the fold needs them: they are the two vertices
     that travel to the nose. A pill's round ends fold to a rounded tent and
     the peak never arrives. */
  border-radius: var(--btn-r);
  background: none;
  font: inherit;
  font-size: calc(var(--u) * .225);
  font-weight: 600; letter-spacing: -.005em;
  color: var(--off-ink);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  /* max-content, because the two words are stacked in one grid cell: the
     button is already exactly as wide as the wider of them, so swapping
     which one shows cannot change its width and nothing has to be
     measured to keep the input's padding honest. */
  width: max-content;
  transform: translateX(var(--nudge, 0px)) scale(var(--squash, 1));
  transition: transform .16s var(--ease-soft);
}
.plume.is-live .plume__btn { transition: none; }
.plume__btn[aria-disabled='true'] { cursor: default; }
.plume__btn:focus-visible { outline: none; }
.plume__btn:focus-visible .plume__face {
  box-shadow: 0 0 0 2px var(--field), 0 0 0 4px var(--accent);
}

/* The face is a surface of its own, because it has to crease while the word
   leaves. --nudge is the small refusal shove when it is pressed too early;
   --squash is the press. Both are transforms on this one element. */
.plume__face {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--accent-off);
  /* The face and the paper are the same quadrilateral at --k 0, so this
     hand-over is invisible: the only thing not continuous across it is the
     corner radius, which the SVG does not carry. */
  opacity: clamp(0, calc(1 - var(--k, 0) * 11), 1);
  transition: background-color .26s var(--ease-soft), box-shadow .15s var(--ease-soft);
}
/* Muted only while it is not armed; the accent from the moment it is. Said
   that way round it cannot go stale when a beat is renamed — the enumerated
   version silently lost the fold when the phases were re-measured. */
.plume:not([data-state='idle']) .plume__face { background: var(--accent); }

/* The words ride the face's centre line and are gone by the time the crease
   is a third of the way down — paper does not fold with print on it. Both are
   in the DOM and laid out at all times, stacked in one grid cell. */
.plume__words {
  position: relative;
  display: grid;
  place-items: center;
  transform: scaleX(calc(1 - .16 * var(--k, 0)));
  opacity: clamp(0, calc(1 - var(--k, 0) * 3), 1);
}
.plume__words > * { grid-area: 1 / 1; }

/* Fast, because the message line beside it changes instantly: at 200ms the
   eye arrives at "that did not get through" while the button still says
   Subscribe. */
.plume__word {
  white-space: nowrap;
  transition: opacity .12s var(--ease-soft);
}
/* Armed, or already committed: paper on the accent. */
.plume:not([data-state='idle']) .plume__btn { color: var(--on-ink); }

.plume__word--retry { opacity: 0; }
.plume[data-state='fail'] .plume__word--go    { opacity: 0; }
.plume[data-state='fail'] .plume__word--retry { opacity: 1; }

/* ---- the verdict ------------------------------------------------------- */
.plume__verdict {
  display: flex; align-items: center;
  gap: calc(var(--u) * .11);
  padding-right: calc(var(--u) * .17);
  font-size: calc(var(--u) * .225);
  font-weight: 600; letter-spacing: -.005em;
  color: var(--accent);
  opacity: 0;
  transform: translateY(calc(var(--u) * .13));
  transition: opacity .3s var(--ease-soft), transform .42s var(--ease);
  pointer-events: none;
}
.plume[data-state='done'] .plume__verdict {
  opacity: 1; transform: none;
  transition-delay: .06s;
}

.plume__tick {
  width: calc(var(--u) * .26); height: calc(var(--u) * .26);
  flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 2.9; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
}
/* The tick is struck, not faded: the dash lets out over a fifth of a second
   after the word has already arrived, so the eye reads word-then-answer. */
.plume[data-state='done'] .plume__tick {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .30s var(--ease-fold) .12s;
}

/* ---- the air ----------------------------------------------------------
   A zero-size anchor at the button's centre. Both SVGs hang off it with
   overflow visible, so the flight is not clipped by anything and the
   geometry is in plain pixels from the seat. */
.plume__air {
  position: absolute;
  top: var(--gap); right: var(--gap); bottom: var(--gap);
  width: var(--bw, var(--bw-guess));
  pointer-events: none;
}

.plume__plane,
.plume__wake {
  position: absolute; left: 50%; top: 50%;
  overflow: visible;
  opacity: 0;
}

/* 1x1 viewport, 1x1 viewBox, overflow visible: one user unit is one pixel,
   so app.js emits plain pixels measured from the seat and nothing clips the
   throw. The attitude is baked into the points, so there is no rotation
   here — only where it is, how big it is, and how much is left. */
.plume__plane {
  width: 1px; height: 1px;
  transform: translate(var(--px, 0px), var(--py, 0px)) scale(var(--ps, 1));
  opacity: var(--pa, 0);
}
.plume__facet {
  /* fill is written per frame; this is only what a dead script leaves */
  fill: var(--paper-lit);
  shape-rendering: geometricPrecision;
}

/* 1x1 viewport with a 1x1 viewBox: one user unit is one pixel, and
   overflow:visible means the whole flight draws outside it. */
.plume__wake {
  width: 1px; height: 1px;
  opacity: var(--wa, 0);
}
.plume__dash {
  fill: none;
  stroke: var(--wake-ink);
  stroke-width: 2.2; stroke-linecap: round;
}

/* ---- the message line -------------------------------------------------
   Always in the layout so nothing below it moves when it fills. */
.plume__msg {
  min-height: 1.25em;
  margin: 0;
  padding: 0 calc(var(--pad) + 6px);
  font-size: 12px; font-weight: 450;
  color: var(--field-msg);
  transition: color .2s var(--ease-soft);
}
.plume[data-state='fail'] .plume__msg { color: var(--warn); }
.plume[data-state='done'] .plume__msg { color: var(--field-msg-lit); }

/* ---- il consenso (Mondo Segnaletica) -------------------------------------
   Obbligatorio e mai preselezionato. Stessa colonna e stesso tono del
   messaggio sopra; l'etichetta intera e' il bersaglio (>= 44px). */
.plume__consent {
  display: flex; align-items: flex-start; gap: 10px;
  min-height: 44px; padding: 2px calc(var(--pad) + 6px) 0;
  font-size: 12px; font-weight: 450; line-height: 1.6;
  color: var(--field-msg);
  cursor: pointer;
}
.plume__consent input {
  flex: none; width: 16px; height: 16px; margin: 2px 0 0;
  accent-color: var(--accent);
}
.plume__consent a { color: var(--field-msg-lit); text-decoration: underline; }
.plume__consent a:hover { color: var(--accent); }

/* =========================================================================
   Reduced motion

   Nothing folds, nothing is thrown. The wait is real, so it is still shown —
   the face dims and the word is replaced by the answer — and the tick is
   still struck, because that is not motion, it is the answer.
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .plume__air { display: none; }
  .plume__face,
  .plume__word { transform: none; }
  .plume[data-state='wait'] .plume__face { opacity: .55; }
  .plume[data-state='wait'] .plume__word { opacity: 0; }
  .plume[data-state='done'] .plume__face,
  .plume[data-state='fail'] .plume__face,
  .plume[data-state='done'] .plume__word,
  .plume[data-state='fail'] .plume__word { opacity: 0; }
  .plume__verdict { transform: none; transition: opacity .22s linear; }
  .plume[data-state='done'] .plume__tick { transition: stroke-dashoffset .34s linear .05s; }
}

/* =========================================================================
   Small screens

   The field keeps its shape; only the numbers shrink, because every
   dimension on it is a multiple of --u.
   ========================================================================= */
@media (max-width: 560px) {
  .plume { --u: 54px; }
  /* 16px: sotto, iOS ingrandisce la pagina al focus del campo */
  .plume__input { font-size: 16px; }
}
