/* insurance.mathematics – theme styles
   Colours from Designsystem/farbpalette.css; light greys only for glass and footer. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --papierweiss: #ffffff;
  --druckschwarz: #000000;
  --kuliblau: #1f3fd1;
  --markerblau: #e6ebff;
  --bleistiftgrau: #6b6f78;
  --kaestchengrau: #dfe3ec;
  --hellgrau: #f5f5f7;

  --glass-bg: rgba(245, 245, 247, 0.72);
  --glass-blur: blur(20px) saturate(180%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 0 0 0.5px rgba(0, 0, 0, 0.07);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.07);

  --gutter: 16px;
  --font: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--papierweiss);
  color: var(--druckschwarz);
  font-family: var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--kuliblau);
  outline-offset: 2px;
  border-radius: 999px;
}

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

.nav-wrap {
  position: fixed;
  inset: var(--gutter) var(--gutter) auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  pointer-events: auto;
}

.nav-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: 6px;
  border-radius: 12px;
  background: var(--markerblau);
  color: var(--kuliblau);
}

.sigma svg { display: block; width: 17px; height: auto; }

.nav-items {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-items a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.01em;
  transition: color 160ms ease-out;
}

.nav-items a:hover { color: var(--kuliblau); }

.nav-hover {
  position: absolute;
  top: 6px;
  left: 0;
  z-index: 0;
  width: 0;
  height: 40px;
  border-radius: 999px;
  background: var(--markerblau);
  opacity: 0;
  pointer-events: none;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  grid-area: 1 / 1;
  width: 18px;
  height: 1.75px;
  border-radius: 2px;
  background: var(--druckschwarz);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-toggle span:first-child { transform: translateY(-3.5px); }
.nav-toggle span:last-child { transform: translateY(3.5px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

/* veils the formula field while the sheet is open; a click on it closes the menu */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease-out, visibility 0s linear 220ms;
}

.nav-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.nav-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 28px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  transform-origin: top center;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  filter: blur(6px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms ease-out,
    transform 320ms cubic-bezier(0.32, 0.72, 0, 1),
    filter 220ms ease-out,
    visibility 0s linear 320ms;
}

.nav-sheet[data-open="true"] {
  opacity: 1;
  transform: none;
  filter: none;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.nav-sheet ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-sheet a {
  display: block;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 160ms ease-out;
}

/* the sheet's gliding box, like .nav-hover in the pill but moving up and down */
.nav-sheet-hover {
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  z-index: 0;
  height: 0;
  border-radius: 20px;
  background: var(--markerblau);
  opacity: 0;
  pointer-events: none;
}

.nav-items a.is-hot,
.nav-sheet a.is-hot { color: var(--kuliblau); }

@media (max-width: 760px) {
  .nav { width: 100%; max-width: 420px; }
  .nav-items, .nav-hover { display: none; }
  .nav-toggle { display: grid; }
}

/* ---------- Formula field ---------- */

.hero {
  position: relative;
  /* 100vh stage + the longest scroll timeline of field.js (flight 140, gap 5, sentence 25, hold 25);
     field.js shortens it to where the last formula actually leaves the screen */
  height: 295vh;
}

.stage {
  position: sticky;
  top: 0;
  /* large viewport: on phones the field also covers the strip behind a collapsing address bar */
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  touch-action: pan-y;
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spot-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), 0 6px 20px rgba(0, 0, 0, 0.08);
  color: var(--kuliblau);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.spot-label span { display: block; }
.spot-label span.swap { animation: label-swap 200ms ease-out; }

@keyframes label-swap {
  from { opacity: 0; filter: blur(3px); transform: translateY(3px); }
}

.answer {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(92vw, 1100px);
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: clamp(34px, 5.6vw, 84px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}

.answer .w {
  display: inline-block;
  opacity: 0;
}

.answer .k { color: var(--kuliblau); }

/* ---------- Subpages and Nachschlagewerk ---------- */

/* Über mich, Kontakt and Blog are blank until their own design is decided; main still pushes the footer down. */

.reference-empty {
  max-width: 720px;
  margin: 18vh auto 0;
  color: var(--bleistiftgrau);
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
}

.reference { max-width: 1100px; margin: 0 auto; }

.reference-search { display: block; max-width: 420px; }

.reference-search input {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--hellgrau);
  color: var(--druckschwarz);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming into the field */
  -webkit-appearance: none;
  appearance: none;
}

.reference-search input::placeholder { color: var(--bleistiftgrau); }
.reference-search input:focus-visible { outline-offset: 0; }

.reference-group { scroll-margin-top: 104px; }

.reference-heading {
  margin: 48px 0 16px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.reference-none { margin: 48px 0 0; color: var(--bleistiftgrau); font-size: 16px; }

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.formula-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 168px;
  padding: 24px;
  border-radius: 24px;
  background: var(--hellgrau);
  transition: background-color 400ms ease-out;
}

/* reached from "Zur Formel" in the glossary */
.formula-grid li { scroll-margin-top: 104px; }
.formula-grid li:target .formula-card { background: var(--markerblau); }

.formula-math {
  display: grid;
  flex: 1;
  place-items: center;
  overflow: hidden;
  font-size: 18px;
}

.formula-math svg { max-width: 100%; height: auto; }

.formula-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.formula-grid li:target .formula-name { color: var(--kuliblau); }

.glossary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 20px;
}

.glossary-bar a,
.glossary-bar span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.glossary-bar a:hover { background: var(--markerblau); color: var(--kuliblau); }
.glossary-bar [aria-disabled="true"] { color: var(--kaestchengrau); pointer-events: none; }

.glossary-list { margin: 0; padding: 0; list-style: none; }

.glossary-list li {
  display: grid;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--kaestchengrau);
}

.glossary-term {
  justify-self: start;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.glossary-formula { color: var(--kuliblau); }
.glossary-formula:hover { text-decoration: underline; text-underline-offset: 0.16em; }

.glossary-text { max-width: 720px; margin: 0; color: var(--bleistiftgrau); font-size: 16px; line-height: 1.55; }
.glossary-formula { justify-self: start; font-size: 14px; font-weight: 600; }

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

.footer {
  margin: 0 var(--gutter) var(--gutter);
  padding: 56px clamp(24px, 4vw, 56px) 28px;
  border-radius: 32px;
  background: var(--hellgrau);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: start;
}

.footer-logo { margin: 0; }
.footer-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.footer-col h2 {
  margin: 0 0 14px;
  color: var(--bleistiftgrau);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.footer-col ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-col a, .footer-col .placeholder { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.footer-col a { transition: color 160ms ease-out; }
.footer-col a:hover { color: var(--kuliblau); }
.footer-col .placeholder { color: var(--bleistiftgrau); }

.footer-copy {
  margin: 48px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--kaestchengrau);
  color: var(--bleistiftgrau);
  font-size: 13px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- WordPress ---------- */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  padding: 10px 16px;
  clip-path: none;
  border-radius: 999px;
  background: var(--papierweiss);
  box-shadow: var(--glass-shadow);
  color: var(--kuliblau);
  font-weight: 600;
}

body.admin-bar .nav-wrap { top: calc(32px + var(--gutter)); }
@media (max-width: 782px) { body.admin-bar .nav-wrap { top: calc(46px + var(--gutter)); } }

.nav-logo img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.nav-items .current-menu-item > a,
.nav-sheet .current-menu-item > a { color: var(--kuliblau); }

.hero.no-webgl { height: 100vh; height: 100svh; }
.hero.no-webgl .answer .w { opacity: 1; }

/* Pages, posts and Elementor content below the floating menu */

main,
body > .elementor { flex: 1 0 auto; }
.footer { flex: none; }

.site-main { padding: 112px var(--gutter) 96px; }
.entry a { color: var(--kuliblau); }
.front-content:empty { display: none; }

.entry {
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.6;
}

.entry-title {
  margin: 0 0 24px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.entry-meta { margin: -12px 0 32px; color: var(--bleistiftgrau); font-size: 14px; }

.entry-content > * + * { margin-top: 1em; }
.entry-content h2 { margin-top: 2em; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.entry-content h3 { margin-top: 1.6em; font-size: 21px; letter-spacing: -0.015em; }
.entry-content a { color: var(--kuliblau); text-decoration: underline; text-underline-offset: 0.16em; }
.entry-content img { max-width: 100%; height: auto; border-radius: 16px; }

.entry-content mark,
.entry-content .has-markerblau-background-color { background: var(--markerblau); color: var(--druckschwarz); }

.post-list { display: grid; gap: 40px; max-width: 720px; margin: 0 auto; padding: 0; list-style: none; }
.post-list h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.post-list a:hover h2 { color: var(--kuliblau); }
.post-list p { margin: 8px 0 0; color: var(--bleistiftgrau); }

.pagination { display: flex; gap: 8px; justify-content: center; max-width: 720px; margin: 56px auto 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 999px; background: var(--hellgrau); font-weight: 600; }
.pagination .current { background: var(--markerblau); color: var(--kuliblau); }

/* Elementor sections get the full width; the menu floats above them */
.elementor-page .site-main { padding-inline: 0; }
.nav-spacer { height: 96px; }

/* ---------- Preferences ---------- */

@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: var(--hellgrau); }
  .nav, .nav-sheet, .spot-label { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .spot-label { background: var(--papierweiss); }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 215vh; } /* fade 60 instead of the flight */
  .nav-sheet, .nav-toggle span { transition-duration: 1ms; }
}
