/* Proposal layer on top of the live design: page opening, section structure, desktop parallax.
   Loaded only by index.html and aifm-platform.html. */

/* ---------- Eyebrow with gold rule: marks the start of every section ---------- */
.p-eyebrow { display: flex !important; align-items: center; gap: 14px; }
.p-eyebrow::before { content: ""; flex: 0 0 36px; height: 2px; background: #CCB666; }

/* ---------- Navy band: breaks the run of light sections ---------- */
.p-navy { background: #1E232E !important; color: #FFFFFF !important; }
.p-navy.p-bleed { box-shadow: 0 0 0 100vmax #1E232E; clip-path: inset(0 -100vmax); padding-top: 88px !important; padding-bottom: 88px !important; margin-top: 24px; }
.p-navy h2, .p-navy h3 { color: #FFFFFF !important; }
.p-navy p { color: #C9CCD3 !important; }
.p-navy .p-eyebrow { color: #CCB666 !important; }
.p-sand { background: #F4F0E4 !important; }

/* ---------- Section marker without a label: short gold rule above the heading ---------- */
.p-rule::before { content: ""; display: block; width: 36px; height: 2px; margin-bottom: 20px; background: #CCB666; }
.p-first { padding-top: 88px !important; }
.p-figs-row .p-f::before { content: none !important; }
@media (max-width: 900px) { .p-first { padding-top: 28px !important; } .p-rule::before { width: 24px; margin-bottom: 12px; } }

/* ---------- A block that slides over the opening part of the page ---------- */
.p-tint { background-color: #FDFBF7; box-shadow: 0 0 0 100vmax #FDFBF7; clip-path: inset(0 -100vmax); }
@media (min-width: 901px) {
  .p-under { position: sticky; top: 0; z-index: 0; background: #FFFFFF; }
  .p-under > section { translate: 0 var(--p-under-shift, 0px); }
  .p-over { position: relative; z-index: 1; background: #FFFFFF; box-shadow: 0 -22px 44px rgba(20,26,38,.10); }
}

/* ---------- Key facts bar at the foot of the opening image ---------- */
.p-herobar { background: #161C28; border-top: 1px solid rgba(204,182,102,0.55); }
.p-herobar ul { list-style: none; margin: 0; padding: 0 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-herobar li { position: relative; padding: 24px 24px 24px 46px; font-size: 15px; line-height: 1.4; letter-spacing: 2px; text-transform: uppercase; color: #EFEDE7; border-left: 1px solid rgba(255,255,255,0.16); }
.p-herobar li:first-child { border-left: 0; }
.p-herobar li::before { content: ""; position: absolute; left: 24px; top: 30px; width: 8px; height: 8px; background: #CCB666; transform: rotate(45deg); }

/* ---------- Key figures: 2 x 4 grid on white with inset divider lines ---------- */
.p-figs { background: #FFFFFF; color: #1E232E; padding: 80px 64px 56px; }
.p-figs-wrap { max-width: 1200px; margin: 0 auto; }
.p-figs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-f { position: relative; padding: 44px 40px 48px; display: flex; flex-direction: column; gap: 18px; }
.p-f b { min-width: 0; max-width: 100%; font-family: Georgia, serif; font-weight: 400; font-size: 64px; line-height: 1; letter-spacing: -0.5px; white-space: nowrap; color: #1E232E; }
.p-f b small { font-size: 0.5em; letter-spacing: 0.5px; color: #5A6070; }
.p-f b sup { font-size: 0.45em; vertical-align: 0.6em; margin-left: 2px; color: #8A7B3E; }
.p-f span { font-size: 15px; letter-spacing: 3px; line-height: 1.5; text-transform: uppercase; color: #5A5A5A; }
.p-f:not(:nth-child(4n))::after { content: ""; position: absolute; right: 0; top: 28px; bottom: 28px; width: 1px; background: #D9D4C6; }
.p-f:nth-child(-n+4)::before { content: ""; position: absolute; left: 28px; right: 28px; bottom: 0; height: 1px; background: #D9D4C6; }
.p-f:nth-child(4n+1)::before { left: 0; }
.p-f:nth-child(4n)::before { right: 0; }
.p-figs-note { margin: 28px 0 0; font-size: 14px; color: #5A5A5A; }
@media (max-width: 900px) {
  .p-figs { padding: 36px 20px 32px !important; }
  .p-figs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-f { padding: 26px 16px 28px; gap: 10px; }
  .p-f b { font-size: 38px; white-space: normal; }
  .p-f span { font-size: 12px !important; letter-spacing: 2px; }
  .p-f span, .p-herobar li { overflow-wrap: break-word; min-width: 0; }
  html[lang="de"] .p-f span { letter-spacing: 1px; }   /* long German words stay inside their column */
  .p-f::after, .p-f::before { content: none !important; }
  .p-f:nth-child(odd)::after { content: "" !important; position: absolute; right: 0; top: 18px; bottom: 18px; width: 1px; background: #D9D4C6; }
  .p-f:not(:nth-last-child(-n+2))::before { content: "" !important; position: absolute; bottom: 0; height: 1px; background: #D9D4C6; }
  .p-f:nth-child(odd):not(:nth-last-child(-n+2))::before { left: 0; right: 18px; }
  .p-f:nth-child(even):not(:nth-last-child(-n+2))::before { left: 18px; right: 0; }
}

/* ---------- Contact band with image ---------- */
.p-cta { position: relative; overflow: hidden; }
/* full-width photo, lower half of the picture: tower, plaza and the hall. A navy fade on the left carries the text */
.p-cta > .p-cta-bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; object-fit: cover; object-position: 50% 87%; opacity: 0.92; transform: scaleX(-1); }
.p-cta::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(24,29,40,0.90) 0%, rgba(24,29,40,0.72) 34%, rgba(24,29,40,0.30) 62%, rgba(24,29,40,0.10) 100%); }
.p-cta > div { position: relative; z-index: 2; }

/* ---------- "On this page" bar (AIFM Platform) ---------- */
.p-subnav { background: #FFFFFF; border-bottom: 1px solid #E8E8E4; position: sticky; top: 94px; z-index: 40; }   /* stays under the header on every screen size; the script sets the exact offset */
.p-subnav ul { list-style: none; margin: 0 auto; padding: 0 64px; max-width: 1200px; display: flex; gap: 34px; overflow-x: auto; scrollbar-width: none; }
.p-subnav ul::-webkit-scrollbar { display: none; }
.p-subnav a { display: block; padding: 18px 0 15px; border-bottom: 3px solid transparent; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; color: #5A5A5A !important; text-decoration: none; }
.p-subnav a:hover { color: #2A2A2A !important; }
.p-subnav a.on { color: #2A2A2A !important; border-bottom-color: #CCB666; }
.p-anchor { scroll-margin-top: 170px; }

.p-logo-light { display: none !important; }

/* ---------- Desktop only ---------- */
@media (min-width: 901px) {
  /* header stays in view; over the opening image it is transparent with the white logo */
  .p-header { position: sticky; top: 0; z-index: 60; background: #FFFFFF; transition: background .25s ease, border-color .25s ease, box-shadow .25s ease; }
  .p-header.is-scrolled { box-shadow: 0 6px 24px rgba(20,26,38,0.08); }
  .p-header.is-top { background: transparent !important; border-bottom-color: transparent !important; }
  .p-header.is-top .p-logo-dark { display: none !important; }
  .p-header.is-top .p-logo-light { display: block !important; }
  .p-header.is-top .navlink, .p-header.is-top .langswitch a, .p-header.is-top .langswitch span { color: #FFFFFF !important; }
  .p-header.is-top .langswitch a:hover { color: #CCB666 !important; }
  /* over the opening image: menu items get a white outline without fill, like the two platform buttons */
  .p-header.is-top .navlink { transition: box-shadow .18s ease; }
  .p-header.is-top .navlink:hover, .p-header.is-top .navitem:hover > .navlink, .p-header.is-top .navitem:focus-within > .navlink { background: transparent !important; color: #FFFFFF !important; box-shadow: inset 0 0 0 2px #FFFFFF; }
  .p-header.is-top .submenu-inner { background: transparent !important; border: 0 !important; box-shadow: none !important; gap: 10px; }
  .p-header.is-top .submenu-inner a { background: transparent !important; color: #FFFFFF !important; border: 0 !important; box-shadow: inset 0 0 0 2px #FFFFFF; font-weight: 600; letter-spacing: .3px; transition: background-color .18s ease; }
  .p-header.is-top .submenu-inner a:hover { background: rgba(255,255,255,.14) !important; color: #FFFFFF !important; }
  .p-header.is-top .btn-nav { background: transparent !important; box-shadow: inset 0 0 0 2px #FFFFFF; }
  /* same hover as the two platform buttons in the hero: gold fill, dark text */
  .p-header.is-top .btn-nav:hover { background: #CCB666 !important; color: #1A1A1A !important; box-shadow: inset 0 0 0 2px #CCB666; }

  .p-hero { margin-top: -103px; }
  /* text sits directly on the image: no box, a soft dark fade from the left and from the top instead */
  .p-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, rgba(18,23,34,0.90) 0%, rgba(18,23,34,0.74) 36%, rgba(18,23,34,0.12) 74%), linear-gradient(180deg, rgba(18,23,34,0.62) 0%, rgba(18,23,34,0) 24%); }
  .p-hero > div:not(.p-herobar), .p-hero > div:not(.p-herobar) > div { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .p-hero > div:not(.p-herobar) { z-index: 2; }
  .p-hero.p-hero-home { min-height: 820px; padding: 200px 0 110px !important; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
  .p-hero.p-hero-page { min-height: 640px; padding: 190px 0 150px !important; box-sizing: border-box; }

  .p-subnav { position: sticky; top: 103px; z-index: 55; }

  /* opening image stays in place; the rest of the page slides over it like a curtain */
  .p-hero { position: sticky !important; top: 0; z-index: 0; }
  .p-curtain { position: relative; z-index: 1; background: #FFFFFF; box-shadow: 0 -18px 40px rgba(10,14,22,0.28); }
  .p-hero::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: #0B0F18; opacity: var(--p-dim, 0); }
  .p-hero > div { translate: 0 var(--p-shift, 0px); opacity: var(--p-fade, 1); }
  .p-hero.p-hero-gone > div { visibility: hidden; }

  /* home: the curtain has an opening. Around the "Two ways we work" card the opening image shows through */
  .p-curtain.p-curtain-open { background: transparent; box-shadow: none; }
  .p-curtain-open > .p-herobar { position: relative; }
  .p-band { padding: 120px 64px; }
  .p-band > .p-card { box-sizing: border-box; max-width: 1328px; margin-left: auto; margin-right: auto; background: #FFFFFF; padding: 72px 64px 68px !important; box-shadow: 0 30px 80px rgba(8,12,20,0.45); }
  /* every other block of the page stays opaque from edge to edge, so the image only shows around the card */
  .p-curtain-open > section { background-color: #FFFFFF; box-shadow: 0 0 0 100vmax #FFFFFF; clip-path: inset(0 -100vmax); }
  .p-curtain-open > .p-subnav { position: sticky; }
  .p-curtain-open > .p-navy.p-bleed { margin-top: 0; }

  /* contact band keeps the proportions of the chosen crop (full width, lower 45 % of the photo) */
  .p-cta { aspect-ratio: 3.16 / 1; box-sizing: border-box; display: flex; align-items: center; }
  .p-cta > div { width: 100%; }

  /* image inside a fixed frame, slightly larger than the frame, drifting while the page scrolls */
  .p-frame { overflow: hidden; }
  .p-frame > img { width: 100% !important; height: 100% !important; flex: none !important; scale: 1.15; will-change: translate; }
  /* window effect: the frame scrolls, the picture behind it stands still */
  .p-frame.p-drift > img { scale: 1; height: 110% !important; }
  .p-frame.p-window { background-repeat: no-repeat; background-attachment: fixed; background-color: #1E232E; }
  .p-frame.p-window > img { visibility: hidden; scale: 1; }

  /* lines draw themselves and figures come in one after the other */
  .p-anim .p-eyebrow::before { flex-basis: 0; transition: flex-basis .7s cubic-bezier(.2,.7,.2,1) .15s; }
  .p-anim .p-eyebrow.is-in::before { flex-basis: 36px; }
  .p-anim .p-f::after { transform: scaleY(0); transform-origin: top; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
  .p-anim .p-f::before { transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.2,.7,.2,1) .2s; }
  .p-anim .p-figs.is-in .p-f::after, .p-anim .p-figs.is-in .p-f::before { transform: none; }
  .p-anim .p-f > b, .p-anim .p-f > span { opacity: 0; translate: 0 22px; transition: opacity .7s ease, translate .7s cubic-bezier(.2,.7,.2,1); }
  .p-anim .p-figs.is-in .p-f > b, .p-anim .p-figs.is-in .p-f > span { opacity: 1; translate: 0 0; }
  .p-anim .p-f:nth-child(1) > * { transition-delay: .05s; } .p-anim .p-f:nth-child(2) > * { transition-delay: .15s; }
  .p-anim .p-f:nth-child(3) > * { transition-delay: .25s; } .p-anim .p-f:nth-child(4) > * { transition-delay: .35s; }
  .p-anim .p-f:nth-child(5) > * { transition-delay: .45s; } .p-anim .p-f:nth-child(6) > * { transition-delay: .55s; }
  .p-anim .p-f:nth-child(7) > * { transition-delay: .65s; } .p-anim .p-f:nth-child(8) > * { transition-delay: .75s; }
  .p-anim .p-herobar li { opacity: 0; translate: 0 14px; transition: opacity .6s ease, translate .6s ease; }
  .p-anim .p-herobar.is-in li { opacity: 1; translate: 0 0; }
  .p-anim .p-herobar li:nth-child(2) { transition-delay: .12s; } .p-anim .p-herobar li:nth-child(3) { transition-delay: .24s; } .p-anim .p-herobar li:nth-child(4) { transition-delay: .36s; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .p-herobar { background: #1E232E; }
  .p-herobar ul { grid-template-columns: 1fr 1fr; padding: 6px 12px; }
  .p-herobar li { padding: 12px 8px 12px 26px; font-size: 11px !important; letter-spacing: 1.2px; border-left: 0; }
  .p-herobar li::before { left: 8px; top: 16px; width: 6px; height: 6px; }
  .p-navy.p-bleed { padding-top: 34px !important; padding-bottom: 34px !important; margin-top: 0; }
  .p-eyebrow { gap: 10px; }
  .p-eyebrow::before { flex-basis: 24px; }
  .p-subnav ul { padding: 0 20px; gap: 22px; }
  .p-subnav a { padding: 14px 0 11px; font-size: 12px !important; }
  .p-cta > .p-cta-bg { top: 0; height: 100%; object-position: 40% 86%; opacity: 0.28; }
  .p-cta::before { background: rgba(24,29,40,0.35); }
}

/* ---------- Phones ---------- */
@media (max-width: 900px) {
  .p-nomob { display: none !important; }
  /* two-column blocks: columns may shrink below their longest word, the word then breaks instead of pushing the page wide */
  div[style*="grid-template-columns: repeat(4, minmax(0, 1fr))"]:not(.rise) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  div[style*="grid-template-columns: repeat(4, minmax(0, 1fr))"]:not(.rise) > * { min-width: 0; overflow-wrap: break-word; }
  html[lang="de"] div[style*="grid-template-columns: repeat(4, minmax(0, 1fr))"]:not(.rise) :is(h3, p, span) { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 12 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; }   /* only long words are hyphenated */
}
@media (max-width: 360px) {
  a.card > div[style*="padding: 22px 24px 26px"] { padding: 16px 12px 18px !important; }
  a.card span[style*="font-size: 24px"] { font-size: 20px !important; }
}

/* ---------- Phones: opening as on the desktop - picture with the text directly on it, no box ---------- */
@media (max-width: 900px) {
  section.p-hero.p-hero.p-hero.p-hero[style] { position: sticky !important; top: 95px; z-index: 0; display: flex !important; flex-direction: column !important; justify-content: flex-end !important; align-items: stretch !important;
    min-height: 620px; min-height: min(86svh, 720px); padding: 0 !important; box-sizing: border-box !important; background: #1E232E !important; color: #FFFFFF !important; overflow: hidden !important; }
  section.p-hero.p-hero.p-hero.p-hero[style] > img { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; display: block !important; object-fit: cover !important; }
  section.p-hero.p-hero.p-hero.p-hero-home[style] { padding-top: 92px !important; }
  section.p-hero.p-hero.p-hero.p-hero-home[style] > img { object-position: 62% 50% !important; }
  section.p-hero.p-hero.p-hero.p-hero-page[style] > img { object-position: 58% 50% !important; }
  section.p-hero.p-hero.p-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(18,23,34,0.58) 0%, rgba(18,23,34,0.18) 20%, rgba(18,23,34,0.44) 36%, rgba(18,23,34,0.84) 56%, rgba(18,23,34,0.94) 100%); }
  section.p-hero.p-hero.p-hero.p-hero[style] > div { position: relative !important; z-index: 2; width: 100% !important; box-sizing: border-box !important; justify-content: flex-end !important; }
  section.p-hero.p-hero.p-hero.p-hero[style] div[style*="background: rgba(22,28,40"] { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    width: 100% !important; box-sizing: border-box !important; padding: 36px 20px 30px !important; gap: 14px !important; }
  section.p-hero.p-hero.p-hero.p-hero[style] p[style*="letter-spacing: 3px"] { color: #CCB666 !important; }
  section.p-hero.p-hero.p-hero.p-hero[style] p[style*="color: #EFEDE7"] { color: #EFEDE7 !important; }
  section.p-hero.p-hero.p-hero.p-hero[style] h1 { color: #FFFFFF !important; text-shadow: 0 1px 18px rgba(10,14,22,0.45); }
  section.p-hero.p-hero.p-hero.p-hero-page[style] a.btn-ghost { display: inline-flex !important; min-height: 52px !important; padding: 0 24px !important; font-size: 16px !important; margin-top: 6px; }
  html[lang="de"] .p-herobar li { letter-spacing: 0.6px; hyphens: auto; -webkit-hyphens: auto; }
  /* scroll effect as on the desktop: the picture stays, its text leaves, the page slides over it */
  .p-hero > div { translate: 0 var(--p-shift, 0px); opacity: var(--p-fade, 1); }
  .p-hero.p-hero-gone > div { visibility: hidden; }
  /* home: only the text fades, the two buttons stay solid while they are pushed up */
  .p-hero.p-hero-home > div { opacity: 1; }
  .p-hero.p-hero-home p, .p-hero.p-hero-home h1 { opacity: var(--p-fade, 1); }
  .p-curtain, .p-curtain.p-curtain-open { position: relative; z-index: 1; background: #FFFFFF; }
  /* home only - header over the picture: transparent with the light logo, turns white as soon as the page is scrolled (not while the menu is open) */
  .p-header { position: relative !important; top: auto !important; transition: background-color .3s ease, border-color .3s ease; }   /* not fixed on phones: it scrolls away with the page, so it costs no room when the phone is turned sideways */
  body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) { background: transparent !important; border-bottom-color: transparent !important; }
  body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .p-logo-dark { display: none !important; }
  body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .p-logo-light { display: block !important; }
  body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .navtoggle { background: transparent; border-color: rgba(255,255,255,0.75); }
  body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .navtoggle span, body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .navtoggle span::before, body:has(.p-hero-home) .p-header.is-top:not(:has(nav.open)) .navtoggle span::after { background: #FFFFFF; }
  .p-hero + .p-curtain > img.m-only { display: none !important; }   /* the picture is now part of the opening */
}

/* ---------- Careers page ---------- */
/* opening photo: without effects it keeps the width of the text column */
.cv-grow { padding: 0 64px 72px; }
.cv-grow-frame { max-width: 1200px; height: 420px; margin: 0 auto; overflow: hidden; }
.cv-fx .cv-grow { padding: 0 0 72px; }
.cv-fx .cv-grow-frame { max-width: none; height: 560px; clip-path: inset(var(--gy, 70px) var(--gx, 64px)); }
.cv-fx .cv-grow-frame > img { transform: scale(var(--gs, 1.08)); transform-origin: 50% 40%; will-change: transform; }

/* layered collage of three photos and a thin gold frame */
@media (min-width: 901px) {
  div.cv-mosaic.cv-collage { display: block !important; position: relative; height: 640px; margin-top: 36px !important; }
  .cv-collage > img { position: absolute; box-shadow: 0 18px 44px rgba(20, 26, 38, 0.14); }
  .cv-collage > img:nth-of-type(1) { left: 0; top: 48px; width: 60% !important; height: 470px !important; z-index: 1; }
  .cv-collage > img:nth-of-type(2) { right: 0; top: 0; width: 36% !important; height: 250px !important; z-index: 1; }
  .cv-collage > img:nth-of-type(3) { right: 7%; top: 300px; width: 40% !important; height: 270px !important; z-index: 2; outline: 10px solid #FDFBF7; }
  .cv-collage > .cv-deco { position: absolute; left: -32px; top: 0; width: 34%; height: 320px; border: 1px solid #CCB666; z-index: 0; pointer-events: none; }
  .cv-fx [data-depth] { will-change: translate; }
}
@media (max-width: 900px) { .cv-deco { display: none; } }

/* application steps: the gold line draws across one step after the other */
.cv-fx .cv-steps > div { position: relative; border-top-color: rgba(204, 182, 102, 0.22) !important; opacity: calc(0.25 + 0.75 * var(--sp, 1)); translate: 0 calc((1 - var(--sp, 1)) * 18px); }
.cv-fx .cv-steps > div::before { content: ""; position: absolute; left: 0; top: -2px; width: 100%; height: 2px; background: #CCB666; transform-origin: 0 50%; transform: scaleX(var(--sp, 1)); }

.cv-fx .cv-wipe { will-change: clip-path, scale; }

@media (max-width: 900px) {
  .cv-grow { padding: 0 20px 40px; }
  .cv-grow-frame { height: 240px; }
}
