/* Shardana Tribes — design system */
:root {
  --notte: #12324A;
  --notte-2: #0C2436;
  --carta: #F7F0E3;
  --sabbia: #F2E6D2;
  --brace: #F0C25C;
  --ocra: #D69A3A;
  --terra: #B4552B;
  --terra-testo: #A34A24; /* terra scurita per testi piccoli (contrasto AA) */
  --ink: #14283A;
  --muted: #4A5A68;
  --on-dark-muted: #BFD0DC;
  --line: rgba(18, 50, 74, .16);

  --display: "Bricolage Grotesque", "Avenir Next Condensed", system-ui, sans-serif;
  --accent: "Fraunces", Georgia, serif;
  --body: "Figtree", "Avenir Next", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 44px);
  --radius: 24px;
  --radius-sm: 16px;
  --header-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--carta);
  color: var(--ink);
  font: 400 17.5px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; border-radius: 6px; }
.section--dark :focus-visible, .site-footer :focus-visible { outline-color: var(--brace); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--notte); color: var(--sabbia); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 780px; }
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section--tight { padding-top: clamp(28px, 4vw, 48px); }
.section--dark { background: var(--notte); color: var(--sabbia); }
.section--brace { background: var(--brace); color: var(--notte); }
.section--white { background: #fff; }

/* ---------- type ---------- */
.kicker {
  display: inline-block;
  font: 700 12.5px/1.2 var(--body);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terra-testo);
  margin: 0 0 18px;
}
.section--dark .kicker { color: var(--brace); }
.section--brace .kicker { color: var(--notte); }

.h-display {
  font: 800 clamp(40px, 7.4vw, 104px)/.92 var(--display);
  letter-spacing: -.045em;
  color: var(--notte);
  margin: 0 0 .32em;
  max-width: 15ch;
  overflow-wrap: break-word;
  hyphens: manual;
  text-wrap: balance;
}
.h-display--m { font-size: clamp(36px, 5.6vw, 76px); max-width: 17ch; }
.h-display--s { font-size: clamp(30px, 4.2vw, 54px); max-width: 20ch; }
.h-display em {
  font-family: var(--accent);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.03em;
  color: var(--terra);
}
.section--dark .h-display { color: var(--sabbia); }
.section--dark .h-display em { color: var(--brace); }
.section--brace .h-display em { color: var(--terra); }

.h-card { font: 700 clamp(21px, 2vw, 25px)/1.15 var(--display); letter-spacing: -.015em; margin: 0 0 10px; color: var(--notte); }
.section--dark .h-card { color: var(--sabbia); }

.lede { font-size: clamp(18px, 1.55vw, 21px); line-height: 1.55; color: var(--muted); max-width: 40ch; }
.section--dark .lede, .section--dark p { color: var(--on-dark-muted); }
.prose { max-width: 62ch; }
.prose p { color: var(--muted); }
.section--dark .prose p { color: var(--on-dark-muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  border-radius: 999px; border: 0; cursor: pointer;
  padding: 15px 24px;
  font: 700 15.5px/1 var(--body);
  text-decoration: none;
  transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn--terra { background: var(--terra); color: #fff; box-shadow: 0 14px 30px -14px rgba(180, 85, 43, .8); }
.btn--terra:hover { background: #9E4824; }
.btn--notte { background: var(--notte); color: var(--sabbia); }
.btn--notte:hover { background: #1C4766; }
.btn--brace { background: var(--brace); color: var(--notte); }
.btn--brace:hover { background: #F5CF7A; }
.btn--sm { padding: 11px 18px; font-size: 14.5px; }

/* ---------- cards & grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 22px); }
.card { background: #fff; border-radius: var(--radius-sm); padding: clamp(22px, 2.4vw, 30px); }
.card p { margin: 0; color: var(--muted); font-size: 16.5px; }
.section--white .card { background: var(--carta); }
.section--dark .card { background: rgba(242, 230, 210, .06); border: 1px solid rgba(242, 230, 210, .14); }
.img-hero { border-radius: var(--radius); overflow: hidden; background: #C6A27A; }
.img-hero img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- tessuto (Sardinian rhombus band) ---------- */
.tessuto {
  height: 22px;
  background-color: var(--notte);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='22'%3E%3Cpath d='M0 11 L11 0 L22 11 L11 22Z' fill='%23D69A3A'/%3E%3Cpath d='M22 11 L33 0 L44 11 L33 22Z' fill='%23B4552B'/%3E%3Cpath d='M8 11 L11 8 L14 11 L11 14Z' fill='%23F2E6D2'/%3E%3Cpath d='M30 11 L33 8 L36 11 L33 14Z' fill='%23F2E6D2'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 240, 227, .92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--terra); flex-shrink: 0; }
.brand img { width: 42px; height: 42px; }
.site-header .brand img { width: 58px; height: 58px; }
.brand span { font: 800 clamp(17px, 1.7vw, 22px)/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav__panel { display: flex; align-items: center; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a { display: block; padding: 10px 14px; border-radius: 999px; font: 600 15px/1 var(--body); color: var(--notte); text-decoration: none; transition: background-color .2s; }
.nav__links a:hover { background: rgba(18, 50, 74, .07); }
.lang-switch {
  display: inline-grid; place-items: center;
  min-width: 40px; height: 34px; padding: 0 10px; margin: 0 8px 0 4px;
  border: 1.5px solid var(--notte); border-radius: 999px;
  font: 700 12.5px/1 var(--body); letter-spacing: .06em;
  color: var(--notte); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.lang-switch:hover { background: var(--notte); color: var(--sabbia); }
.nav__toggle {
  display: none;
  align-items: center; gap: 8px;
  background: none; border: 1.5px solid var(--notte); border-radius: 999px;
  color: var(--notte); font: 700 14px/1 var(--body);
  padding: 9px 14px; cursor: pointer;
}
.nav__toggle-bars { width: 16px; height: 10px; position: relative; }
.nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, top .25s; }
.nav__toggle-bars::before { top: 0; }
.nav__toggle-bars::after { top: 8px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { top: 4px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { top: 4px; transform: rotate(-45deg); }

@media (max-width: 920px) {
  .nav__toggle { display: inline-flex; }
  .nav__panel {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--carta); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 22px;
    display: none;
  }
  .nav__panel.is-open { display: block; }
  .nav__links { flex-direction: column; align-items: stretch; }
  .nav__links a { font-size: 19px; padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav__panel .lang-switch { margin: 16px 0 0; }
}
@media (max-width: 520px) {
  .site-header .brand img { width: 46px; height: 46px; }
  :root { --header-h: 76px; }
  .brand span { font-size: 15px; }
  .site-header .btn--sm { padding: 10px 14px; font-size: 13.5px; }
  .nav__toggle { padding: 9px 11px; }
  .nav__toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (max-width: 420px) {
  .site-header .brand { gap: 8px; }
  .site-header .brand span { font-size: 14px; line-height: .95; max-width: 5.6em; white-space: normal; }
}
@media (max-width: 360px) {
  .site-header .btn--sm { padding: 9px 11px; font-size: 12.5px; }
  .site-header .brand img { width: 34px; height: 34px; }
  .nav { gap: 4px; }
}
/* ---------- footer ---------- */
.site-footer { background: var(--notte); color: var(--sabbia); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 44px 0; }
.site-footer .brand { color: var(--sabbia); }
.site-footer__tagline { color: var(--on-dark-muted); max-width: 34ch; margin: 12px 0 0; font-size: 15.5px; }
.site-footer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: 14.5px; }
.site-footer__links a { color: var(--sabbia); text-decoration: none; opacity: .85; }
.site-footer__links a:hover { opacity: 1; text-decoration: underline; }
.site-footer .lang-switch { border-color: var(--sabbia); color: var(--sabbia); margin: 0; }
.site-footer .lang-switch:hover { background: var(--sabbia); color: var(--notte); }
.site-footer__rights { width: 100%; border-top: 1px solid rgba(242, 230, 210, .14); padding-top: 20px; font-size: 13.5px; color: var(--on-dark-muted); }

/* ========== HOME ========== */
.link-arrow { font-weight: 700; color: var(--notte); text-decoration: none; border-bottom: 2px solid var(--ocra); padding-bottom: 3px; }
.link-arrow:hover { border-color: var(--terra); }

/* 1 hero */
.hero { padding-top: clamp(36px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.hero__title { max-width: 14ch; }
.hero__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; margin-bottom: clamp(32px, 4vw, 52px); }
.hero__row .lede { margin: 0; max-width: 46ch; }
.hero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero__media { max-width: calc(var(--wrap) + 80px); margin: 0 auto; padding: 0 clamp(8px, 2vw, 20px); }
.hero__img { aspect-ratio: 16 / 7.5; }
.hero__band {
  list-style: none; margin: -56px clamp(16px, 5vw, 64px) 0; padding: clamp(18px, 2vw, 26px) clamp(20px, 2.4vw, 32px);
  position: relative;
  background: var(--brace); color: var(--notte); border-radius: 22px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 28px;
  box-shadow: 0 24px 50px -28px rgba(18, 50, 74, .55);
}
.hero__band li { border-bottom: 1.5px solid rgba(18, 50, 74, .3); padding-bottom: 10px; }
.hero__band small { display: block; font: 700 11px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
.hero__band span { font: 600 clamp(16px, 1.4vw, 19px)/1.25 var(--body); }
@media (max-width: 760px) {
  .hero__img { aspect-ratio: 4 / 3.4; }
  .hero__band { grid-template-columns: 1fr; margin-top: -36px; }
}

/* 2 mirror */
.mirror__cards { margin-top: clamp(28px, 3vw, 44px); }
.mirror__closing { margin: clamp(28px, 3vw, 40px) 0 0; font: 400 clamp(21px, 2.1vw, 28px)/1.35 var(--accent); font-style: italic; color: var(--notte); max-width: 34ch; }

/* 3 why now */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.split .prose { padding-top: 8px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* 4 manifesto excerpt */
.manifesto-excerpt { text-align: left; }
.manifesto-excerpt__text { font: 400 clamp(24px, 3vw, 40px)/1.3 var(--accent); color: var(--sabbia) !important; max-width: 30ch; margin: 0 0 36px; }
.manifesto-excerpt__text b { font-weight: 600; font-style: italic; color: var(--brace); }

/* 5 bridge */
.bridge { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin: clamp(28px, 3vw, 44px) 0; }
.bridge__loop { color: var(--terra); display: grid; place-items: center; }
.bridge__img { aspect-ratio: 16 / 7; }
.bridge__note { margin: 28px 0 0; font: 600 clamp(18px, 1.6vw, 21px)/1.45 var(--body); color: var(--notte); max-width: 52ch; }
@media (max-width: 760px) {
  .bridge { grid-template-columns: 1fr; }
  .bridge__loop svg { transform: rotate(90deg); width: 60px; height: 60px; }
  .bridge__img { aspect-ratio: 4 / 3; }
}

/* 6 method */
.steps { list-style: none; margin: clamp(32px, 4vw, 52px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { border-top: 3px solid var(--ocra); padding-top: 18px; }
.step__n { display: block; font: 800 34px/1 var(--display); color: var(--ocra); margin-bottom: 14px; }
.step p { color: var(--muted); font-size: 16px; margin: 0; }
.tools-line { margin: clamp(32px, 4vw, 48px) 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15.5px; color: var(--muted); max-width: 70ch; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* 7 outcomes */
.outcomes { margin-top: clamp(28px, 3vw, 44px); }
.outcome__mark { display: block; width: 26px; height: 26px; margin-bottom: 18px; background: var(--ocra); transform: rotate(45deg); border-radius: 3px; box-shadow: inset 0 0 0 8px var(--ocra), inset 0 0 0 13px var(--sabbia); }
.outcome:nth-child(2) .outcome__mark { background: var(--terra); box-shadow: inset 0 0 0 8px var(--terra), inset 0 0 0 13px var(--sabbia); }
.outcome:nth-child(3) .outcome__mark { background: var(--notte); box-shadow: inset 0 0 0 8px var(--notte), inset 0 0 0 13px var(--sabbia); }

/* 8 about */
.about { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.about__portrait { aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 10px var(--sabbia), 0 0 0 13px var(--notte); margin: 14px; }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.section--brace .prose p { color: var(--notte); }
.about__name { margin: 8px 0 0; padding-left: 16px; border-left: 3px solid var(--terra); font-size: 15.5px; color: var(--notte); max-width: 56ch; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .about__portrait { max-width: 280px; } }

/* 9 contact + form */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.form { background: #fff; border-radius: var(--radius); padding: clamp(22px, 3vw, 38px); display: grid; gap: 20px; box-shadow: 0 30px 60px -40px rgba(18, 50, 74, .45); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.field label { display: block; font: 600 14.5px/1.3 var(--body); color: var(--notte); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; font: 400 16.5px/1.5 var(--body); color: var(--ink);
  background: var(--carta); border: 1.5px solid transparent; border-radius: 12px;
  padding: 12px 14px; transition: border-color .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--terra); background: #fff; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 14.5px; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--terra); }
.consent a { color: var(--terra); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form__foot small { color: var(--muted); font-size: 13.5px; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ========== MANIFESTO ========== */
.manifesto-hero { padding-bottom: clamp(32px, 4vw, 56px); }
.manifesto-img { aspect-ratio: 16 / 7; }
.theses { list-style: none; margin: 0; padding: 0; }
.thesis { position: relative; padding: clamp(28px, 3.4vw, 44px) 0 clamp(28px, 3.4vw, 44px) clamp(56px, 7vw, 92px); border-top: 1px solid var(--line); }
.thesis:last-child { border-bottom: 1px solid var(--line); }
.thesis__n { position: absolute; left: 0; top: clamp(26px, 3.2vw, 40px); font: 800 clamp(30px, 3.6vw, 46px)/1 var(--display); color: var(--ocra); }
.thesis__title { font: 400 clamp(26px, 3.2vw, 40px)/1.15 var(--accent); font-style: italic; letter-spacing: -.02em; color: var(--notte); margin: 0 0 12px; }
.thesis p { margin: 0; color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); max-width: 56ch; }
.manifesto-closing .manifesto-excerpt__text { max-width: 26ch; }

/* ========== THANKS ========== */
.thanks { min-height: 62vh; display: flex; align-items: center; }
.thanks__emblem { width: 96px; height: 96px; margin-bottom: 28px; }
.thanks .lede { margin-bottom: 32px; }

/* ========== PRIVACY ========== */
.legal h2 { font: 700 22px/1.25 var(--display); color: var(--notte); margin: 40px 0 10px; }
.legal p { color: var(--muted); }
.legal a { color: var(--terra); }
.legal__updated { font-size: 14px; color: var(--muted); }

/* ========== MOTION ========== */
/* Nascosto solo se JS è attivo e l'utente non chiede movimento ridotto.
   Fallback: dopo 2.5s tutto compare comunque, anche se main.js non arriva. */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal]:not(.is-in) {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal-fallback 0s linear 2.5s forwards;
  }
  html.js.reveal-ready [data-reveal]:not(.is-in) { animation: none; }
  html.js [data-reveal] { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .grid-3 > [data-reveal]:nth-child(2), .steps > [data-reveal]:nth-child(2) { transition-delay: .08s; }
  .grid-3 > [data-reveal]:nth-child(3), .steps > [data-reveal]:nth-child(3) { transition-delay: .16s; }
  .steps > [data-reveal]:nth-child(4) { transition-delay: .24s; }
}
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }
