:root {
  --bg: #ffffff;
  --text: #111111;
  --line: #d3d3d3;

  --top-band: 26px;
  --top-line-gap: 8px;
  --pad: 16px;

  --grid-max: 1200px;                                          /* ← neu */
  --frame: max(12px, calc((100vw - var(--grid-max)) / 2));    /* ← ersetzt altes --frame */

  --font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  overflow-x: clip; /* clip statt hidden – beeinflusst fixed-Elemente nicht */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-width: 360px;
}

/* Vertikale Außenlinien */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 9999;
}

body::before { left: var(--frame); }
body::after  { right: var(--frame); }

/* Horizontale Rahmenlinien oben & unten */
html::before,
html::after {
  content: "";
  position: fixed;
  left: var(--frame);
  right: var(--frame);
  height: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 9999;
}

html::before { top: 0; }
html::after  { bottom: 0; }

/* HEADER */
header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  border-top: 1px solid var(--line);
  border-bottom: none;
}

@keyframes header-nudge {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(-6px); }
  55%  { transform: translateY(3px); }
  75%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

header.nudge {
  animation: header-nudge 400ms ease;
}

header::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 26px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

header.scrolled {
  border-bottom: none;
}


/* MAIN */
main {
  padding-left: var(--frame);
  padding-right: var(--frame);
  padding-bottom: var(--footer-h, 40px);
  border-bottom: 1px solid var(--line);
}

/* FOOTER */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 10;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px calc(var(--frame) + var(--pad));
  font-size: 11px;
  color: var(--text);
  opacity: 0.5;
}



/* TOPBAR */
.topbar {
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px calc(var(--frame) + var(--pad));
}

.topbar-left {
  font-size: 11px;
  opacity: 0.5;
}

.topbar-right {
  font-size: 11px;
  opacity: 0.5;
  text-transform: uppercase;
}

/* NAVBAR */
.navbar {
  border-bottom: 1px solid var(--line);
}

.navbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  padding: 0 calc(var(--frame) + var(--pad));
  gap: 24px;
}

.nav-left,
.nav-right {
  align-self: center;
  padding: 10px 0;
}

.nav-left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-self: start;
}

/* HAMBURGER */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  align-self: center;
  justify-self: start;
  grid-column: 1;
  grid-row: 1;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.hamburger span {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--text);
  border-radius: 0;
}

.hamburger:hover {
  background: #111;
  border-color: #111;
}

.hamburger:hover span {
  background: #fff;
}

header.hamburger-mode .nav-left {
  display: none;
}

header.hamburger-mode .hamburger {
  display: flex;
}

/* MOBILES MENÜ */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0 calc(var(--frame) + var(--pad));
}

header.menu-open .mobile-menu {
  display: flex;
}

.mobile-link {
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  padding: 8px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 150ms ease;
}

/* Pfeil links */
.mobile-link::before {
  content: "→";
  font-size: 11px;
  opacity: 0.35;
  transition: opacity 150ms ease, transform 150ms ease;
}

.mobile-link:hover::before {
  opacity: 0.8;
  transform: translateX(3px);
}

/* Trennlinie */
.mobile-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(-1 * (var(--frame) + var(--pad)));
  right: calc(-1 * (var(--frame) + var(--pad)));
  height: 1px;
  background: var(--line);
}

/* Klick-Flash */
@keyframes mobile-flash {
  0%   { background: #111; color: #fff; }
  60%  { background: #111; color: #fff; }
  100% { background: transparent; color: var(--text); }
}

.mobile-link.flash {
  animation: mobile-flash 320ms ease forwards;
}
.mobile-link.flash::before {
  opacity: 1;
  color: #fff;
}


.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.logo {
  display: flex;
  align-self: stretch;
  justify-self: center;
  text-decoration: none;
}

.logo-badge {
  display: block;
  position: relative;
  overflow: hidden;
  height: 100%;
  width: 160px;
  background: #111;
}

.logo-mk {
  position: absolute;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  user-select: none;
}

/* NAVIGATION LINKS */
.nav-pill {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color 250ms ease, border-color 250ms ease;
}

/* Schwarzer Kreis wächst von innen nach außen */
.nav-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #111;
  border-radius: inherit;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 320ms ease;
  z-index: -1;
}

.nav-pill:hover::before,
.nav-pill:focus-visible::before {
  clip-path: circle(150% at 50% 50%);
}

@keyframes pill-bounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.09); }
  65%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.nav-pill.clicked {
  animation: pill-bounce 320ms ease;
}

.nav-pill:hover,
.nav-pill:focus-visible {
  color: #fff;
  border-color: #111;
  outline: none;
  animation: pill-bounce 320ms ease;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-icon:hover {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* SPRACHAUSWAHL */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.lang {
  text-decoration: none;
  color: var(--text);
  position: relative;
}

.lang:hover {
  text-decoration: none;
}

.lang.active {
  text-decoration: underline;
}

.lang-sep {
  opacity: 0.6;
  pointer-events: none;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, var(--grid-max));
  margin: 0 auto;
  background-color: var(--line);
  gap: 1px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--bg);
  padding: 8px;
}

.cell-link {
  display: contents;
  text-decoration: none;
  color: inherit;
}

.projekt-img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: cover;
  border-radius: 8px;
}

/* LABEL OBEN LINKS */
.cell-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cell-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  opacity: 0.85;
}

/* WEISSER BUTTON UNTEN */
.cell-footer {
  position: absolute;
  bottom: 20px;
  left: 20px;
}

.cell-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color 250ms ease;
  cursor: default;
  justify-self: start;
}

.cell-title::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #111;
  border-radius: inherit;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 320ms ease;
  z-index: -1;
}

.cell-title::after {
  content: none;
}

.cell-title:hover::before {
  clip-path: circle(150% at 50% 50%);
}

.cell-title:hover {
  color: #fff;
  animation: pill-bounce 320ms ease;
}

/* RESPONSIVE */
@media (min-width: 1600px) {
  :root {
    --grid-max: 1800px;
  }
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}