/* ENDORPHIN — libreria componenti (prefisso .en-).
   Usa SOLO variabili di assets/css/tokens.css: per cambiare uno stile ovunque
   modifica brand/tokens.json e rigenera i token, non questo file. */

body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.en-stage { padding: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start; }
.en-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.en-wrap { width: 100%; max-width: var(--content-max); margin: 0 auto; padding-inline: var(--space-7); box-sizing: border-box; }
.en-section { padding-block: var(--space-10); border-top: var(--stroke-hair) solid var(--line); }
.en-icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: var(--stroke-control) solid var(--focus); outline-offset: 3px; }

/* Wordmark */
.en-wordmark { display: inline-block; font-family: var(--font-sans); font-weight: 700; text-transform: uppercase; line-height: 0.85; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.en-wordmark--s { font-size: 24px; }
.en-wordmark--m { font-size: 48px; letter-spacing: -0.03em; }
.en-wordmark--l { font-size: 96px; letter-spacing: -0.045em; }
.en-wordmark--xl { font-size: clamp(56px, 16vw, 300px); letter-spacing: -0.06em; line-height: 0.8; }

/* Testi */
.en-eyebrow { margin: 0; font-size: 13px; line-height: 1.2; font-weight: 700; letter-spacing: var(--eyebrow-tracking); text-transform: var(--btn-case); color: var(--ink-muted); }
.en-display { margin: 0; font-weight: var(--display-weight); text-transform: var(--heading-case); text-wrap: balance; }
.en-display--xl { font-size: clamp(64px, 12.6vw, 196px); line-height: 0.84; letter-spacing: -0.045em; }
.en-display--l { font-size: clamp(48px, 8vw, 120px); line-height: 0.86; letter-spacing: var(--display-tracking); }
.en-display--m { font-size: clamp(40px, 5vw, 72px); line-height: 0.9; letter-spacing: var(--display-tracking); }
.en-display--s { font-size: 44px; line-height: 0.92; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.en-lead { margin: 0; max-width: 34ch; font-size: 21px; line-height: 1.4; }
.en-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-5); }
.en-section-head__title { display: flex; flex-direction: column; gap: var(--space-4); }
.en-section-head__aside { margin: 0; max-width: 40ch; color: var(--ink-muted); }

/* Button */
.en-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--control-m); padding: 0 22px; box-sizing: border-box; border: var(--stroke-control) solid var(--ink); border-radius: var(--radius-control); background: transparent; color: var(--ink); font-family: var(--font-sans); font-size: 13px; font-weight: var(--btn-weight); line-height: 1; letter-spacing: var(--btn-tracking); text-transform: var(--btn-case); text-decoration: none; cursor: pointer; transition: background-color var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast); }
.en-btn:hover { background: var(--ink); color: var(--ground); }
.en-btn--primary { background: var(--ink); color: var(--ground); }
.en-btn--primary:hover { background: transparent; color: var(--ink); }
.en-btn--action { background: var(--accent); border-color: var(--volt-edge); color: var(--on-volt); }
.en-btn--action:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.en-btn--on-volt { border-color: var(--on-volt); color: var(--on-volt); }
.en-btn--on-volt:hover { background: var(--on-volt); color: var(--brand-bone); }
.en-btn--on-volt.en-btn--primary { background: var(--on-volt); color: var(--brand-bone); }
.en-btn--on-volt.en-btn--primary:hover { background: transparent; color: var(--on-volt); }
.en-btn--s { min-height: var(--control-s); padding: 0 16px; font-size: 12px; }
.en-btn--l { min-height: var(--control-l); padding: 0 26px; font-size: 14px; }
.en-btn--block { display: flex; width: 100%; }
.en-btn[disabled], .en-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* Link button (pagina /links) */
.en-link-btn { border-radius: var(--radius-control); display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-height: var(--control-l); padding: 0 16px; box-sizing: border-box; border: var(--stroke-control) solid var(--ink); color: var(--ink); font-family: var(--font-sans); font-size: 15px; font-weight: var(--btn-weight); line-height: 1.2; letter-spacing: 0.06em; text-transform: var(--btn-case); text-decoration: none; transition: background-color var(--motion-fast), color var(--motion-fast); }
.en-link-btn:hover { background: var(--ink); color: var(--ground); }
.en-link-btn--primary { background: var(--ink); color: var(--ground); }
.en-link-btn--primary:hover { background: transparent; color: var(--ink); }
.en-link-btn__label { text-align: center; }
.en-link-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.en-link-tile { border-radius: var(--radius-control); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 96px; box-sizing: border-box; border: var(--stroke-control) solid var(--ink); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: var(--btn-case); text-decoration: none; transition: background-color var(--motion-fast), color var(--motion-fast); }
.en-link-tile:hover { background: var(--ink); color: var(--ground); }

/* Marquee */
.en-marquee { overflow: hidden; white-space: nowrap; background: var(--ink); color: var(--ground); padding: 14px 0; }
.en-marquee__track { display: inline-flex; animation: en-marquee var(--marquee-speed) linear infinite; }
.en-marquee__item { font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; line-height: 1; letter-spacing: -0.02em; text-transform: var(--heading-case); }
.en-marquee__item::after { content: "/"; margin: 0 0.8em; opacity: 0.35; }
@keyframes en-marquee { to { transform: translateX(-50%); } }

/* Run ticket */
.en-ticket { border-radius: var(--radius-card); display: flex; flex-direction: column; gap: var(--space-4); max-width: 360px; padding: 22px; box-sizing: border-box; background: var(--accent); color: var(--on-volt); border: var(--stroke-hair) solid var(--volt-edge); }
.en-ticket__top { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: 0.16em; text-transform: var(--btn-case); }
.en-ticket__when { margin: 0; font-size: 46px; font-weight: 700; line-height: 0.88; letter-spacing: -0.035em; text-transform: var(--heading-case); font-variant-numeric: tabular-nums; }
.en-ticket__where { padding-top: 14px; border-top: var(--stroke-control) dashed var(--on-volt); font-size: 15px; line-height: 1.35; }
.en-ticket__where strong { display: block; text-transform: var(--heading-case); }
.en-ticket__actions { display: flex; gap: var(--space-2); }
.en-ticket__actions .en-btn { flex: 1; padding: 0 12px; font-size: 12px; }

/* Step (come funziona) */
.en-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.en-step { display: flex; flex-direction: column; gap: 10px; padding-top: var(--space-6); border-top: var(--stroke-hair) solid var(--line); }
.en-step__num { font-size: 96px; font-weight: 700; line-height: 1; letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.en-step__title { margin: var(--space-4) 0 0; font-size: 26px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; text-transform: var(--heading-case); }
.en-step__text { margin: 0; color: var(--ink-muted); }

/* Stat */
.en-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
.en-stat { padding-top: var(--space-5); border-top: var(--stroke-rule) solid var(--ink); }
.en-stat__value { display: block; font-size: clamp(48px, 6.4vw, 96px); font-weight: 700; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.en-stat__label { display: block; margin-top: 10px; font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: 0.14em; text-transform: var(--btn-case); color: var(--ink-muted); }

/* Event row */
.en-event-list { margin: 0; padding: 0; list-style: none; border-top: var(--stroke-hair) solid var(--line); }
.en-event-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 24px; gap: 20px; align-items: center; padding: 18px 0; border-bottom: var(--stroke-hair) solid var(--line); color: var(--ink); text-decoration: none; }
.en-event-row__thumb { border-radius: var(--radius-media); filter: var(--photo-filter); width: 64px; height: 80px; object-fit: cover; background: var(--surface); }
.en-event-row__text { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; align-items: center; }
.en-event-row__date { font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: 0.08em; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.en-event-row__title { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.025em; text-transform: var(--heading-case); }
.en-event-row:hover .en-event-row__title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* Partner */
.en-partners { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: var(--stroke-hair) solid var(--line); border-left: var(--stroke-hair) solid var(--line); }
.en-partners > li { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 16px; border-right: var(--stroke-hair) solid var(--line); border-bottom: var(--stroke-hair) solid var(--line); font-size: clamp(18px, 2.2vw, 28px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; text-transform: var(--heading-case); text-align: center; }
.en-partners a { color: var(--ink); }

/* Badge */
.en-badge { border-radius: var(--radius-control); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; box-sizing: border-box; border: var(--stroke-hair) solid var(--line-strong); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0.12em; text-transform: var(--btn-case); white-space: nowrap; }
.en-badge::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.en-badge--live { background: var(--accent); border-color: var(--volt-edge); color: var(--on-volt); }
.en-badge--positive { color: var(--positive); border-color: var(--positive); }
.en-badge--warning { color: var(--warning); border-color: var(--warning); }
.en-badge--negative { color: var(--negative); border-color: var(--negative); }
.en-badge--flag { background: var(--flag); border-color: var(--flag); color: var(--on-flag); }

/* Field */
.en-field { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.en-field__label { font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: 0.14em; text-transform: var(--btn-case); }
.en-field__control { width: 100%; min-height: var(--control-m); padding: 0 14px; box-sizing: border-box; border: var(--stroke-control) solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface-sunk); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.3; }
.en-field__control::placeholder { color: var(--ink-muted); }
.en-field__control:focus { border-color: var(--focus); }
.en-field__control:focus-visible { outline: var(--stroke-control) solid var(--focus); outline-offset: 2px; }
textarea.en-field__control { min-height: 120px; padding: 12px 14px; resize: vertical; }
.en-field__help { font-size: 13px; color: var(--ink-muted); }
.en-field--error .en-field__control { border-color: var(--negative); }
.en-field--error .en-field__control:focus-visible { outline-color: var(--focus); }
.en-field__error { font-size: 13px; font-weight: 700; color: var(--negative); }

/* Choice (checkbox, radio) */
.en-choice { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; }
.en-choice input { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none; width: 22px; height: 22px; margin: 0; border: var(--stroke-control) solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface-sunk); cursor: pointer; }
.en-choice input:checked { background: var(--ink); border-color: var(--ink); }
.en-choice input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--ground); border-bottom: 2px solid var(--ground); transform: translateY(-1px) rotate(-45deg); }
.en-choice input[type="radio"] { border-radius: var(--radius-full); }
.en-choice input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--ground); }

/* Notice */
.en-notice { border-radius: var(--radius-card); display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; max-width: 520px; padding: 16px; box-sizing: border-box; border: var(--stroke-hair) solid var(--line-strong); background: var(--surface); font-size: 15px; line-height: 1.45; }
.en-notice__icon { width: 20px; height: 20px; }
.en-notice__title { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: var(--btn-case); }
.en-notice--positive { border-color: var(--positive); }
.en-notice--positive .en-notice__icon, .en-notice--positive .en-notice__title { color: var(--positive); }
.en-notice--warning { border-color: var(--warning); }
.en-notice--warning .en-notice__icon, .en-notice--warning .en-notice__title { color: var(--warning); }
.en-notice--negative { border-color: var(--negative); }
.en-notice--negative .en-notice__icon, .en-notice--negative .en-notice__title { color: var(--negative); }

/* Member card (tessera digitale) */
.en-member-card { border-radius: var(--radius-card); display: flex; flex-direction: column; justify-content: space-between; width: 100%; max-width: 400px; aspect-ratio: 1.586; padding: 22px; box-sizing: border-box; background: var(--flag); color: var(--on-flag); overflow: hidden; }
.en-member-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.en-member-card__wordmark { font-size: 30px; font-weight: 700; line-height: 0.85; letter-spacing: -0.03em; }
.en-member-card__type { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: var(--btn-case); }
.en-member-card__name { margin: 0; font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; text-transform: var(--heading-case); }
.en-member-card__meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: 0.1em; text-transform: var(--btn-case); font-variant-numeric: tabular-nums; }
.en-member-card__code { display: grid; place-items: center; width: 64px; height: 64px; background: var(--brand-bone); color: var(--brand-black); font-size: 10px; letter-spacing: 0.1em; }

/* Product card */
.en-product { display: flex; flex-direction: column; gap: 12px; max-width: 300px; color: var(--ink); text-decoration: none; }
.en-product__media { border-radius: var(--radius-card); position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); }
.en-product__media img { border-radius: var(--radius-media); filter: var(--photo-filter); display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--motion-media); }
.en-product:hover .en-product__media img { transform: scale(1.03); }
.en-product__media .en-badge { position: absolute; left: 10px; top: 10px; background: var(--ground); }
.en-product__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.en-product__name { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; text-transform: var(--heading-case); }
.en-product__price { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.en-product__meta { font-size: 14px; color: var(--ink-muted); }
.en-swatches { display: flex; gap: 6px; }
.en-swatch { width: 14px; height: 14px; border: var(--stroke-hair) solid var(--line-strong); }

/* Data table (admin) */
.en-table-wrap { border-radius: var(--radius-card); overflow-x: auto; border: var(--stroke-hair) solid var(--line); }
.en-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.en-table th { position: sticky; top: 0; padding: 12px 16px; background: var(--surface-sunk); border-bottom: var(--stroke-hair) solid var(--line); color: var(--ink-muted); font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: 0.14em; text-align: left; text-transform: var(--btn-case); white-space: nowrap; }
.en-table td { padding: 14px 16px; border-bottom: var(--stroke-hair) solid var(--line); vertical-align: middle; }
.en-table tbody tr:last-child td { border-bottom: 0; }
.en-table tbody tr:hover { background: var(--surface); }
.en-table__strong { font-weight: 700; text-transform: var(--heading-case); letter-spacing: -0.01em; }
.en-table__num { text-align: right; }
.en-table__actions { text-align: right; white-space: nowrap; }

/* Header */
.en-header { position: sticky; top: 0; z-index: 20; background: var(--ground); border-bottom: var(--stroke-hair) solid var(--line); }
.en-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); height: var(--header-h); padding-inline: var(--space-7); }
.en-nav { display: flex; align-items: center; gap: 28px; }
.en-nav a { color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: var(--btn-case); text-decoration: none; }
.en-nav a:hover, .en-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.en-header__actions { display: flex; align-items: center; gap: 12px; }
.en-live-chip { border-radius: var(--radius-control); display: inline-flex; align-items: center; gap: 8px; height: var(--control-s); padding: 0 14px; box-sizing: border-box; border: var(--stroke-hair) solid var(--line-strong); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: var(--btn-case); white-space: nowrap; }
.en-live-chip::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--accent); box-shadow: 0 0 0 1px var(--volt-edge); }
.en-menu-btn { display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }

/* Footer */
.en-footer { padding: var(--space-8) var(--space-7) var(--space-6); border-top: var(--stroke-hair) solid var(--line); }
.en-footer__cols { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--space-6); padding-bottom: var(--space-8); border-bottom: var(--stroke-hair) solid var(--line); }
.en-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.en-footer__col a { color: var(--ink); }
.en-footer__mark { padding-top: var(--space-6); }
.en-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: var(--space-6); font-size: 14px; color: var(--ink-muted); }
.en-socials { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.en-socials a { border-radius: var(--radius-control); display: grid; place-items: center; width: 48px; height: 48px; box-sizing: border-box; border: var(--stroke-hair) solid var(--line-strong); color: var(--ink); transition: background-color var(--motion-fast), color var(--motion-fast); }
.en-socials a:hover { background: var(--ink); color: var(--ground); }

/* Responsive */
@media (max-width: 900px) {
  .en-wrap, .en-header__inner { padding-inline: var(--space-4); }
  .en-header__inner { height: 60px; }
  .en-nav, .en-live-chip { display: none; }
  .en-menu-btn { display: grid; }
  .en-section { padding-block: 88px; }
  .en-footer { padding-inline: var(--space-4); }
  .en-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .en-steps { grid-template-columns: minmax(0, 1fr); }
  .en-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .en-partners { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .en-event-row { grid-template-columns: 52px minmax(0, 1fr) 20px; gap: 14px; padding: 14px 0; }
  .en-event-row__thumb { width: 52px; height: 64px; }
  .en-event-row__text { display: block; }
  .en-event-row__date { display: block; font-size: 12px; }
  .en-event-row__title { display: block; font-size: 19px; line-height: 1.05; }
  .en-ticket__when { font-size: 40px; }
}
@media (max-width: 360px) {
  .en-header__inner { gap: var(--space-2); }
  .en-header__inner .en-wordmark { font-size: 20px; }
  .en-header__actions { gap: var(--space-1); }
  .en-header__actions .en-btn { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .en-marquee__track { animation: none; }
  .en-btn, .en-link-btn, .en-link-tile, .en-socials a, .en-product__media img { transition: none; }
}
