/* ===========================================================================
   Site shell — bottom dock, CV menu and the closing block (footer with waves).
   Apple-clean base from alex эппл + the editorial serif accent from strato.
   =========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif/instrument-serif-regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif/instrument-serif-italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root { --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif; }

/* The old auto-hiding dock is replaced by .site-dock */
.dock { display: none !important; }
/* Keep the hero headline clear of the dock */
.has-site-dock .desktop-stage { padding-bottom: 92px; }

/* ── Dock ────────────────────────────────────────────────────────────── */
.site-dock {
  --ease-spring: cubic-bezier(.3, 1.35, .45, 1);
  position: fixed; z-index: 90; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));   /* above the case focus veil (80) and the spotlit case (81) */
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border: 1px solid #ffffffd9; border-radius: 24px;
  background: #ffffffbd;
  box-shadow: 0 12px 36px #1e253526, 0 2px 6px #1e25350d, inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(26px) saturate(180%);
          backdrop-filter: blur(26px) saturate(180%);
  animation: dock-in .7s cubic-bezier(.2, .9, .2, 1.1) .25s backwards;
}
[data-theme="dark"] .site-dock { border-color: #ffffff1f; background: #1d2027c9; box-shadow: 0 14px 40px #0008, inset 0 1px 0 #ffffff14; }
.site-dock a, .cv-menu a { text-decoration: none; }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 140%); } }

/* Avatar: home button, same rounded-rect shape as the CV button */
.site-dock__me {
  display: block; flex-shrink: 0; overflow: hidden;
  width: 42px; height: 42px; border-radius: 18px;
  box-shadow: inset 0 0 0 1px #0000000f;
  transition: transform .35s var(--ease-spring);
}
.site-dock__me:hover { transform: translateY(-2px); }
.site-dock__me img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
[data-theme="dark"] .site-dock__me { box-shadow: inset 0 0 0 1px #ffffff1a; }

/* Links + the sliding glass lens */
.site-dock__links { position: relative; display: flex; align-items: center; }
.site-dock__links a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; height: 42px; padding: 0 15px; border-radius: 15px;
  color: var(--secondary); font-size: 14px; font-weight: 550; letter-spacing: -.01em; white-space: nowrap;
  transition: color .2s;
}
.site-dock__links a:hover, .site-dock__links a[aria-current] { color: var(--ink); }
.site-dock__links a:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.site-dock__lens {
  position: absolute; left: 0; top: 0; height: 42px; width: 0; border-radius: 15px; opacity: 0;
  background: #fff; box-shadow: 0 2px 10px #1e25351f, inset 0 1px 0 #fff, inset 0 -1px 0 #0000000a;
  transition: transform .5s var(--ease-spring), width .5s var(--ease-spring), opacity .25s;
  pointer-events: none;
}
[data-theme="dark"] .site-dock__lens { background: #3a3e48; box-shadow: 0 2px 10px #0006, inset 0 1px 0 #ffffff1a; }
.site-dock__sep { width: 1px; height: 24px; margin: 0 4px; background: var(--line); }

.lang-switch { display: inline-flex; padding: 3px; border-radius: 14px; background: #0000000d; }
.lang-switch button, .lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 12px;
  background: transparent; color: var(--secondary);
  font: 600 12px/1 var(--font); letter-spacing: .04em; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s;
}
.lang-switch button[aria-pressed="true"], .lang-switch a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px #0000001f; }
[data-theme="dark"] .lang-switch { background: #ffffff14; }
[data-theme="dark"] .lang-switch button[aria-pressed="true"], [data-theme="dark"] .lang-switch a[aria-current="page"] { background: #3d414c; color: #fff; }

/* ── CV menu (opens upwards from the dock) ───────────────────────────── */
.cv-menu { position: relative; }
.cv-menu__button {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 16px;
  border: 0; border-radius: 16px; background: var(--ink); color: var(--paper);
  font: 650 13px/1 var(--font); letter-spacing: .02em; cursor: pointer; transition: opacity .15s;
  border-radius: 18px;
}
.cv-menu__button:hover { opacity: .86; }
.cv-menu__button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cv-menu__chev { transform: rotate(180deg); transition: transform .25s; }
.cv-menu.is-open .cv-menu__chev { transform: none; }
.cv-menu__panel {
  position: absolute; right: -5px; bottom: calc(100% + 14px); width: 330px; padding: 8px;
  border: 1px solid #ffffffe6; border-radius: 20px; background: #fffffff7;
  box-shadow: 0 24px 60px #1e25352e;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  transform-origin: 90% 100%;
}
.cv-menu__panel:not([hidden]) { animation: shell-pop .22s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .cv-menu__panel { border-color: #ffffff1c; background: #23262ef7; box-shadow: 0 24px 60px #0008; }
.cv-menu__item {
  display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px;
  padding: 10px; border-radius: 13px; color: var(--ink); outline: none;
}
.cv-menu__item:hover, .cv-menu__item:focus-visible { background: #0000000b; }
[data-theme="dark"] .cv-menu__item:hover, [data-theme="dark"] .cv-menu__item:focus-visible { background: #ffffff12; }
.cv-menu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.cv-menu__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: #fff; }
.cv-menu__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cv-menu__icon--product { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.cv-menu__icon--web { background: linear-gradient(135deg, #ff9f0a, #ff375f); }
.cv-menu__text strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.cv-menu__text span { display: block; margin-top: 2px; color: var(--secondary); font-size: 12px; }
@keyframes shell-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── Dock: phones ── */
@media (max-width: 640px) {
  .site-dock { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; justify-content: space-between; gap: 2px; }
  @keyframes dock-in { from { opacity: 0; transform: translateY(140%); } }
  .site-dock .site-dock__optional, .site-dock__sep { display: none; }
  .site-dock__links { flex: 1; justify-content: center; }
  .site-dock__links a { padding: 0 10px; font-size: 14px; }
  /* Language: one button that names the other language */
  .lang-switch :is(button[aria-pressed="true"], a[aria-current="page"]) { display: none; }
  .lang-switch button, .lang-switch a { min-width: 40px; height: 36px; padding: 0 8px; font-size: 12px; }
  .cv-menu__button { padding: 0 14px; }
  .cv-menu__button svg { display: none; }
  .cv-menu__panel { position: fixed; left: 8px; right: 8px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 66px); width: auto; }
}
@media (max-width: 380px) {
  .site-dock__links a { padding: 0 7px; font-size: 13.5px; }
  .cv-menu__button { padding: 0 12px; }
}
/* German labels are longer */
@media (max-width: 420px) { html[lang="de"] .site-dock__links a { padding: 0 6px; font-size: 13px; letter-spacing: -.015em; } }
@media (max-width: 370px) { html[lang="de"] .site-dock__links a { padding: 0 4px; } }
@media (max-width: 340px) { .site-dock__me { display: none; } }

/* ── Closing wordmark: big "Alex Lehmann" warped on a WebGL mesh (wordmark.js),
      rippling with the cursor in the mood colour. The <span> is the fallback. ── */
.site-word {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(8px, 2vw, 28px) var(--page-gutter, 40px) clamp(96px, 12vw, 150px);
  pointer-events: none; user-select: none;
}
.site-word span {
  display: inline-block; white-space: nowrap;
  font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; line-height: .9;
  font-size: clamp(44px, 15.5vw, 240px);
  color: color-mix(in srgb, var(--blue) 72%, var(--ink) 10%);
}
.site-word.is-gl span { visibility: hidden; }
.site-word .wordmark-gl { position: absolute; display: block; pointer-events: none; }
@media (max-width: 640px) {
  .site-word { padding-bottom: calc(clamp(96px, 12vw, 150px) + 56px); }
  .site-word span { white-space: normal; font-size: 22vw; }
}

@media (prefers-reduced-motion: reduce) {
  .site-dock { animation: none; }
  .site-dock__lens, .site-dock__me img { transition: none; }
}
