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

:root {
  --bg: #f5f1e6;
  --surface: #ffffff;
  --accent: #1f6f68;
  --accent-light: #3f9c8f;
  --accent-glow: #7fd9c9;
  --accent-2: #c1652e;
  --text: #171f1a;
  --text-muted: #666f63;
  --border: #e1dbca;
  --tag-bg: #edeee2;
  --tag-color: #3d4a41;
  --nav-bg: rgba(245,241,230,0.85);
  --radius: 4px;
  --max-w: 860px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512;
    --surface: #151f1a;
    --accent: #5fd0c2;
    --accent-light: #7fe0d3;
    --accent-glow: #a8ecdf;
    --accent-2: #e2925a;
    --text: #e9efe9;
    --text-muted: #8ea198;
    --border: #253029;
    --tag-bg: #1a2420;
    --tag-color: #8fd9cb;
    --nav-bg: rgba(14,21,18,0.85);
  }
}

body a {
  color: var(--accent-light);
  }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: -2;
}

/* NEURAL NETWORK BACKGROUND */
#neural-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

@media (prefers-color-scheme: dark) {
  #neural-canvas {
    opacity: 0.4;
  }
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav .nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

nav .logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

nav .logo::before {
  content: "//";
  color: var(--accent);
  margin-right: 0.4em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--accent);
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--font-mono);
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* LAYOUT */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* SCROLL REVEAL */
.reveal,
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible,
.reveal-stagger > *.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.09s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.23s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.30s; }
.reveal-stagger > *:nth-child(6) { transition-delay: 0.37s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    transition: none;
    transform: none;
  }
}

/* BIG DIVIDER HEADINGS */
.divider {
  position: relative;
  min-height: 48vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  overflow: hidden;
}

.divider::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 16%, transparent) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent) 0 1px, transparent 1px 64px);
  opacity: 0.35;
  pointer-events: none;
}

.divider-block {
  width: 100%;
  padding: 0 2rem;
  position: relative;
}

.divider-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  row-gap: 0.9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.4;
  max-width: 100%;
  position: relative;
}

.divider-heading > * {
  opacity: 0;
  transform: translateY(22px) scale(0.94);
  filter: blur(6px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.divider-phrase {
  display: inline-block;
  white-space: nowrap;
  position: relative;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-light) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.divider-num {
  font-family: inherit;
  font-style: inherit;
  font-weight: inherit;
  font-size: 1em;
  letter-spacing: inherit;
  color: var(--accent-light);
  opacity: 0.55;
  margin-right: 0.12em;
}

.divider-phrase:nth-of-type(3n+2) {
  background: linear-gradient(120deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.divider-phrase.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.divider-sep {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.75em;
  color: var(--accent-light);
  margin: 0 0.7em;
  transform-origin: center;
}

.divider-sep.is-visible {
  opacity: 0.6;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .divider-heading > * {
    transition: none;
    transform: none;
    filter: none;
    opacity: 1;
  }
}

/* HERO */
#hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: none;
  background-image: url('images/hero-lake.jpg');
  background-size: cover;
  background-position: center 62%;
  background-repeat: no-repeat;
  overflow: hidden;
}

section + #hero,
#hero + section {
  border-top: none;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 6, 0.35) 0%,
    rgba(8, 12, 6, 0.05) 30%,
    rgba(8, 12, 6, 0.25) 52%,
    rgba(8, 12, 6, 0.85) 100%
  );
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 6.5rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  color: #eef1e0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.hero-tag::before,
.hero-tag::after {
  content: "";
  width: 1.4em;
  height: 1px;
  background: var(--accent-glow);
  opacity: 0.8;
}

h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

h1 em {
  font-style: italic;
  font-weight: 500;
}

#hero h1 {
  font-size: clamp(2.2rem, 5.8vw, 3.6rem);
  line-height: 1.12;
  background: linear-gradient(100deg, #ffffff 35%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.45);
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.86);
  max-width: 560px;
  margin-bottom: 2rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.hero-meta {
  position: absolute;
  z-index: 2;
  right: 1.5rem;
  bottom: 2.1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-align: right;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

@media (max-width: 700px) {
  .hero-meta {
    display: none;
  }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 100px;
}

.scroll-cue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 100px;
  animation: scroll-cue-move 1.8s ease-in-out infinite;
}

@keyframes scroll-cue-move {
  0% { opacity: 1; top: 7px; }
  70% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span { animation: none; }
}

@media (max-width: 600px) {
  #hero {
    background-position: center 55%;
  }
  .hero-inner {
    padding-bottom: 4.5rem;
  }
  .scroll-cue {
    bottom: 1.25rem;
  }
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  margin-left: 0.75rem;
}

.btn-outline:hover {
  background: var(--accent);
  color: #000;
}

@media (prefers-color-scheme: light) {
  .btn {
    color: #ffffff;
  }

  #hero .btn-outline {
    color: #ffffff;
    border-color: #ffffff;
  }

  #hero .btn-outline:hover {
    background: var(--accent-light);
    color: #ffffff;
    border-color: var(--accent-light);
    transform: translateY(-1px);
  }
}

/* SECTION HEADINGS */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.section-mark {
  color: var(--accent);
  font-weight: 600;
}

h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 3rem;
}

/* SKILL CARDS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  column-gap: 3rem;
  counter-reset: card;
  border-top: 1px solid var(--border);
}

.skill-card {
  counter-increment: card;
  position: relative;
  padding: 2.1rem 0.25rem 2.1rem 0;
  border-bottom: 1px solid var(--border);
}

.skill-card::before {
  content: counter(card, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.9rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

.skill-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--accent-2);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.25s ease;
}

.skill-card:hover::after {
  transform: scaleY(1);
}

.skill-card:hover::before {
  color: var(--accent-2);
  transform: translateX(0.85rem);
}

.skill-card:hover h3,
.skill-card:hover p,
.skill-card:hover .tag-list {
  transform: translateX(0.85rem);
}

.skill-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: transform 0.25s ease;
}

.skill-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  transition: transform 0.25s ease;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  transition: transform 0.25s ease;
}

.tag {
  color: var(--tag-color);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.tag:not(:last-child)::after {
  content: "·";
  color: var(--accent);
  margin: 0 0.55em;
}

/* PROJECTS */
.projects-list {
  display: flex;
  flex-direction: column;
  counter-reset: proj;
  border-top: 1px solid var(--border);
}

.project-card {
  counter-increment: proj;
  position: relative;
  padding: 1.85rem 0.25rem 1.85rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  transition: padding-left 0.25s ease;
}

.project-card:hover {
  padding-left: 1.1rem;
  border-bottom-color: var(--accent);
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.project-meta {
  flex-shrink: 0;
  text-align: right;
}

.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.status-badge::before {
  content: "●";
  margin-right: 0.4em;
  font-size: 0.6em;
  vertical-align: middle;
}

.project-preview-wrap {
  position: relative;
  flex-shrink: 0;
  order: -1;
  width: 128px;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

@media (min-width: 601px) {
  .project-preview-wrap {
    width: 216px;
    margin-left: -2.5rem;
  }
}

.project-preview-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  mix-blend-mode: color;
  opacity: 0.9;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.project-card:hover .project-preview-wrap::after {
  opacity: 0;
}

.project-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(1.05);
  transition: filter 0.35s ease, transform 0.35s ease;
}

.project-card:hover .project-preview {
  filter: grayscale(0) contrast(1) brightness(1);
  transform: scale(1.04);
}

@media (hover: none) {
  .project-card.in-view .project-preview-wrap::after {
    opacity: 0;
  }

  .project-card.in-view .project-preview {
    filter: grayscale(0) contrast(1) brightness(1);
  }
}

@media (max-width: 600px) {
  .project-preview-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

/* CONTACT */
.contact-box {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 3.5rem 3rem;
  text-align: center;
  position: relative;
}

.contact-box h2 {
  color: var(--bg);
  margin-bottom: 0.75rem;
}

.contact-box p {
  color: color-mix(in srgb, var(--bg) 65%, transparent);
  margin-bottom: 1.75rem;
}

.contact-box .btn::before {
  content: "› ";
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer a:hover {
  color: var(--accent);
}

/* IMPRESSUM PAGE */
.impressum-content {
  padding: 4rem 0;
  max-width: 600px;
}

.impressum-content h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.impressum-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}

.impressum-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .project-card {
    flex-direction: column;
    align-items: stretch;
  }
  .project-meta {
    text-align: left;
  }
  .contact-box {
    padding: 2rem 1.25rem;
  }
  nav ul {
    gap: 1rem;
  }
  .divider {
    min-height: 40vh;
    padding: 3rem 0;
  }
}
