/* ============================================================
   Ingenieurbüro Ernst — rebuilt static site
   Original look: dark navy + light grey, Roboto light headings
   ============================================================ */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Roboto-Light.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Roboto-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Roboto-Medium.ttf') format('truetype');
}

:root {
  --color-primary: #0C1620;
  --color-secondary: #3C68F6;
  --color-light: #EBEBEB;
  --color-light-shade: #879CB1;
  --color-dark-shade: #273542;

  --font-family: 'Roboto', system-ui, sans-serif;
  --nav-height: 60px;

  /* fluid horizontal section padding (30px on phones → 200px on desktop) */
  --pad-x: clamp(30px, 12vw, 200px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  word-spacing: 1px;
  background-color: var(--color-primary);
  color: var(--color-light);
}

a {
  color: var(--color-light);
  text-decoration: none;
  transition: color 300ms;
}

a:hover {
  color: var(--color-light-shade);
}

p {
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.8;
}

p:not(:last-child) {
  margin-bottom: 30px;
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 300;
  padding: 0 clamp(40px, 6vw, 80px) clamp(16px, 2vw, 20px);
  border-bottom: 2px solid;
  display: inline-block;
}

h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 300;
  text-align: center;
  margin-bottom: clamp(30px, 6vw, 70px);
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background-color: var(--color-dark-shade);
  z-index: 10;
}

.main-nav__title {
  font-size: 20px;
  font-weight: 500;
}

.main-nav__menu {
  display: flex;
}

.navlink {
  display: block;
  padding: 22px 26px;
  cursor: pointer;
  background-color: var(--color-dark-shade);
  transition: color 300ms;
}

.navlink.active,
.navlink:hover {
  color: var(--color-light-shade);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 10px 0;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-light);
  transition: all 300ms;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(-45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(45deg);
}

@media (max-width: 1099px) {
  .main-nav__title {
    font-size: 14px;
    padding: 22px 0;
    letter-spacing: 1px;
  }

  .burger {
    display: flex;
  }

  .main-nav__menu {
    position: absolute;
    width: 100%;
    top: 100%;
    left: 0;
    flex-direction: column;
    display: none;
  }

  .main-nav__menu.active {
    display: flex;
  }

  .navlink {
    font-size: 14px;
    padding: 18px 22px;
  }
}

/* ------------------------------------------------------------
   Landing
   ------------------------------------------------------------ */

.landing {
  width: 100%;
  height: 100vh;
  height: 100svh;
  position: relative;
}

/* fixed background div: content scrolls over the hero image (works on iOS,
   unlike background-attachment: fixed) */
.landing__background {
  position: fixed;
  inset: 0;
  z-index: -20;
  background-image: url('../img/landing.jpg');
  background-position: center;
  background-size: cover;
}

.landing__card {
  position: absolute;
  right: 120px;
  bottom: 100px;
  background-color: var(--color-dark-shade);
  padding: 50px 80px;
  letter-spacing: 1px;
  box-shadow: 0 0 14px #222222;
}

.landing__card h1 {
  font-size: 50px;
  font-weight: 500;
  margin-bottom: 14px;
}

.landing__subtitle {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 400;
}

.landing__scrollbtn {
  display: none;
  width: 40px;
  height: 40px;
  background-image: url('../svg/arrow-down.svg');
  background-size: cover;
}

@media (max-width: 1099px) {
  .landing {
    display: flex;
    flex-direction: column;
  }

  .landing__card {
    position: static;
    margin: auto;
  }

  .landing__card h1 {
    font-size: 35px;
  }

  .landing__subtitle {
    font-size: 16px;
  }
}

@media (max-width: 449px) {
  .landing {
    align-items: center;
  }

  .landing__card {
    margin-bottom: 5vh;
    padding: 30px 40px;
  }

  .landing__card h1 {
    font-size: 20px;
  }

  .landing__subtitle {
    font-size: 10px;
    line-height: 1.6;
  }

  .landing__scrollbtn {
    display: block;
    margin-bottom: 10vh;
  }
}

/* ------------------------------------------------------------
   Tile boards (shared by services and projects)
   ------------------------------------------------------------ */

.board {
  display: grid;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms;
}

.tile__filter {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  transition: opacity 800ms;
}

.tile__label {
  z-index: 1;
  color: var(--color-light);
  text-align: center;
  transition: opacity 600ms;
  user-select: none;
}

.tile:hover img {
  transform: scale(1.02);
}

.tile:hover .tile__filter,
.tile:hover .tile__label {
  opacity: 0;
}

/* ------------------------------------------------------------
   Services
   ------------------------------------------------------------ */

.services {
  background-color: var(--color-light);
  color: var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

.services__intro {
  display: grid;
  grid-template-columns: 3fr 1fr 3fr;
  margin: 100px 0 180px;
  padding: 0 var(--pad-x);
}

.services__intro-img {
  grid-column: 1;
  background-image: url('../img/planing.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.4);
  min-height: 300px;
}

.services__intro-text {
  grid-column: 3;
  padding: 70px 0;
}

.services__boards {
  width: 100%;
  background-color: var(--color-primary);
  padding-bottom: 60px;
}

.services__group {
  padding-top: 60px;
}

.services__group:not(:last-child) {
  margin-bottom: 60px;
}

.services__group h3 {
  color: var(--color-light);
}

.board--services {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 17vw;
}

.board--services .tile__label {
  font-size: 22px;
  font-weight: 400;
}

.services__cta {
  padding: 100px var(--pad-x);
}

.services__cta p {
  text-align: center;
}

.services__cta a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 300ms;
}

.services__cta a:hover {
  text-decoration-color: currentColor;
}

@media (max-width: 1099px) {
  .board--services .tile__label {
    font-size: 18px;
    font-weight: 300;
  }
}

@media (max-width: 449px) {
  .services__intro {
    grid-template-columns: 1fr;
    margin: 0;
    padding: 40px 30px;
    gap: 30px;
  }

  .services__intro-img {
    min-height: 200px;
  }

  .services__intro-text {
    grid-column: 1;
    padding: 0;
  }

  .services__group h3 {
    margin-left: 30px;
    margin-right: 30px;
  }

  .board--services {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 34vw;
  }

  .board--services .tile__label {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.6px;
  }

  .services__cta {
    padding: 80px 30px;
  }
}

/* ------------------------------------------------------------
   Projects
   ------------------------------------------------------------ */

.projects {
  background-color: var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

.projects__header {
  padding: 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.projects__header h2 {
  margin-bottom: 40px;
}

.projects__header p {
  margin-bottom: 80px;
  text-align: center;
}

.board--projects {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-template-rows: 50vh;
  grid-auto-rows: 0;
}

.board--projects .tile {
  align-items: flex-end;
}

.board--projects .tile__label {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 60px 20px;
  text-align: left;
}

@media (max-width: 1099px) {
  .board--projects {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 15vh);
  }

  .board--projects .tile {
    justify-content: flex-start;
    align-items: center;
  }

  .board--projects .tile__label {
    font-size: 16px;
    line-height: 1.5;
    writing-mode: horizontal-tb;
    transform: none;
    padding: 0 30px;
    text-align: left;
  }
}

@media (max-width: 449px) {
  .board--projects .tile__label {
    font-size: 10px;
    line-height: 1.6;
    padding: 20px 14px;
  }
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */

.contact {
  color: var(--color-primary);
  background-color: var(--color-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px var(--pad-x);
  margin-bottom: 20vh;
}

.contact__body {
  padding: 80px 0;
  width: 100%;
}

.contact__headline {
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 300;
  text-align: center;
  margin-bottom: 60px;
}

.contact__container {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.contact__address {
  font-style: normal;
  line-height: 1.75;
}

.contact__name {
  font-weight: 500;
  font-size: 18px;
}

.contact__channels p {
  line-height: 1.75;
}

.contact__channels .icon {
  width: 16px;
  height: 16px;
  margin-right: 14px;
  vertical-align: -2px;
}

.contact__channels a {
  color: var(--color-primary);
}

.contact__channels a:hover {
  text-decoration: underline;
}

@media (max-width: 449px) {
  .contact {
    padding: 60px 40px;
  }

  .contact__body {
    padding: 30px 0;
  }

  .contact__headline {
    margin-bottom: 30px;
  }

  .contact__container {
    flex-direction: column;
  }

  .contact__address {
    text-align: center;
    margin-bottom: 20px;
  }
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.main-footer {
  background-color: var(--color-primary);
  font-size: 14px;
  padding: 100px 50px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-footer nav ul {
  list-style: none;
  display: flex;
}

.main-footer nav li:not(:last-child)::after {
  content: "|";
  padding: 0 8px;
}

@media (max-width: 1099px) {
  .main-footer {
    flex-direction: column-reverse;
    padding: 50px;
  }

  .main-footer__copy {
    margin-top: 20px;
  }

  .main-footer nav ul {
    flex-direction: column;
    align-items: center;
  }

  .main-footer nav li {
    margin-top: 6px;
  }

  .main-footer nav li::after {
    content: "" !important;
    padding: 0 !important;
  }

  .main-footer__credit {
    margin-top: 12px;
    font-size: 10px;
    color: var(--color-dark-shade);
  }

  .main-footer__credit a {
    color: var(--color-dark-shade);
  }
}

/* ------------------------------------------------------------
   Impressum page
   ------------------------------------------------------------ */

.impressum-nav {
  display: flex;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-primary);
  z-index: 10;
}

.impressum-nav a {
  padding: 16px 30px;
}

.impressum {
  background-color: var(--color-light);
  color: var(--color-primary);
  padding: 100px clamp(30px, 10vw, 100px) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.impressum h2 {
  margin-bottom: clamp(38px, 8vw, 80px);
}

.impressum .text {
  max-width: 1100px;
}

.impressum .text p {
  line-height: 1.6;
}

.impressum .text ol,
.impressum .text ul {
  padding-left: 24px;
}

@media (max-width: 449px) {
  .impressum-nav .home-label {
    display: none;
  }

  .impressum-nav a.back::before {
    content: '<';
    margin-right: 14px;
  }
}
