/* ==========================================================================
   Services (staggered tiles), Why-us (accordion), Process (staircase)
   ========================================================================== */

/* ---------- Services ---------- */
.services {
  padding-block: var(--space-section);
  background: linear-gradient(180deg, var(--paper), var(--white) 60%);
}
.services__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }

.services__head .eyebrow { color: var(--teal-700); }
.services__head h2 {
  margin-top: 1rem;
  font-size: var(--step-4);
  text-transform: uppercase;
  color: var(--teal-700);
  line-height: 0.98;
}
.services__sub { margin-block: 1.5rem 2rem; max-width: 26rem; color: var(--text-muted-on-light); }

.services__list { display: grid; gap: 1.25rem; }

.tile {
  --mx: 50%; --my: 0%;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.4rem, 2.4vw, 2rem);
  border-radius: var(--radius-l);
  background: var(--white);
  border: 1px solid rgb(9 84 115 / 0.1);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo), border-color 0.4s;
}
/* Pointer-follow glow (JS sets --mx / --my; on touch it follows the finger) */
.tile::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(22rem circle at var(--mx) var(--my), rgb(16 140 181 / 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.tile h3 { font-size: clamp(1.35rem, 1.15rem + 0.6vw, 1.75rem); line-height: 1.1; color: var(--teal-700); }
.tile h3 span { display: block; }
.tile p { color: var(--text-muted-on-light); max-width: 30rem; }

.tile__num {
  position: absolute; top: 0.6rem; right: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 6vw, 5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(9 84 115 / 0.22);
  transition: color 0.5s, -webkit-text-stroke-color 0.5s;
  pointer-events: none;
}
.tile__icon {
  width: 3.5rem; height: 3.5rem;
  padding: 0.7rem;
  border-radius: 1rem;
  background: var(--cyan-50);
  color: var(--teal-700);
  transition: transform 0.7s var(--ease-out-expo), background 0.4s, color 0.4s;
}
.tile__link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  align-self: flex-start;
  font-weight: 700;
  color: var(--teal-700);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.5s var(--ease-out-expo);
}
.tile__link svg { transition: transform 0.4s var(--ease-out-expo); }
.tile__link:hover, .tile__link:focus-visible { background-size: calc(100% - 1.6rem) 2px; }
.tile__link:hover svg { transform: translateX(5px); }
/* whole tile is clickable: stretch the link's hit area */
.tile__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* Image tile (Ventilation Systems): same look, with a photo */
.tile--photo { padding: 0; }
.tile--photo > :not(.tile__photo):not(.tile__num) { margin-inline: clamp(1.4rem, 2.4vw, 2rem); }
.tile--photo .tile__link { margin-bottom: clamp(1.4rem, 2.4vw, 2rem); }
.tile--photo .tile__icon { margin-top: -2.2rem; position: relative; box-shadow: 0 0 0 5px var(--white); }
.tile__photo { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; }
.tile__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out-expo), filter 0.6s; filter: saturate(0.8) contrast(1.05); }
.tile--photo .tile__num { -webkit-text-stroke-color: rgb(255 255 255 / 0.7); } /* stacked layout: number sits over the photo */

/* Hover (pointer devices) + focus + press (touch) share the same micro-interactions */
.tile:focus-within, .tile:active, .tile.is-touched {
  transform: translateY(-4px);
  box-shadow: 0 1.75rem 3rem -1.25rem rgb(9 84 115 / 0.45);
}
.tile:focus-within::before, .tile:active::before, .tile.is-touched::before { opacity: 1; }
.tile:active .tile__icon, .tile.is-touched .tile__icon { background: var(--teal-700); color: var(--cyan-50); }
.tile:active .tile__photo img, .tile.is-touched .tile__photo img { transform: scale(1.06); filter: saturate(1) contrast(1.05); }

@media (hover: hover) {
  .tile:hover { transform: translateY(-6px); box-shadow: 0 1.75rem 3rem -1.25rem rgb(9 84 115 / 0.45); border-color: rgb(16 140 181 / 0.35); }
  .tile:hover::before { opacity: 1; }
  .tile:hover .tile__num { color: rgb(9 84 115 / 0.08); -webkit-text-stroke-color: rgb(9 84 115 / 0.5); }
  .tile:hover .tile__icon { background: var(--teal-700); color: var(--cyan-50); }
  .tile:hover .tile__photo img { transform: scale(1.06); filter: saturate(1) contrast(1.05); }
  /* per-service icon motion */
  .tile:nth-child(1):hover .tile__icon { transform: translateY(-4px) rotate(-6deg); }
  .tile:nth-child(2):hover .tile__icon { transform: translateY(5px) scale(1.08); }
  .tile:nth-child(3):hover .tile__icon { transform: scale(1.12) rotate(8deg); }
  .tile:nth-child(4):hover .tile__icon { transform: translateY(-5px) rotate(-8deg); }
  .tile:nth-child(5):hover .tile__icon { transform: rotate(360deg); }
}

@media (min-width: 64em) {
  .services__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); align-items: start; }
  .services__head { position: sticky; top: calc(var(--header-h) + 2rem); }
  .services__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }

  /* Image tile: full width, photo left, text right */
  .tile--photo {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    row-gap: 0.9rem;
    align-items: stretch;
  }
  .tile--photo .tile__photo { grid-column: 1; grid-row: 1 / span 4; aspect-ratio: auto; height: 100%; min-height: 15rem; }
  .tile--photo > :not(.tile__photo):not(.tile__num) { grid-column: 2; margin-inline: clamp(1.4rem, 2.4vw, 2.25rem); }
  .tile--photo .tile__icon { margin-top: clamp(1.4rem, 2.4vw, 2.25rem); box-shadow: none; }
  .tile--photo .tile__num { -webkit-text-stroke-color: rgb(9 84 115 / 0.22); }
  .tile--photo .tile__link { justify-self: start; align-self: end; }
}

/* ---------- Why us ---------- */
.why { padding-block: var(--space-section); background: var(--white); }
.why__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
.why__head .eyebrow { color: var(--teal-700); }
.why__head h2 { margin-top: 1rem; font-size: var(--step-4); text-transform: uppercase; color: var(--teal-700); line-height: 0.98; }

.why__list { border-top: 1px solid rgb(9 84 115 / 0.18); }
.why-item { border-bottom: 1px solid rgb(9 84 115 / 0.18); transition: background 0.5s; }
.why-item h3 { font-size: inherit; line-height: inherit; }
.why-item button {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.35rem 0.25rem;
  border: 0; background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--teal-700);
}
.why-item__n { font-family: var(--font-mono); font-size: 0.85rem; color: var(--mist-500); }
.why-item__t { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); line-height: 1.1; transition: transform 0.5s var(--ease-out-expo); }
.why-item button svg { transition: transform 0.5s var(--ease-out-expo); }
.why-item.is-open button svg { transform: rotate(45deg); }
.why-item button:hover .why-item__t { transform: translateX(0.5rem); }

.why-item__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease-out-expo); }
.why-item.is-open .why-item__panel { grid-template-rows: 1fr; }
.why-item__panel > div { overflow: hidden; }
.why-item__panel p { padding: 0 0.25rem 1.5rem 4rem; max-width: 40rem; color: var(--text-muted-on-light); }
.no-js .why-item__panel { grid-template-rows: 1fr; }

@media (min-width: 64em) {
  .why__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); align-items: start; }
  .why__head { position: sticky; top: calc(var(--header-h) + 2rem); }
}

/* ---------- Process: a descending staircase ---------- */
.process {
  position: relative;
  padding-block: var(--space-section);
  color: var(--text-on-dark);
  background:
    radial-gradient(50% 50% at 90% 100%, rgb(211 171 125 / 0.2), transparent 70%),
    linear-gradient(170deg, var(--teal-700), var(--abyss-900) 85%);
  overflow: hidden;
}
.process__head .eyebrow { color: var(--sand-400); }
.process__head h2 { margin-top: 1rem; font-size: var(--step-4); text-transform: uppercase; max-width: 14ch; line-height: 0.98; }
.process__sub { margin-top: 1.25rem; max-width: 28rem; color: var(--text-muted-on-dark); }
@media (min-width: 64em) {
  .process__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); column-gap: clamp(2rem, 5vw, 6rem); align-items: end; }
  .process__head .eyebrow, .process__head h2 { grid-column: 1; }
  .process__sub { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; padding-bottom: 0.4rem; }
}

.process__steps { display: grid; gap: 2rem; margin-top: clamp(2.5rem, 5vw, 4rem); counter-reset: none; }
.process__steps li {
  position: relative;
  padding: 1.5rem 0 0 1.5rem;
  border-left: 1px solid rgb(236 248 254 / 0.25);
}
.process__n {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--sand-400);
}
.process__steps h3 { margin-block: 0.6rem; font-size: clamp(1.35rem, 1.15rem + 0.6vw, 1.75rem); line-height: 1.1; }
.process__steps p { color: var(--text-muted-on-dark); font-size: 0.975rem; }
.process__steps li { transition: translate 0.6s var(--ease-out-expo), border-color 0.4s; }
.process__n { transition: color 0.5s, translate 0.6s var(--ease-out-expo); }
@media (hover: hover) {
  .process__steps li:hover { translate: 0 -4px; border-left-color: var(--sand-400); }
  .process__steps li:hover .process__n { color: rgb(211 171 125 / 0.18); translate: 0.25rem 0; }
}

@media (min-width: 64em) {
  .process__steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; padding-bottom: 7rem; }
  .process__steps li:nth-child(2) { margin-top: 2.5rem; }
  .process__steps li:nth-child(3) { margin-top: 5rem; }
  .process__steps li:nth-child(4) { margin-top: 7.5rem; }
}