/* ==========================================================================
   Base — shared by index.html, projects.html and 404.html
   Tokens, reset, and the two reusable controls:
   .knock  white box whose label is "knocked out" (the image shows through)
   .icon-btn  44×44 square holding an SVG icon (combine with .knock)
   ========================================================================== */
:root {
  --ink: #101719; /* page background behind media */
  --paper: #fff;
  --black: #000;
  --gold: #f2c94c; /* award accent */
  --font: Arial, Helvetica, sans-serif;
  --edge: 2vw; /* side inset for corner controls */
  --top: calc(7% - 12px); /* top inset for corner controls */
  --ease: 0.2s ease;
}
@media (max-width: 700px) {
  :root {
    --edge: 4vw;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  :root {
    --top: max(4px, env(safe-area-inset-top));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  overflow: hidden; /* home and projects are single full-screen views */
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
img,
video,
svg {
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
h1,
h2,
p {
  margin: 0;
}

/* Knockout control: black label on white + screen blend → the label becomes a window onto the media below.
   Hover / focus inverts to an outlined box with a solid white label. */
.knock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--paper);
  color: var(--black);
  border: 1px solid var(--paper);
  font-weight: 700;
  mix-blend-mode: screen;
  transition:
    background-color var(--ease),
    color var(--ease);
}
.knock:hover,
.knock:focus-visible {
  background: transparent;
  color: var(--paper);
}
:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Phones / tablets: no backdrop blur. Over autoplaying video it is re-computed every frame, which
   stutters on iOS (Safari and Chrome there are both WebKit); the glass panels keep their tinted fill. */
@media (hover: none) and (pointer: coarse) {
  *,
  *::before,
  *::after,
  ::backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  /* without the blur, a denser fill keeps the pills readable over bright footage */
  :root .lang-toggle,
  :root .corner-home {
    background: rgb(10 14 16 / 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Language toggle — always shows both languages, current one filled.
   A pill, so it never reads as one of the square icon buttons.
   Markup is generated by tools/build.cjs: svg.lang-globe + a[hreflang=en] + a[hreflang=de]
   ========================================================================== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 4px 4px 4px 12px;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 999px;
  background: rgb(10 14 16 / 0.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  color: var(--paper);
}
.lang-globe {
  flex: none;
  margin-right: 6px;
  opacity: 0.75;
}
.lang-toggle a {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgb(255 255 255 / 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition:
    background-color var(--ease),
    color var(--ease);
}
.lang-toggle a:hover {
  background: rgb(255 255 255 / 0.14);
  color: var(--paper);
}
.lang-toggle a[aria-current] {
  background: var(--paper);
  color: var(--black);
}
.lang-toggle a:focus-visible {
  outline-offset: 2px;
}
/* phones: drop the globe, tighter segments */
@media (max-width: 700px) {
  .lang-toggle {
    padding: 4px;
  }
  .lang-globe {
    display: none;
  }
  .lang-toggle a {
    min-width: 36px;
    height: 34px;
    padding: 0 8px;
  }
}
