/* ============================================================
   aceArt GmbH – Static Website
   style.css
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --color-black:     #111016;
  --color-off-white: #E1E2E4;
  --color-red:       #F0533E;
  --color-grey:      #bebec0;
  --color-white:     #fff;

  --font-bold:    'IBM Plex Sans', sans-serif;
  --font-medium:  'IBM Plex Sans', sans-serif;
  --font-regular: 'IBM Plex Sans', sans-serif;

  --fs-h1:     80px;
  --fs-h2:     50px;
  --fs-h3:     35px;
  --fs-intro:  30px;
  --fs-head:   25px;
  --fs-copy:   20px;
  --fs-footer: 18px;
  --fs-btn:    20px;

  --lh-h1:    80px;
  --lh-h2:    55px;
  --lh-h3:    40px;
  --lh-intro: 40px;
  --lh-copy:  30px;

  --border-radius: 25px;

  --hdr-h: 100px;
  --max-1220: 1220px;
  --max-1780: 1780px;
  --pad-1220: 90%;
  --pad-1780: 95%;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-regular);
  font-size: var(--fs-copy);
  font-weight: 400;
  line-height: var(--lh-copy);
  color: var(--color-black);
  background: var(--color-off-white);
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }

h1 {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}
h2 {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}
h3 {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ---- Color helpers ---- */
.bg-black     { background-color: var(--color-black); }
.bg-off-white { background-color: var(--color-off-white); }
.bg-red       { background-color: var(--color-red); }
.bg-white     { background-color: var(--color-white); }

.color-off-white { color: var(--color-off-white); }
.color-red       { color: var(--color-red); }
.color-footer    { color: var(--color-grey); }

/* ---- Layout ---- */
.section { padding: 80px 0; }
.pt-0 { padding-top: 0 !important; }

.width-1220 {
  width: var(--pad-1220);
  max-width: var(--max-1220);
  margin-left: auto;
  margin-right: auto;
}
.width-1780 {
  width: var(--pad-1780);
  max-width: var(--max-1780);
  margin-left: auto;
  margin-right: auto;
}

.intro-text {
  font-size: var(--fs-copy);
  line-height: var(--lh-copy);
  max-width: 900px;
}

/* ---- Buttons ---- */
.aceart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-medium);
  font-weight: 500;
  font-size: var(--fs-btn);
  line-height: 1;
  border: 2px solid;
  border-radius: var(--border-radius);
  padding: 10px 22px;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
  text-decoration: none;
  background: none;
  width: fit-content;
  white-space: nowrap;
}

/* Grey button */
.aceart-button.grey-button {
  background-color: var(--color-off-white);
  border-color: var(--color-black);
  color: var(--color-black);
}
.aceart-button.grey-button:hover {
  background-color: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-black);
}

/* Black button */
.aceart-button.black-button {
  background-color: var(--color-black);
  border-color: var(--color-off-white);
  color: var(--color-off-white);
}
.aceart-button.black-button:hover {
  background-color: var(--color-off-white);
  border-color: var(--color-off-white);
  color: var(--color-black);
}

/* Red button (nav CTA) */
.aceart-button.red-button {
  background-color: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-black);
}
.aceart-button.red-button:hover {
  background-color: transparent;
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn-heart {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  object-fit: contain;
}


/* ============================================================
   NAVIGATION
============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background-color: var(--color-off-white);
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  width: var(--pad-1220);
  max-width: var(--max-1220);
  margin: 0 auto;
  gap: 2rem;
  height: 100%;
}

.nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.nav-logo img { height: 42px; width: auto; }

/* ---- Desktop Nav ---- */
.main-nav { flex: 1; display: flex; justify-content: flex-end; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--hdr-h);
}
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }

.nav-link {
  display: block;
  padding: 6px 12px;
  font-size: 18px;
  font-weight: 400;
  color: var(--color-black);
  position: relative;
  white-space: nowrap;
}
/* Animated underline */
.nav-link:not(.nav-cta)::before {
  content: '';
  position: absolute;
  bottom: 0; left: 12px;
  width: calc(100% - 24px);
  height: 3px;
  background: var(--color-red);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}
.nav-item:hover > .nav-link:not(.nav-cta)::before { transform: scaleX(1); }

.nav-cta {
  font-size: 16px;
  padding: 9px 15px !important;
}
.nav-link-tel {
  font-size: 16px;
  color: var(--color-grey);
}

/* ---- Mega Menu (full-width dark dropdown) ---- */
.mega-menu {
  position: fixed;
  top: var(--hdr-h);
  left: 0;
  right: 0;
  background: var(--color-black);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  border-top: 3px solid var(--color-red);
}
.nav-item.has-mega:hover > .mega-menu {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.mega-inner {
  display: flex;
  width: var(--pad-1220);
  max-width: var(--max-1220);
  margin: 0 auto;
  padding: 2.5rem 0;
  gap: 0;
}
.mega-col {
  flex: 1;
  padding: 0 2rem;
  border-left: 1px solid rgba(255,255,255,.15);
}
.mega-col:first-child { border-left: none; padding-left: 0; }
.mega-col:last-child { padding-right: 0; }

.mega-heading {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-red);
  margin-bottom: 1.2rem;
}

.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 2rem;
}
.mega-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mega-menu a {
  display: block;
  padding: .45rem 0;
  font-size: 17px;
  color: var(--color-off-white);
  transition: color 0.2s;
  white-space: nowrap;
}
.mega-menu a:hover { color: var(--color-red); }

/* Agentur mega variant */
.mega-inner--agentur {
  align-items: center;
}
.mega-inner--agentur .mega-col:first-child { flex: 0 0 auto; min-width: 200px; }
.mega-promo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.mega-promo-img {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}
.mega-promo-text {
  font-size: 16px;
  color: var(--color-off-white);
  line-height: 1.6;
}
.mega-promo-link {
  font-weight: 700;
  color: var(--color-off-white) !important;
}
.mega-promo-link:hover { color: var(--color-red) !important; }

/* Hide phone number on desktop */
.nav-tel { display: none; }

/* Burger */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.ham { cursor: pointer; user-select: none; }
.ham .line {
  fill: none;
  stroke: var(--color-black);
  stroke-width: 5.5;
  stroke-linecap: round;
  transition: stroke-dasharray 400ms, stroke-dashoffset 400ms;
}
.ham4 .top {
  stroke-dasharray: 40 121;
}
.ham4 .bottom {
  stroke-dasharray: 40 121;
}
.ham4.active .top {
  stroke-dashoffset: -68px;
}
.ham4.active .bottom {
  stroke-dashoffset: -68px;
}


/* ============================================================
   HERO
============================================================ */
.hero-wrap {
  background-color: var(--color-off-white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--hdr-h);
}

.hero {
  width: var(--pad-1220);
  max-width: var(--max-1220);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  padding: 60px 0;
}

.hero-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-intro {
  font-family: var(--font-regular);
  font-weight: 400;
  font-size: var(--fs-intro);
  line-height: var(--lh-intro);
  color: var(--color-black);
}

.hero-main {
  font-family: var(--font-medium);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--color-black);
  letter-spacing: -0.02em;
}

/* Retained for inner pages */
.hero-sub {
  font-family: var(--font-regular);
  font-weight: 400;
  font-size: var(--fs-intro);
  line-height: var(--lh-intro);
  color: var(--color-black);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nerd-wrap { display: inline-flex; align-items: center; }
.nerd-img {
  display: inline-block;
  width: 80px;
  height: auto;
  vertical-align: sub;
}

.hero-image {
  flex-shrink: 0;
  width: 200px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero-Bild Endlos-Drehen */
@keyframes spin { 
  100% { transform: rotate(360deg); } 
}
.hero-img {
  width: 100%;
  height: auto;
  animation: spin 10s linear infinite;
}
.hero-img:hover { animation-play-state: paused; }

/* Loop-SVGs auf den Flip-Cards drehen sich langsam */
.loop-img.turnjoke {
  animation: turnSlow 20s linear infinite;
}
@keyframes turnSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* ============================================================
   SERVICES / FLIP CARDS
============================================================ */
.auszeichnung h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  position: relative;
  padding-right: 2rem;
}

.service-module {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}

/* Flip Card */
.flip-card {
  height: 730px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:active .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 50px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border: 2px solid var(--color-off-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.flip-card-front { z-index: 0; }
.flip-card-back  { z-index: 1; }

.flip-card-back {
  background-color: var(--color-off-white);
  color: var(--color-black);
  transform: rotateY(180deg);
  text-align: center;
}

.flip-card-back h3 {
  font-family: var(--font-bold);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  text-transform: uppercase;
  color: var(--color-black);
}

.flip-card-back p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-black);
}

/* Loop image (big circular SVG) */
.loop-img {
  width: 220px;
  height: auto;
}

/* Service red vertical line */
.service-line {
  width: 2px;
  
  background-color: var(--color-red);
  flex-shrink: 0;
}

/* Small white service icon */
.service-icon {
  width: 130px;
  height: auto;
}

/* Decorative line on flip back */
.flip-back-line {
  position: relative;
  flex-shrink: 0;
}
.flip-back-line::before {
  content: '';
  display: block;
  
  width: 2px;
  background-color: var(--color-black);
}
.flip-back-line::after {
  content: '';
  background-image: url('/assets/images/aceArt_Ace_Red-Heart.svg');
  background-repeat: no-repeat;
  background-size: 15px;
  display: block;
  height: 15px;
  width: 15px;
  position: absolute;
  right: -7px;
  bottom: -7px;
}


/* ============================================================
   FOCUS / SKALIERBARE LÖSUNGEN
============================================================ */
.focus-section .width-1220 { padding-top: 0; }
.focus-text {
  max-width: 900px;
  margin-top: 2rem;
}
.focus-text p {
  font-size: var(--fs-copy);
  line-height: var(--lh-copy);
}
.focus-text strong { font-weight: 700; }


/* ============================================================
   EXPERTISE / METRICS
============================================================ */
.expertise-block { max-width: 900px; }
.expertise-block .headline {
  font-family: var(--font-bold);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.expertise-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.expertise-list li {
  font-size: var(--fs-copy);
  line-height: var(--lh-copy);
  padding-left: 1.5rem;
  position: relative;
}
.expertise-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-red);
  font-weight: 700;
}
.expertise-list a {
  color: var(--color-red);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}
.expertise-list a:hover { text-decoration-color: var(--color-red); }


/* ============================================================
   PORTFOLIO SLIDER
============================================================ */
.portfolio-slider-wrap {
  margin-top: 3rem;
  padding: 0 4%;
}

.portfolio-swiper .swiper-slide { height: auto; }

.proj-card {
  background: var(--color-white);
  border: 2px solid var(--color-black);
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.proj-img-wrap {
  display: block;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--color-off-white);
}
.proj-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.proj-card:hover .proj-img-wrap img { transform: scale(1.04); }

.proj-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.proj-title {
  font-family: var(--font-bold);
  font-size: var(--fs-head);
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-black);
}
.proj-title:hover { color: var(--color-red); }

.proj-cats {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.proj-cats a {
  font-size: 14px;
  color: var(--color-grey);
  border: 1px solid var(--color-grey);
  border-radius: 100px;
  padding: 2px 10px;
  transition: color 0.2s, border-color 0.2s;
}
.proj-cats a:hover { color: var(--color-red); border-color: var(--color-red); }

/* Swiper arrow overrides */
.portfolio-swiper .swiper-button-prev,
.portfolio-swiper .swiper-button-next {
  color: var(--color-black);
  background: var(--color-off-white);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-black);
}
.portfolio-swiper .swiper-button-prev::after,
.portfolio-swiper .swiper-button-next::after { font-size: 16px; font-weight: 700; }


/* ============================================================
   CLIENTS SLIDER
============================================================ */
.clients-swiper { padding: 1rem 3rem !important; }

.client-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-off-white);
  padding: 30px 40px;
  border-radius: 30px;
  
  transition: ease 0.4s;
}
.client-logo-wrap:hover {
  background-color: var(--color-red);
}
.client-logo-wrap a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}
.client-logo-wrap img {
  height: 80px;
  width: 218px;
  object-fit: contain;
  transition: filter 300ms ease 0ms;
  /* staging site has no explicit grayscale filter by default if commented out, 
     but previously we had brightness(0) invert(0.7). Let's use the original image styling */
  filter: none;
}
.client-logo-wrap:hover img {
  filter: none;
}

.clients-swiper .swiper-button-prev,
.clients-swiper .swiper-button-next {
  right: 0;
    height: 40px;
  width: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.clients-swiper .swiper-button-prev::after,
.clients-swiper .swiper-button-next::after {
  content: ''; /* Remove default swiper arrow icons */
}
.clients-swiper .swiper-button-prev {
  left: 0;
    background-image: url('/assets/images/aceArt_Ace_Red-Heart_left.svg');
}
.clients-swiper .swiper-button-next {
  background-image: url('/assets/images/aceArt_Ace_Red-Heart.svg');
}
@media only screen and (max-width: 650px) {
  .clients-swiper .swiper-button-prev,
  .clients-swiper .swiper-button-next {
    height: 30px;
    width: 15px;
  }
}


/* ============================================================
   STEPPER
============================================================ */
.stepper-section { padding: 0; }

.stepper-starter {
  background-color: var(--color-off-white);
  padding: 80px 0;
}
.stepper-start-inner {
  width: var(--pad-1220);
  max-width: var(--max-1220);
  margin: 0 auto;
}

.stepper-headline {
  font-family: var(--font-bold);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: .75rem;
}
.stepper-description {
  font-size: var(--fs-copy);
  color: var(--color-black);
  margin-bottom: 2rem;
  max-width: 700px;
}

.stepper-start-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Dialog overlay */
.stepper-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(17,16,22,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.stepper-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.stepper-dialog {
  background: var(--color-red);
  border: 2px solid var(--color-black);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  transform: scale(.95) translateY(16px);
  transition: transform 0.3s;
}
.stepper-overlay.open .stepper-dialog { transform: none; }

.stepper-dialog-inner { padding: 2.5rem; }

.stepper-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.stepper-back,
.stepper-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-black);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.stepper-back:hover,
.stepper-close:hover { background: rgba(0,0,0,.1); }
.stepper-counter { font-size: var(--fs-copy); font-weight: 700; color: var(--color-black); }

/* Step content */
.step-heading {
  font-family: var(--font-bold);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: .5rem;
}
.step-sub {
  font-size: var(--fs-copy);
  color: var(--color-black);
  margin-bottom: 2rem;
}

.step-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

/* Form in stepper */
.form-row { margin-bottom: 1.25rem; }
.form-row label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: .4rem;
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: .7em 1em;
  border: 2px solid var(--color-black);
  border-radius: 10px;
  font-family: var(--font-regular);
  font-size: 18px;
  color: var(--color-black);
  background: var(--color-off-white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--color-black);
  box-shadow: 0 0 0 3px rgba(17,16,22,.15);
}
.form-row input.err { border-color: #cc0000; }
.form-row textarea { resize: vertical; min-height: 100px; }
.form-row .err-msg {
  display: none;
  font-size: 13px;
  color: #cc0000;
  margin-top: .3rem;
  font-weight: 700;
}
.form-row input.err ~ .err-msg { display: block; }

.stepper-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(17,16,22,.2);
  gap: 1rem;
}

/* Success */
.step-success {
  text-align: center;
  padding: 2rem 0;
}
.step-success h3 {
  font-size: var(--fs-h3);
  margin-bottom: 1rem;
  color: var(--color-black);
}
.step-success p { font-size: var(--fs-copy); color: var(--color-black); }
.step-success a { text-decoration: underline; color: var(--color-black); }


/* ============================================================
   FOOTER
============================================================ */
.site-footer { background-color: var(--color-black); }

.footer-grid {
  width: var(--pad-1780);
  max-width: var(--max-1780);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  padding: 60px 0 40px;
  align-items: start;
}

.footer-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(0.7);
}
.footer-logo:hover { filter: brightness(0) invert(1); }

.footer-col p,
.footer-col address {
  font-size: var(--fs-footer);
  line-height: 1.8;
  color: var(--color-grey);
}
.footer-col a {
  color: var(--color-grey);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--color-off-white); }

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer-social a { display: block; opacity: .7; transition: opacity 0.2s; }
.footer-social a:hover { opacity: 1; }
.footer-social img { width: 40px; height: 40px; filter: brightness(0) invert(1); }

.footer-breadcrumb {
  width: var(--pad-1780);
  max-width: var(--max-1780);
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 14px;
  color: var(--color-grey);
}


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1520px) {
  .flip-back-line { display: none; }
  .flip-card-back h3 {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
  }
  .flip-card-front,
  .flip-card-back { padding: 20px; gap: 20px; }
  .loop-img { width: 160px; }
  .service-icon { width: 100px; }
}

@media (max-width: 980px) {
  .nerd-img { width: 50px; }
  :root {
    --fs-h1: 48px;
    --lh-h1: 52px;
    --fs-h2: 36px;
    --lh-h2: 40px;
    --fs-h3: 26px;
    --lh-h3: 32px;
    --fs-intro: 22px;
    --lh-intro: 30px;
    --fs-copy: 18px;
    --lh-copy: 26px;
    --hdr-h: 72px;
  }

  /* Mobile nav */
  .main-nav { display: none; }
  .burger { display: flex; }

  .main-nav.open {
    display: flex;
    position: fixed;
    top: var(--hdr-h);
    left: 0; right: 0; bottom: 0;
    background: var(--color-off-white);
    overflow-y: auto;
    padding: 1.5rem;
    flex-direction: column;
    z-index: 999;
  }
  .main-nav.open .nav-list {
    flex-direction: column;
    height: auto;
    gap: 0;
    width: 100%;
    align-items: flex-start;
  }
  .main-nav.open .nav-item {
    width: 100%;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
  }
  .main-nav.open .nav-link {
    width: 100%;
    padding: .8rem 0;
    border-bottom: 1px solid var(--color-grey);
    font-size: 20px;
  }

  /* Mobile mega menu override */
  .main-nav.open .mega-menu {
    position: static;
    opacity: 1; pointer-events: auto;
    transform: none;
    background: var(--color-off-white);
    border-top: none;
    display: none;
  }
  .main-nav.open .nav-item.mob-open > .mega-menu { display: block; }
  .main-nav.open .mega-inner {
    flex-direction: column;
    padding: 0.5rem 0 0.5rem 1rem;
    width: 100%;
    gap: 0.5rem;
  }
  .main-nav.open .mega-col {
    border-left: none;
    padding: 0;
  }
  .main-nav.open .mega-heading {
    color: var(--color-red);
    margin-bottom: 0.3rem;
    margin-top: 0.8rem;
    font-size: 12px;
  }
  .main-nav.open .mega-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .main-nav.open .mega-menu a {
    color: var(--color-black);
    padding: .3rem 0;
    font-size: 17px;
  }
  .main-nav.open .mega-promo { display: none; }

  /* Show phone number in mobile nav */
  .main-nav.open .nav-tel { display: flex; }

  /* Hero */
  .hero-wrap { align-items: flex-start; }
  .hero {
    flex-direction: column;
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 2rem;
  }
  .hero-image { width: 80%; max-width: 300px; margin: 0 auto; }
  .loop-img.turnjoke { animation: none; }

  /* Service flip cards */
  .service-module {
    grid-template-columns: 1fr;
  }
  .flip-card { height: auto; min-height: 420px; }
  .flip-card-front, .flip-card-back { padding: 40px; gap: 30px; }
  .flip-back-line { display: block; }

  /* Portfolio */
  .portfolio-slider-wrap { padding: 0 2%; }

  /* Footer */
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  :root {
    --fs-h1: 36px;
    --lh-h1: 40px;
    --fs-h2: 28px;
    --lh-h2: 34px;
  }

  .section { padding: 50px 0; }
  .hero-image { width: 70%; }

  .stepper-start-btns { flex-direction: column; }
  .stepper-start-btns .aceart-button { width: 100%; justify-content: center; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .footer-social { flex-direction: row; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.pupil {
    transition: transform 0.1s ease-out;
    transform-origin: center;
}
