/* ============================================================
   VARIABLEN
   ============================================================ */
:root {
  /* Navy – Hero */
  --navy:         #0A1628;
  --navy-text:    #F0F4FF;
  --navy-mid:     rgba(240, 244, 255, 0.52);
  --navy-faint:   rgba(240, 244, 255, 0.16);

  /* Off-White – Portfolio */
  --bg:           #FAFAFA;
  --ink:          #111111;
  --ink-mid:      #777777;
  --ink-faint:    #DDDDDD;

  /* Layout (Desktop-Basis) */
  --max-chat:     720px;
  --max-grid:     1200px;
  --pad-h:        64px;    /* horizontaler Seitenabstand Desktop */
}


/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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


/* ============================================================
   ANIMATIONEN
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40%           { transform: scale(1);   opacity: 1; }
}


/* ============================================================
   SITE-HEADER  (lebt auf Navy-Hintergrund)
   ============================================================ */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 36px var(--pad-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fade-up 0.6s ease both;
  /* Verhindert, dass der Header den Hero-Content überlagert */
  pointer-events: none;
}

.site-header * {
  pointer-events: auto;
}

.logo {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--navy-text);
}

.site-header nav a {
  font-size: 13px;
  color: var(--navy-mid);
  margin-left: 40px;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: var(--navy-text);
}


/* ============================================================
   HERO  (Navy)
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--navy);
  color: var(--navy-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px var(--pad-h) 96px;
}

/* 2-Spalten-Layout: Text links, Foto rechts */
.hero-content {
  width: 100%;
  max-width: var(--max-grid);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-left {
  max-width: 560px;
}


/* ============================================================
   HEADLINE
   ============================================================ */
.headline-block {
  margin-bottom: 72px;
  animation: fade-up 0.75s ease 0.1s both;
}

h1 {
  font-size: clamp(40px, 5.5vw, 76px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--navy-text);
}

h1 em {
  font-style: normal;
  display: block;
}

.subline {
  margin-top: 20px;
  font-size: 14px;
  color: var(--navy-mid);
  font-weight: 300;
  letter-spacing: 0.015em;
}


/* ============================================================
   CHAT-BEREICH  (auf Navy)
   ============================================================ */
.chat-area {
  animation: fade-up 0.75s ease 0.22s both;
}

.chat-history {
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 32px;
  scrollbar-width: none;
}

.chat-history::-webkit-scrollbar { display: none; }

.msg {
  font-size: 15px;
  line-height: 1.68;
  margin-bottom: 26px;
  max-width: 92%;
}

.msg--user {
  font-size: 13px;
  color: var(--navy-mid);
}

.msg--user::before {
  content: '› ';
  color: var(--navy-faint);
}

.msg--assistant {
  color: var(--navy-text);
  font-weight: 400;
}

/* Lade-Punkte */
.msg.is-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy-mid);
  animation: dot-pulse 1.3s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.30s; }
.dot:nth-child(2) { animation-delay: -0.15s; }
.dot:nth-child(3) { animation-delay: 0s; }


/* ============================================================
   EINGABEZEILE  (auf Navy)
   ============================================================ */
.input-line {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--navy-faint);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.prompt-char {
  font-size: 24px;
  line-height: 1;
  color: var(--navy-text);
  flex-shrink: 0;
  user-select: none;
  opacity: 0.7;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 16px;       /* min 16px → kein iOS-Zoom */
  color: var(--navy-text);
  letter-spacing: 0.01em;
  padding: 0;
  caret-color: var(--navy-text);
}

#chat-input::placeholder {
  color: var(--navy-faint);
  font-weight: 300;
}

#chat-input:disabled {
  opacity: 0.4;
}

.fake-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--navy-text);
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
  opacity: 0.8;
}


/* ============================================================
   CHIPS  (auf Navy)
   ============================================================ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  background: transparent;
  border: 1px solid var(--navy-faint);
  color: var(--navy-mid);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 7px 17px;
  border-radius: 100px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--navy-text);
  background: var(--navy-text);
  color: var(--navy);
}

.chip:active {
  transform: scale(0.97);
}


/* ============================================================
   SPATIAL PHOTO
   ============================================================ */
.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.spatial-photo {
  position: relative;
  /* Breite treibt die Größe – zuverlässiger im Grid */
  width: 100%;
  max-width: 380px;
  aspect-ratio: 2 / 3;        /* Foto: 3651 × 5476 ≈ 2:3 */
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.60),
    0 10px  28px rgba(0, 0, 0, 0.40);
  cursor: default;
  /* Kein transform-style: preserve-3d – kollidiert mit overflow:hidden in Safari */
  transform: perspective(900px) rotateY(0deg) rotateX(0deg);
  animation: fade-up 0.8s ease 0.35s both;
  will-change: transform;
}

/* Ebene 1: Hintergrund-Foto – bewegt sich langsam, minimal unscharf → wirkt weit */
.spatial-bg {
  position: absolute;
  inset: 0;
  background-image: url('photo-bg.jpg');
  background-size: cover;
  background-position: center top;
  /* scale(1.05): nur 5% Überstand als Bewegungsspielraum für Parallax */
  transform: scale(1.05);
  filter: blur(1px) brightness(0.88);
  will-change: transform;
}

/* Ebene 2: Freigestelltes Motiv – exakt gleicher Ausschnitt, nur 2% größer */
.spatial-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.04) translate(0, 0);
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.45));
  will-change: transform;
}

/* Ebene 3: Glare – folgt dem Cursor (Apple Lens-Flare) */
.spatial-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  mix-blend-mode: overlay;
}


/* ============================================================
   SCROLL-PFEIL  (Hero, unten zentriert)
   ============================================================ */
.scroll-arrow {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--navy-text);
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.25s;
  animation: arrow-bounce 2.8s ease-in-out infinite;
}

.scroll-arrow:hover {
  opacity: 0.9;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.4; }
  50%       { transform: translateX(-50%) translateY(9px); opacity: 0.65; }
}

/* Chat-Navigations-Links (erscheinen nach relevanten Bot-Antworten) */
.chat-nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-nav-link {
  font-size: 12px;
  color: var(--navy-mid);
  border: 1px solid var(--navy-faint);
  padding: 5px 12px;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  white-space: nowrap;
}

.chat-nav-link:hover {
  color: var(--navy);
  background: var(--navy-text);
  border-color: var(--navy-text);
}


/* ============================================================
   PORTFOLIO  (Off-White)
   ============================================================ */
.portfolio {
  background: var(--bg);
  padding: 112px var(--pad-h) 140px;
  max-width: var(--max-grid);
  margin: 0 auto;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 56px;
}

/* Desktop: 3 Spalten – großzügige Abstände */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
}

.project-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  cursor: pointer;
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #EBEBEB;
  border-radius: 3px;
  margin-bottom: 18px;
  transition: background 0.25s;
}

.project-card:hover .project-thumb {
  background: #E0E0E0;
}

.project-info h3 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  color: var(--ink);
}

.project-tag {
  font-size: 11px;
  color: var(--ink-mid);
  font-weight: 300;
  letter-spacing: 0.05em;
}


/* ============================================================
   LEBENSLAUF  (Off-White)
   ============================================================ */
.cv-section {
  background: var(--bg);
  border-top: 1px solid var(--ink-faint);
  padding: 112px var(--pad-h) 120px;
}

.cv-inner {
  max-width: var(--max-grid);
  margin: 0 auto;
}

.cv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 80px;
}

.cv-col-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 40px;
}

.cv-col-title--gap {
  margin-top: 56px;
}

.cv-entry {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--ink-faint);
}

.cv-entry:last-of-type {
  border-bottom: none;
}

.cv-year {
  display: block;
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.cv-role {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 3px;
}

.cv-company {
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 8px;
}

.cv-desc {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.65;
  font-weight: 300;
}

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cv-skill {
  font-size: 12px;
  color: var(--ink-mid);
  border: 1px solid var(--ink-faint);
  padding: 5px 13px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}


/* ============================================================
   PHILOSOPHIE-ZITAT  (Navy)
   ============================================================ */
.quote-section {
  background: var(--navy);
  padding: 120px var(--pad-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-block {
  max-width: 760px;
  text-align: center;
}

.quote-text {
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--navy-text);
  margin-bottom: 28px;
  font-style: italic;
}

.quote-cite {
  font-size: 13px;
  color: var(--navy-mid);
  letter-spacing: 0.06em;
  font-style: normal;
}


/* ============================================================
   KONTAKT  (Off-White)
   ============================================================ */
.contact-section {
  background: var(--bg);
  border-top: 1px solid var(--ink-faint);
  padding: 120px var(--pad-h) 140px;
  text-align: center;
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
}

.contact-headline {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.1;
}

.contact-sub {
  font-size: 15px;
  color: var(--ink-mid);
  font-weight: 300;
  margin-bottom: 48px;
  line-height: 1.6;
}

.contact-email {
  display: inline-block;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 4px;
  transition: border-color 0.2s;
  margin-bottom: 40px;
}

.contact-email:hover {
  border-color: var(--ink);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.contact-links a {
  font-size: 13px;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: var(--ink);
}


/* ============================================================
   FOOTER  (Off-White)
   ============================================================ */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--ink-faint);
  padding: 40px var(--pad-h);
  text-align: center;
}

.site-footer p {
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.03em;
}


/* ============================================================
   RESPONSIVE  (Desktop-first: Breakpoints gehen NUR runter)
   ============================================================ */

/* Großer Laptop / kleines Desktop  ≤ 1100px */
@media (max-width: 1100px) {
  :root {
    --max-grid: 100%;
    --pad-h:    48px;
  }

  .project-grid {
    gap: 36px 28px;
  }
}

/* Tablet  ≤ 900px — Hero wird einspaltg, Foto wandert nach oben */
@media (max-width: 900px) {
  :root { --pad-h: 36px; }

  .hero {
    padding-top: 100px;
    padding-bottom: 72px;
    align-items: flex-start;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  /* Foto zuerst auf Mobil */
  .hero-right  { order: -1; }
  .hero-left   { order:  1; max-width: 100%; }

  .spatial-photo {
    max-width: 280px;
    margin: 0 auto;
    border-radius: 16px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 24px;
  }

  .portfolio {
    padding-top: 80px;
    padding-bottom: 100px;
  }
}

/* Tablet: CV einspaltig */
@media (max-width: 860px) {
  .cv-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cv-col + .cv-col {
    margin-top: 56px;
  }
}

/* Kleines Tablet  ≤ 680px */
@media (max-width: 680px) {
  :root { --pad-h: 28px; }

  .site-header {
    padding: 28px var(--pad-h);
  }

  h1 {
    font-size: clamp(36px, 9vw, 56px);
  }

  .headline-block {
    margin-bottom: 48px;
  }
}

/* Mobil  ≤ 520px */
@media (max-width: 520px) {
  :root { --pad-h: 20px; }

  .site-header nav a:not(:last-child) {
    display: none;
  }

  h1 {
    font-size: clamp(32px, 10.5vw, 48px);
  }

  .headline-block {
    margin-bottom: 36px;
  }

  .spatial-photo {
    max-width: 220px;
    border-radius: 14px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .portfolio {
    padding-top: 60px;
    padding-bottom: 80px;
  }

  .site-footer {
    padding: 28px var(--pad-h);
  }
}
