/* ── Reset & Root ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #000000;
  --text:       #FFFFFF;
  --accent:     #FF5C00;
  --rule:       rgba(255, 255, 255, 0.10);
  --c-dim-1:    rgba(255, 255, 255, 0.65);
  --c-dim-2:    rgba(255, 255, 255, 0.45);
  --c-dim-3:    rgba(255, 255, 255, 0.32);
  --c-dim-4:    rgba(255, 255, 255, 0.18);
  --backdrop:   rgba(0, 0, 0, 0.55);
  --rule-faint: rgba(255, 255, 255, 0.07);
}

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Film grain noise overlay ─────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ── Preloader ────────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s;
}

#preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-text {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.02em;
  animation: preloaderPulse 1.2s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.97); }
  50%       { opacity: 1;    transform: scale(1); }
}

/* ── Custom cursor ────────────────────────────────────────────── */
@media (pointer: coarse) {
  .cursor-dot { display: none !important; }
  * { cursor: auto !important; }
}

@media (pointer: fine) {
  * { cursor: none !important; }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.22s ease, height 0.22s ease,
                background 0.22s ease, opacity 0.22s ease;
    mix-blend-mode: difference;
  }

  .cursor-dot.is-hover {
    width: 44px;
    height: 44px;
    background: var(--accent);
    mix-blend-mode: normal;
    opacity: 0.25;
  }

  .cursor-dot.is-click {
    width: 14px;
    height: 14px;
    opacity: 0.8;
  }

}

/* ── WebGL Canvas ─────────────────────────────────────────────── */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Fallback gradient shown when WebGL isn't available */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 65% 50%, rgba(80, 30, 0, 0.5) 0%, rgba(30, 0, 60, 0.3) 40%, #000 70%);
  z-index: 0;
  pointer-events: none;
}

/* ── Content Layer ────────────────────────────────────────────── */
#content {
  position: relative;
  z-index: 1;
}

/* ── Scroll Progress ──────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  height: 100px;
  width: 1px;
  background: var(--rule-faint);
  z-index: 50;
}
#scroll-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--accent);
  height: var(--progress, 0%);
  transition: height 0.1s linear;
}

/* ── Navigation ───────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  mix-blend-mode: difference;
}

.nav-logo {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

#lang-toggle {
  background: transparent;
  border: 1px solid var(--c-dim-4);
  color: var(--text);
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}

#lang-toggle:hover {
  border-color: var(--c-dim-1);
}

/* ── Hero ─────────────────────────────────────────────────────── */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 40px 60px;
}

#hero::after {
  content: '2026';
  position: absolute;
  top: 50%;
  right: 32px;
  bottom: auto;
  left: auto;
  transform: translateY(calc(-50% + var(--watermark-y, 0px)));
  font-size: clamp(4rem, 8vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--c-dim-4);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  font-family: 'Inter', system-ui, sans-serif;
  transition: transform 0s;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
}

.hero-name {
  font-size: clamp(4rem, 2rem + 8vw, 12rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 120px rgba(0, 0, 0, 0.8);
}

.hero-roles {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-role-line {
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 400;
  color: var(--c-dim-1);
  letter-spacing: 0.02em;
}

.hero-role-divider {
  color: var(--accent);
  font-weight: 300;
  opacity: 0.7;
  line-height: 1;
}

.hero-loc {
  font-size: 0.75rem;
  color: var(--c-dim-3);
  margin-top: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--c-dim-2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00FF41;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

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

.scroll-hint {
  position: absolute;
  bottom: 40px;
  right: 40px;
  font-size: 0.75rem;
  color: var(--c-dim-2);
  letter-spacing: 0.15em;
  text-transform: lowercase;
  animation: fadeUpDown 2.5s ease-in-out infinite;
}

@keyframes fadeUpDown {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 0.7; transform: translateY(4px); }
}

/* ── Section shared ───────────────────────────────────────────── */
section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
}

.section-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 40px;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-dim-3);
  margin-bottom: 60px;
}

/* ── About ────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-statement {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.about-right {
  display: flex;
  flex-direction: column;
}

.about-para {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--c-dim-1);
}

.stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  display: block;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--c-dim-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

/* ── Work ─────────────────────────────────────────────────────── */
.work-list {
  display: flex;
  flex-direction: column;
  max-width: 55%;
}

.work-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.work-item:first-child {
  border-top: 1px solid var(--rule);
}

/* Clickable items hover */
.work-item:not(.work-item--soon):not(.work-item--live):hover {
  opacity: 0.82;
}

.work-item:not(.work-item--soon):not(.work-item--live):hover .work-num {
  color: var(--accent);
}

.work-item:not(.work-item--soon):not(.work-item--live):hover h2 {
  color: var(--accent);
}

.work-item:not(.work-item--soon):not(.work-item--live):hover .work-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.work-num {
  font-size: 0.75rem;
  color: var(--c-dim-3);
  min-width: 30px;
  font-weight: 300;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.work-info {
  flex: 1;
}

.work-info h2 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  transition: color 0.3s ease;
}

.work-info p {
  font-size: 0.85rem;
  color: var(--c-dim-2);
  margin-top: 4px;
  font-weight: 300;
}

.work-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--c-dim-4);
  flex-shrink: 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

/* CTO / role badge */
.work-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  margin-left: 12px;
  vertical-align: middle;
  border-radius: 2px;
  opacity: 0.85;
  transition: opacity 0.3s;
}

/* Soon (placeholder) */
.work-item--soon {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.work-soon {
  margin-left: auto;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 4px 10px;
  flex-shrink: 0;
}

/* Live (in production) */
.work-item--live {
  pointer-events: none; /* no link available */
}

.work-status-live {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00FF41;
}

.work-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00FF41;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

/* ── Contact ──────────────────────────────────────────────────── */
.contact-headline {
  font-size: clamp(3rem, 6vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 60px;
}

.accent {
  color: var(--accent);
}

/* Form */
.contact-form {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-dim-3);
  font-weight: 400;
  transition: color 0.3s ease;
}

.form-field:focus-within label {
  color: var(--accent);
}

input,
textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-dim-4);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 300;
  padding: 12px 0;
  width: 100%;
  outline: none;
  transition: border-bottom-color 0.3s ease;
  caret-color: var(--accent);
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--c-dim-4);
}

input:focus,
textarea:focus {
  border-bottom-color: var(--accent);
}

.form-submit {
  align-self: flex-start;
  position: relative;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 16px 40px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
  z-index: 2;
}

.form-submit:hover {
  opacity: 0.9;
}

.form-submit:active {
  transform: scale(0.97) !important;
  opacity: 1;
}

/* Contact email */
.contact-email {
  display: block;
  font-size: clamp(1.5rem, 3vw, 3rem);
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
  margin: 48px 0;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

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

/* Footer row */
.contact-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
  gap: 16px;
}

.socials {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.socials a {
  color: var(--c-dim-2);
  text-decoration: none;
  font-size: 0.85rem;
  margin-right: 24px;
  font-weight: 300;
  transition: color 0.3s ease;
}

.socials a:last-child {
  margin-right: 0;
}

.socials a:hover {
  color: var(--text);
}

.copyright {
  font-size: 0.75rem;
  color: var(--c-dim-4);
}

/* ── Section readability backdrop ────────────────────────────── */
#about .section-inner,
#work .section-inner,
#contact .section-inner {
  position: relative;
}

#about .section-inner::before,
#work .section-inner::before,
#contact .section-inner::before {
  content: '';
  position: absolute;
  inset: -40px -60px;
  background: radial-gradient(ellipse at center, var(--backdrop) 0%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

/* ── Mobile Responsive ────────────────────────────────────────── */

/* Tablet: scroll-progress dezenter */
@media (max-width: 900px) and (min-width: 601px) {
  #scroll-progress { right: 16px; height: 60px; opacity: 0.5; }
}

@media (max-width: 768px) {
  #nav { padding: 16px 24px; }

  /* Touch-Targets vergrößern */
  .nav-logo { padding: 12px 8px; margin: -12px -8px; min-width: 44px; }
  #lang-toggle { padding: 10px 16px; min-height: 44px; display: flex; align-items: center; }

  #hero { padding: 0 24px 48px; }

  .scroll-hint { right: 24px; bottom: 24px; }

  .section-inner { padding: 80px 24px; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }

  .about-statement { font-size: clamp(2rem, 8vw, 3rem); }

  .stats { gap: 24px; }

  .stat-num { font-size: 2.25rem; }

  .form-row { grid-template-columns: 1fr; }

  .contact-headline { font-size: clamp(2.5rem, 10vw, 4rem); }

  .contact-footer { flex-direction: column; align-items: flex-start; gap: 20px; }

  .socials a { margin-right: 16px; padding: 12px 0; min-width: 44px; }

  .contact-email { padding: 8px 0; }

  .work-list { max-width: 100%; }

  .copyright { color: rgba(255, 255, 255, 0.35); }

  /* Backdrop-Insets reduzieren gegen Overflow */
  #about .section-inner::before,
  #work .section-inner::before,
  #contact .section-inner::before { inset: -20px 0; }

  /* Sections ohne unnötigen Leerraum */
  #about, #work, #contact { min-height: auto; }

  /* Film-Grain auf Mobile ausblenden (GPU sparen) */
  body::after { display: none; }
}

/* Phone-spezifische Anpassungen */
@media (max-width: 600px) {
  #scroll-progress { display: none; }
}

@media (max-width: 480px) {
  .hero-name { font-size: clamp(3.5rem, 16vw, 6rem); }

  /* Hero-Roles vertikal statt inline */
  .hero-roles { flex-direction: column; gap: 4px; align-items: flex-start; }
  .hero-role-divider { display: none; }

  .stats { flex-direction: column; gap: 20px; }

  /* Hero kompakter */
  #hero { padding: 0 20px 40px; }
  .hero-status { margin-top: 14px; }
  .hero-loc { margin-top: 6px; }
  .scroll-hint { right: 20px; bottom: 20px; }

  /* Watermark dezenter */
  #hero::after { font-size: 3rem; right: 16px; opacity: 0.08; }

  /* Sections kompakter */
  .section-inner { padding: 60px 20px; }
  .section-label { margin-bottom: 36px; font-size: 0.75rem; }

  /* Work-Items lesbar + 320px-safe */
  .work-info h2 { font-size: 1.05rem; }
  .work-info p { font-size: 0.8rem; }
  .work-item { padding: 22px 0; gap: 16px; flex-wrap: wrap; }
  .work-badge { font-size: 0.65rem; margin-left: 8px; padding: 2px 6px; }
  .work-status-live { font-size: 0.7rem; gap: 5px; width: auto; margin-left: 46px; margin-top: -4px; }

  /* Contact atmen lassen */
  .contact-headline { font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; margin-bottom: 40px; }
  .contact-form { gap: 24px; }
  .form-field { gap: 6px; }
  label { font-size: 0.8rem; }

  /* Footer kompakter */
  .contact-email { font-size: clamp(1.1rem, 5vw, 1.8rem); margin: 32px 0; }
  .socials a { font-size: 0.8rem; margin-right: 14px; }
}

/* ── Selection colour ─────────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: #000;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--c-dim-4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-dim-3); }

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
