/* =========================================================
   AZTEC 360 - STYLES (v2 dark)
   Colours are taken from the logo file itself.
   Breakpoints: tablet (max 850px), mobile (max 600px).
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Logo colours (sampled from logo_darkbg.png) */
  --logo-dark: #1f282d; /* the road - main page background */
  --logo-ring: #454547; /* dark ring inside the gear */
  --logo-grey: #77787b; /* road edges - decoration only, too faint for small text */
  --cyan: #32c6f4; /* speedometer band */
  --red: #ed1c24; /* needle */

  /* Shades built from the logo dark */
  --deep: #161d21; /* header, footer, darkest bands */
  --deep-rgb: 22, 29, 33; /* --deep as numbers, for fades over photos */
  --panel: #263137; /* about band */
  --panel-hover: #2c3940; /* service card hover */
  --line: rgba(255, 255, 255, 0.14);

  --white: #f4f6f6;
  --text: #d6dcde; /* body text */
  --muted: #aeb7bb; /* secondary text */
  --on-cyan: #10181c; /* text on cyan buttons */

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "DM Sans", Arial, sans-serif;
  --max: 1240px;
}

@font-face {
  font-family: "911 Porscha";
  src: url("assets/911porschav3.ttf") format("truetype");
  font-display: swap;
}

/* ---------- 2. Base ---------- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 108px;
}
body {
  margin: 0;
  background: var(--logo-dark);
  color: var(--white);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
.container {
  width: min(100% - 64px, var(--max));
  margin-inline: auto;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
h1 {
  font-size: clamp(40px, 5.6vw, 72px);
  margin: 0 0 14px;
}
h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  margin: 0 0 20px;
}
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}
/* No coloured flash when tapping links and buttons on phones */
a,
button {
  -webkit-tap-highlight-color: transparent;
}
/* On touch screens, no outline left on a service card after its pop-up closes
   (keyboard users on computers still get the outline) */
@media (hover: none) {
  .service-card:focus,
  .service-card:focus-visible {
    outline: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 14px 22px;
  background: var(--cyan);
  color: var(--on-cyan);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s,
    background 0.2s;
}
.button:hover {
  transform: translateY(-2px);
  background: var(--white);
}
.button-lg {
  font-size: 20px;
  padding: 15px 24px;
}
.button-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- 4. Header ---------- */
.header {
  height: 108px; /* logo is 78px, leaving 15px above and below */
  background: var(--deep);
  /* Stays at the top of the screen; slides away when scrolling down
     and back when scrolling up (see script.js) */
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
}
.header.is-hidden {
  transform: translateY(-100%);
}
/* Never hide it while someone is tabbing through the links */
.header:focus-within {
  transform: none;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  width: 94px;
  height: 78px;
}
.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header nav {
  display: flex;
  align-items: center;
  gap: 40px;
}
.header nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.header nav a:hover {
  color: var(--cyan);
}
.header nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cyan);
  color: var(--on-cyan);
  padding: 11px 20px 11px 16px;
  border-radius: 4px;
  font-weight: 700;
}
.nav-cta-icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.header nav .nav-cta:hover {
  background: var(--white);
  color: var(--on-cyan);
}

/* ---------- 5. Hero ---------- */
.hero {
  min-height: 560px;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--panel);
}
.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-bg {
  object-fit: cover;
  object-position: center 48%;
  filter: saturate(0.72);
}
.hero-shade {
  background:
    linear-gradient(
      90deg,
      rgba(var(--deep-rgb), 0.97) 0%,
      rgba(var(--deep-rgb), 0.88) 34%,
      rgba(var(--deep-rgb), 0.43) 68%,
      rgba(var(--deep-rgb), 0.16) 100%
    ),
    linear-gradient(0deg, rgba(var(--deep-rgb), 0.38), transparent 45%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding-block: 80px 80px;
}
.hero h1 {
  max-width: 640px;
}
.hero-accent {
  font: 700 clamp(19px, 2vw, 24px) var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan);
  margin: 0 0 14px;
}
.hero-description {
  max-width: 470px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
}


/* ---------- 6. Services ---------- */
.services {
  background: var(--deep);
  padding: 64px 0 72px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.services h2 {
  margin-bottom: 28px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* Each card is a button that opens the details pop-up */
.service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 220px;
  padding: 26px 26px 24px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s;
}
.service-card:first-child {
  border-left: 1px solid var(--line);
}
@media (hover: hover) {
  .service-card:hover {
    background: var(--panel-hover);
  }
}
.service-icon {
  width: 40px;
  height: 40px;
  color: var(--cyan);
  margin-bottom: 8px;
}
.service-icon svg {
  width: 100%;
  height: 100%;
}
.service-title {
  font: 700 22px/1.05 var(--display);
  text-transform: uppercase;
  color: var(--white);
  max-width: 15ch;
}
.service-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 27ch;
}
.service-more {
  margin-top: auto;
  padding-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}
.more-icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}
@media (hover: hover) {
  .service-card:hover .more-icon {
    transform: rotate(90deg);
  }
}
.service-note {
  margin: 22px 0 0;
  color: var(--text);
  font-size: 16px;
}

/* ---------- 7. Service pop-up ---------- */
.service-dialog {
  width: min(100% - 32px, 480px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--logo-dark);
  color: var(--white);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.service-dialog::backdrop {
  background: rgba(var(--deep-rgb), 0.75);
}
.dialog-inner {
  position: relative;
  padding: 32px 32px 30px;
  border-top: 4px solid var(--cyan);
  border-radius: 6px 6px 0 0;
}
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}
.dialog-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
.dialog-close svg {
  width: 22px;
  height: 22px;
}
.dialog-icon {
  display: block;
  width: 40px;
  height: 40px;
  color: var(--cyan);
  margin-bottom: 14px;
}
.dialog-icon svg {
  width: 100%;
  height: 100%;
}
.service-dialog h3 {
  font-size: 30px;
  margin: 0 0 8px;
}
.dialog-text {
  color: var(--muted);
  margin: 0 0 18px;
}
.dialog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.dialog-list li {
  padding: 11px 0 11px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--text);
}
.dialog-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 8px;
  height: 2px;
  background: var(--red);
}
.dialog-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.service-dialog .button {
  margin-top: 20px;
}

/* ---------- 8. About ---------- */
.about {
  background: var(--panel);
  padding: 84px 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(48px, 7vw, 100px);
}
.about-image {
  position: relative;
  margin: 0;
  min-height: 400px;
}
.about-image::after {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 2px solid var(--cyan);
  opacity: 0.8;
  z-index: 0;
}
.about-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 400px;
  object-fit: cover;
  filter: saturate(0.75);
  background: var(--logo-ring);
}
.about-image figcaption {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 18px;
  padding: 9px 13px;
  background: var(--cyan);
  color: var(--on-cyan);
  font: 700 12px var(--body);
  letter-spacing: 0.12em;
}
.about-copy {
  max-width: 540px;
}
.about-copy > p {
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 15px;
}
.about-rule {
  width: 56px;
  height: 4px;
  background: var(--red);
  margin-top: 30px;
}

/* ---------- 9. Contact ---------- */
.contact {
  position: relative;
  overflow: hidden;
  background: var(--deep);
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 72px 0;
}
.contact-road,
.contact-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Full photo, like the hero: dark on the left for the text, the road showing through on the right */
.contact-road {
  object-fit: cover;
  /* Higher % shows more road and less sky; lower % shows more sky */
  object-position: center 80%;
  /* Cuts through haze: more contrast, slightly darker, full colour */
  filter: contrast(1.25) brightness(0.85) saturate(1.05);
}
.contact-overlay {
  background: linear-gradient(
    90deg,
    rgba(var(--deep-rgb), 0.95) 0%,
    rgba(var(--deep-rgb), 0.8) 35%,
    rgba(var(--deep-rgb), 0.3) 70%,
    rgba(var(--deep-rgb), 0.35) 100%
  );
}
/* Keeps the address readable now the photo is brighter behind it */
.contact-details {
  text-shadow: 0 1px 12px rgba(var(--deep-rgb), 0.9);
}
.contact-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; /* both sides centred, so the heading doesn't drop to the bottom */
  gap: 50px;
}
.contact h2 {
  max-width: 600px;
  margin-bottom: 12px;
}
.contact-inner > div > p {
  color: var(--text);
  margin: 0;
}
/* Right-hand block: logo on top, centred over address and hours side by side */
.contact-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--text);
  font-size: 15px;
}
.details-cols {
  display: grid;
  grid-template-columns: auto auto;
  gap: 40px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}
.contact-details address,
.hours {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-style: normal;
}
.details-label {
  font: 700 13px var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 2px;
}
/* Logo at the top (it carries the business name) */
.contact-logo {
  width: 170px;
  height: auto;
}

/* ---------- 10. Footer ---------- */
.footer {
  background: var(--deep);
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font: 500 12px var(--body);
  letter-spacing: 0.1em;
}
.footer a {
  text-decoration: none;
  color: var(--text);
}
.footer a:hover {
  color: var(--cyan);
}

/* ---------- 11. Tablet (max 850px) ---------- */
@media (max-width: 850px) {
  .hero {
    min-height: 520px;
  }
  .hero-shade {
    background: linear-gradient(
      90deg,
      rgba(var(--deep-rgb), 0.94),
      rgba(var(--deep-rgb), 0.66) 65%,
      rgba(var(--deep-rgb), 0.36)
    );
  }
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .service-card:nth-child(3) {
    border-left: 1px solid var(--line);
  }
  .service-card:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .about-grid {
    gap: 45px;
  }
  .about-image,
  .about-image img {
    min-height: 340px;
    height: 340px;
  }
  .contact-inner {
    gap: 28px;
  }
}

/* ---------- 12. Mobile (max 600px) ---------- */
@media (max-width: 600px) {
  .container {
    width: min(100% - 38px, var(--max));
  }
  .header {
    height: 92px; /* logo is 68px, leaving 12px above and below */
  }
  .brand {
    width: 76px;
    height: 68px;
  }
  .header nav {
    gap: 14px;
  }
  .header nav a {
    font-size: 13px;
  }
  .header nav .nav-cta {
    padding: 9px 12px 9px 10px;
    gap: 6px;
  }
  .contact-logo {
    width: 100px;
  }
  .hero {
    min-height: 540px;
    align-items: flex-end;
  }
  .hero-bg {
    object-position: 58% center;
  }
  .hero-shade {
    background: linear-gradient(
      0deg,
      rgba(var(--deep-rgb), 0.98) 0%,
      rgba(var(--deep-rgb), 0.83) 53%,
      rgba(var(--deep-rgb), 0.2) 100%
    );
  }
  .hero-content {
    padding-block: 80px 80px;
  }
  .hero h1 {
    font-size: clamp(40px, 11vw, 54px);
  }
  .hero-description {
    font-size: 16px;
    max-width: 38ch;
  }
  .services {
    padding: 52px 0 56px;
  }
  h2 {
    font-size: 32px;
  }
  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Compact cards on phones: icon on the left, text beside it */
  .service-card {
    min-height: 0;
    padding: 18px 16px;
    border-left: 1px solid var(--line);
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 4px;
  }
  .service-icon {
    grid-row: 1 / span 3;
    width: 32px;
    height: 32px;
    margin: 2px 0 0;
  }
  .service-title,
  .service-text,
  .service-more {
    grid-column: 2;
  }
  .service-title {
    max-width: none;
  }
  .service-more {
    margin-top: 0;
    padding-top: 4px;
  }
  .service-card + .service-card {
    border-top: 1px solid var(--line);
  }
  .about {
    padding: 60px 0;
  }
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }
  .about-image,
  .about-image img {
    height: 280px;
    min-height: 280px;
  }
  .about-image::after {
    inset: 12px -10px -12px 10px;
  }
  .contact {
    min-height: 0;
    padding: 160px 0 56px;
  }
  /* On phones the road is a short band across the top, cropped to the road
     rather than the sky, fading into the dark section below */
  .contact-road {
    height: 200px;
    object-position: center 95%;
  }
  .contact-overlay {
    background: linear-gradient(
      180deg,
      rgba(var(--deep-rgb), 0.05) 0px,
      rgba(var(--deep-rgb), 0.35) 110px,
      rgb(var(--deep-rgb)) 200px
    );
  }
  .contact-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  /* On phones the details sit under the call button; columns stay side by side */
  .details-cols {
    gap: 24px;
  }
  /* Logo back to the left and smaller on phones */
  .contact-details {
    align-items: flex-start;
  }
  .dialog-inner {
    padding: 28px 22px 24px;
  }
  .footer-inner {
    min-height: 75px;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-block: 15px;
    gap: 7px 18px;
  }
  .footer-inner span:nth-child(2) {
    display: none;
  }
  .footer a {
    margin-left: auto;
  }
}

/* Narrowest phones (e.g. small Androids, iPhone SE) */
@media (max-width: 400px) {
  .header {
    height: 84px;
  }
  .brand {
    width: 64px;
    height: 60px;
  }
  .header nav {
    gap: 11px;
  }
  .header nav a {
    font-size: 12px;
  }
}

/* ---------- 13. Motion (surprise and delight) ----------
   Everything here is skipped for people who have asked their device to
   reduce motion, and the page looks complete without any of it. */

/* Icon parts that move rotate around the centre of their 24px box */
.icon .turn,
.icon .disc,
.icon .needle,
.icon .bonnet {
  transform-box: view-box;
  transform-origin: 12px 12px;
}
.icon .needle {
  transform-origin: 12px 14px;
}
.icon .bonnet {
  transform-origin: 16px 10px; /* the hinge at the bottom of the windscreen */
  opacity: 0; /* hidden at rest, so the car looks like the original */
}

@media (prefers-reduced-motion: no-preference) {
  /* Hero settles in on load, one line after another */
  .hero-content > * {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero-content > :nth-child(2) {
    animation-delay: 0.1s;
  }
  .hero-content > :nth-child(3) {
    animation-delay: 0.2s;
  }
  .hero-content > :nth-child(4) {
    animation-delay: 0.3s;
  }

  /* Sections slide up as they scroll into view (script.js adds .motion) */
  .motion [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.7s ease,
      transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--d, 0s);
  }
  .motion .service-card[data-reveal] {
    transition:
      background 0.2s,
      opacity 0.6s ease var(--d, 0s),
      transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s);
  }
  .motion [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }

  /* Gauge needle sweeps up as the cards arrive */
  .motion .service-card[data-reveal] .needle {
    transform: rotate(-100deg);
  }
  .motion .service-card.is-in .needle {
    transform: none;
    transition: transform 1.1s cubic-bezier(0.3, 1.4, 0.5, 1)
      calc(var(--d, 0s) + 0.35s);
  }

  /* Each service icon does its job on hover */
  .icon .turn,
  .icon .disc,
  .icon .bonnet {
    transition:
      transform 0.5s cubic-bezier(0.8, 1, 0.5, 2),
      opacity 0.12s;
  }
  .icon .disc {
    transition-duration: 0.9s;
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .service-card:hover .turn {
    transform: rotate(-28deg);
  } /* spanner turns */
  .service-card:hover .needle,
  .motion .service-card.is-in:hover .needle {
    /* needle revs to the red */
    animation: rev 1s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
  }
  .service-card:hover .disc {
    transform: rotate(90deg);
  } /* brake disc spins */
  .service-card:hover .bonnet {
    transform: rotate(-60deg);
    opacity: 1;
  } /* bonnet lifts */

  /* Phone rings on the call buttons */
  .button:hover .icon-phone,
  .nav-cta:hover .icon-phone {
    animation: ring 0.6s ease;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
/* Needle drops to the left of the dial, swings hard to the red, overshoots,
   flickers and settles there. 0deg is its resting position (pointing up-right). */
@keyframes rev {
  0% {
    transform: rotate(0deg);
  }
  52% {
    transform: rotate(70deg);
  }
  64% {
    transform: rotate(52deg);
  }
  74% {
    transform: rotate(64deg);
  }
  84% {
    transform: rotate(56deg);
  }
  100% {
    transform: rotate(60deg);
  }
}
@keyframes ring {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-14deg);
  }
  40% {
    transform: rotate(12deg);
  }
  60% {
    transform: rotate(-8deg);
  }
  80% {
    transform: rotate(4deg);
  }
}

/* Touch screens: the icon in the service pop-up does its move when the pop-up opens
   (the same moves the cards do on hover with a mouse) */
@media (prefers-reduced-motion: no-preference) and (hover: none) {
  .service-dialog[open] .dialog-icon .turn   { animation: turn-open 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) 0.2s both; }
  .service-dialog[open] .dialog-icon .needle { animation: rev 1s cubic-bezier(0.3, 0.7, 0.4, 1) 0.2s both; }
  .service-dialog[open] .dialog-icon .disc   { animation: spin-half 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both; }
  .service-dialog[open] .dialog-icon .bonnet { animation: bonnet-lift 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) 0.2s both; }
}
@keyframes turn-open { to { transform: rotate(-28deg); } }
@keyframes spin-half { to { transform: rotate(180deg); } }
@keyframes bonnet-lift {
  from { transform: rotate(0); opacity: 1; }
  to   { transform: rotate(-50deg); opacity: 1; }
}

/* ---------- 14. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
