/* Il Canzoniere Rosanero — the site is built as pieces of the printed booklet:
   paper sheets with cut edges, on rosa or black grounds. Two inks and paper, like a two-colour print job. */
:root {
  --rosa: #fda0b9;
  --rosa-tone: #f78fab;
  --ink: #0c0809;
  --ink-tone: #1d1416;
  --paper: #fff6f8;
  --paper-tone: #f6e3e9;
  --muted: #6a4d58;          /* secondary text on paper, 7:1 */
  --muted-dark: #d9b9c4;     /* secondary text on ink */
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3rem, 0.9rem + 7.6vw, 6.75rem);
  --m: clamp(16px, 2.2vw, 32px);
  --gap-section: clamp(96px, 12vw, 200px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--ink); font-family: var(--font); font-size: var(--step-body);
  line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.04em; line-height: 0.92; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.ground-ink :focus-visible, .indice :focus-visible, .lettera :focus-visible, .curtain :focus-visible { outline-color: var(--rosa); }
.sheet :focus-visible, .menu :focus-visible, .letter :focus-visible, .postcard :focus-visible, .card :focus-visible { outline-color: var(--ink); }
::selection { background: var(--ink); color: var(--rosa); }

main { background: var(--rosa); }
.ground-ink main { background: var(--ink); padding-bottom: var(--gap-section); }
.foot { background: var(--ink); padding: 0 var(--m) var(--m); }

/* ---------- cut edges ---------- */
.scallop-corners { --r: 30px;
  -webkit-mask: radial-gradient(circle var(--r) at 0 0, #0000 98%, #000) 0 0 / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 100% 0, #0000 98%, #000) 100% 0 / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 0 100%, #0000 98%, #000) 0 100% / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 100% 100%, #0000 98%, #000) 100% 100% / 51% 51% no-repeat; /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
          mask: radial-gradient(circle var(--r) at 0 0, #0000 98%, #000) 0 0 / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 100% 0, #0000 98%, #000) 100% 0 / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 0 100%, #0000 98%, #000) 0 100% / 51% 51% no-repeat, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 100% 100%, #0000 98%, #000) 100% 100% / 51% 51% no-repeat; } /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
.scallop-edges { --r: 11px; --w: 30px;
  -webkit-mask: radial-gradient(circle var(--r) at 50% 0, #0000 98%, #000) 0 0 / var(--w) 51% repeat-x, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 50% 100%, #0000 98%, #000) 0 100% / var(--w) 51% repeat-x; /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
          mask: radial-gradient(circle var(--r) at 50% 0, #0000 98%, #000) 0 0 / var(--w) 51% repeat-x, /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
    radial-gradient(circle var(--r) at 50% 100%, #0000 98%, #000) 0 100% / var(--w) 51% repeat-x; } /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
.scallop-bottom { --r: 9px; --w: 26px;
  -webkit-mask: radial-gradient(circle var(--r) at 50% 100%, #0000 98%, #000) 0 0 / var(--w) 100% repeat-x; /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
          mask: radial-gradient(circle var(--r) at 50% 100%, #0000 98%, #000) 0 0 / var(--w) 100% repeat-x; } /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
.scallop-top { --r: 50px; --w: calc(100% / 12);
  -webkit-mask: radial-gradient(circle var(--r) at 50% 0, #0000 98%, #000) 0 0 / var(--w) 100% repeat-x; /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
          mask: radial-gradient(circle var(--r) at 50% 0, #0000 98%, #000) 0 0 / var(--w) 100% repeat-x; } /* taste-skill-ignore: scallop cut-out mask, not a colour fill */

/* ---------- buttons ---------- */
.btn, .cell { display: inline-flex; align-items: center; justify-content: center; gap: .5em; text-decoration: none;
  font-weight: 500; font-size: var(--step-body); line-height: 1; padding: 15px 22px; border: 0; border-radius: 0;
  cursor: pointer; font-family: inherit; transition: transform .18s var(--ease-out), background-color .18s; }
.btn:hover, .cell:hover { transform: translateY(-2px); }
.btn:active, .cell:active { transform: translateY(0) scale(.97); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-tone); }
.btn-rosa { background: var(--rosa); color: var(--ink); }
.btn-rosa:hover { background: var(--rosa-tone); }
.btn-quiet { background: var(--paper-tone); color: var(--ink); }

/* ---------- header ---------- */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 28px var(--m) 0; gap: 16px; }
.mark { justify-self: start; font-weight: 600; font-size: var(--step-lead); letter-spacing: -0.04em; text-decoration: none;
  width: 52px; height: 52px; display: grid; place-items: center; background: var(--ink); color: var(--rosa); border-radius: 50%;
  transition: transform .25s var(--ease-out); }
.mark:hover { transform: rotate(-8deg) scale(1.05); }
.ground-ink .mark { background: var(--rosa); color: var(--ink); }
.links { display: flex; gap: 32px; }
.links a { text-decoration: none; font-weight: 500; transition: opacity .15s; }
.links a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ground-ink .links a { color: var(--paper); }
.top .btn { justify-self: end; }
.ground-ink .top .btn-ink { background: var(--paper); color: var(--ink); }

/* ---------- home: hero card ---------- */
.hero { padding: clamp(72px, 9vw, 130px) var(--m) 0; overflow-x: clip; }
.card { width: min(760px, 100%); margin: 0 auto; aspect-ratio: 5 / 7; background: var(--paper);
  padding: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 56px) 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.card h1 { font-size: var(--step-display); display: flex; flex-direction: column; width: 100%; }
.card h1 .l1 { align-self: flex-start; padding-left: 2%; }
.card h1 .l2 { align-self: flex-end; padding-right: 6%; }
.card-details { margin-top: 36px; font-size: var(--step-lead); max-width: 30ch; line-height: 1.6; }
.card-details span { white-space: nowrap; }
.diamond { display: inline-block; width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); margin: 0 12px 2px; }
.card-plate { margin-top: auto; width: 124%; max-width: none; }
.hero-404 .card p:has(.btn) { margin-top: 28px; }

/* ---------- home: the wall of video covers ---------- */
.video-wall { padding: var(--gap-section) var(--m) 0; }
.vw-head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; align-items: end; max-width: 1320px; margin: 0 auto; }
.vw-head h2 { font-size: var(--step-head); }
.vw-head p { font-size: var(--step-lead); line-height: 1.35; max-width: 32ch; }
.vw-grid { list-style: none; padding: 0; margin: 56px auto 0; max-width: 1320px; display: grid;
  grid-template-columns: repeat(6, 1fr); gap: 32px 12px; }
.vw-grid a { display: block; text-decoration: none; }
.vw-grid img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--ink);
  transition: transform .35s var(--ease-out); }
.vw-grid a:hover img { transform: translateY(-6px) rotate(-1.2deg); }
.vw-grid li:nth-child(even) a:hover img { transform: translateY(-6px) rotate(1.2deg); }
.vw-grid span { display: block; margin-top: 12px; font-weight: 500; line-height: 1.25; }

/* ---------- home: the index sheet ---------- */
.indice { background: var(--ink); margin-top: var(--gap-section); padding: var(--gap-section) var(--m);
  display: grid; grid-template-columns: 1fr minmax(0, 680px); gap: clamp(32px, 5vw, 96px); align-items: start; }
.indice-art { position: sticky; top: 15vh; width: 100%; }
.menu { background: var(--paper); padding: 72px clamp(24px, 5vw, 64px); text-align: center; }
.menu h2 { font-size: var(--step-head); }
.menu-note { margin: 18px auto 0; max-width: 40ch; font-size: var(--step-body); color: var(--muted); }
.group { margin-top: 64px; }
.group h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.1; }
.group ul { list-style: none; margin: 24px auto 0; padding: 0; max-width: 460px; text-align: left; }
.group li a { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; text-decoration: none; padding: 9px 12px;
  margin: 0 -12px; transition: background-color .15s, transform .2s var(--ease-out); }
.group li a:hover { background: var(--paper-tone); transform: translateX(4px); }
.it-name { font-weight: 500; font-size: var(--step-body); line-height: 1.3; }
.it-tag { font-size: var(--step-small); font-weight: 500; align-self: center; }
.it-tag:not(:empty)::before { content: ''; display: inline-block; width: 0; height: 0; margin-right: 6px;
  border-left: 8px solid var(--ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.it-first { grid-column: 1 / -1; font-size: var(--step-small); color: var(--muted); line-height: 1.4; }
.menu-end { margin-top: 64px; font-size: var(--step-body); }

/* ---------- home: in curva split ---------- */
.incurva { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; background: var(--rosa);
  padding: var(--gap-section) var(--m) 0; gap: 40px; }
.plate { align-self: center; position: relative; }
.plate .loop { width: 100%; aspect-ratio: 1; object-fit: cover; }
.incurva-text { display: flex; flex-direction: column; justify-content: center; gap: 56px; padding: 8px 0; max-width: 560px; }
.tabs { display: flex; gap: 28px; font-size: var(--step-body); }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 500; }
.tabs a.on { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 7px; }
.tabs a:hover { color: var(--ink); }
.incurva h2 { font-size: var(--step-head); }
.lead { margin-top: 48px; font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cell { min-height: 72px; padding: 16px; text-align: center; }
.cell-ink { background: var(--ink); color: var(--paper); }
.cell-tone { background: var(--rosa-tone); color: var(--ink); }

/* ---------- home: the letter ---------- */
.lettera { background: var(--ink); margin-top: var(--gap-section); padding: var(--gap-section) var(--m);
  display: grid; grid-template-columns: 1fr minmax(0, 640px) 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.lettera-art { width: 100%; max-width: 420px; justify-self: end; }
.lettera-col { min-width: 0; }
.letter { width: 100%; margin: 0 auto; background: var(--paper); padding: 60px clamp(24px, 5vw, 60px) 72px; }
.portrait { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--rosa); }
.letter p { margin-top: 1.5em; line-height: 1.6; }
.letter .portrait + p { margin-top: 28px; }
mark { background: var(--rosa); color: var(--ink); padding: 0 .15em; }
.sign { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; }
.letter .role { margin-top: 4px; font-size: var(--step-small); color: var(--muted); }
.tearoff { width: 100%; margin: 6px auto 0; background: var(--paper); padding: 22px clamp(24px, 5vw, 60px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.tearoff::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 6px;
  background: radial-gradient(circle 2.5px, var(--paper) 96%, #0000) 0 0 / 14px 6px repeat-x; } /* taste-skill-ignore: scallop cut-out mask, not a colour fill */
.tearoff span { font-weight: 500; }
.tearoff .soon { font-weight: 600; background: var(--rosa); padding: 12px 18px; }

/* ---------- footer: the back of the card ---------- */
.postcard { max-width: 1180px; margin: 0 auto; background: var(--paper); padding: 96px clamp(24px, 5vw, 72px) 28px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px 64px; min-height: 420px; }
.pc-sign { font-size: var(--step-head); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; margin-bottom: 24px; }
.pc-msg p:not(.pc-sign) { max-width: 44ch; }
.pc-addr { position: relative; padding-top: 8px; }
.stamp { position: absolute; top: -40px; right: 0; width: 88px; height: auto; background: var(--paper);
  padding: 6px; outline: 6px dotted var(--rosa); outline-offset: -3px; transform: rotate(4deg); }
.pc-addr ul { list-style: none; padding: 0; margin: 64px 0 0; display: grid; gap: 12px; font-size: 1.125rem; }
.pc-addr a { text-decoration: none; font-weight: 500; }
.pc-addr a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.imprint { grid-column: 1 / -1; align-self: end; text-align: center; font-size: 1rem; color: var(--muted);
  max-width: 58ch; margin: 24px auto 0; }

/* ---------- chant page ---------- */
.coro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px);
  padding: clamp(48px, 6vw, 96px) var(--m) 0; max-width: 1320px; margin: 0 auto; align-items: start; }
.sheet { background: var(--paper); padding: clamp(48px, 6vw, 88px) clamp(24px, 5vw, 72px) clamp(64px, 7vw, 104px); text-align: center; }
.sheet-sec { margin-top: clamp(48px, 6vw, 72px); font-size: var(--step-body); color: var(--muted); }
.sheet h1 { font-size: var(--step-display); text-wrap: balance; }
.sheet-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.poem { margin-top: clamp(48px, 6vw, 80px); font-size: var(--step-lead); line-height: 1.45; }
.strofa + .strofa, .bis + .strofa { margin-top: 1.25em; }
.bis { margin-top: .5em; font-size: var(--step-body); color: var(--muted); font-style: italic; }
.coro-media { position: sticky; top: 24px; }
.player { margin: 0; }
.player video { width: 100%; max-height: calc(100svh - 120px); aspect-ratio: 9 / 16; object-fit: contain; background: #000; margin: 0 auto; }
.player figcaption { margin-top: 14px; color: var(--muted-dark); font-size: var(--step-body); }
.player.soon { background: var(--rosa); padding: 40px 32px 32px; }
.player.soon img { width: 70%; margin: 0 auto; }
.player.soon figcaption { color: var(--ink); font-size: var(--step-body); margin-top: 28px; }

.stub { max-width: 1320px; margin: var(--gap-section) auto 0; padding: 0 var(--m); display: grid;
  grid-template-columns: 1fr minmax(0, 300px) 1fr; align-items: end; gap: 24px; }
.stub a { display: block; background: var(--rosa); color: var(--ink); text-decoration: none; padding: 24px 28px 28px;
  font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; transition: transform .2s var(--ease-out), background-color .15s; }
.stub a:hover { background: var(--rosa-tone); transform: translateY(-4px); }
.stub a span { display: block; font-size: var(--step-small); font-weight: 500; letter-spacing: 0; margin-bottom: 10px; }
.stub-next { text-align: right; }
.stub-art { width: 100%; }
.more { max-width: 1320px; margin: var(--gap-section) auto 0; padding: 0 var(--m); }
.more h2 { font-size: var(--step-head); color: var(--paper); }
.more .vw-grid { grid-template-columns: repeat(4, 1fr); max-width: none; gap: 16px; }
.more .vw-grid span { color: var(--paper); }

/* ---------- canta in curva ---------- */
.curva { position: fixed; inset: 0; z-index: 50; background: var(--ink); color: var(--rosa); display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) var(--m) max(20px, env(safe-area-inset-bottom)); cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.curva[hidden] { display: none; }
.curva-close { align-self: flex-end; background: var(--paper); color: var(--ink); border: 0; font: 500 var(--step-body)/1 var(--font);
  padding: 14px 20px; cursor: pointer; }
.curva-lines { flex: 1; display: flex; flex-direction: column; justify-content: center; font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.02; overflow: hidden; }
.curva-lines p { margin: 0; padding-left: .7em; text-indent: -.7em; }
.curva-lines.one-line p { white-space: nowrap; }
.curva-lines.swap { animation: verse .38s var(--ease-out); }
@keyframes verse { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.curva-hint { color: var(--muted-dark); font-size: var(--step-small); text-align: center; }
.curva-end { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.curva-end .btn { font-size: var(--step-lead); }

/* ---------- entrances (only when script runs, so nothing stays hidden without it) ---------- */
.js .rise { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: var(--d, 0ms); }
.js .rise.in { opacity: 1; transform: none; }
.js .card.rise { transform: translateY(64px); transition-duration: .8s, 1s; }
.js .card.rise.in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise, .js .card.rise { transform: none; transition: opacity .3s linear; }
  .curva-lines.swap { animation: none; }
  .btn:hover, .cell:hover, .stub a:hover, .group li a:hover, .mark:hover { transform: none; }
}

/* ---------- tablet & phone ---------- */
@media (max-width: 900px) {
  .indice { grid-template-columns: 1fr; }
  .indice-art { position: static; order: 2; width: min(560px, 100%); margin: 0 auto; }
  .incurva { grid-template-columns: 1fr; min-height: 0; }
  .vw-head { grid-template-columns: 1fr; }
  .vw-grid { grid-template-columns: repeat(4, 1fr); }
  .lettera { grid-template-columns: 1fr; }
  .lettera-art { justify-self: center; max-width: 320px; order: 2; }
  .incurva-text { max-width: none; }
  .coro { grid-template-columns: 1fr; }
  .coro-media { position: static; }
  .player video { max-height: 78svh; width: auto; }
  .postcard { grid-template-columns: 1fr; --w: calc(100% / 6); }
  .stub { grid-template-columns: 1fr 1fr; }
  .stub-art { display: none; }
  .more .vw-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .top { grid-template-columns: auto 1fr; padding-top: 16px; }
  .links { display: none; }
  .mark { width: 44px; height: 44px; font-size: 1.125rem; }
  .top .btn { padding: 13px 16px; }
  .hero { padding: 56px 12px 0; }
  .card { padding: 48px 20px 0; }
  .card h1 { font-size: 13vw; }
  .card h1 .l1, .card h1 .l2 { align-self: center; padding: 0; }
  .diamond { margin: 0 8px 2px; }
  .indice { padding: 96px 10px; }
  .menu { padding: 56px 20px; --r: 9px; --w: 24px; }
  .group h3 { font-size: 1.25rem; }
  .incurva { padding: 96px 16px 0; }
  .tabs { gap: 22px; }
  .lead { margin-top: 28px; }
  .cells { grid-template-columns: 1fr; }
  .cell { min-height: 60px; }
  .lettera { padding: 96px 0; }
  .video-wall { padding: 72px 16px 0; }
  .vw-grid { grid-template-columns: repeat(3, 1fr); gap: 24px 8px; margin-top: 36px; }
  .vw-grid span { font-size: 0.9375rem; }
  .letter, .tearoff { padding-left: 24px; padding-right: 24px; }
  .tearoff { flex-direction: column; align-items: stretch; text-align: center; }
  .foot { padding: 0; }
  .postcard { padding: 88px 24px 24px; --r: 30px; }
  .stamp { width: 64px; top: 8px; }
  .pc-addr ul { margin-top: 0; padding-right: 96px; font-size: 1.0625rem; }
  .coro { padding: 40px 0 0; gap: 12px; }
  .sheet { padding: 48px 20px 64px; --r: 20px; }
  .sheet h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .poem { font-size: 1.25rem; }
  .coro-media { padding: 0 var(--m); }
  .player video { width: 100%; max-height: none; }
  .stub { grid-template-columns: 1fr; gap: 8px; }
  .stub-next { text-align: left; }
}
