/* Spatial system — loaded last.
   One content edge shared by header, sections and footer; a capped frame on wide
   screens; a deliberate vertical rhythm between and inside page panels. */

:root{
  /* Content edge: 20px on small phones, ~64px on laptops, then the frame caps at 1376px. */
  --gutter:max(clamp(20px,calc(4vw + 8px),72px),calc((100vw - 1376px) / 2));
  /* The header pill sits a little outside the content edge so its contents line up with it. */
  --hdr-x:max(10px,calc(var(--gutter) - 24px));
  --hdr-top:18px;
  --hdr-h:76px;
  /* Vertical rhythm */
  --section-y:clamp(72px,8vw,128px);
  --group-y:clamp(48px,5.5vw,88px);
  --panel-top:calc(var(--hdr-top) + var(--hdr-h) + clamp(40px,5vw,72px));
}
@media(max-width:760px){:root{--hdr-top:12px;--hdr-h:66px}}

/* ---------- Header: aligned to the content edge ---------- */
.site-header{
  top:var(--hdr-top);
  left:var(--hdr-x);
  width:calc(100% - 2 * var(--hdr-x));
  height:var(--hdr-h);
  padding-inline:calc(var(--gutter) - var(--hdr-x));
}
@media(max-width:1150px){.site-header{padding-inline:calc(var(--gutter) - var(--hdr-x))}}
@media(max-width:760px){.site-header{padding-inline:calc(var(--gutter) - var(--hdr-x))}}
/* Legal pages live in the footer; keep the primary navigation to the five real destinations. */
.desktop-nav a.nav-legal{display:none}
.mobile-menu a.nav-legal{font-size:.82rem;color:#bfaecb;padding-block:9px}
/* Thumb-sized menu toggle */
@media(max-width:1050px){
  .menu-toggle{width:44px;height:44px;align-items:center;margin-right:-10px}
}

/* ---------- Hero ---------- */
.hero,.panel-mode .hero{padding-inline:var(--gutter)}
@media(min-width:761px){
  .panel-mode .hero-copy{padding-top:calc(var(--panel-top) + clamp(0px,4vh,48px))}
  .panel-mode .hero>.hero-logo{left:auto;right:var(--gutter)!important;transform:translateY(-50%)}
}
@media(max-width:760px){
  .panel-mode .hero{padding-bottom:56px}
  .panel-mode .hero>.hero-logo{margin-top:calc(var(--hdr-top) + var(--hdr-h) + 36px)}
  .panel-mode .hero-description{max-width:30ch}
}

/* ---------- Page panels: consistent top/bottom breathing room ---------- */
.panel-mode #main>.active-panel:not(.hero){padding-top:var(--panel-top);padding-bottom:var(--section-y);min-height:0}
.panel-mode .team.active-panel{padding-top:var(--group-y)}
.panel-mode[data-panel=studio] #main>.intro.active-panel{padding-bottom:0}

/* Home: intro and team read as one "studio" group; portfolio is a new chapter. */
.panel-mode[data-panel=inizio] #main>.active-panel:not(.hero){padding-top:var(--section-y);padding-bottom:var(--section-y)}
.panel-mode[data-panel=inizio] #main>.intro.active-panel{padding-bottom:0}
.panel-mode[data-panel=inizio] #main>.team.active-panel{padding-top:var(--group-y)}
.panel-mode[data-panel=inizio] #main>.work.active-panel{padding-top:var(--section-y)}

/* ---------- Intro: on the shared edge, not floating in the middle ---------- */
.intro .intro-body{max-width:none;margin-inline:0}
.intro h2{max-width:16ch;text-wrap:balance}
.intro-details{max-width:760px;margin-top:clamp(28px,3vw,40px);column-gap:clamp(24px,3vw,48px)}

/* ---------- Team: a poster that fits the viewport ---------- */
.team-feature{max-width:none;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(40px,6vw,96px)}
.team-story{max-width:34rem}
.team-story h2{text-wrap:balance}
.team-poster{justify-self:end;width:100%;max-width:min(600px,calc((100svh - 140px) * .8))}
@media(max-width:760px){
  .team-feature{grid-template-columns:1fr;gap:40px}
  .team-story{max-width:none}
  .team-poster{justify-self:stretch;max-width:none}
}

/* ---------- Portfolio ---------- */
.panel-mode .work.active-panel .section-top,.work .section-top{align-items:flex-end;margin-bottom:clamp(24px,3vw,36px)}
.work .section-aside{margin:0;padding-bottom:.6em}
.work-filters{margin-bottom:clamp(20px,2.4vw,32px)}
.panel-mode .work.active-panel .work-grid{padding-bottom:0}
html[data-portfolio-layout=grid] .work-grid{gap:clamp(20px,2.2vw,32px)}
@media(max-width:760px){
  .work .section-aside{padding-bottom:0;margin-top:16px}
  .work-filters{flex-wrap:wrap;row-gap:8px}
}

/* ---------- Services ---------- */
.services-heading{margin-bottom:clamp(32px,4vw,56px)}
.service-list{gap:clamp(14px,1.6vw,22px)}

/* ---------- Contact: sized by its content ---------- */
.contact,.panel-mode #main>.active-panel.contact{
  margin:var(--panel-top) var(--gutter) var(--section-y);
  padding:clamp(36px,5.5vw,80px) clamp(24px,5vw,72px);
  min-height:0;
}
.contact-bottom{margin-top:clamp(32px,4vw,48px);align-items:flex-end}
@media(max-width:760px){
  .contact,.panel-mode #main>.active-panel.contact{margin-inline:var(--gutter);padding:36px 24px 28px}
  .contact-bottom .button{width:100%}
}

/* Contact channels: WhatsApp and Instagram, no on-site form. */
.contact-lead{margin-top:clamp(20px,2.4vw,28px);color:#c9b8d4;font-size:clamp(1rem,1.3vw,1.15rem);line-height:1.5}
.contact-bottom{display:block}
.contact-actions{display:flex;flex-wrap:wrap;gap:12px}
.contact-channel{display:inline-flex;align-items:center;gap:12px;text-decoration:none}
.contact-channel[hidden]{display:none}
.contact-bottom .contact-channel:not(.button-accent){background:linear-gradient(145deg,#ffffff1f,#ffffff08)!important;border-color:#ffffff3d!important;color:#fff}
.contact-bottom .contact-channel:not(.button-accent):hover{background:linear-gradient(145deg,#ffffff30,#ffffff12)!important;border-color:#ffffff7a!important}
.channel-icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){
  .contact-actions{flex-direction:column}
  .contact-channel{width:100%;justify-content:center}
}

/* ---------- One-page home ---------- */
/* Sections already carry top padding: land so the heading sits ~40px under the floating header. */
html{scroll-padding-top:max(0px,calc(var(--hdr-top) + var(--hdr-h) + 40px - var(--section-y)))}
/* The team sits under the intro: anchor "Chi siamo" on the intro. */
.panel-mode[data-panel=inizio] #main>.services.active-panel{border-top:1px solid #ffffff15}
.panel-mode[data-panel=inizio] #main>.active-panel.contact{margin-top:0;margin-bottom:var(--section-y)}
/* Buttons that are links now look identical to the old buttons. */
a.button{text-decoration:none}

/* ---------- Dividers: one rule, one style ----------
   A single hairline marks each new chapter of the home (Portfolio, Services),
   inset to the content edge. No full-bleed borders, no doubled lines under headings.
   The contact card carries its own outline, so it needs no extra rule. */
:root{--rule:#ffffff17}
#main>section.section-shell:not(.contact),.site-footer{border-block:0!important}
.work .section-top,.services-heading{border-top:0;padding-top:0}
.panel-mode[data-panel=inizio] #main>:is(.work,.services).active-panel{position:relative}
.panel-mode[data-panel=inizio] #main>:is(.work,.services).active-panel::before{
  content:'';position:absolute;top:0;left:var(--gutter);right:var(--gutter);height:1px;background:var(--rule);pointer-events:none
}
.footer-bottom{border-top:1px solid var(--rule)}

/* ---------- Footer ----------
   Brand + motto on the left, then two calm columns: where to go, where to write.
   A quiet bottom row closes the page. A soft magenta horizon ties it to the hero. */
.site-footer,.panel-mode .site-footer{
  position:relative;overflow:hidden;
  padding-top:clamp(56px,6vw,88px);padding-bottom:max(28px,env(safe-area-inset-bottom));
  background:radial-gradient(ellipse 70% 120% at 50% 130%,#ff00991f,transparent 70%);
}
.footer-top{
  display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr);
  grid-template-rows:auto 1fr;column-gap:clamp(32px,5vw,80px);row-gap:20px;
  align-items:start;padding-bottom:clamp(40px,5vw,72px)
}
.footer-top>.wordmark{grid-column:1;grid-row:1;font-size:clamp(28px,2.6vw,36px);gap:12px}
.footer-top .brand-icon{width:clamp(36px,3vw,46px);height:clamp(36px,3vw,46px)}
.footer-top>p{grid-column:1;grid-row:2;margin:0;max-width:22ch;color:#b9a8c4;font-size:clamp(1.05rem,1.5vw,1.35rem);line-height:1.35;letter-spacing:-.01em}
.footer-nav{grid-column:2;grid-row:1/3}
.footer-social{grid-column:3;grid-row:1/3}
.footer-nav,.footer-social{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.footer-label{margin:0 0 10px;font-size:.72rem;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:#8f7e9a;font-family:inherit!important}
.footer-nav a{color:#efe6f4;font-size:.98rem;padding:6px 0;transition:color .2s,transform .25s cubic-bezier(.2,.8,.2,1)}
.footer-nav a:hover{color:var(--accent);transform:translateX(4px)}
.footer-channel{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 18px 0 14px;margin-bottom:8px;border:1px solid #ffffff2b;border-radius:999px;background:linear-gradient(145deg,#ffffff14,#ffffff05);box-shadow:inset 0 1px 0 #ffffff26;color:#fff;font-size:.88rem;transition:border-color .25s,background .25s,transform .25s cubic-bezier(.2,.8,.2,1)}
.footer-channel:hover{border-color:var(--accent);background:linear-gradient(145deg,#ff009926,#ff00990a);transform:translateY(-2px)}
.footer-channel[hidden]{display:none}
.footer-channel .channel-icon{width:18px;height:18px}
.footer-bottom{display:flex;align-items:center;gap:14px 28px;padding-top:22px;font-size:.75rem;color:#8f7e9a}
.footer-bottom .footer-motto{flex:1;text-align:center;display:inline}
.footer-bottom .privacy-links{display:flex;gap:20px;font-size:inherit}
.footer-bottom .privacy-links a{color:#c9b7d3;transition:color .2s}
.footer-bottom .privacy-links a:hover{color:#fff}
@media(max-width:900px){
  .footer-top{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;row-gap:16px}
  .footer-top>.wordmark,.footer-top>p{grid-column:1/-1}
  .footer-top>p{grid-row:2;margin-bottom:20px}
  .footer-nav{grid-column:1;grid-row:3}
  .footer-social{grid-column:2;grid-row:3}
}
@media(max-width:760px){
  .footer-bottom{justify-content:space-between;font-size:.72rem}
  .footer-bottom .footer-motto{display:none}
}
@media(max-width:420px){
  .footer-top{grid-template-columns:1fr;column-gap:0}
  .footer-nav{grid-column:1;grid-row:3}
  .footer-social{grid-column:1;grid-row:4;margin-top:12px}
  .footer-nav{flex-direction:row;flex-wrap:wrap;column-gap:20px}
  .footer-nav .footer-label{flex-basis:100%}
}

/* ---------- Header CTA: all caps, no "+" ---------- */
.header-cta{text-transform:uppercase;letter-spacing:.08em;font-weight:600}
.header-cta .tiny-plus{display:none}

/* ---------- Animated galaxy (galaxy.js) ---------- */
.hero-art>.galaxy-canvas{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;transition:opacity 1.6s ease}
.hero-art.galaxy-live>.galaxy-canvas{opacity:var(--galaxy-opacity,.6)}
.hero-art.galaxy-live>img{visibility:hidden;animation:none}
.hero-art::after{z-index:1}

/* ---------- Legal pages ---------- */
.legal-page>*{max-width:72ch}

/* ---------- One continuous canvas ----------
   Sections no longer paint their own fill: each one cut its colour or glow at its edge,
   which showed as a band between sections. The page base and the ambient glows live on
   the body (fixed, so they never end at a section boundary); a section may add an accent
   only as a closest-side ellipse that fades to nothing inside its own box. */
body{background-color:var(--ink)}
#main>section.section-shell:not(.contact),.panel-mode #main>section.section-shell.active-panel:not(.contact),.site-footer,.panel-mode .site-footer{background:transparent!important}
.hero,.panel-mode #main>.hero.active-panel{background:radial-gradient(closest-side at 82% 50%,#ff009920,transparent)!important}
.services,.panel-mode #main>.services.active-panel{background:radial-gradient(closest-side at 4% 55%,#ff00990d,transparent)!important}
.site-footer,.panel-mode .site-footer{background:radial-gradient(closest-side at 50% 100%,#ff00991a,transparent)!important;background-size:100% 200%!important;background-position:50% 0!important;background-repeat:no-repeat!important}
/* The contact card is a card: its fill stays inside its rounded outline. */
.contact,.panel-mode #main>.active-panel.contact{background:radial-gradient(closest-side at 92% 20%,#ff009917,transparent),linear-gradient(160deg,#17121c,#100d14)!important}

/* ---------- One structural line ----------
   Every section head splits 7/5 on the same columns: the heading leads on the left,
   the supporting copy sits on a single vertical line at the right, bottom-aligned
   with the heading. The team poster and the footer columns land on that same line. */
:root{--col-gap:clamp(24px,4vw,56px);--col-a:minmax(0,7fr);--col-b:minmax(0,5fr)}
@media(min-width:901px){
  .intro .intro-body,.work .section-top,.panel-mode .work.active-panel .section-top,.services-heading{
    display:grid;grid-template-columns:var(--col-a) var(--col-b);column-gap:var(--col-gap);align-items:end
  }
  .intro .intro-body>h2{grid-column:1;margin:0}
  .intro-details{grid-column:2;display:flex;flex-direction:column;align-items:flex-start;gap:14px;max-width:44ch;margin:0}
  .intro-details p{margin:0}
  .intro-details .text-link{margin-top:10px}
  .work .section-top>div{grid-column:1}
  .work .section-aside{grid-column:2;justify-self:start;padding-bottom:.35em;text-align:left}
  .services-heading{grid-template-rows:auto auto}
  .services-heading>h2{grid-column:1;grid-row:1/3;margin:0}
  .services-heading>p:not(.eyebrow){grid-column:2;grid-row:1;align-self:end;margin:0;max-width:40ch}
  .services-heading>.button{grid-column:2;grid-row:2;justify-self:start;align-self:end;margin-top:20px}
  .team-feature{grid-template-columns:var(--col-a) var(--col-b);column-gap:var(--col-gap);align-items:center}
  .team-poster{justify-self:stretch;max-width:none}
  .footer-top{grid-template-columns:calc((100% - var(--col-gap)) * 7 / 12) minmax(0,1fr) minmax(0,1fr);column-gap:var(--col-gap)}
}
/* The galaxy faded into solid ink, which no longer matches the glowing page below it:
   fade the whole art (canvas, image and its scrim) to transparency instead. */
.hero-art{-webkit-mask-image:linear-gradient(to bottom,#000 55%,transparent 98%);mask-image:linear-gradient(to bottom,#000 55%,transparent 98%)}
.hero,.panel-mode #main>.hero.active-panel{border-bottom:0!important}

/* ---------- Hero: one statement on the shared grid ----------
   The headline leads, bottom-left, at display size; it spans the page so its short
   lines leave room for the supporting copy, which stands on the same 7/12 line as every
   section head below. The mark sits on that line above it. A hairline foot closes the view. */
.hero,.panel-mode #main>.hero.active-panel{
  display:grid!important;grid-template-rows:minmax(0,1fr) auto;
  height:auto!important;min-height:clamp(640px,100svh,1100px)!important;max-height:none!important;
  padding:calc(var(--hdr-top) + var(--hdr-h) + clamp(20px,4vh,48px)) var(--gutter) 0!important;
  overflow:hidden
}
.hero .eyebrow,.hero>.hero-logo,.hero>.hero-copy,.hero>.hero-bottom,.hero>.hero-vertical{display:none!important}
.hero-stage{
  position:relative;z-index:2;display:grid;
  grid-template-columns:var(--col-a) var(--col-b);column-gap:var(--col-gap);
  grid-template-rows:minmax(0,1fr) auto;align-content:end;
  padding-bottom:clamp(40px,7vh,88px)
}
.hero-mark{grid-column:2;grid-row:1;align-self:center;width:clamp(120px,14vw,232px);aspect-ratio:1;position:relative;overflow:hidden}
.hero-mark img{position:absolute;width:143%;height:143%;left:-21.5%;top:-21.5%;max-width:none;filter:drop-shadow(0 18px 48px #ff00992e)}
.hero .hero-stage h1{
  grid-column:1/-1;grid-row:2;margin:0;max-width:none;
  font-size:clamp(56px,9.4vw,172px)!important;line-height:.86;letter-spacing:-.04em;font-weight:600;
  text-wrap:nowrap;color:#fff;text-shadow:0 2px 40px #0b0b0e66
}
.hero .hero-stage h1 em{
  display:inline;font-style:normal;color:var(--accent);
  background:none!important;border:0!important;padding:0!important;border-radius:0!important;box-shadow:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important
}
.hero-aside{grid-column:2;grid-row:2;align-self:end;justify-self:start;padding-bottom:.4em;position:relative}
.hero .hero-aside .hero-description{margin:0;max-width:30ch;font-size:clamp(1.05rem,1.3vw,1.3rem);line-height:1.5;color:#ddd0e6;text-align:left}
.hero .hero-aside .hero-actions{margin:clamp(22px,2.4vw,32px) 0 0;justify-content:flex-start}
.hero-foot{
  position:relative;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:20px;
  border-top:1px solid var(--rule);padding:18px 0 max(22px,env(safe-area-inset-bottom));
  font-size:.75rem;letter-spacing:.08em;text-transform:uppercase;color:#a897b3
}
.hero-scroll{display:inline-flex;align-items:center;gap:10px;color:#d9cce3;text-decoration:none;transition:color .2s}
.hero-scroll svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s cubic-bezier(.2,.8,.2,1)}
.hero-scroll:hover{color:#fff}
.hero-scroll:hover svg{transform:translateY(3px)}
@media(prefers-reduced-motion:no-preference){
  .hero .hero-stage h1{animation:hero-rise 1.1s cubic-bezier(.16,1,.3,1) both}
  .hero-aside,.hero-mark{animation:hero-rise 1.1s .18s cubic-bezier(.16,1,.3,1) both}
  .hero-foot{animation:hero-fade .9s .4s ease-out both}
  @keyframes hero-rise{from{opacity:0;transform:translateY(28px);filter:blur(6px)}to{opacity:1;transform:none;filter:none}}
  @keyframes hero-fade{from{opacity:0}to{opacity:1}}
}
@media(max-width:760px){
  .hero,.panel-mode #main>.hero.active-panel{min-height:max(600px,100svh)!important}
  .hero-stage{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto auto;padding-bottom:36px}
  .hero-mark{grid-column:1;grid-row:1;align-self:end;width:72px;margin-bottom:28px}
  .hero .hero-stage h1{grid-column:1;grid-row:2;font-size:clamp(40px,13.2vw,92px)!important;line-height:.9}
  .hero-aside{grid-column:1;grid-row:3;padding:0;margin-top:24px;width:100%}
  .hero .hero-aside .hero-actions .button{width:100%;justify-content:center}
  .hero-foot{font-size:.68rem}
  .hero-foot>span{display:none}
  .hero-foot{justify-content:flex-start}
}
.hero .hero-stage h1{text-align:left!important;justify-self:start}
.hero .hero-stage h1 em::before,.hero .hero-stage h1 em::after,.hero .hero-stage h1::before,.hero .hero-stage h1::after{content:none!important;display:none!important}
.hero .hero-stage h1 em{color:var(--accent)!important;-webkit-text-fill-color:currentColor}
.hero-stage{align-self:stretch;height:100%}
