/* ============================================================
   OPTIVION GmbH — website styles
   Brand: red (#E31B23) + black on light · logo set in Magneto
   ============================================================ */

:root {
  --paper:      #F7F5F1;   /* light warm background          */
  --paper-2:    #EEEAE1;   /* slightly deeper panel          */
  --ink:        #161412;   /* near-black text                */
  --ink-2:      #2C2825;   /* button hover                   */
  --ink-soft:   #4A4641;   /* muted body text                */
  --red:        #E31B23;   /* brand accent (logo red)        */
  --red-dark:   #C0151C;
  --line:       rgba(22,20,18,.14);
  --line-soft:  rgba(22,20,18,.08);

  --maxw: 1240px;
  --gutter: clamp(1.25rem, 5vw, 5rem);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--paper);
  font-size: clamp(1rem, .96rem + .25vw, 1.125rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* paper grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- language switching ---------- */
html[data-lang="de"] [data-en-only],
html[data-lang="en"] [data-de-only] { display: none !important; }

/* ---------- layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--red);
  display: inline-flex; align-items: center; gap: .7em;
}
.eyebrow::before {
  content: ""; width: 2.2rem; height: 2px; background: var(--red);
}
.section { padding-block: clamp(4.5rem, 10vw, 9rem); position: relative; z-index: 2; }
.section--tight { padding-block: clamp(3rem, 7vw, 6rem); }

h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.06; letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; gap: .65em;
  padding: .95em 1.7em; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: .9rem; letter-spacing: .01em;
  border: 1px solid var(--bg);
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--ease), border-color .35s var(--ease);
  will-change: transform;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); transform: translateY(-2px); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--red { --bg: var(--red); border-color: var(--red); }
.btn--red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn--ghost:hover { background: transparent; border-color: var(--ink); }

/* link with growing underline */
.ulink { position: relative; color: var(--red); font-weight: 600; }
.ulink::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.ulink:hover::after { transform: scaleX(1); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(247,245,241,.82);
  backdrop-filter: saturate(150%) blur(14px);
  box-shadow: 0 1px 0 var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.brand { display: inline-flex; align-items: center; z-index: 60; }
.brand-logo { height: clamp(34px, 5vw, 42px); width: auto; }
.footer-brand .brand-logo { height: 34px; }

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.4rem); }
.nav-links a {
  font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; position: relative; color: var(--ink-soft);
  transition: color .3s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 1.3rem; }
.lang-toggle {
  display: inline-flex; font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.lang-toggle button {
  background: transparent; border: 0; cursor: pointer; color: var(--ink-soft);
  padding: .42em .85em; font: inherit; transition: background .3s var(--ease), color .3s var(--ease);
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.menu-btn { display: none; background: none; border: 0; cursor: pointer; z-index: 60; }
.menu-btn span { display: block; width: 26px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .35s var(--ease), opacity .3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding-top: 168px; padding-bottom: clamp(4rem,9vw,8rem); overflow: hidden; }
.hero::after {
  content: ""; position: absolute; z-index: 0; right: -10%; top: -10%;
  width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle at 50% 50%, rgba(227,27,35,.08), transparent 62%);
  filter: blur(8px); pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy { min-width: 0; }
.hero-figure {
  position: relative; margin: 0; border-radius: 16px; overflow: hidden;
  box-shadow: 0 50px 90px -45px rgba(22,20,18,.5);
}
.hero-figure::after {
  content: ""; position: absolute; inset: 0; border-radius: 16px;
  border: 1px solid var(--line); pointer-events: none;
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3.05; display: block; }
.hero-eyebrow { margin-bottom: 2rem; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-optical-sizing: auto;
  max-width: 17ch;
  margin-bottom: 1.6rem;
}
.hero h1 em { font-style: italic; color: var(--red); }
.hero-lead {
  font-size: clamp(1.05rem, 1.1vw + .8rem, 1.3rem);
  color: var(--ink-soft); max-width: 56ch; margin-bottom: 2.6rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

.hero-meta {
  margin-top: clamp(3rem, 7vw, 6rem);
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(1rem,3vw,3rem); border-top: 1px solid var(--line); padding-top: 2rem;
}
.hero-meta dt { font-family: var(--f-display); font-size: clamp(1.5rem,2.4vw,2.3rem); color: var(--ink); }
.hero-meta dt .accent { color: var(--red); }
.hero-meta dd { font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-top: .4rem; }

/* ============================================================
   ABOUT / INTRO
   ============================================================ */
.about { background: var(--paper-2); }
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem,6vw,6rem); align-items: start; }
.about-grid h2 { font-size: clamp(1.9rem,3.4vw,2.9rem); }
.about-body p { color: var(--ink-soft); margin-bottom: 1.3rem; max-width: 60ch; }
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   SERVICES — editorial accordion list
   ============================================================ */
.services-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1.5rem; margin-bottom: clamp(2.5rem,5vw,4rem); }
.services-head h2 { font-size: clamp(2rem,4vw,3.4rem); max-width: 16ch; }
.services-head p { color: var(--ink-soft); max-width: 38ch; }

.svc { border-top: 1px solid var(--line); }
.svc:last-child { border-bottom: 1px solid var(--line); }
.svc-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1rem,3vw,2.5rem);
  width: 100%; background: none; border: 0; cursor: pointer;
  padding: clamp(1.4rem,2.5vw,2.1rem) 0; text-align: left; font: inherit; color: inherit;
}
.svc-num { font-family: var(--f-display); font-size: clamp(1rem,1.4vw,1.25rem); color: var(--red); font-feature-settings: "tnum"; }
.svc-title { font-family: var(--f-display); font-size: clamp(1.35rem,2.6vw,2.1rem); transition: color .3s var(--ease); }
.svc-row:hover .svc-title { color: var(--red); }
.svc-plus { position: relative; width: 22px; height: 22px; flex: none; }
.svc-plus::before, .svc-plus::after {
  content: ""; position: absolute; background: var(--ink); transition: transform .4s var(--ease), background .3s;
  left: 50%; top: 50%;
}
.svc-plus::before { width: 16px; height: 2px; transform: translate(-50%,-50%); }
.svc-plus::after  { width: 2px; height: 16px; transform: translate(-50%,-50%); }
.svc[aria-expanded="true"] .svc-plus::after { transform: translate(-50%,-50%) scaleY(0); }
.svc[aria-expanded="true"] .svc-plus::before { background: var(--red); }
.svc-panel { overflow: hidden; height: 0; transition: height .45s var(--ease); }
.svc-panel-inner {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem,3vw,2.5rem);
  padding: 0 0 clamp(1.8rem,3vw,2.6rem) 0;
}
.svc-desc { color: var(--ink-soft); max-width: 64ch; }
.svc-desc ul { margin-top: 1rem; display: grid; gap: .5rem; }
.svc-desc li { position: relative; padding-left: 1.4rem; font-size: .96rem; }
.svc-desc li::before { content: "—"; position: absolute; left: 0; color: var(--red); }

@media (min-width: 760px) {
  .svc-panel-inner { grid-template-columns: clamp(2.5rem,8vw,7rem) 1fr; }
}

/* ============================================================
   WHY US
   ============================================================ */
.why { background: var(--ink); color: var(--paper); }
.why .eyebrow { color: var(--red); }
.why .eyebrow::before { background: var(--red); }
.why h2 { font-size: clamp(2rem,4vw,3.2rem); color: var(--paper); max-width: 18ch; margin-bottom: clamp(2.5rem,5vw,4rem); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 1px; background: rgba(247,245,241,.14); border: 1px solid rgba(247,245,241,.14); }
.why-item { background: var(--ink); padding: clamp(1.8rem,3vw,2.6rem); }
.why-item .idx { font-family: var(--f-display); color: var(--red); font-size: 1.1rem; }
.why-item h3 { font-size: clamp(1.2rem,1.8vw,1.5rem); color: var(--paper); margin: 1rem 0 .7rem; }
.why-item p { color: rgba(247,245,241,.68); font-size: .96rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem,6vw,6rem); align-items: start; }
.contact h2 { font-size: clamp(2.1rem,4.4vw,3.6rem); max-width: 14ch; margin-bottom: 1.5rem; }
.contact-lead { color: var(--ink-soft); max-width: 46ch; margin-bottom: 2.2rem; }
.contact-card {
  border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.6rem,3vw,2.4rem);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
}
.contact-card .row { padding: 1.1rem 0; border-bottom: 1px solid var(--line-soft); }
.contact-card .row:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-card .row:first-child { padding-top: 0; }
.contact-card .lbl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem; }
.contact-card .val { font-size: 1.05rem; color: var(--ink); }
.contact-card .val a { color: var(--red); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); position: relative; z-index: 2; }
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; padding-block: clamp(2.5rem,5vw,4rem); }
.footer-brand .brand-logo { margin-bottom: .8rem; }
.footer-legalname { font-weight: 700; color: var(--ink); letter-spacing: .02em; margin-bottom: .35rem; }
.footer-brand p { color: var(--ink-soft); max-width: 34ch; font-size: .95rem; }
.footer-nav { display: flex; gap: clamp(2rem,5vw,5rem); flex-wrap: wrap; }
.footer-nav h4 { font-family: var(--f-body); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; font-weight: 700; }
.footer-nav a { display: block; font-size: .95rem; color: var(--ink); padding: .28rem 0; transition: color .3s; }
.footer-nav a:hover { color: var(--red); }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.6rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--ink-soft); }

/* ============================================================
   LEGAL PAGES (Impressum / Datenschutz)
   ============================================================ */
.legal { padding-top: 168px; }
.legal h1 { font-size: clamp(2.2rem,5vw,3.6rem); margin-bottom: 2.5rem; }
.legal h2 { font-size: clamp(1.4rem,2.6vw,1.9rem); margin: 2.6rem 0 1rem; }
.legal p, .legal li { color: var(--ink-soft); max-width: 70ch; margin-bottom: .8rem; }
.legal a { color: var(--red); }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; max-width: 70ch; margin: 1rem 0; }
.legal dt { font-weight: 700; color: var(--ink); }
.legal-list { margin: 1.1rem 0; display: grid; gap: .7rem; max-width: 72ch; }
.legal-list li { position: relative; padding-left: 1.4rem; }
.legal-list li::before { content: "—"; position: absolute; left: 0; color: var(--red); }
.legal .back { display: inline-flex; gap: .5rem; margin-bottom: 2rem; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-copy { order: 1; }
  .hero-figure { order: 2; margin-top: .5rem; }
  .hero-meta { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
}
@media (max-width: 560px) {
  .hero-meta { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav-links {
    position: fixed; inset: 0 0 0 30%; background: var(--paper);
    flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 1.6rem; padding: var(--gutter); transform: translateX(100%);
    transition: transform .5s var(--ease); box-shadow: -20px 0 60px rgba(0,0,0,.08);
  }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 1.1rem; }
  .nav.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  .nav.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
