/* LA FACTORY — V13 MOBILE REDESIGN
   Base: V10 PRE-MASTER approvata.
   Queste regole esistono SOLO sotto 901px: desktop e animazioni desktop restano V10. */

@media (max-width:900px){
  :root{--mp:20px}
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{position:relative}
  *,*:before,*:after{max-width:100%}
  img,svg,video,iframe{display:block;max-width:100%;height:auto}

  /* Mai spezzare una parola nel mezzo */
  h1,h2,h3,h4,p,a,strong,em,span,small,dt,dd,li{
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
    -webkit-hyphens:none!important;
  }

  /* HEADER */
  .site-header{
    height:68px!important;padding:0 var(--mp)!important;
    background:rgba(8,8,8,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  }
  .brand{position:relative;z-index:1002;white-space:nowrap!important;font-size:12px!important;gap:10px!important}
  .brand-mark{width:20px!important;height:34px!important;min-width:20px!important;overflow:visible!important}
  .menu-toggle{display:block!important;position:relative;z-index:1002;width:44px!important;height:44px!important;padding:7px!important;flex:0 0 44px}
  .menu-toggle span{display:block!important;width:26px!important;height:1px!important;background:#fff!important;margin:7px auto!important}
  .nav{
    position:fixed!important;z-index:1001!important;inset:68px 0 0!important;
    width:100vw!important;height:calc(100dvh - 68px)!important;
    padding:18px var(--mp) 30px!important;background:#080808!important;
    display:none!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;
    overflow-y:auto!important;
  }
  .nav.open{display:flex!important}
  .nav a{width:100%!important;min-height:56px!important;padding:13px 0!important;margin:0!important;border-bottom:1px solid #242424!important;font-size:21px!important;line-height:1.05!important;letter-spacing:.05em!important}
  body.mobile-menu-open{overflow:hidden!important}

  /* TYPOGRAPHY SCALE */
  .eyebrow{font-size:10px!important;line-height:1.45!important;letter-spacing:.15em!important}
  .hero-copy h1{font-size:clamp(48px,15vw,68px)!important;line-height:.86!important;letter-spacing:-.055em!important}
  .statement h2,.section-head h2,.open-copy h2,.status h2,
  .origin-copy h2,.vision-head h2,.founder h2,.journey h2,.closing h2,
  .intro h2,.form-head h2,.routes-head h2{
    font-size:clamp(38px,10.5vw,50px)!important;line-height:.96!important;letter-spacing:-.045em!important;
  }
  /* Parole singole molto lunghe: devono entrare intere */
  h1 em,h2 em,h3 em{max-width:100%}
  .founder-title h2{font-size:clamp(36px,10vw,46px)!important}
  .founder-title h2 em{white-space:nowrap!important}
  .continue-word{font-size:clamp(50px,14vw,68px)!important}
  .next-link strong{font-size:clamp(44px,12vw,58px)!important;line-height:.88!important}
  p{line-height:1.6}
  .cta,.route-link,.back,.closing-links a{white-space:normal!important;line-height:1.45!important;min-height:44px}

  /* HERO GENERICO PAGINE CREATE / PRODUCE / CONNECT */
  .research-hero{
    height:100svh!important;min-height:680px!important;padding:0 var(--mp) 12vh!important;
    align-items:flex-end!important;overflow:hidden!important;
  }
  .research-hero .hero-copy{position:relative!important;z-index:4!important;width:100%!important;max-width:100%!important}
  .research-hero .hero-copy h1{max-width:100%!important}
  .research-hero .hero-line{font-size:11px!important;line-height:1.55!important;letter-spacing:.12em!important;max-width:78%!important}
  .research-hero .field-glow{width:80vw!important;height:80vw!important;right:0!important;top:8%!important}
  .scroll{right:var(--mp)!important;bottom:24px!important;font-size:9px!important;line-height:1.4!important}

  /* CREATE symbol — completamente dentro schermo */
  .create-symbol{
    width:46vw!important;height:58vw!important;max-width:190px!important;max-height:240px!important;
    right:7vw!important;top:31%!important;transform:translateY(-50%)!important;
  }
  /* PRODUCE symbol */
  .produce-symbol{
    width:150px!important;height:150px!important;right:8vw!important;top:30%!important;
    transform:translateY(-50%) rotate(45deg)!important;
  }
  /* CONNECT symbol */
  .connect-symbol{
    width:180px!important;height:180px!important;right:5vw!important;top:30%!important;
    transform:translateY(-50%)!important;
  }
  .connect-symbol i{width:64px!important;height:22px!important}
  .connect-symbol i:nth-child(1){transform:rotate(0deg) translate(28px,-50%)!important}
  .connect-symbol i:nth-child(2){transform:rotate(90deg) translate(28px,-50%)!important}
  .connect-symbol i:nth-child(3){transform:rotate(180deg) translate(28px,-50%)!important}
  .connect-symbol i:nth-child(4){transform:rotate(270deg) translate(28px,-50%)!important}

  /* CHI SIAMO hero: niente logo tagliato */
  .about-hero{
    height:100svh!important;min-height:680px!important;padding:0 var(--mp) 12vh!important;
    align-items:flex-end!important;overflow:hidden!important;
  }
  .about-hero .hero-copy{position:relative!important;z-index:4!important;width:100%!important;max-width:100%!important}
  .about-hero .hero-copy h1{font-size:clamp(46px,14vw,64px)!important;line-height:.88!important}
  .origin-lines{
    width:54vw!important;height:42vh!important;right:7vw!important;top:14vh!important;opacity:.72!important;
    max-width:230px!important;
  }
  .origin-lines i{max-width:none!important}
  .hero-line{line-height:1.5!important}

  /* CONTATTI hero mark */
  .contact-hero{height:100svh!important;min-height:680px!important;padding-left:var(--mp)!important;padding-right:var(--mp)!important;overflow:hidden!important}
  .contact-hero .hero-copy{width:100%!important;max-width:100%!important}
  .connect-mark{width:190px!important;right:5vw!important;top:31%!important;opacity:.8!important}

  /* HOME */
  .hero{height:100svh!important;min-height:650px!important;overflow:hidden!important}
  .hero-copy{left:var(--mp)!important;right:var(--mp)!important;width:auto!important;max-width:none!important}
  .hero h1{font-size:clamp(54px,18vw,82px)!important;line-height:.82!important}
  .claim{max-width:90%!important;line-height:1.5!important}
  .manifesto{min-height:100svh!important;padding:90px var(--mp) 76px!important}
  .manifesto-copy{width:100%!important;max-width:100%!important;margin:0!important}
  .manifesto-copy h2{font-size:clamp(37px,10.7vw,50px)!important;line-height:.97!important}
  .system,.betrained,.journey,.future,.contact{padding-left:var(--mp)!important;padding-right:var(--mp)!important}
  .direction{grid-template-columns:24px 42px minmax(0,1fr)!important;gap:10px!important;min-height:128px!important}
  .direction .icon{width:42px!important;max-width:42px!important;overflow:visible!important}
  .direction h3{font-size:18px!important;line-height:1.05!important}
  .direction small{font-size:9px!important;line-height:1.45!important}
  .direction b{display:none!important}
  .bt-main,.bt-data{width:100%!important;min-width:0!important}
  .bt-main h2{font-size:clamp(60px,18vw,82px)!important;line-height:.82!important}
  .bt-data>strong{font-size:clamp(64px,20vw,88px)!important}
  .bt-data dl div{gap:12px!important}
  .bt-data dt{max-width:44%}.bt-data dd{max-width:56%;text-align:right}
  .future{min-height:65svh!important}

  /* SEZIONI INTERNE */
  .statement,.process,.open-space,.status,.next-direction,
  .continue,.origin,.vision,.founder,.journey,.closing,
  .intro,.form-section,.routes,
  .bt-intro,.bt-practice,.bt-facts,.bt-selection,.bt-calendar,.bt-fee,.bt-origin,.bt-action,.bt-venue{
    padding-left:var(--mp)!important;padding-right:var(--mp)!important;
  }
  .statement,.open-space,.status,.origin,.vision,.founder{grid-template-columns:1fr!important}
  .statement-index,.founder-index{display:none!important}
  .statement-copy{padding:16px 0!important}
  .research-grid,.form-grid,.network-grid,.route-grid{grid-template-columns:1fr!important}
  .research-card,.form-card,.network-card{min-height:290px!important;padding:28px!important}
  .card-mark{right:24px!important;bottom:24px!important;transform:scale(.72)!important;transform-origin:right bottom!important}
  .aperture{height:330px!important;max-height:42vh!important}
  .next-link{grid-template-columns:1fr!important}
  .next-link b{display:none!important}
  .continue-grid{grid-template-columns:1fr!important}
  .continue article{min-height:250px!important;padding:28px!important}
  .continue article h2{font-size:34px!important;margin-top:52px!important}
  .rome-mark{height:330px!important;max-height:42vh!important}
  .system-row{grid-template-columns:1fr!important}
  .system-item{min-height:175px!important}
  .journey-line{width:70vw!important;right:-10vw!important;opacity:.22!important}
  .closing-links{flex-direction:column!important;align-items:flex-start!important;gap:26px!important}

  /* BE TRAINED */
  .bt-hero{min-height:680px!important;height:auto!important;padding-left:var(--mp)!important;padding-right:var(--mp)!important}
  .bt-hero h1{font-size:clamp(54px,17vw,78px)!important;line-height:.84!important}
  .bt-hero-meta{display:flex!important;flex-wrap:wrap!important;gap:10px 16px!important}
  .timeline div{grid-template-columns:88px minmax(0,1fr)!important;gap:12px!important}
  .venue-map,.venue-map iframe{width:100%!important;height:360px!important;min-height:360px!important}
  .map-caption{left:10px!important;right:10px!important;bottom:10px!important;max-width:calc(100% - 20px)!important}

  /* FORM */
  .contact-form input,.contact-form select,.contact-form textarea{width:100%!important;max-width:100%!important;font-size:16px!important}
  .form-bottom{flex-direction:column!important;gap:14px!important}
  .form-bottom button{width:100%!important;min-height:48px!important}

  footer{padding:28px var(--mp)!important;flex-direction:column!important;align-items:flex-start!important;gap:7px!important;line-height:1.5!important}
}

/* MOBILE ANIMATIONS: traduzione delle hover desktop in tap + ingresso viewport */
@media (pointer:coarse) and (max-width:900px){
  .research-hero.mobile-active .create-symbol i:first-child{transform:translateX(-24%) rotateY(-18deg)!important}
  .research-hero.mobile-active .create-symbol i:last-child{transform:translateX(24%) rotateY(18deg)!important}

  .research-hero.mobile-active .produce-symbol{
    transform:translateY(-50%) rotate(135deg) scale(.86)!important;
    background:rgba(255,74,28,.05)!important;box-shadow:0 0 80px rgba(255,74,28,.18)!important;
  }

  .research-hero.mobile-active .connect-symbol i{background:rgba(255,74,28,.12)!important}
  .research-hero.mobile-active .connect-symbol i:nth-child(1){transform:rotate(0deg) translate(10px,-50%)!important}
  .research-hero.mobile-active .connect-symbol i:nth-child(2){transform:rotate(90deg) translate(10px,-50%)!important}
  .research-hero.mobile-active .connect-symbol i:nth-child(3){transform:rotate(180deg) translate(10px,-50%)!important}
  .research-hero.mobile-active .connect-symbol i:nth-child(4){transform:rotate(270deg) translate(10px,-50%)!important}
  .research-hero.mobile-active .connect-symbol:after{background:#ff4a1c!important;transform:translate(-50%,-50%) rotate(135deg) scale(.72)!important}

  .about-hero.mobile-active .origin-lines i:nth-child(1){transform:translateX(-16px) rotate(-3deg)!important}
  .about-hero.mobile-active .origin-lines i:nth-child(2){transform:translateX(-6px)!important}
  .about-hero.mobile-active .origin-lines i:nth-child(3){transform:translateX(6px)!important}
  .about-hero.mobile-active .origin-lines i:nth-child(4){transform:translateX(16px) rotate(3deg)!important}

  .origin.mobile-active .door{transform:translateX(-50%) scaleX(.62)!important}
  .origin.mobile-active .pulse{box-shadow:0 0 150px 90px rgba(255,80,20,.28)!important}

  .open-space.mobile-active .aperture i:first-child{transform:translateX(-38%) rotateY(-18deg)!important}
  .open-space.mobile-active .aperture i:last-child{transform:translateX(38%) rotateY(18deg)!important}

  .contact-hero.mobile-active .connect-mark i:nth-child(1){transform:translateY(18%)!important}
  .contact-hero.mobile-active .connect-mark i:nth-child(2){transform:translateX(-18%)!important}
  .contact-hero.mobile-active .connect-mark i:nth-child(3){transform:translateY(-18%)!important}
  .contact-hero.mobile-active .connect-mark i:nth-child(4){transform:translateX(18%)!important}
  .contact-hero.mobile-active .connect-mark b{transform:rotate(135deg) scale(1.35)!important;background:#ff5b19!important}
}


/* V14 — correzioni mirate dagli screenshot reali iPhone.
   Solo <=900px. Tutto ciò che non è coinvolto resta V13. */
@media(max-width:900px){
  /* HOME / SISTEMA: niente titoli o frecce fuori griglia */
  #system .section-head h2{
    font-size:clamp(35px,9.6vw,46px)!important;
    line-height:.96!important;
    max-width:100%!important;
  }
  #system .direction{
    grid-template-columns:24px 42px minmax(0,1fr)!important;
    padding-left:0!important;padding-right:0!important;
  }
  #system .direction h3{
    font-size:clamp(17px,4.7vw,21px)!important;
    max-width:100%!important;
  }
  #system .direction small{max-width:100%!important}
  #system .direction b{display:none!important}

  /* CREATE: cards compatte, simboli fuori dal testo */
  .research-grid{border-left:1px solid #c8c4bc!important}
  .research-card{
    min-height:0!important;
    padding:36px 28px 118px!important;
    overflow:hidden!important;
  }
  .research-card h3{
    font-size:clamp(30px,8.6vw,40px)!important;
    line-height:1!important;
    margin:38px 0 22px!important;
    max-width:100%!important;
  }
  .research-card p{
    font-size:17px!important;line-height:1.58!important;
    max-width:100%!important;margin:0!important;
  }
  .research-card .card-mark{
    width:76px!important;height:76px!important;
    right:26px!important;bottom:24px!important;
    transform:scale(.72)!important;
    transform-origin:right bottom!important;
  }
  .research-card .mark-possibility{
    width:54px!important;height:54px!important;
    right:26px!important;bottom:28px!important;
    transform:rotate(45deg)!important;
  }

  /* PRODUCE: il rombo diventa un segno di chiusura, non attraversa il testo */
  .form-grid{grid-template-columns:1fr!important}
  .form-card{
    min-height:0!important;
    padding:36px 28px 112px!important;
    overflow:hidden!important;
  }
  .form-card h3{
    font-size:clamp(30px,8.5vw,40px)!important;
    line-height:1!important;margin:38px 0 22px!important;
    max-width:100%!important;
  }
  .form-card p{
    font-size:17px!important;line-height:1.58!important;
    max-width:100%!important;margin:0!important;color:#777!important;
  }
  .form-card:after{
    left:auto!important;right:28px!important;bottom:30px!important;
    width:38px!important;height:38px!important;
  }

  /* CONNECT: stessa densità di CREATE/PRODUCE, niente vuoti enormi */
  .network-grid{grid-template-columns:1fr!important}
  .network-card{
    min-height:0!important;
    padding:36px 28px 92px!important;
    overflow:hidden!important;
  }
  .network-card h3{
    font-size:clamp(30px,8.2vw,39px)!important;
    line-height:1.02!important;margin:38px 0 22px!important;
    max-width:100%!important;
  }
  .network-card p{
    font-size:17px!important;line-height:1.58!important;
    max-width:100%!important;margin:0!important;color:#777!important;
  }
  .network-card:after{
    left:28px!important;bottom:34px!important;
    width:8px!important;height:8px!important;
  }

  /* CONTATTI: titolo leggibile integralmente su 3 righe controllate */
  .contact-hero{
    height:auto!important;min-height:calc(100svh - 0px)!important;
    padding:150px 20px 90px!important;
    align-items:center!important;
  }
  .contact-hero .hero-copy{width:100%!important;max-width:100%!important}
  .contact-hero h1{
    font-size:clamp(43px,11.2vw,54px)!important;
    line-height:.91!important;letter-spacing:-.05em!important;
    max-width:100%!important;
  }
  .contact-hero h1 br{display:block!important}
  .contact-hero .hero-line{
    max-width:100%!important;font-size:11px!important;line-height:1.55!important;
  }
  .connect-mark{width:150px!important;right:2vw!important;top:29%!important;opacity:.32!important}
  .intro .mail{
    font-size:clamp(17px,4.7vw,21px)!important;
    overflow-wrap:anywhere!important;word-break:normal!important;
  }
}

/* iPhone stretti */
@media(max-width:430px){
  #system .section-head h2{font-size:9.2vw!important}
  .research-card,.form-card,.network-card{padding-left:24px!important;padding-right:24px!important}
  .contact-hero h1{font-size:10.8vw!important}
}


/* V15 — precision fix from six real iPhone screenshots. MOBILE ONLY */
@media(max-width:900px){

  /* 1-2 CREATE: all orange card marks use one identical anchor box */
  .research-card{
    position:relative!important;
    padding-bottom:126px!important;
  }
  .research-card .card-mark,
  .research-card .mark-research,
  .research-card .mark-experiment,
  .research-card .mark-contamination,
  .research-card .mark-possibility{
    position:absolute!important;
    left:auto!important;
    right:30px!important;
    top:auto!important;
    bottom:30px!important;
    margin:0!important;
    transform-origin:center center!important;
  }
  .research-card .card-mark{
    width:72px!important;height:72px!important;
    transform:scale(.72)!important;
  }
  .research-card .mark-possibility{
    width:52px!important;height:52px!important;
    transform:rotate(45deg)!important;
  }

  /* 3 HOME system rows: icons share the same column and optical centre */
  #system .direction{
    display:grid!important;
    grid-template-columns:46px 58px minmax(0,1fr)!important;
    column-gap:18px!important;
    align-items:center!important;
  }
  #system .direction>span:first-child{
    width:46px!important;text-align:left!important;
  }
  #system .direction .icon{
    width:58px!important;height:72px!important;
    max-width:58px!important;
    margin:0 auto!important;
    justify-self:center!important;
    align-self:center!important;
    transform-origin:center!important;
  }
  #system .direction .icon-train,
  #system .direction .icon-create,
  #system .direction .icon-produce,
  #system .direction .icon-connect{
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  }
  #system .direction>div:last-of-type{
    min-width:0!important;align-self:center!important;
  }

  /* 4 HOME final contact: force the headline into viewport */
  .contact{
    overflow:hidden!important;
    padding-top:86px!important;padding-bottom:86px!important;
  }
  .contact h2{
    font-size:clamp(35px,9.6vw,46px)!important;
    line-height:.94!important;
    letter-spacing:-.045em!important;
    max-width:100%!important;
    width:100%!important;
  }
  .contact h2 em{display:block!important;max-width:100%!important}
  .contact-side{min-width:0!important;width:100%!important}
  .contact-side>a{
    display:inline-block!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }

  /* 5 HOME headline: exact 2x2 grid, not an inline chain */
  #system .section-head h2{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:auto auto!important;
    gap:8px 18px!important;
    width:100%!important;
    max-width:100%!important;
    font-size:clamp(34px,9vw,43px)!important;
    line-height:.92!important;
    letter-spacing:-.045em!important;
  }
  #system .section-head h2 span{
    display:block!important;
    position:relative!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    white-space:nowrap!important;
  }
  #system .section-head h2 span:nth-child(1){grid-column:1;grid-row:1}
  #system .section-head h2 span:nth-child(2){grid-column:2;grid-row:1}
  #system .section-head h2 span:nth-child(3){grid-column:1;grid-row:2}
  #system .section-head h2 span:nth-child(4){grid-column:2;grid-row:2}
  #system .section-head h2 b,
  #system .section-head h2 i{display:none!important}

  /* 6 HOME hero: separate eyebrow / title / claim vertically */
  .hero .hero-copy{
    left:20px!important;right:20px!important;
    bottom:13vh!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:0!important;
  }
  .hero .hero-copy .eyebrow{
    position:static!important;
    display:block!important;
    margin:0 0 26px!important;
    line-height:1.3!important;
    z-index:2!important;
  }
  .hero .hero-copy h1{
    position:static!important;
    margin:0 0 28px!important;
    line-height:.82!important;
    max-width:100%!important;
  }
  .hero .hero-copy .claim{
    position:static!important;
    display:block!important;
    margin:0!important;
    max-width:100%!important;
    width:100%!important;
    line-height:1.45!important;
    white-space:normal!important;
  }
}

/* tighter iPhone widths */
@media(max-width:430px){
  #system .section-head h2{
    font-size:clamp(31px,8.7vw,39px)!important;
    gap:8px 14px!important;
  }
  #system .direction{
    grid-template-columns:40px 54px minmax(0,1fr)!important;
    column-gap:14px!important;
  }
  .contact h2{font-size:clamp(33px,9.2vw,41px)!important}
  .hero .hero-copy{bottom:12vh!important}
  .hero .hero-copy .eyebrow{margin-bottom:22px!important}
  .hero .hero-copy h1{margin-bottom:24px!important}
}


/* V18 — FRECCE SISTEMA: desktop V17 invariato, correzione esclusiva mobile. */
@media (min-width:901px){
  #system .section-head h2 .system-arrow{
    display:inline-block;
    color:#ff4b16;
    font-style:normal;
    margin:0 .12em;
    transition:transform .35s ease;
  }
}

@media (max-width:900px){
  /* Override solo della headline TRAIN / CREATE / PRODUCE / CONNECT */
  #system .section-head h2{
    display:grid!important;
    grid-template-columns:max-content 28px max-content!important;
    grid-template-rows:auto 24px auto!important;
    justify-content:start!important;
    align-items:center!important;
    column-gap:8px!important;
    row-gap:4px!important;
    width:100%!important;
    max-width:100%!important;
  }

  #system .section-head h2 span{
    position:static!important;
  }

  /* parole */
  #system .section-head h2 span:nth-of-type(1){grid-column:1!important;grid-row:1!important}
  #system .section-head h2 span:nth-of-type(2){grid-column:3!important;grid-row:1!important}
  #system .section-head h2 span:nth-of-type(3){grid-column:1!important;grid-row:3!important}
  #system .section-head h2 span:nth-of-type(4){grid-column:3!important;grid-row:3!important}

  /* rimuove le frecce pseudo-elemento errate della V17 */
  #system .section-head h2 span::after{content:none!important}

  /* usa le tre frecce reali già presenti nell'HTML */
  #system .section-head h2 .system-arrow{
    display:block!important;
    position:static!important;
    color:#ff4b16!important;
    font-style:normal!important;
    font-size:.72em!important;
    line-height:1!important;
    width:28px!important;
    margin:0!important;
    padding:0!important;
    text-align:center!important;
    transform:none!important;
  }

  #system .section-head h2 .system-arrow:nth-of-type(1){
    grid-column:2!important;grid-row:1!important;
  }
  #system .section-head h2 .system-arrow:nth-of-type(2){
    grid-column:2!important;grid-row:2!important;
    transform:rotate(90deg)!important;
    justify-self:center!important;
  }
  #system .section-head h2 .system-arrow:nth-of-type(3){
    grid-column:2!important;grid-row:3!important;
  }
}
