/* ==========================================================================
   Anna-Katharina Bender – Beratung für Ingenieurprozesse
   ========================================================================== */

:root {
  --color-navy: #1b2a4a;
  --color-navy-dark: #101c33;
  --color-gold: #c89b5d;
  --color-gold-light: #e4c48c;
  --color-bg: #f7f5f1;
  --color-bg-alt: #efece5;
  --color-white: #ffffff;
  --color-text: #2b2b33;
  --color-text-soft: #565660;

  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1080px;
  --radius: 14px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--color-navy);
}

h2 {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: left center;
  animation: rule-in 0.9s var(--ease) 0.5s forwards;
}

@keyframes rule-in {
  to { transform: scaleX(1); }
}

/* Scroll progress bar ------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-navy), var(--color-gold));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Minimal floating header (no nav bar) ---------------------------------- */

.brand-mark {
  position: fixed;
  top: 1.75rem;
  left: 1.75rem;
  z-index: 950;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-white);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

.brand-mark strong {
  color: var(--color-gold-light);
  font-weight: 400;
  transition: color var(--transition);
}

.brand-mark.is-over-light {
  color: var(--color-navy);
}

.brand-mark.is-over-light strong {
  color: var(--color-gold);
}

/* Hero — a dark, cinematic opening frame that cuts into the light page ---- */

.hero {
  position: relative;
  padding: 9rem 0 11rem;
  background: linear-gradient(155deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 90px), 0 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(200, 155, 93, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 60% at 10% 90%, rgba(200, 155, 93, 0.08), transparent 60%);
  pointer-events: none;
}

/* A whisper of film grain over the dark opener */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  max-width: 15ch;
  color: var(--color-white);
  letter-spacing: -0.01em;
}

/* Title card: the headline wipes up into view like film-title lettering */
.hero-title {
  overflow: hidden;
}

.hero-title span {
  display: block;
  transform: translateY(105%);
  animation: title-in 1s var(--ease) 0.65s forwards;
}

@keyframes title-in {
  to { transform: translateY(0); }
}

.hero-fade-1,
.hero-fade-2 {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-up 0.9s var(--ease) forwards;
}

.hero-fade-1 { animation-delay: 1.15s; }
.hero-fade-2 { animation-delay: 1.4s; }

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.hero-lede {
  font-size: 1.25rem;
  color: rgba(247, 245, 241, 0.72);
  max-width: 46ch;
  margin-bottom: 2.5rem;
}

.hero .btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

.hero .btn-ghost:hover,
.hero .btn-ghost:focus-visible {
  background: var(--color-white);
  color: var(--color-navy-dark);
}

.hero-portrait {
  position: relative;
}

.portrait-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: perspective(900px) rotate(-3deg) translateY(28px) scale(0.96);
  animation: portrait-in 1.2s var(--ease) 0.3s forwards;
}

.portrait-frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  animation: kenburns 18s ease-in-out 1.6s infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 -50px 70px -30px rgba(16, 28, 51, 0.65);
  z-index: 1;
  pointer-events: none;
}

.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0;
  transform: rotate(2deg);
  animation: frame-in 1.2s var(--ease) 0.7s forwards;
}

@keyframes portrait-in {
  to { opacity: 1; transform: perspective(900px) rotate(0) translateY(0) scale(1); }
}

@keyframes frame-in {
  to { opacity: 1; transform: rotate(0); }
}

/* A small cue inviting the reel to keep rolling */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 3.5rem;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 2s forwards;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--color-gold);
  animation: cue-drop 1.8s ease-in-out infinite;
}

@keyframes cue-drop {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  71% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.04rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
}

.btn-primary {
  background: var(--color-gold);
  color: var(--color-navy-dark);
  box-shadow: 0 12px 24px -10px rgba(200, 155, 93, 0.55);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  background: var(--color-gold-light);
}

.btn-ghost {
  border: 1.5px solid var(--color-navy);
  color: var(--color-navy);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Reveal-on-scroll ----------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* A larger tilt-in reveal for single standout elements (not cards with
   their own hover-transform, to avoid the two transforms fighting). */

.reveal-tilt {
  opacity: 0;
  transform: perspective(1000px) rotateX(-8deg) rotateY(6deg) translateY(22px) scale(0.95);
  transition: opacity 0.9s var(--transition), transform 0.9s var(--transition);
}

.reveal-tilt.is-visible {
  opacity: 1;
  transform: perspective(1000px) rotateX(0) rotateY(0) translateY(0) scale(1);
}

/* Section basics --------------------------------------------------------- */

section {
  padding: 5.5rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* Slide the section right after the hero up under its diagonal cut, so the
   wedge the clip-path exposes is this section's own background — not a
   mismatched sliver of the page's base color behind it. */
#leistungen {
  margin-top: -90px;
  padding-top: calc(5.5rem + 90px);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 3rem;
}

.section-head p {
  color: var(--color-text-soft);
  font-size: 1.15rem;
}

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

.services-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2.5rem;
}

/* A drawn "reference line" – like a dimension line on a technical drawing –
   ties the three service cards together as the section comes into view. */

.services-grid::before {
  content: "";
  position: absolute;
  top: -2.5rem;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold) 8%, var(--color-gold) 92%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s var(--transition);
}

.services-grid.is-visible::before {
  transform: scaleX(1);
}

.service-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  box-shadow: 0 20px 40px -28px rgba(27, 42, 74, 0.25);
  opacity: 0;
  transform: translateY(24px);
  transition: transform var(--transition), box-shadow var(--transition),
              opacity 0.7s var(--transition), translate 0.7s var(--transition);
}

.services-grid.is-visible .service-card {
  opacity: 1;
  transform: translateY(0);
}

.services-grid.is-visible .service-card:nth-child(1) { transition-delay: 0.55s; }
.services-grid.is-visible .service-card:nth-child(2) { transition-delay: 0.7s; }
.services-grid.is-visible .service-card:nth-child(3) { transition-delay: 0.85s; }

.service-card::before {
  content: "";
  position: absolute;
  top: -2.5rem;
  left: 50%;
  width: 1px;
  height: 2.5rem;
  background: var(--color-gold);
  opacity: 0;
  transition: opacity 0.4s var(--transition);
}

.services-grid.is-visible .service-card:nth-child(1)::before { opacity: 1; transition-delay: 0.55s; }
.services-grid.is-visible .service-card:nth-child(2)::before { opacity: 1; transition-delay: 0.7s; }
.services-grid.is-visible .service-card:nth-child(3)::before { opacity: 1; transition-delay: 0.85s; }

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px -24px rgba(27, 42, 74, 0.32);
}

.service-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 1.25rem;
  color: var(--color-gold);
}

.service-card h3 {
  margin-bottom: 0.6em;
}

.service-card p {
  color: var(--color-text-soft);
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* Quote ----------------------------------------------------------------- */

.quote {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.quote blockquote {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  color: var(--color-navy);
  margin: 0 0 1.5rem;
  line-height: 1.35;
}

.traits {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.trait {
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  color: var(--color-navy);
  font-weight: 600;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-gold);
}

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

.contact {
  background: var(--color-navy);
  color: var(--color-white);
  text-align: center;
}

.contact h2 {
  color: var(--color-white);
}

.contact p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.18rem;
}

.contact .btn-row {
  justify-content: center;
  margin-top: 2rem;
}

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

.site-footer {
  padding: 2.5rem 0;
  font-size: 0.88rem;
  color: var(--color-text-soft);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  text-decoration: none;
  color: var(--color-text-soft);
}

.footer-links a:hover {
  color: var(--color-navy);
}

/* Legal pages ------------------------------------------------------------------ */

.legal {
  padding: 6rem 0 6rem;
}

.legal .container {
  max-width: 760px;
}

.legal h1 {
  margin-bottom: 1.2em;
}

.legal h2 {
  font-size: 1.25rem;
  margin-top: 2.2em;
}

.legal p, .legal li {
  color: var(--color-text-soft);
}

.legal a.back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--color-gold);
  text-decoration: none;
  font-weight: 600;
}

/* Responsive -------------------------------------------------------------------- */

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .services-grid::before {
    display: none;
  }

  .service-card::before {
    display: none;
  }

  .hero {
    padding: 7.5rem 0 7rem;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 50px), 0 100%);
  }

  #leistungen {
    margin-top: -50px;
    padding-top: calc(5.5rem + 50px);
  }

  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    max-width: 320px;
    margin: 0 auto;
    order: -1;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 6.5rem;
  }

  .brand-mark {
    font-size: 1.1rem;
  }

  .traits {
    gap: 1.25rem 2rem;
  }
}

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

  .reveal,
  .reveal-tilt,
  .service-card,
  .services-grid::before,
  .service-card::before,
  .eyebrow::before,
  .hero-title span,
  .hero-fade-1,
  .hero-fade-2,
  .portrait-frame,
  .portrait-frame img,
  .hero-portrait::after,
  .scroll-cue,
  .scroll-cue span {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
