/* ============================================================
   STUDIO SENSI · Structural Engineering — Portfolio 2026
   Palette & type derived from the official portfolio PDF
   ============================================================ */

:root {
  /* Brand palette (from portfolio) */
  --navy-900: #061838;
  --navy-800: #0a2550;
  --navy-700: #12376b;
  --navy:     #1a3564;
  --blue:     #6baed6;
  --blue-soft:#9fb5d0;
  --ink:      #1b2430;
  --gray:     #6b7280;
  --gray-2:   #8a919c;
  --line:     #d0d6de;
  --bg:       #ffffff;
  --bg-soft:  #f5f6f8;
  --bg-soft-2:#eef1f4;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1200px;
  --radius: 4px;
  --shadow-sm: 0 2px 10px rgba(10,37,80,.06);
  --shadow-md: 0 14px 40px rgba(10,37,80,.12);
  --shadow-lg: 0 30px 70px rgba(6,24,56,.22);
  --ease: cubic-bezier(.22,.61,.36,1);
}

*,*::before,*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 600; line-height: 1.12; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ---------- Reusable bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans);
  font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 22px;
}
.eyebrow::before {
  content: ""; width: 34px; height: 2px; background: var(--blue); display: inline-block;
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::after { content:""; width:34px; height:2px; background:var(--blue); display:inline-block; }

.display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -.01em;
}
.display b, .display strong { font-weight: 700; }

.section { padding: 118px 0; position: relative; }
.section--soft { background: var(--bg-soft); }
.section--navy { background: var(--navy-800); color: #fff; }

.section-head { max-width: 760px; margin-bottom: 60px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.1rem, 4.6vw, 3.4rem); color: var(--navy-800); }
.section-head h2 b { font-weight: 700; }
.section--navy .section-head h2 { color: #fff; }
.section-head p.lead { margin: 22px 0 0; color: var(--gray); font-size: 1.08rem; max-width: 640px; }
.section-head.center p.lead { margin-left:auto; margin-right:auto; }
.section--navy .section-head p.lead { color: var(--blue-soft); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  padding: 15px 30px; border-radius: var(--radius);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .3s;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--blue); color: var(--navy-900); }
.btn--primary:hover { background: #86c1e4; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(107,174,214,.35); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn--dark { background: var(--navy-800); color: #fff; }
.btn--dark:hover { background: var(--navy-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; color: var(--navy-800); border-color: var(--line); }
.btn--outline:hover { border-color: var(--navy-800); transform: translateY(-2px); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 18px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px;
  background: linear-gradient(180deg, rgba(4,8,16,.62) 0%, rgba(4,8,16,.34) 55%, rgba(4,8,16,0) 100%);
  pointer-events: none; opacity: 1; transition: opacity .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(10,37,80,.08), 0 8px 30px rgba(10,37,80,.06);
  padding: 12px 0;
}
.site-header.scrolled::before { opacity: 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; }
.brand img { height: 96px; width: auto; transition: height .4s var(--ease), filter .4s var(--ease); }
.brand .logo-light { filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)) drop-shadow(0 3px 14px rgba(0,0,0,.4)); }
.brand .logo-dark { display: none; }
.site-header.scrolled .brand .logo-light { display: none; }
.site-header.scrolled .brand .logo-dark { display: block; }
.site-header.scrolled .brand img { height: 96px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-size: .92rem; font-weight: 500; letter-spacing: .01em;
  padding: 9px 16px; border-radius: var(--radius); color: #fff;
  transition: color .25s, background .25s; position: relative;
}
.site-header.scrolled .nav a { color: var(--navy-800); }
.nav a:hover { color: var(--blue); }
.site-header.scrolled .nav a:hover { background: var(--bg-soft); color: var(--navy-700); }
.nav .nav-cta {
  margin-left: 10px; background: var(--blue); color: var(--navy-900); font-weight: 600;
  padding: 10px 20px;
}
.nav .nav-cta:hover { background: #86c1e4; color: var(--navy-900); }
.site-header.scrolled .nav .nav-cta { color: var(--navy-900); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 2px; background: #fff; transition: .3s; }
.site-header.scrolled .nav-toggle span { background: var(--navy-800); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  color: #fff; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__slide { position: absolute; inset: 0; z-index: 0; opacity: 0; }
.hero__slide.is-active { opacity: 1; z-index: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 68%; transform: scale(1.08); }
.hero__slide:nth-child(2) img { object-position: 50% 46%; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(105deg, rgba(10,14,22,.62) 0%, rgba(14,18,26,.34) 45%, rgba(24,27,32,.06) 75%),
    linear-gradient(0deg, rgba(10,14,20,.32), rgba(10,14,20,0) 36%),
    linear-gradient(180deg, rgba(8,12,22,.34), rgba(8,12,22,0) 28%);
}
.hero .container { position: relative; z-index: 2; padding-top: 150px; padding-bottom: 60px; }
.hero__inner { max-width: 820px; }
.hero__eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--blue); display: inline-flex; align-items: center; gap: 14px; margin-bottom: 30px;
}
.hero__eyebrow::before { content:""; width: 44px; height: 2px; background: var(--blue); }
.hero h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: 1.04; letter-spacing: -.015em;
  text-shadow: 0 2px 30px rgba(6,14,24,.75), 0 1px 4px rgba(6,14,24,.6);
}
.hero h1 b { font-weight: 700; }
.hero p {
  margin: 30px 0 40px; max-width: 610px; font-size: 1.18rem; color: #ffffff; line-height: 1.6;
  text-shadow: 0 1px 3px rgba(6,14,24,.7), 0 2px 18px rgba(6,14,24,.6);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 3;
  color: rgba(255,255,255,.7); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hero__scroll .mouse { width: 24px; height: 38px; border: 2px solid rgba(255,255,255,.5); border-radius: 14px; position: relative; }
.hero__scroll .mouse::after {
  content:""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; background: var(--blue); border-radius: 3px; animation: scrolldot 1.8s infinite;
}
@keyframes scrolldot { 0%{opacity:0;transform:translate(-50%,0)} 40%{opacity:1} 80%{opacity:0;transform:translate(-50%,12px)} 100%{opacity:0} }

/* Carosello hero: indicatori a barra con progresso */
.hero__dots {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 3;
  display: flex; gap: 10px;
}
.hero__dot {
  width: 34px; height: 3px; border-radius: 2px; padding: 0; border: 0; cursor: pointer;
  background: rgba(255,255,255,.28); position: relative; overflow: hidden;
  transition: background .3s var(--ease);
}
.hero__dot:hover { background: rgba(255,255,255,.46); }
.hero__dot::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--blue);
}
.hero__dot.is-active::after { animation: dotFill linear both; animation-duration: var(--dur, 7000ms); }
@keyframes dotFill { from { width: 0%; } to { width: 100%; } }

/* =========================================================
   STATS
   ========================================================= */
.stats { background: var(--navy-800); color: #fff; position: relative; z-index: 3; }
.stats__grid { display: grid; grid-template-columns: repeat(4,1fr); }
.stat {
  padding: 62px 34px; border-right: 1px solid rgba(255,255,255,.1);
  position: relative;
}
.stats__grid .stat:last-child { border-right: 0; }
.stat__num-index { font-size: 12px; color: var(--blue); font-weight: 600; letter-spacing: .2em; }
.stat__value {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.4rem,4vw,3.3rem);
  line-height: 1; margin: 16px 0 14px; color: #fff;
}
.stat__value span { color: var(--blue); }
.stat__label { font-size: .82rem; letter-spacing: .04em; color: var(--blue-soft); text-transform: uppercase; line-height: 1.5; }

/* =========================================================
   STUDIO / PROFILE
   ========================================================= */
.studio__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: center; }
.studio__media { position: relative; }
.studio__media img { border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; height: 100%; object-fit: cover; }
.studio__media .tag {
  position: absolute; left: -22px; bottom: 34px; background: var(--navy-800); color: #fff;
  padding: 22px 28px; border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 240px;
}
.studio__media .tag strong { font-family: var(--serif); font-size: 2rem; display: block; color: var(--blue); }
.studio__media .tag span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-soft); }
.studio__body p { color: var(--gray); margin: 0 0 20px; }
.studio__body p.intro { font-size: 1.2rem; color: var(--ink); font-family: var(--serif); font-weight: 400; line-height: 1.5; }
.values { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.values .value {
  border: 1px solid var(--line); border-radius: 40px; padding: 10px 22px;
  font-size: .9rem; font-weight: 600; color: var(--navy-700); background: #fff;
  display: inline-flex; align-items: center; gap: 8px;
}
.values .value::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }

/* =========================================================
   SERVICES
   ========================================================= */
.services__grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.service {
  padding: 40px 34px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease), transform .35s var(--ease); position: relative; background: #fff;
}
.service:hover { background: var(--navy-800); transform: translateY(0); }
.service__icon { width: 46px; height: 46px; color: var(--blue); margin-bottom: 22px; }
.service:hover .service__icon { color: var(--blue); }
.service__num { position: absolute; top: 26px; right: 30px; font-size: .8rem; font-weight: 700; color: var(--line); letter-spacing: .05em; }
.service:hover .service__num { color: rgba(255,255,255,.25); }
.service h3 { font-size: 1.14rem; color: var(--navy-800); margin-bottom: 12px; font-weight: 600; }
.service:hover h3 { color: #fff; }
.service p { font-size: .92rem; color: var(--gray); margin: 0; }
.service:hover p { color: var(--blue-soft); }

/* =========================================================
   PROJECTS
   ========================================================= */
.projects__filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 48px; }
.filter-btn {
  font-family: var(--sans); font-size: .9rem; font-weight: 600; letter-spacing: .02em;
  padding: 10px 22px; border-radius: 40px; border: 1.5px solid var(--line); background: #fff; color: var(--gray);
  cursor: pointer; transition: .3s var(--ease);
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy-800); }
.filter-btn.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.filter-btn .count { opacity: .55; font-weight: 500; margin-left: 4px; }

.projects__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.project-card {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: var(--shadow-sm); cursor: pointer; border: 1px solid var(--line);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.project-card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-soft-2); }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.project-card:hover .project-card__media img { transform: scale(1.07); }
.project-card__cat {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(10,37,80,.9); color: #fff; padding: 7px 12px; border-radius: 3px; backdrop-filter: blur(4px);
}
.project-card__flag {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--blue); color: var(--navy-900); padding: 7px 12px; border-radius: 3px;
  display: flex; align-items: center; gap: 6px;
}
.project-card__flag svg { width: 12px; height: 12px; }
.project-card__body { padding: 24px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.project-card__loc { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.project-card__year { font-size: .78rem; color: var(--gray-2); font-weight: 500; }
.project-card h3 { font-family: var(--serif); font-size: 1.35rem; color: var(--navy-800); font-weight: 600; margin-bottom: 10px; }
.project-card p { font-size: .92rem; color: var(--gray); margin: 0 0 20px; flex: 1; }
.project-card__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.project-card__type { font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-2); }
.project-card__price { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--navy-800); }
.project-card.is-hidden { display: none; }

/* =========================================================
   FLAGSHIP
   ========================================================= */
.flagship { background: var(--navy-900); color: #fff; position: relative; overflow: hidden; }
.flagship::before {
  content: "FLAGSHIP"; position: absolute; top: 40px; right: -20px;
  font-family: var(--serif); font-size: 15rem; font-weight: 700; color: rgba(255,255,255,.03);
  letter-spacing: .05em; line-height: 1; pointer-events: none;
}
.flagship__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; position: relative; z-index: 2; }
.flagship__media { position: relative; }
.flagship__media > img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; }
.flagship__thumbs { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 14px; }
.flagship__thumbs img { border-radius: 3px; aspect-ratio: 1/1; object-fit: cover; opacity: .82; transition: opacity .3s, transform .3s; border: 1px solid rgba(255,255,255,.1); }
.flagship__thumbs img:hover { opacity: 1; transform: translateY(-3px); }
.flagship__body .eyebrow { color: var(--blue); }
.flagship__body h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem,4vw,3rem); margin-bottom: 8px; }
.flagship__body h2 b { font-weight: 700; }
.flagship__place { color: var(--blue-soft); font-size: 1rem; letter-spacing: .04em; margin-bottom: 22px; }
.flagship__body p.desc { color: #cdd7e6; font-size: 1.05rem; margin: 0 0 30px; }
.flagship__facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 30px; }
.flagship__fact { border-left: 2px solid var(--blue); padding-left: 16px; }
.flagship__fact strong { font-family: var(--serif); font-size: 1.9rem; display: block; color: #fff; line-height: 1; }
.flagship__fact span { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-soft); }
.flagship__pub {
  display: flex; align-items: center; gap: 20px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 18px 22px;
}
.flagship__pub img { width: 76px; height: 76px; border-radius: 4px; background: #fff; padding: 5px; }
.flagship__pub .txt span { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.flagship__pub .txt p { margin: 4px 0 0; font-size: .92rem; color: #cdd7e6; }
.flagship__pub a { color: var(--blue); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }

/* =========================================================
   TECH / EQUIPMENT
   ========================================================= */
.tech__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tech__col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 42px; }
.tech__col h3 { font-family: var(--serif); font-size: 1.6rem; color: var(--navy-800); font-weight: 600; margin-bottom: 6px; }
.tech__col .sub { color: var(--gray); font-size: .95rem; margin-bottom: 28px; }
.tech__list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; }
.tech__item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--bg-soft-2); }
.tech__item .name { font-weight: 600; color: var(--navy-800); font-size: .98rem; }
.tech__item .desc { font-size: .78rem; color: var(--gray-2); text-align: right; }
.tech__badge { display:inline-block; margin-left:8px; font-size:.68rem; font-weight:700; color: var(--blue); background: var(--bg-soft-2); border-radius: 20px; padding: 2px 8px; }

/* =========================================================
   QUOTE
   ========================================================= */
.quote { background: var(--navy-800); color: #fff; text-align: center; padding: 110px 0; }
.quote__mark { font-family: var(--serif); font-size: 6rem; line-height: .5; color: var(--blue); opacity: .5; height: 40px; }
.quote blockquote {
  font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem,3.2vw,2.4rem);
  line-height: 1.4; max-width: 900px; margin: 30px auto 34px; letter-spacing: -.005em;
}
.quote cite { font-style: normal; color: var(--blue-soft); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; }
.quote cite b { color: #fff; font-weight: 600; display:block; margin-bottom: 4px; font-size: 1rem; letter-spacing: .02em; text-transform: none; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact__info .lead2 { font-size: 1.1rem; color: var(--gray); margin: 0 0 34px; max-width: 460px; }
.contact__cards { display: grid; gap: 14px; }
.contact-card { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: border-color .3s, transform .3s; }
.contact-card:hover { border-color: var(--blue); transform: translateX(4px); }
.contact-card__ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-soft); color: var(--navy-700); display: grid; place-items: center; }
.contact-card__ic svg { width: 20px; height: 20px; }
.contact-card .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gray-2); font-weight: 600; }
.contact-card .val { color: var(--navy-800); font-weight: 600; font-size: 1rem; word-break: break-word; }
.contact-card .val small { display:block; font-weight: 500; color: var(--gray); font-size: .82rem; margin-top: 2px; }

.contact__form { background: var(--navy-800); border-radius: var(--radius); padding: 44px; color: #fff; align-self: start; box-shadow: var(--shadow-md); }
.contact__form h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin-bottom: 8px; }
.contact__form p { color: var(--blue-soft); font-size: .92rem; margin: 0 0 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-soft); margin-bottom: 8px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--sans); font-size: .98rem; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius);
  padding: 13px 16px; transition: border-color .3s, background .3s;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.4); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); background: rgba(255,255,255,.1); }
.field textarea { resize: vertical; min-height: 110px; }
.field select option { color: #111; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact__form .btn { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { font-size: .78rem; color: var(--blue-soft); margin: 16px 0 0; text-align: center; }
.form-success, .form-error { display:none; border-radius: var(--radius); padding: 16px; text-align:center; font-size:.92rem; margin-top: 16px; }
.form-success { background: rgba(107,174,214,.15); border:1px solid var(--blue); }
.form-error { background: rgba(220,90,90,.12); border:1px solid #e08a8a; color: #ffd9d9; }
.form-error a { color: #fff; font-weight: 700; text-decoration: underline; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.contact__form .btn[disabled] { opacity: .7; cursor: not-allowed; pointer-events: none; }
.contact__form .btn .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(6,24,56,.35); border-top-color: var(--navy-900);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--navy-900); color: #fff; padding: 70px 0 30px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 46px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__brand { justify-self: start; min-width: 0; }
.footer__brand img { height: 84px; width: auto; max-width: 100%; margin-bottom: 22px; margin-left: -8px; }
.footer__brand p { color: var(--blue-soft); font-size: .92rem; max-width: 320px; }
.footer__col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); margin-bottom: 20px; }
.footer__col a, .footer__col p { display: block; color: #c3cede; font-size: .92rem; margin-bottom: 12px; transition: color .25s; }
.footer__col a:hover { color: #fff; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 26px; flex-wrap: wrap; }
.footer__bottom p { font-size: .82rem; color: var(--gray-2); margin: 0; }
.footer__bottom .legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer__bottom .legal span { font-size: .82rem; color: var(--gray-2); }

/* =========================================================
   LIGHTBOX (project modal)
   ========================================================= */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox__overlay { position: absolute; inset: 0; background: rgba(6,24,56,.82); backdrop-filter: blur(6px); }
.lightbox__dialog {
  position: relative; z-index: 2; background: #fff; border-radius: var(--radius); overflow: hidden;
  max-width: 940px; width: 100%; max-height: 92vh; display: grid; grid-template-columns: 1.15fr 1fr;
  box-shadow: var(--shadow-lg); animation: pop .4s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.lightbox__img { background: var(--bg-soft-2); }
.lightbox__img img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; }
.lightbox__content { padding: 44px 40px; overflow-y: auto; }
.lightbox__content .cat { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.lightbox__content h3 { font-family: var(--serif); font-size: 2rem; color: var(--navy-800); margin: 12px 0 6px; font-weight: 600; }
.lightbox__content .loc { color: var(--gray); font-size: .95rem; margin-bottom: 24px; }
.lightbox__content .desc { color: var(--gray); margin-bottom: 26px; }
.lightbox__facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lightbox__facts .row { display: flex; justify-content: space-between; padding: 14px 18px; background: #fff; font-size: .92rem; }
.lightbox__facts .row .k { color: var(--gray-2); text-transform: uppercase; font-size: .74rem; letter-spacing: .06em; font-weight: 600; align-self: center; }
.lightbox__facts .row .v { color: var(--navy-800); font-weight: 600; text-align: right; }
.lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; cursor: pointer; display: grid; place-items: center; color: var(--navy-800); transition: transform .3s, background .3s; }
.lightbox__close:hover { transform: rotate(90deg); background: #fff; }
.lightbox__close svg { width: 20px; height: 20px; }

/* =========================================================
   ANIMATION UTILITIES
   ========================================================= */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .section { padding: 90px 0; }
  .stats__grid { grid-template-columns: repeat(2,1fr); }
  .stats__grid .stat:nth-child(2) { border-right: 0; }
  .stat { border-bottom: 1px solid rgba(255,255,255,.1); }
  .services__grid { grid-template-columns: repeat(2,1fr); }
  .studio__grid { grid-template-columns: 1fr; gap: 44px; }
  .studio__media .tag { left: 20px; }
  .flagship__grid { grid-template-columns: 1fr; gap: 40px; }
  .projects__grid { grid-template-columns: repeat(2,1fr); }
  .tech__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; gap: 40px; }
  .lightbox__dialog { grid-template-columns: 1fr; max-height: 88vh; }
  .lightbox__img img { max-height: 260px; min-height: 200px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .nav { position: fixed; inset: 0 0 0 auto; width: min(320px,82vw); background: var(--navy-800); flex-direction: column; align-items: stretch; padding: 96px 26px 40px; gap: 6px; transform: translateX(100%); transition: transform .4s var(--ease); box-shadow: var(--shadow-lg); }
  .nav.open { transform: none; }
  .nav a { color: #fff !important; padding: 14px 16px; border-radius: var(--radius); font-size: 1.05rem; }
  .nav a:hover { background: rgba(255,255,255,.08); }
  .nav .nav-cta { margin-left: 0; margin-top: 12px; text-align: center; justify-content: center; }
  .nav-toggle { display: flex; z-index: 120; }
  .nav-toggle.open span { background: #fff; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .section { padding: 74px 0; }
  .stats__grid { grid-template-columns: 1fr; }
  .stat { border-right: 0 !important; }
  .services__grid { grid-template-columns: 1fr; }
  .service { border-right: 0; }
  .projects__grid { grid-template-columns: 1fr; }
  .tech__list { grid-template-columns: 1fr; }
  .tech__col { padding: 30px 24px; }
  .contact__form { padding: 30px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 34px; }
  .flagship__facts { grid-template-columns: 1fr 1fr; }
  .hero p { font-size: 1.05rem; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
}

/* =========================================================
   V2 — PREMIUM POLISH
   ========================================================= */
::selection { background: var(--blue); color: var(--navy-900); }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-soft-2); }
::-webkit-scrollbar-thumb { background: var(--navy-800); border-radius: 8px; border: 3px solid var(--bg-soft-2); }
::-webkit-scrollbar-thumb:hover { background: var(--navy-700); }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--blue), #a3d0ec);
  z-index: 150; pointer-events: none;
}

.section, .flagship { scroll-margin-top: 72px; }

/* ---------- Ghost chapter numbers ---------- */
.section[data-num] > .container { position: relative; z-index: 1; }
.section[data-num]::before {
  content: attr(data-num);
  position: absolute; top: 42px; right: 3vw;
  font-family: var(--serif); font-weight: 700; line-height: 1;
  font-size: clamp(7rem, 13vw, 12rem);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(26,53,100,.09);
  pointer-events: none; user-select: none;
}

/* ---------- Hero: carosello con crossfade + Ken Burns continuo ---------- */
.hero__bg { inset: -7% 0; }
.hero__slide { transition: opacity 1.6s var(--ease); }
.hero__slide img {
  translate: calc(var(--mx, 0) * 1px) calc(var(--my, 0) * 1px);
  transition: translate 1.2s cubic-bezier(.16,1,.3,1);
  will-change: transform, translate, filter;
}
/* Zoom lento e continuo mentre la slide è visibile, alternato per varietà */
.hero__slide.is-active img { animation: kenburnsA 8.2s linear both; }
.hero__slide:nth-child(even).is-active img { animation-name: kenburnsB; }
@keyframes kenburnsA { from { transform: scale(1.08); } to { transform: scale(1.17); } }
@keyframes kenburnsB { from { transform: scale(1.15) translateX(0); } to { transform: scale(1.06) translateX(-1.6%); } }
/* Ingresso cinematico riservato al primissimo caricamento della pagina */
.hero__slide--intro.is-active img { animation: heroIntro 6.5s var(--ease) both; }
@keyframes heroIntro {
  0%   { transform: scale(1.22); filter: blur(10px) brightness(1.35) saturate(.55); }
  45%  { filter: blur(0) brightness(1.04) saturate(1); }
  100% { transform: scale(1.08); filter: blur(0) brightness(1) saturate(1); }
}
.hero__grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(115deg, rgba(0,0,0,.9), rgba(0,0,0,.1));
  mask-image: linear-gradient(115deg, rgba(0,0,0,.9), rgba(0,0,0,.1));
  animation: gridIn 2.2s var(--ease) .9s both;
}
@keyframes gridIn {
  from { opacity: 0; background-position: 0 42px, 42px 0; }
  to   { opacity: 1; background-position: 0 0, 0 0; }
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2;
  height: clamp(48px, 9vw, 120px);
  background: var(--navy-800);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.hero__scroll { bottom: 20px; animation: fadeUp 1s var(--ease) 1.8s both; }

/* Titolo: reveal riga per riga con maschera */
.hero-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero-line__in { display: block; transform: translateY(112%) rotate(1.2deg); animation: lineUp 1s cubic-bezier(.16,1,.3,1) both; }
.hero-line:nth-child(1) .hero-line__in { animation-delay: .45s; }
.hero-line:nth-child(2) .hero-line__in { animation-delay: .6s; }
.hero-line:nth-child(3) .hero-line__in { animation-delay: .75s; }
@keyframes lineUp { to { transform: translateY(0) rotate(0); } }

/* Eyebrow: la linea si disegna, il testo scivola dentro */
.hero__eyebrow { animation: fadeUp .8s var(--ease) .3s both; }
.hero__eyebrow::before { transform-origin: left center; animation: lineGrow .9s var(--ease) .5s both; }
@keyframes lineGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero p       { animation: fadeUp .9s var(--ease) 1.05s both; }
.hero__actions{ animation: fadeUp .9s var(--ease) 1.25s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* Bottoni hero: riflesso che scorre al passaggio */
.hero__actions .btn { position: relative; overflow: hidden; }
.hero__actions .btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -80%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-18deg); transition: left .7s var(--ease); pointer-events: none;
}
.hero__actions .btn:hover::after { left: 130%; }

/* ---------- Stats micro-interactions ---------- */
.stat { transition: background .4s var(--ease); }
.stat:hover { background: rgba(255,255,255,.045); }
.stat::after {
  content: ""; position: absolute; top: 0; left: 34px;
  height: 3px; width: 0; background: var(--blue);
  transition: width .5s var(--ease);
}
.stat:hover::after { width: 58px; }

/* ---------- Blueprint grid on soft sections ---------- */
.section--soft {
  background-image:
    linear-gradient(rgba(26,53,100,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,53,100,.045) 1px, transparent 1px);
  background-size: 54px 54px;
}

/* ---------- Nav: active indicator ---------- */
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a.active::after, .nav a:not(.nav-cta):hover::after { transform: scaleX(1); }

/* ---------- Buttons: arrow slide ---------- */
.btn svg { transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

/* ---------- Project cards: overlay + view chip ---------- */
.project-card__media::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(6,24,56,.45), transparent 50%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.project-card:hover .project-card__media::after { opacity: 1; }
.project-card:hover { border-color: rgba(107,174,214,.55); }
.project-card__view {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: var(--navy-900);
  display: grid; place-items: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.project-card__view svg { width: 18px; height: 18px; }
.project-card:hover .project-card__view { opacity: 1; transform: none; }
.project-card__media img { filter: saturate(1.04); }

.filter-btn.active { box-shadow: 0 10px 24px rgba(10,37,80,.22); }

.flagship__thumbs img:hover { border-color: var(--blue); }

/* ---------- Quote: depth glow ---------- */
.quote { background: radial-gradient(1100px 480px at 50% -8%, #143a75, var(--navy-800) 70%); }

/* ---------- Form focus glow ---------- */
.field input:focus, .field textarea:focus, .field select:focus {
  box-shadow: 0 0 0 3px rgba(107,174,214,.22);
}

/* ---------- Footer diagonal ---------- */
.footer {
  clip-path: polygon(0 clamp(24px, 4vw, 54px), 100% 0, 100% 100%, 0 100%);
  padding-top: calc(70px + clamp(24px, 4vw, 54px));
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--navy-800); color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s, background .3s, color .3s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--blue); color: var(--navy-900); }

@media (max-width: 720px) {
  .section[data-num]::before { display: none; }
  .to-top { right: 18px; bottom: 18px; width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide img, .hero__grid, .hero__eyebrow, .hero__eyebrow::before,
  .hero h1, .hero-line__in, .hero p, .hero__actions, .hero__scroll, .hero__dot.is-active::after { animation: none; }
  .hero__slide img { transform: scale(1.08); filter: none; translate: none; transition: none; }
  .hero__slide { transition: none; }
  .hero-line__in { transform: none; }
}

/* =========================================================
   ARTICLES (Approfondimenti)
   ========================================================= */
.articles__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.article-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.article-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(107,174,214,.55); }
.article-card__media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft-2); }
.article-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.article-card:hover .article-card__media img { transform: scale(1.06); }
.article-card__media--pattern {
  display: flex; align-items: center; justify-content: center; color: var(--blue);
  background-image:
    linear-gradient(rgba(26,53,100,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,53,100,.06) 1px, transparent 1px);
  background-size: 22px 22px; background-color: var(--bg-soft);
}
.article-card__media--pattern svg { width: 52px; height: 52px; opacity: .65; }
.article-card__body { padding: 24px 24px 22px; display: flex; flex-direction: column; flex: 1; }
.article-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.article-card__cat { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--blue); background: var(--bg-soft-2); padding: 4px 11px; border-radius: 20px; }
.article-card__date { font-size: .78rem; color: var(--gray-2); font-weight: 500; }
.article-card h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--navy-800); margin-bottom: 10px; line-height: 1.32; }
.article-card p { font-size: .92rem; color: var(--gray); margin: 0 0 20px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.article-card__read { font-size: .76rem; color: var(--gray-2); font-weight: 500; }
.article-card__more { font-size: .84rem; font-weight: 700; color: var(--navy-800); display: inline-flex; align-items: center; gap: 6px; transition: gap .3s var(--ease), color .3s; }
.article-card__more svg { width: 14px; height: 14px; }
.article-card:hover .article-card__more { color: var(--blue); gap: 9px; }

.articles__more { display: none; justify-content: center; margin-top: 44px; }

/* =========================================================
   ARTICLE READER (reading modal)
   ========================================================= */
/* Il lettore non è più una finestra sovrapposta: è una pagina dedicata a sé,
   nel normale flusso del documento. Quando <body> ha la classe "reading" la
   home (main + footer) viene nascosta e resta visibile solo l'articolo, sotto
   l'header fisso. L'apertura è gestita via hash routing (#articolo/slug) in main.js. */
.reader { display: none; }
body.reading .reader { display: block; animation: readerIn .5s var(--ease); }
body.reading > main,
body.reading > .footer { display: none; }

.reader__inner { max-width: 820px; margin: 0 auto; padding: 140px 24px 90px; }
.reader__topbar { margin-bottom: 30px; }
.reader__back {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .9rem; font-weight: 600; letter-spacing: .01em; color: var(--blue);
  transition: color .25s, gap .25s var(--ease);
}
.reader__back:hover { color: var(--navy-700); gap: 14px; }
.reader__back svg { width: 18px; height: 18px; }
.reader__media { aspect-ratio: 16/7; background: var(--bg-soft-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 38px; box-shadow: var(--shadow-sm); }
.reader__media img { width: 100%; height: 100%; object-fit: cover; }
.reader__foot { margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--line); }
@keyframes readerIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reader__content .cat { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.reader__content h2 { font-family: var(--serif); font-size: clamp(1.5rem,3vw,2.15rem); color: var(--navy-800); margin: 14px 0 10px; font-weight: 600; line-height: 1.28; }
.reader__meta { color: var(--gray-2); font-size: .88rem; margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.reader__body { color: var(--ink); font-size: 1.02rem; line-height: 1.75; }
.reader__body p { margin: 0 0 20px; }
.reader__body h3 { font-family: var(--serif); font-size: 1.25rem; color: var(--navy-800); margin: 30px 0 14px; font-weight: 600; }
.reader__body ul { margin: 0 0 20px; padding-left: 22px; }
.reader__body li { margin-bottom: 10px; }
.reader__body strong { color: var(--navy-800); }
.reader__body figure { margin: 8px 0 26px; }
.reader__body figure img { width: 100%; height: auto; border-radius: var(--radius); display: block; border: 1px solid var(--line); }
.reader__body figcaption { font-size: .85rem; color: var(--gray-2); margin-top: 10px; text-align: center; }

@media (max-width: 1024px) {
  .articles__grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px) {
  .articles__grid { grid-template-columns: 1fr; }
  .reader__inner { padding: 132px 20px 64px; }
  .reader__media { margin-bottom: 28px; }
}
