/* Homepage layout fixes: the hero fits the first screen, the method section is
   compact and readable. Loaded last on index.html only. */

/* ---- Header: contacts stay on the logo row (icons only) instead of a second row ---- */
@media (max-width: 1400px) {
  .agency-home .site-header {
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .agency-home .site-header > .agency-socials {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  .agency-home .agency-socials h2,
  .agency-home .agency-social-item > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .agency-home .agency-social-items {
    display: flex;
    gap: 6px;
  }
  .agency-home .agency-social-item {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e3e1db;
    border-radius: 50%;
    background: #fff8;
  }
  .agency-home .agency-social-item > svg {
    margin: 0;
  }
}
@media (max-width: 960px) {
  .agency-home .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .agency-home .site-header > .agency-socials {
    grid-column: 2;
  }
  .agency-home .site-header > .menu-toggle {
    grid-column: 3;
  }
}
@media (max-width: 520px) {
  /* The contacts are repeated in the footer. */
  .agency-home .site-header > .agency-socials {
    display: none;
  }
}

/* ---- Hero: the stage takes the height left on the first screen (see hero-orbit.js) ---- */
.agency-home .hero h1 {
  font-size: clamp(44px, min(6vw, 9.6svh), 92px);
  margin-bottom: clamp(10px, 2.2svh, 25px);
}
.agency-home .hero-actions {
  margin-top: clamp(12px, 2.4svh, 22px);
}
.agency-home .hero-art-stage {
  height: clamp(200px, var(--hero-stage-h, 480px), 560px);
  margin-top: 4px;
}
.agency-home .hero-art-footer .orbit-pause {
  grid-column: 1;
  justify-self: start;
}
@media (max-width: 760px) {
  .agency-home .hero-art-stage {
    margin-top: 8px;
    margin-bottom: 62px;
  }
  .agency-home .hero-art-footer {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .agency-home .hero-art-footer .orbit-pause {
    grid-column: 1;
    grid-row: 1;
  }
  .agency-home .hero-art-footer .hero-cta {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (max-width: 600px) {
  .agency-home .hero h1 {
    font-size: clamp(34px, min(10.8vw, 6.6svh), 61px);
  }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .agency-home .hero-art-stage {
    margin-bottom: 62px;
  }
  .agency-home .hero-art-footer {
    grid-template-columns: minmax(0, 1fr);
  }
  .agency-home .hero-art-footer .hero-cta {
    grid-column: 1;
  }
}

/* ---- Come lavoriamo: less empty space, larger and darker text ---- */
body.agency-home #come-lavoriamo {
  padding-top: 64px;
  padding-bottom: 54px;
}
body.agency-home #come-lavoriamo .process-heading {
  margin-top: 12px;
}
body.agency-home #come-lavoriamo .process-intro {
  max-width: 440px;
  font-size: 19px;
  line-height: 1.55;
  color: #2f2d29;
}
body.agency-home #come-lavoriamo .process-grid {
  margin-top: 30px;
}
body.agency-home #come-lavoriamo .process-step {
  padding: 24px 32px 4px 0;
}
body.agency-home #come-lavoriamo .process-step + .process-step {
  padding-left: 32px;
}
body.agency-home #come-lavoriamo .process-step:last-child {
  padding-right: 0;
}
body.agency-home #come-lavoriamo .process-step-top {
  min-height: 0;
  justify-content: flex-start;
  margin-bottom: 12px;
}
body.agency-home #come-lavoriamo .process-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  color: #3a3631;
}
body.agency-home #come-lavoriamo .process-tag {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #3d3a35;
}
body.agency-home #come-lavoriamo .process-step-title {
  font-size: clamp(30px, 2.6vw, 38px);
  line-height: 1.12;
}
body.agency-home #come-lavoriamo .process-copy {
  max-width: 440px;
  margin-top: 10px;
  font-size: 19px;
  line-height: 1.55;
  color: #2f2d29;
}
body.agency-home #come-lavoriamo .process-timing-note {
  max-width: 440px;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.55;
  color: #3a3732;
}
body.agency-home #come-lavoriamo .process-result {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d6d2ca;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: #2a2824;
}
@media (max-width: 800px) {
  body.agency-home #come-lavoriamo {
    padding-top: 48px;
    padding-bottom: 40px;
  }
  body.agency-home #come-lavoriamo .process-step,
  body.agency-home #come-lavoriamo .process-step + .process-step {
    padding: 22px 0 18px;
  }
  body.agency-home #come-lavoriamo .process-intro,
  body.agency-home #come-lavoriamo .process-copy {
    font-size: 18px;
  }
  body.agency-home #come-lavoriamo .process-result {
    font-size: 15px;
  }
}

/* ---- Hero: the i's of "fioritura" are dotless (ı) and carry small glowing flowers ----
   Figtree: the ı stem is centred 0.1094em from the glyph start and ends 0.5em above the
   baseline; the inline content area starts 0.95em above the baseline. The flower
   (0.12em) sits just above the stem, its centre 0.605em above the baseline. */
.agency-home .hero h1 .fi {
  position: relative;
}
/* The f hook reaches towards the first i: a little room keeps the flower clear of it. */
.agency-home .hero h1 .fi:first-of-type {
  margin-left: .05em;
}
.agency-home .hero h1 .fi-flower {
  position: absolute;
  left: calc(.1094em - .06em);
  top: calc(.95em - .605em - .06em);
  width: .12em;
  height: .12em;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: fi-bloom .9s cubic-bezier(.2, .9, .3, 1.25) .45s both, fi-glow 6s ease-in-out 1.4s infinite alternate both;
}
.agency-home .hero h1 .fi:nth-of-type(2) .fi-flower {
  animation-delay: .7s, 3.4s;
}
@keyframes fi-bloom {
  from { transform: scale(0) rotate(-120deg); }
  to { transform: scale(1) rotate(0deg); }
}
/* A soft halo that drifts through the same pinkish red, light green and silver (silver in between, so pink and green never blend into brown). */
@keyframes fi-glow {
  0% { filter: drop-shadow(0 0 .02em #ff6f8a) drop-shadow(0 0 .06em #ff6f8a99); }
  33% { filter: drop-shadow(0 0 .02em #e3e6ea) drop-shadow(0 0 .06em #c7ccd4aa); }
  66% { filter: drop-shadow(0 0 .02em #a9ec90) drop-shadow(0 0 .06em #b4ef9eaa); }
  100% { filter: drop-shadow(0 0 .02em #e3e6ea) drop-shadow(0 0 .06em #c7ccd4aa); }
}
@media (prefers-reduced-motion: reduce) {
  .agency-home .hero h1 .fi-flower {
    animation: none;
    filter: drop-shadow(0 0 .02em #ff6f8a) drop-shadow(0 0 .06em #ff6f8a99);
  }
}

/* ---- Hero: holographic rim around "fioritura" ----
   The transparent text stroke widens the area the background is clipped to; the black
   fill covers the inner half, so only a thin iridescent rim shows outside each letter.
   Pinkish red and light green, always separated by silver, drift slowly across the word. */
.agency-home .hero h1 .holo {
  -webkit-text-stroke: max(.026em, 2px) transparent;
  -webkit-text-fill-color: currentColor;
  background: linear-gradient(110deg, #f1f3f6 0%, #ff6b88 11%, #f3d9e0 20%, #dfe3e8 28%, #b4ef9e 39%, #e2f6da 47%, #c7ccd4 55%, #ff7d97 66%, #eef0f3 76%, #a7eab3 87%, #f4f5f7 100%) 0 50% / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: holo-shift 9s ease-in-out infinite alternate;
}
@keyframes holo-shift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .agency-home .hero h1 .holo { animation: none; }
}
