@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #111111;
  --paper: #f3f4f1;
  --vermilion: #ee4a2a;
  --yellow: #f5be18;
  --ultra: #2340c8;
  --green: #0f7a4a;
  --green-lit: #2fc27a;

  --rail-x: 0px;
  --rail-w: 6px;
  --rail-col: 64px;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1360px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-1: clamp(1.15rem, 1.05rem + .45vw, 1.4rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.6rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.6vw, 4.6rem);
  --step-5: clamp(3.4rem, 1.6rem + 8vw, 6rem);

  color-scheme: light;
  scrollbar-color: var(--vermilion) var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Lenis inertial scroll (vendor/lenis.min.js, started in smooth-scroll.js) */
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--vermilion);
  overflow-x: clip;
}
::selection { background: var(--vermilion); color: var(--ink); }
.field--vermilion ::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
svg { display: block; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.field--yellow :focus-visible, .field--paper :focus-visible { outline-color: var(--ultra); }
.field--vermilion :focus-visible { outline-color: var(--ink); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--yellow); color: var(--ink); padding: .6em 1em; font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.railed { padding-left: calc(var(--gutter) + var(--rail-col)); position: relative; }

/* ---------- fields ---------- */
.field { position: relative; }
.field--ink { background: var(--ink); color: var(--paper); }
.field--paper { background: var(--paper); color: var(--ink); }
.field--yellow { background: var(--yellow); color: var(--ink); }
.field--ultra { background: var(--ultra); color: var(--paper); }
.field--green { background: var(--green); color: var(--paper); }
.field--vermilion { background: var(--vermilion); color: var(--ink); }

/* ---------- bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink); color: var(--paper);
  border-bottom: 1px solid #000;
}
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.mark { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.mark__glyph { width: 44px; height: 22px; }
.mark__word { font-weight: 800; font-stretch: 118%; letter-spacing: -.01em; font-size: 1.05rem; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.4vw, 2rem); font-weight: 600; font-stretch: 110%; }
.nav a { white-space: nowrap; text-decoration: none; padding: .3em 0; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--vermilion); }
.lang {
  display: inline-flex; border: 2px solid var(--paper); background: none; padding: 0; cursor: pointer;
  font-weight: 800; font-size: .8rem; letter-spacing: .04em;
}
.lang span { padding: .25em .55em; }
html[lang="it"] .lang [data-lang="it"], html[lang="en"] .lang [data-lang="en"] { background: var(--paper); color: var(--ink); }
.lang:hover span:not(:only-child) { transition: none; }

/* ---------- thread ---------- */
/* The tip rides with position: sticky so the compositor moves it in step with
   the scroll (JS-driven transforms lagged a frame during iOS momentum scroll).
   .thread spans the rail from first to last node (+9px room for the tip);
   overflow-y: clip trims the line above the start. */
.thread {
  position: absolute; z-index: 5; top: 0; left: 0;
  width: var(--rail-w); padding-block: 9px; pointer-events: none;
  overflow-y: clip;
}
.thread__ride { position: sticky; top: 62svh; height: 0; }
.thread__line {
  position: absolute; left: 0; bottom: 0; width: 100%;
  height: var(--thread-len, 0px); background: var(--vermilion);
}
.thread__tip {
  position: absolute; left: 50%; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  background: var(--vermilion); border-radius: 50%;
}
main { position: relative; }
.node {
  position: absolute; z-index: 6;
  width: 22px; height: 22px;
  left: calc(var(--gutter) + var(--rail-x) + var(--rail-w) / 2 - 11px);
  border: 4px solid currentColor; background: transparent;
  transition: background-color .01s linear, border-color .01s linear;
}
.node.is-lit { background: var(--vermilion); border-color: var(--vermilion); }
.field--vermilion .node.is-lit { background: var(--ink); border-color: var(--ink); }

/* ---------- hero ---------- */
.hero { min-height: calc(100svh - 64px); display: flex; align-items: stretch; }
.hero__in {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: end;
  padding-block: clamp(2rem, 5vw, 4.5rem) clamp(3rem, 6vw, 5.5rem);
}
.monogram { position: relative; align-self: center; }
.monogram__grid {
  --cols: 10; --rows: 6;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  aspect-ratio: var(--cols) / var(--rows);
  width: 100%; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mod { position: relative; }
.mod svg { width: 100%; height: 100%; overflow: visible; transition: transform .6s var(--ease); }
.mod path, .mod rect, .mod circle { transition: fill .01s linear; }
.monogram__hint {
  display: inline-flex; align-items: center; gap: .5em; margin-top: 1.1rem;
  font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: #bdbdb8;
}
.monogram__hint svg { width: 16px; height: 16px; color: var(--yellow); }

.hero__copy { position: relative; padding-bottom: 3.2rem; }
.hero__title {
  font-size: var(--step-4); line-height: .98; font-weight: 850; font-stretch: 112%;
  letter-spacing: -.03em; text-wrap: balance;
}
.hero__lede { margin-top: 1.4rem; max-width: 44ch; font-size: var(--step-1); line-height: 1.5; color: #d9dad5; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: .65em;
  padding: .95em 1.3em; text-decoration: none; font-weight: 750; font-stretch: 108%;
  color: var(--ink);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--vermilion { background: var(--vermilion); }
.btn--yellow { background: var(--yellow); }
.btn:hover { background: var(--paper); }
.btn:active { background: var(--ultra); color: var(--paper); }
.node--start { left: auto; bottom: 0; }

/* ---------- section type ---------- */
.h2 {
  font-size: var(--step-3); line-height: 1; font-weight: 850; font-stretch: 115%;
  letter-spacing: -.03em; text-wrap: balance; max-width: 18ch;
}
.lede { margin-top: 1.2rem; max-width: 56ch; font-size: var(--step-1); }

/* ---------- method ---------- */
.method { padding-block: clamp(5rem, 10vw, 9rem) clamp(4rem, 8vw, 7rem); }
.stations {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem); margin-top: clamp(3rem, 6vw, 5rem);
}
.station { position: relative; }
.stations__branch { position: absolute; z-index: 1; height: var(--rail-w); background: var(--vermilion); transform-origin: left center; transform: scaleX(0); pointer-events: none; }
.station__glyph { position: relative; z-index: 2; }
.station .node { top: 0; }
.station__glyph { width: clamp(72px, 7vw, 104px); height: auto; aspect-ratio: 1; margin-bottom: 1.4rem; }
.station h3 { font-size: var(--step-1); font-weight: 850; font-stretch: 118%; letter-spacing: -.01em; }
.station p { margin-top: .5rem; max-width: 32ch; }

/* reel: the method told as a vertical video, set like a poster plate */
.method__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.reel-cta {
  display: inline-flex; align-items: center; gap: .65em; margin-top: 2rem;
  padding: .95em 1.3em; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-weight: 750; font-stretch: 108%; line-height: 1.2; text-align: left;
}
.reel-cta svg { width: 18px; height: 18px; flex: none; color: var(--vermilion); }
.reel-cta__note { margin-left: .35em; font-weight: 500; color: #b9bab4; white-space: nowrap; }
.reel-cta:hover { background: var(--vermilion); color: var(--ink); }
.reel-cta:hover svg, .reel-cta:hover .reel-cta__note { color: var(--ink); }
.reel-cta:active { background: var(--ultra); color: var(--paper); }

.reel { position: relative; width: clamp(260px, 25vw, 340px); }
.reel::before {
  /* a yellow quarter disc tucked behind the top corner, like the plate art */
  content: ""; position: absolute; z-index: 0;
  top: -28px; right: -28px; width: 120px; height: 120px;
  background: var(--yellow); border-radius: 0 0 0 100%;
}
.reel__frame {
  position: relative; z-index: 1; aspect-ratio: 9 / 16;
  background: var(--ink) url("media/metodo-poster.jpg?v=4") center / cover;
  overflow: hidden;
}
.reel__video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.reel__bar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--rail-w); background: rgb(243 244 241 / .14); }
.reel__bar span {
  display: block; height: 100%; background: var(--vermilion);
  transform-origin: left center; transform: scaleX(var(--p, 0));
}
.reel__controls {
  position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--rail-w));
  display: flex; justify-content: space-between; gap: .5rem;
}
.reel__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-width: 44px; height: 44px; padding: 0 .8em; border: 0; cursor: pointer;
  background: var(--paper); color: var(--ink);
  font-size: .85rem; font-weight: 800; font-stretch: 108%;
}
.reel__btn svg { width: 18px; height: 18px; flex: none; }
.reel__btn:hover { background: var(--yellow); }
.reel__btn--sound { background: var(--yellow); }
.reel__btn--sound:hover { background: var(--paper); }
.reel__btn--sound[aria-pressed="true"] { background: var(--vermilion); }
.reel__btn .i-play, .reel__btn .i-on,
.reel.is-paused .i-pause, .reel__btn[aria-pressed="true"] .i-off { display: none; }
.reel.is-paused .i-play, .reel__btn[aria-pressed="true"] .i-on { display: block; }
.reel :focus-visible { outline-color: var(--yellow); }
.reel__cap { margin-top: .9rem; font-size: .85rem; font-weight: 700; font-stretch: 108%; }
.reel__cap::before {
  content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .5em;
  background: var(--vermilion); vertical-align: .02em;
}

/* ---------- works ---------- */
.works__head { padding-block: clamp(3rem, 6vw, 5rem) clamp(2.5rem, 4vw, 3.5rem); }
.plate { padding-block: clamp(4rem, 8vw, 7.5rem); overflow: hidden; }
.plate__in {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.plate--flip .plate__copy { order: 2; }
.plate__copy { position: relative; min-width: 0; container-type: inline-size; }
.plate__copy .node { top: .35em; }
.plate__title {
  font-size: min(var(--step-5), 16cqi); line-height: .9; font-weight: 900; font-stretch: 122%;
  letter-spacing: -.04em; text-wrap: balance;
}
.plate__text { margin-top: 1.4rem; max-width: 52ch; font-size: var(--step-1); line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.tags li {
  font-size: .85rem; font-weight: 700; font-stretch: 108%;
  padding: .35em .75em; border: 2px solid currentColor;
}

.plate__art { width: 100%; max-width: 560px; height: auto; justify-self: center; }
.box { transition: transform .7s var(--ease); transform-box: fill-box; }
.boxes:hover .box--a { transform: translateX(-10px); }
.boxes:hover .box--b { transform: translateY(-14px); }
.box--c { transform-box: view-box; transform-origin: 110px 130px; transition: transform .7s var(--ease); }
.boxes:hover .box--c { transform: rotate(180deg); }
.boxes:hover .box--d { transform: translate(14px, -10px); }
.win-cell { transition: transform .7s var(--ease); transform-box: fill-box; transform-origin: center; }
.window:hover .win-cell:nth-of-type(odd) { transform: rotate(90deg); }

.stamp { transition: fill .01s linear; }
.loyalty:hover .stamp { fill: var(--vermilion); }
.loyalty:hover .stamp:nth-of-type(9) { transition-delay: .12s; }
.loyalty:hover .stamp:nth-of-type(10) { transition-delay: .24s; }
.reward { transform-box: view-box; transform-origin: 340px 290px; transition: transform .7s var(--ease); }
.loyalty:hover .reward { transform: rotate(180deg); transition-delay: .3s; }
.coin { transition: transform .7s var(--ease); }
.loyalty:hover .coin { transform: translate(-14px, 10px); }

/* damage demo */
.damage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); gap: 1rem 1.5rem; align-items: start; justify-self: center; width: 100%; max-width: 560px; }
.damage__types { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.damage__types button {
  background: none; border: 2px solid var(--ink); padding: .4em .85em; cursor: pointer;
  font-weight: 700; font-stretch: 108%; font-size: .9rem;
}
.damage__types button[aria-checked="true"] { background: var(--ink); color: var(--yellow); }
.damage__types button:hover:not([aria-checked="true"]) { background: var(--paper); }
.damage__card {
  width: 100%; height: auto; cursor: crosshair; touch-action: manipulation;
  transition: transform .5s var(--ease);
}
.damage__card:hover { transform: rotate(-1.5deg) translateY(-4px); }
.damage__list { display: grid; gap: .4rem; align-content: start; min-height: 3rem; counter-reset: dmg; }
.damage__list li {
  display: flex; align-items: center; gap: .6rem; font-weight: 700;
  animation: dmg-in .4s var(--ease);
}
.damage__list li .dot {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--vermilion); color: var(--ink); font-size: .8rem; font-weight: 850;
  border: 2px solid var(--ink);
}
.damage__list .empty { font-weight: 500; color: #4b3a05; animation: none; }
.damage__note { grid-column: 1 / -1; font-size: .85rem; color: #3d2f04; }
.damage__reset {
  background: none; border: 0; padding: 0; cursor: pointer; font-weight: 800;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em;
}
.damage__marks .mk { animation: mk-in .45s var(--ease) both; transform-box: fill-box; transform-origin: center; }
@keyframes mk-in { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes dmg-in { from { transform: translateX(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- contact ---------- */
.contact { padding-top: clamp(5rem, 10vw, 9rem); }
.contact .railed { container-type: inline-size; }
.contact .node--end { top: .6rem; }
.contact__title {
  font-size: min(13rem, 12.5cqi); line-height: .85; font-weight: 900; font-stretch: 112%;
  letter-spacing: -.04em;
}
.contact__lede { margin-top: 1.6rem; max-width: 46ch; font-size: var(--step-1); font-weight: 500; }
.socials { margin-top: clamp(2.5rem, 5vw, 4rem); border-top: 3px solid var(--ink); }
.socials a {
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.5rem);
  padding-block: clamp(1rem, 2.4vw, 1.8rem); padding-inline: .25rem;
  border-bottom: 3px solid var(--ink); text-decoration: none;
  font-size: var(--step-3); font-weight: 850; font-stretch: 118%; letter-spacing: -.02em; line-height: 1;
}
.socials a > svg:first-child { width: .8em; height: .8em; flex: none; }
.socials__arrow { width: .7em; height: .7em; margin-left: auto; transition: transform .3s var(--ease); }
.socials a:hover { background: var(--ink); color: var(--vermilion); }
.socials__label { display: flex; flex-direction: column; gap: .45rem; }
.socials__addr { font-size: var(--step-1); font-weight: 700; font-stretch: 100%; letter-spacing: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.socials a:hover .socials__arrow { transform: translate(4px, -4px); }
.foot { margin-top: clamp(4rem, 8vw, 7rem); background: var(--ink); color: #c9cac4; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.5rem; font-size: .85rem; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3.5rem; }
}
@media (max-width: 900px) {
  :root { --rail-col: 40px; --rail-w: 4px; }
  .hero { min-height: 0; }
  .hero__in { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero__copy { padding-left: var(--rail-col); }
  .node--start { left: calc(var(--rail-w) / 2 - 11px); }
  .plate__in { grid-template-columns: minmax(0, 1fr); }
  .plate--flip .plate__copy { order: 0; }
  .method__head { grid-template-columns: minmax(0, 1fr); }
  .reel { width: min(100%, 340px); margin-top: .5rem; }
  .reel::before { top: -18px; right: -18px; width: 84px; height: 84px; }
}
@media (max-width: 560px) {
  :root { --rail-col: 32px; }
  .nav a:not([href="#contatti"]):not(.legal__home) { display: none; }
  .bar:has(.legal__home) .mark__word { display: none; }
  .mark__word { font-size: .95rem; }
  .stations { grid-template-columns: 1fr; row-gap: 2.75rem; }
  .damage { grid-template-columns: 1fr; }
  .damage__card { max-width: 300px; justify-self: center; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .reel-cta { width: 100%; }
  .reel { width: min(100% - 18px, 340px); }
  .socials__addr { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- legal page ---------- */
html[lang="it"] body [lang="en"], html[lang="en"] body [lang="it"] { display: none; }
.foot a { text-decoration: none; border-bottom: 2px solid transparent; }
.foot a:hover { color: var(--paper); border-bottom-color: var(--vermilion); }
.legal { padding-block: clamp(3.5rem, 8vw, 7rem); }
.legal__in { max-width: 860px; }
.legal__meta { margin-top: .9rem; font-size: .9rem; font-weight: 600; color: #4a4a46; }
.legal h2 { margin-top: 2.6rem; font-size: var(--step-1); font-weight: 850; font-stretch: 115%; letter-spacing: -.01em; }
.legal p, .legal li { max-width: 68ch; }
.legal p { margin-top: .8rem; }
.legal ul { margin-top: 1rem; display: grid; gap: .9rem; }
.legal li { padding-left: 1.4rem; position: relative; }
.legal li::before { content: ""; position: absolute; left: 0; top: .55em; width: .55rem; height: .55rem; background: var(--vermilion); }
.legal a { text-decoration-color: var(--vermilion); }
.legal .foot { margin-top: 0; }
body > .foot { margin-top: 0; }
