/* ============================================================
   ERBORISTERIA ASTRAGALO — Milano Isola
   L'erbario: carta, inchiostro verde, tavole botaniche
   ============================================================ */

:root {
  --carta:        #F5F1E6;   /* carta d'erbario */
  --carta-scura:  #ECE6D4;   /* tavole alternate */
  --carta-viva:   #FBF8F0;   /* card campioni */
  --inchiostro:   #2E4A3A;   /* l'inchiostro di tutto il sito è verde */
  --tenue:        #5F7565;   /* testo secondario */
  --salvia:       #8FA98F;
  --calendula:    #C4842F;   /* accento caldo, CTA */
  --calendula-su: #2A2114;
  --bruno:        #6E5640;
  --verde-notte:  #24382C;   /* intro e tavole scure */

  --f-serif: "EB Garamond", "Georgia", serif;
  --f-sans: "Karla", "Segoe UI", Arial, sans-serif;

  --maxw: 1060px;
  --rail: 96px;
  --pad: clamp(20px, 5vw, 60px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-padding-top: 24px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.7;
  background-color: var(--carta);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.29 0 0 0 0 0.23 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
  color: var(--inchiostro);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--calendula); color: var(--carta-viva); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--inchiostro);
  outline-offset: 3px;
  border-radius: 2px;
}
.tavola-scura :focus-visible,
.intro :focus-visible { outline-color: var(--carta); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px; left: 16px;
  z-index: 400;
  background: var(--inchiostro);
  color: var(--carta);
  padding: 10px 18px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ============ INTRO "LA GERMINAZIONE" ============ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--verde-notte);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1300px;
}

body.intro-lock { overflow: hidden; }

.intro-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.intro--lift {
  transform: rotateX(-88deg) translateY(-4vh);
  transform-origin: 50% 0%;
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.3, 1), opacity 0.7s ease 0.2s;
  pointer-events: none;
}

.intro-pianta {
  width: min(46vmin, 300px);
  height: auto;
  overflow: visible;
}

.ip-stelo {
  stroke: var(--salvia);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: cresce 1.3s cubic-bezier(0.4, 0, 0.3, 1) 0.25s forwards;
}
@keyframes cresce {
  to { stroke-dashoffset: 0; }
}

.ip-foglia path {
  fill: rgba(143, 169, 143, 0.85);
  stroke: var(--salvia);
  stroke-width: 1.5;
}
.ip-foglia {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: left center;
  transform: scale(0) rotate(-14deg);
  animation: spunta 0.55s cubic-bezier(0.3, 1.2, 0.4, 1) forwards;
}
.ip-f2, .ip-f4, .ip-f6 { transform-origin: right center; transform: scale(0) rotate(14deg); }
.ip-f1 { animation-delay: 0.55s; }
.ip-f2 { animation-delay: 0.70s; }
.ip-f3 { animation-delay: 0.85s; }
.ip-f4 { animation-delay: 1.00s; }
.ip-f5 { animation-delay: 1.15s; }
.ip-f6 { animation-delay: 1.30s; }
@keyframes spunta {
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.ip-fiore ellipse {
  fill: rgba(196, 132, 47, 0.9);
  stroke: var(--calendula);
  stroke-width: 1;
}
.ip-fiore {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scale(0);
  animation: sboccia 0.5s cubic-bezier(0.3, 1.3, 0.4, 1) forwards;
}
.ip-fl4 { animation-delay: 1.50s; }
.ip-fl5 { animation-delay: 1.58s; }
.ip-fl1 { animation-delay: 1.66s; }
.ip-fl2 { animation-delay: 1.74s; }
.ip-fl3 { animation-delay: 1.84s; }
@keyframes sboccia {
  to { opacity: 1; transform: scale(1); }
}

.intro-nome {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(38px, 7vw, 64px);
  color: var(--carta);
  opacity: 0;
  animation: affiora 0.7s ease 2.0s forwards;
}
.intro-latino {
  font-family: var(--f-sans);
  font-size: clamp(11px, 1.6vw, 13.5px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 241, 230, 0.65);
  opacity: 0;
  animation: affiora 0.7s ease 2.25s forwards;
}
@keyframes affiora {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ingresso del frontespizio orchestrato con la fine dell'intro */
.has-intro .fronte-grid {
  opacity: 0;
  transform: translateY(18px);
}
.intro-done .fronte-grid {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease 0.25s, transform 0.8s ease 0.25s;
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .has-intro .fronte-grid { opacity: 1; transform: none; }
}

/* ============ REGISTRO (rail laterale) ============ */

.registro {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 0;
  border-right: 1px solid rgba(46, 74, 58, 0.18);
}

.registro-marca {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
  color: var(--inchiostro);
}
.registro-marca span { color: var(--calendula); }

.registro-voci {
  list-style: none;
  margin: auto 0;
  display: grid;
  gap: 6px;
}
.registro-voci a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 6px;
  min-width: 64px;
  text-decoration: none;
  border-radius: 6px;
  color: var(--tenue);
  transition: color 0.15s, background-color 0.15s;
}
.registro-voci a:hover { color: var(--inchiostro); }
.registro-voci a.is-active {
  color: var(--inchiostro);
  background: rgba(46, 74, 58, 0.08);
}
.registro-voci i {
  font-family: var(--f-serif);
  font-style: normal;
  font-size: 19px;
  line-height: 1;
}
.registro-voci span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.registro-lingua {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 32px;
  background: none;
  border: none;
  font-family: var(--f-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tenue);
  cursor: pointer;
  border-radius: 6px;
}
.lang-btn.is-active { color: var(--calendula); }
.lang-btn:hover { color: var(--inchiostro); }

/* ============ CHIAMA FLOTTANTE ============ */

.chiama-flott {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vw, 28px);
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--inchiostro);
  color: var(--carta-viva);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(36, 56, 44, 0.35);
  transition: transform 0.15s, background-color 0.15s;
}
.chiama-flott:hover { background: #223A2C; transform: translateY(-2px); }
.chiama-punto {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--calendula);
  flex: none;
}

/* ============ BOTTONI ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 15px 28px;
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:active { transform: scale(0.98); }

.btn-calendula {
  background: var(--calendula);
  color: var(--carta-viva);
}
.btn-calendula:hover { background: #A96E24; }

.btn-quieto {
  border: 1.5px solid rgba(46, 74, 58, 0.35);
  color: var(--inchiostro);
}
.btn-quieto:hover { border-color: var(--inchiostro); }

/* ============ TAVOLE ============ */

main { margin-left: var(--rail); }

.tavola {
  padding: clamp(76px, 11vw, 140px) var(--pad);
  border-bottom: 1px solid rgba(46, 74, 58, 0.14);
}

.tavola-scura { background: var(--carta-scura); }

.tavola-corpo {
  max-width: var(--maxw);
  margin: 0 auto;
}

.tavola-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--calendula);
  margin-bottom: clamp(22px, 3vw, 34px);
}

.tavola-titolo {
  font-family: var(--f-serif);
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 0.6em;
}

/* ============ TAVOLA I — FRONTESPIZIO ============ */

.tavola-fronte {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.fronte-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(32px, 5vw, 70px);
  align-items: center;
  width: 100%;
}

.fronte-titolo {
  font-family: var(--f-serif);
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.fronte-titolo em {
  font-style: italic;
  color: var(--calendula);
}

.fronte-latino {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--tenue);
  margin: 14px 0 22px;
}
.fronte-latino span { font-style: normal; font-size: 0.82em; letter-spacing: 0.06em; }

.fronte-sub {
  max-width: 520px;
  font-size: clamp(16.5px, 1.9vw, 19px);
  color: var(--tenue);
  margin-bottom: 34px;
}

.fronte-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.fronte-firma {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--tenue);
}

.fronte-pianta {
  position: relative;
  margin: 0 auto;
  width: min(100%, 320px);
}

.pt-stelo { stroke: var(--salvia); stroke-width: 3; stroke-linecap: round; }
.pt-foglia { fill: rgba(143, 169, 143, 0.55); stroke: var(--salvia); stroke-width: 1.5; }
.pt-fiore { fill: rgba(196, 132, 47, 0.65); stroke: var(--calendula); stroke-width: 1; }

.nota {
  position: absolute;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--tenue);
  white-space: nowrap;
}
.nota::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 34px;
  height: 1px;
  background: rgba(95, 117, 101, 0.55);
}
.nota-1 { right: 102%; top: 74%; } .nota-1::before { left: calc(100% + 6px); }
.nota-2 { left: 102%; top: 6%; }  .nota-2::before { right: calc(100% + 6px); }
.nota-3 { left: 104%; top: 46%; } .nota-3::before { right: calc(100% + 6px); }

/* ============ TAVOLA II — LA BOTTEGA ============ */

.bottega-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(32px, 5vw, 70px);
  align-items: start;
}

.bottega-testo p {
  color: var(--tenue);
  max-width: 560px;
}
.bottega-testo p + p { margin-top: 1.1em; }

.bottega-voci {
  list-style: none;
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bottega-voci li {
  font-size: 14px;
  font-weight: 700;
  color: var(--inchiostro);
  background: rgba(46, 74, 58, 0.08);
  border: 1px solid rgba(46, 74, 58, 0.16);
  border-radius: 999px;
  padding: 8px 16px;
}

.bottega-foto {
  justify-self: center;
  max-width: 330px;
  background: var(--carta-viva);
  padding: 14px 14px 16px;
  border: 1px solid rgba(46, 74, 58, 0.14);
  box-shadow: 0 14px 34px rgba(46, 74, 58, 0.14);
  transform: rotate(1.6deg);
  position: relative;
}
.bottega-foto::before,
.bottega-foto::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 74px;
  height: 26px;
  background: rgba(196, 132, 47, 0.28);
  border: 1px solid rgba(196, 132, 47, 0.18);
}
.bottega-foto::before { left: 14%; transform: rotate(-5deg); }
.bottega-foto::after  { right: 14%; transform: rotate(4deg); }

.bottega-foto img {
  width: 100%;
  height: auto;
}
.bottega-foto figcaption {
  margin-top: 12px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tenue);
}

/* ============ TAVOLA III — L'ERBARIO ============ */

.erbario {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(30px, 4vw, 46px);
}

.campione {
  position: relative;
  background: var(--carta-viva);
  border: 1px solid rgba(46, 74, 58, 0.16);
  padding: 26px 22px 24px;
  box-shadow: 0 8px 22px rgba(46, 74, 58, 0.08);
}
.campione::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 84px;
  height: 22px;
  background: rgba(143, 169, 143, 0.3);
  border: 1px solid rgba(143, 169, 143, 0.25);
}

.campione svg {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
}
.c-tratto { stroke: var(--salvia); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.c-verde  { fill: rgba(143, 169, 143, 0.55); stroke: var(--salvia); stroke-width: 1.4; }
.c-fiore  { fill: rgba(196, 132, 47, 0.6); stroke: var(--calendula); stroke-width: 1; }
.c-petalo { fill: rgba(251, 248, 240, 0.9); stroke: var(--salvia); stroke-width: 1.4; }
.c-petalo-g ellipse { fill: rgba(196, 132, 47, 0.42); stroke: var(--calendula); stroke-width: 1; }

.campione h3 {
  font-family: var(--f-serif);
  font-size: 21px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2px;
}

.campione-lat {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  text-align: center;
  color: var(--calendula);
  margin-bottom: 12px;
}

.campione p:not(.campione-lat) {
  font-size: 14.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--tenue);
}

.campione-invito { background: rgba(46, 74, 58, 0.05); }

/* ============ TAVOLA IV — LE TISANE ============ */

.tisana-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 70px);
  align-items: start;
}
.tisana-grid p {
  color: var(--tenue);
  max-width: 560px;
}
.tisana-grid p + p { margin-top: 1.1em; }

.tisana-passi {
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(46, 74, 58, 0.2);
}
.tisana-passi li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 20px 4px;
  border-bottom: 1px solid rgba(46, 74, 58, 0.2);
}
.tisana-passi em {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 26px;
  color: var(--calendula);
  min-width: 34px;
}
.tisana-passi span {
  font-size: 15.5px;
  color: var(--inchiostro);
}

/* ============ TAVOLA V — DOVE E QUANDO ============ */

.dove-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 70px);
  align-items: start;
}

.dove-indirizzo {
  font-family: var(--f-serif);
  font-style: normal;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.35;
  margin-bottom: 14px;
}

.dove-metro {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--tenue);
  margin-bottom: 26px;
}
.metro-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #A85C98; /* lilla della M5 */
  flex: none;
}

.dove-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.dove-social {
  font-size: 15px;
  color: var(--tenue);
}
.dove-social a {
  color: var(--inchiostro);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 74, 58, 0.35);
}
.dove-social a:hover { border-color: var(--calendula); color: var(--calendula); }

.orari-tabella {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.orari-tabella th,
.orari-tabella td {
  text-align: left;
  padding: 14px 0;
  border-bottom: 1px solid rgba(46, 74, 58, 0.2);
  font-weight: 500;
}
.orari-tabella tr:first-child th,
.orari-tabella tr:first-child td { border-top: 1px solid rgba(46, 74, 58, 0.2); }
.orari-tabella td {
  text-align: right;
  font-family: var(--f-serif);
  font-size: 17px;
}
.orari-tabella .orari-sub { font-style: italic; color: var(--tenue); font-weight: 400; }

.orari-nota {
  margin-top: 16px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--tenue);
}

/* ============ COLOPHON ============ */

.colophon {
  margin-left: var(--rail);
  padding: 34px var(--pad) 110px;
  text-align: center;
}
.colophon-riga {
  font-family: var(--f-serif);
  font-size: 15.5px;
}
.colophon-nota {
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--tenue);
}

/* ============ REVEAL ============ */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s ease, transform 0.65s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 980px) {
  .fronte-grid { grid-template-columns: 1fr; }
  .fronte-pianta { width: min(56vw, 260px); }
  .nota-1 { right: auto; left: -34%; }
  .erbario { grid-template-columns: repeat(2, 1fr); }
  .bottega-grid,
  .tisana-grid,
  .dove-grid { grid-template-columns: 1fr; }
  .bottega-foto { justify-self: start; }
}

@media (max-width: 760px) {
  :root { --rail: 0px; }

  main, .colophon { margin-left: 0; }

  .registro {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(245, 241, 230, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: none;
    border-bottom: 1px solid rgba(46, 74, 58, 0.18);
  }
  .registro-marca { font-size: 26px; }
  .registro-voci {
    margin: 0 auto;
    display: flex;
    gap: 2px;
  }
  .registro-voci a { min-width: 40px; padding: 7px 5px; }
  .registro-voci span { display: none; }
  .registro-lingua { flex-direction: row; }

  html { scroll-padding-top: 70px; }

  .tavola-fronte { padding-top: 96px; }
  .fronte-cta .btn { width: 100%; }

  .nota { display: none; }

  .erbario { grid-template-columns: 1fr; }

  .chiama-flott {
    left: 14px;
    right: 14px;
    justify-content: center;
  }

  .colophon { padding-bottom: 130px; }
}
