/* Home page sections and their responsive layouts. */

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--color-text);
  color: var(--color-background);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 53%;
  min-height: 586px;
  padding-block: 4rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.hero h1 {
  font-size: var(--font-size-display);
  letter-spacing: -0.045em;
}

.hero-sector {
  display: grid;
  width: 100%;
}

/* Reserve the longest phrase so typing never moves the content below it. */
.hero-sector::before {
  content: attr(data-typing-longest) ".";
  visibility: hidden;
  font-style: italic;
}

.hero-sector::before,
.hero-sector-live {
  grid-area: 1 / 1;
}

[data-typing-text] {
  position: relative;
  color: var(--color-accent);
}

[data-typing-text].is-typing::after {
  content: "";
  position: absolute;
  inset-inline-end: -0.08em;
  bottom: 0.12em;
  height: 0.72em;
  border-inline-start: 0.035em solid currentColor;
  animation: typing-caret 1s step-end infinite;
}

.hero-lead {
  font-size: var(--font-size-lead);
  line-height: 1.5;
  max-width: 40ch;
  margin-top: 1.5rem;
}

.hero-content .button {
  margin-top: 2rem;
}

.hero-visual {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
  transform: translateX(-18px);
}

.hero-photo-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% center;
  animation: photo-enter 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.image-caption {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  padding: 0.25rem 0.5rem;
  background: var(--color-background);
  color: var(--color-text);
  font-size: var(--font-size-small);
}

.hero-content > * {
  animation: enter 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-content > :nth-child(2) {
  animation-delay: 0.07s;
}

.hero-content > :nth-child(3) {
  animation-delay: 0.14s;
}

/* Section introductions */

.section-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: center;
  margin-bottom: clamp(2rem, 3vw, 2.5rem);
}

.section-intro > p {
  max-width: 44ch;
}

.section-heading {
  max-width: 26ch;
  margin-bottom: clamp(2rem, 3vw, 2.5rem);
}

/* Service explorer */

.service-tabs {
  display: flex;
  margin-left: calc(50% + 24px);
  height: 58px;
  gap: 0.25rem;
}

.service-tabs button {
  flex: 1;
  min-width: 0;
  background: var(--color-surface);
  color: var(--color-text);
  border: 0;
  cursor: pointer;
  padding: 0.75rem;
  font-weight: 700;
  transition: background-color 0.2s ease-out;
}

.service-tabs button[aria-selected="true"] {
  background: var(--color-accent);
}

.service-tabs button:hover:not([aria-selected="true"]) {
  background: #e3e9e5;
}

.service-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: start;
}

.service-panel + .service-panel {
  margin-top: 4rem;
}

.services-ready .service-panel {
  margin-top: 0;
}

.services-ready .service-figure {
  margin-top: -58px;
}

.service-figure {
  min-width: 0;
}

.service-figure img {
  width: 100%;
  height: clamp(24rem, 34vw, 30rem);
  object-fit: cover;
  clip-path: polygon(0 0, calc(100% - 64px) 0, 100% 64px, 100% 100%, 0 100%);
}

.service-figure figcaption {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.service-copy {
  padding-top: 1.75rem;
}

.service-copy > h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.12;
}

.electrical-services {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 1.5rem 0 2rem;
  list-style: none;
}

.electrical-services li {
  position: relative;
  padding-left: 1.25rem;
}

.electrical-services li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 0.35rem;
  height: 0.35rem;
  background: var(--color-accent);
}

.trade-list {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.trade-item + .trade-item {
  padding-top: 1.25rem;
  border-top: 1px solid #dce3de;
}

.trade-item h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  line-height: 1.1;
}

/* Working with social landlords */

.commitments {
  background:
    radial-gradient(ellipse at top left, rgb(255 121 0 / 7%), transparent 55%),
    var(--color-text);
  color: var(--color-background);
}

.commitments-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.3fr;
  align-items: start;
  gap: clamp(3rem, 6vw, 6rem);
}

.commitments-header {
  position: sticky;
  top: 2rem;
}

.commitments-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.commitments-eyebrow::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: currentColor;
}

.commitments-heading {
  max-width: 17ch;
  margin-top: 1.5rem;
  font-size: var(--font-size-heading);
  line-height: 1.04;
}

.commitments-heading span {
  color: var(--color-accent);
}

.commitment-grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.commitment-card {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1.5rem;
  min-width: 0;
  padding: 1.75rem;
  border: 1px solid #46514b;
  background: #2a3330;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.commitment-card::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--color-accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.commitment-symbol {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--color-accent);
  color: var(--color-text);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.commitment-card h3 {
  padding-top: 0.125rem;
  margin-bottom: 0.875rem;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.commitment-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  transition: transform 0.25s ease;
}

.commitment-card p {
  color: #dce3de;
  font-size: 1rem;
  line-height: 1.65;
}

@media (hover: hover) {
  .commitment-card:hover {
    border-color: var(--color-accent);
    background: #303a35;
  }

}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .commitment-card:hover {
    transform: translateY(-3px);
  }

  .commitment-card:hover .commitment-icon {
    transform: translateY(-2px);
  }
}

/* Five steps from the first visit to handover */

.project {
  background: var(--color-surface);
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
}

.process-steps li {
  min-width: 0;
  padding-top: 1.25rem;
  border-top: 1px solid #cbd5ce;
}

.process-step-number {
  display: block;
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.process-steps h3 {
  margin-top: 1.25rem;
  font-size: 1.5rem;
  line-height: 1.1;
}

.process-steps p {
  margin-top: 0.75rem;
  font-size: 1rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 2rem;
  align-items: end;
}

.project-gallery figure:first-child img {
  height: 280px;
}

.project-gallery figure:last-child img {
  height: 240px;
}

.project-gallery img {
  width: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, calc(100% - 52px) 0, 100% 52px, 100% 100%, 0 100%);
}

.gallery-caption {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.project .button {
  margin-top: 2rem;
}

/* Client references */

.section-divider {
  position: relative;
  height: clamp(1.5rem, 3vw, 3rem);
}

.section-divider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.section-divider > .container {
  position: relative;
  height: 100%;
}

.section-divider > .container::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: -1.5rem;
  width: clamp(1.75rem, 3vw, 2.75rem);
  height: calc(100% + 1.5rem);
  background: var(--color-accent);
  clip-path: polygon(55% 0, 100% 0, 45% 100%, 0 100%);
}

.trust {
  padding-block: clamp(3rem, 5vw, 4rem) 4rem;
  background: var(--color-surface);
}

.trust-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.trust-intro h2 {
  font-size: clamp(2rem, 3.4vw, 2.5rem);
}

.trust-intro p {
  margin-top: 0.75rem;
  font-size: 1rem;
}

/* Contact */

.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at bottom left, rgb(255 121 0 / 5%), transparent 60%),
    var(--color-text);
  color: var(--color-background);
}

.contact-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: start;
}

.contact h2 {
  font-size: var(--font-size-heading);
}

.contact-inner > div > p {
  max-width: 33ch;
  margin-top: 1.5rem;
  font-size: var(--font-size-lead);
}

.contact-details {
  display: grid;
  gap: 1.75rem;
  padding-right: 2rem;
  margin-top: 2rem;
}

.contact-item h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
}

.contact-value {
  font-size: 1.5rem;
  font-weight: 650;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .hero-content {
    min-height: 552px;
    width: 55%;
  }

  .hero-lead {
    max-width: 34ch;
    font-size: 1.0625rem;
  }

  .section-intro,
  .service-panel,
  .contact-inner {
    gap: 3rem;
  }

  .service-tabs {
    margin-left: calc(50% + 24px);
  }

  .project-gallery {
    gap: 1.5rem;
  }
  .process-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 2rem;
  }
}

@media (max-width: 900px) {
  .commitments-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .commitments-header {
    position: static;
  }

  .commitments-heading {
    max-width: 26ch;
  }

  .hero-content {
    width: 58%;
    min-height: 516px;
  }

  .hero-lead {
    font-size: 1rem;
    max-width: 30ch;
  }

  .hero-lead br {
    display: none;
  }

  .hero-visual {
    width: 50%;
  }

  .section-intro {
    gap: 2rem;
  }

  .service-tabs {
    width: 100%;
    margin-left: 0;
  }

  .services-ready .service-figure {
    margin-top: 0;
  }

  .service-panel {
    gap: 2rem;
    margin-top: 1.5rem;
  }

  .services-ready .service-panel {
    margin-top: 1.5rem;
  }

  .service-copy {
    padding-top: 0;
  }

  .project-gallery figure:first-child img {
    height: 290px;
  }

  .project-gallery figure:last-child img {
    height: 250px;
  }

  .contact-details {
    padding-right: 0;
  }

  .contact-value {
    font-size: 1.25rem;
  }

}

@media (max-width: 760px) {
  .process-steps {
    grid-template-columns: 1fr;
  }

  .process-steps {
    gap: 1.5rem;
  }

  .process-steps li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    column-gap: 1.25rem;
  }

  .process-step-number {
    grid-row: 1 / 3;
    font-size: 2.5rem;
  }

  .process-steps h3 {
    margin-top: 0;
  }

  .process-steps p {
    margin-top: 0.5rem;
  }
}

@media (max-width: 640px) {
  .commitments-layout {
    gap: 2rem;
  }

  .commitments-heading {
    margin-top: 1rem;
  }

  .commitment-card {
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.25rem;
  }

  .commitment-symbol {
    width: 2.75rem;
    height: 2.75rem;
  }

  .commitment-card h3 {
    font-size: 1.375rem;
  }

  .commitment-icon {
    width: 1.625rem;
    height: 1.625rem;
  }

  .hero-content {
    width: 100%;
    min-height: 0;
    padding-block: 3rem 2.5rem;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 7.5vw, 3.25rem);
  }

  .hero-lead {
    max-width: 35ch;
    font-size: var(--font-size-body);
  }

  .hero-visual {
    position: relative;
    width: 100%;
    height: 280px;
    margin-top: 0;
  }

  .hero > .container {
    position: relative;
  }

  .hero {
    display: flex;
    flex-direction: column;
  }

  .hero-visual {
    order: 2;
  }

  .hero-visual::before {
    transform: translateX(-12px);
  }

  .hero-photo {
    object-position: 72% 45%;
  }

  .section-heading {
    margin-bottom: 2rem;
  }

  .section-intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .service-panel {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-figure img {
    height: clamp(13rem, 55vw, 17rem);
    min-height: 0;
    object-position: center 45%;
    clip-path: polygon(0 0, calc(100% - 38px) 0, 100% 38px, 100% 100%, 0 100%);
  }

  .service-tabs {
    height: auto;
    min-height: 56px;
  }

  .service-tabs button {
    font-size: 0.9375rem;
  }

  .project-gallery {
    grid-template-columns: 1.3fr 1fr;
    gap: 0.75rem;
  }

  .project-gallery figure:first-child img {
    height: 220px;
  }

  .project-gallery figure:last-child img {
    height: 180px;
  }

  .project-gallery img {
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
  }

  .trust-intro {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .trust-intro > div:first-child {
    width: 100%;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-details {
    gap: 1.5rem;
  }

}

@media (max-width: 360px) {
  .hero-visual {
    height: 240px;
  }
}
