/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

/* ---------- RESET CSS ---------- */

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ---------- END RESET CSS ---------- */

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

/* ---------- FONT ---------- */

@font-face {
  font-family: "BoldElizabeth";
  src:
    url("../BOLDELIZABETH/BoldElizabeth-Regular.woff2") format("woff2"),
    url("../BOLDELIZABETH/BoldElizabeth-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- ROOT ----------
   Alle Größen sind fließend (clamp), es gibt keine Sprünge zwischen
   Handy, Tablet und Desktop. Referenzpunkte:
   390px (iPhone) ... 1100px (Tablet quer) ... 1440px (Laptop)           */

:root {
  --purple: rgb(0, 0, 0);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);

  /* Schrift der Projektliste: 12px bei 600px -> ~8.6px ab 1280px
     (Handy siehe Media Query unten, dort geht es nahtlos weiter) */
  --nav-fs: clamp(0.54rem, 0.93rem - 0.49vw, 0.75rem);

  /* Geöffnet: Reihe(n) oben */
  --list-top: clamp(14px, 1.4vw, 20px); /* Abstand vom oberen Rand */
  --list-left: clamp(16px, 1vw + 8px, 24px); /* Rand links und rechts */
  --row-h: calc(var(--nav-fs) * 2.2 + 14px); /* Zeilenhöhe bei Umbruch */
  --min-gap: clamp(12px, 9vw, 36px); /* kleinster Abstand zweier Projekte */
  --jitter: clamp(
    4.5px,
    0.2vw + 4px,
    6px
  ); /* Einheit für den Höhenversatz (Desktop-Look auch mobil) */

  /* LINA WALK: sitzt auf jeder Seite immer auf derselben Höhe,
     unabhängig von der Textlänge (27% der Fensterhöhe, 190–320px vom unteren Rand) */
  --name-fs: clamp(1.5rem, 1.1rem + 1.6vw, 1.9rem);
  --name-half: calc(
    var(--name-fs) * 0.35
  ); /* halbe Großbuchstabenhöhe: Abstand wird ab der Schrift gemessen */
  --name-b: clamp(190px, 27vh, 320px);

  /* Weißraum zwischen Projektleiste, Bildbereich, LINA WALK und Textbereich */
  --zone-gap: clamp(22px, 3vw + 10px, 37px);

  /* Bildbereich: von Ende der Projektleiste bis Oberkante LINA WALK */
  --zone-h: calc(100svh - var(--nav-h) - var(--name-b) - var(--name-half));
  --zone-fit: calc(var(--zone-h) - var(--zone-gap) * 2); /* maximale Bildhöhe */

  /* Textbereich: von Unterkante LINA WALK (+ Weißraum) bis kurz vor Bildschirmende */
  --info-bottom: calc(var(--zone-gap) / 2);
  --info-h: calc(
    var(--name-b) - var(--name-half) - var(--zone-gap) - var(--info-bottom) -
      env(safe-area-inset-bottom, 0px)
  );

  /* wird von nav.js gesetzt: Höhe der offenen Leiste */
  --nav-h: 0px;
}

@supports (height: 100dvh) {
  :root {
    --name-b: clamp(190px, 27dvh, 320px);
  }
}

/* ---------- GLOBAL ---------- */

html,
body {
  font-family: "BoldElizabeth", serif;
  letter-spacing: 0.025em;
  margin: 0;
  padding: 0;
  width: 100%;
  background: white;
  color: black;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Startseite: kein Scrollen */
html:has(body.home),
body.home {
  height: 100%;
  overflow: hidden;
}

/* Link zurück zur Startseite (auf den Projektseiten) */
.home-link {
  color: black;
  text-decoration: none;
  letter-spacing: 0.5em;
  margin-right: 0.5em;
}

.home-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================
   NAVIGATION
   LINA WALK unten mittig.
   Geschlossen: Haufen um LINA WALK.
   Geöffnet: Projekte als Reihe(n) oben, Zeilenumbruch automatisch (nav.js).
   ========================================================= */

.site-nav {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

/* ---------- LINA WALK ---------- */

.name {
  position: absolute;
  left: 50%;
  top: calc(100% - var(--name-b));
  transform: translate(-50%, -50%);

  z-index: 20;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: black;

  font: inherit;
  font-size: var(--name-fs);
  line-height: 1;
  letter-spacing: 0.5em;
  /* der letzte Buchstabe trägt sonst Leerraum rechts -> optisch mittig halten */
  padding-left: calc(12px + 0.5em);

  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}

.name:focus-visible {
  outline: 1px solid black;
  outline-offset: 2px;
}

/* ---------- PROJEKTLISTE ---------- */

.ul-index {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 10;
  pointer-events: none;
}

.li-index {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  white-space: nowrap;
  pointer-events: auto;
  will-change: transform;

  transition:
    transform 0.9s var(--ease-soft),
    opacity 0.5s ease;
  transition-delay: calc(var(--i) * 40ms);

  /* Geschlossen: Haufen um LINA WALK, Position kommt aus nav.js (--cx / --cy) */
  transform: translate(var(--cx, 40vw), var(--cy, 60vh));
}

/* Geöffnet: Position kommt aus nav.js (--tx / --ty) */
.site-nav.is-open .li-index {
  transform: translate(var(--tx, 20px), var(--ty, 20px));
}

/* ---------- REIHENFOLGE (--i) für die zeitversetzte Animation ---------- */

.project1 {
  --i: 0;
}
.project2 {
  --i: 1;
}
.project3 {
  --i: 2;
}
.project4 {
  --i: 3;
}
.project5 {
  --i: 4;
}
.project6 {
  --i: 5;
}
.project7 {
  --i: 6;
}
.project8 {
  --i: 7;
}

/* ---------- PROJEKT-LINKS ---------- */

.projekte {
  display: block;
  color: black;
  font-size: var(--nav-fs);
  line-height: 2;
  letter-spacing: 0.05em;
  text-align: left;
  text-decoration: none;
  white-space: nowrap; /* jedes Projekt bleibt in voller Länge in einer Zeile */
}

/* Aktuelles Projekt unterstrichen */
.projekte.is-current {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Hover-Unterstreichung nur auf Geräten mit Maus */
@media (hover: hover) {
  .site-nav.is-open .projekte:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

/* Keine Animation (sofort geöffnet, Resize) */
.site-nav.no-anim .li-index {
  transition: none !important;
}

/* ---------- HANDY ---------- */
/* Projektleiste frei gestreut wie im Mockup (Positionen in nav.js).
   Schrift: ~10px bei 390px, ~11px bei 420px, schrumpft mit Breite und Höhe. */
@media (max-width: 600px) {
  :root {
    --nav-fs: clamp(0.62rem, min(2.6vw, 1.5svh), 0.75rem);
    --list-top: clamp(18px, 5.6vw, 34px);
    --list-left: clamp(14px, 4.5vw, 27px);
  }
}

/* ---------- SEHR SCHMALE GERÄTE ---------- */
/* Einziger "harter" Breakpoint der Navigation: unter 360px etwas enger */
@media (max-width: 359px) {
  :root {
    --min-gap: 10px;
  }
  .name {
    letter-spacing: 0.4em;
    padding-left: calc(12px + 0.4em);
  }
}

/* ---------- REDUZIERTE BEWEGUNG ---------- */

@media (prefers-reduced-motion: reduce) {
  .li-index {
    transition: none;
  }
}
