/* ============================================================
   marcfraedrich.de — cinematic dark theme
   ============================================================ */

:root {
  --bg: #07090d;
  --bg-panel: rgba(13, 18, 26, 0.72);
  --line: rgba(120, 180, 255, 0.14);
  --text: #dbe6f4;
  --text-dim: #8494ab;
  --accent: #00e0ff;
  --accent-soft: rgba(0, 224, 255, 0.14);
  --accent2: #7c5cff;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: none;
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

::selection { background: var(--accent); color: #04141a; }

/* ============ BACKGROUND LAYERS ============ */

#bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(124, 92, 255, 0.08), transparent 60%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

/* ============ LOADER ============ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.done { opacity: 0; visibility: hidden; }

.loader-inner { text-align: center; width: min(420px, 80vw); }

.loader-logo {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 224, 255, 0.55);
  margin-bottom: 1.5rem;
}

.blink { animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.loader-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  min-height: 1.2em;
}

.loader-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.2s ease;
}

.loader-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 0.6rem;
  letter-spacing: 0.2em;
}

.loader-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 224, 255, 0.45);
}
.loader-corner.tl { top: 22px; left: 22px; border-right: none; border-bottom: none; }
.loader-corner.tr { top: 22px; right: 22px; border-left: none; border-bottom: none; }
.loader-corner.bl { bottom: 22px; left: 22px; border-right: none; border-top: none; }
.loader-corner.br { bottom: 22px; right: 22px; border-left: none; border-top: none; }

/* ============ CURSOR ============ */

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 99;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(0, 224, 255, 0.5);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.cursor-ring.hovering {
  width: 56px; height: 56px;
  border-color: var(--accent);
  background: rgba(0, 224, 255, 0.08);
}

/* ============ NAV ============ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--text);
  text-decoration: none;
}
.nav-logo-mark { color: var(--accent); }

.nav-links {
  display: flex;
  gap: clamp(0.8rem, 2.5vw, 2.2rem);
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.25s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-num { color: var(--accent); opacity: 0.6; margin-right: 0.15rem; }

.nav-cta {
  border: 1px solid var(--accent);
  padding: 0.45rem 1rem;
  color: var(--accent) !important;
  transition: background 0.25s, box-shadow 0.25s !important;
}
.nav-cta:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(0, 224, 255, 0.35);
}

@media (max-width: 640px) {
  .nav { padding: 0.8rem 1rem; }
  .nav-logo { font-size: 0.72rem; letter-spacing: 0.12em; }
  .nav-links a:not(.nav-cta) .nav-num { display: none; }
  .nav-links { gap: 0.7rem; }
  .nav-links a { font-size: 0.64rem; letter-spacing: 0.1em; }
  .nav-cta { padding: 0.35rem 0.6rem; }
  .hero-hud-right { display: none; }
}

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5.5rem clamp(1.2rem, 5vw, 4rem) 2rem;
}

.hero-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.hero-center {
  text-align: center;
  padding: 2rem 0;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.hero-name {
  font-size: clamp(2.6rem, 9.5vw, 7.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  position: relative;
}

.hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotateX(60deg);
  animation: charIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 55ms + 0.35s);
}
@keyframes charIn {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* glitch flicker overlay */
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch.glitching::before {
  opacity: 0.75;
  color: var(--accent);
  transform: translate(-3px, -2px);
  clip-path: inset(20% 0 55% 0);
  animation: glitchShift 0.18s steps(2) infinite;
}
.glitch.glitching::after {
  opacity: 0.75;
  color: var(--accent2);
  transform: translate(3px, 2px);
  clip-path: inset(60% 0 15% 0);
  animation: glitchShift 0.22s steps(2) infinite reverse;
}
@keyframes glitchShift {
  0% { clip-path: inset(15% 0 60% 0); }
  50% { clip-path: inset(55% 0 20% 0); }
  100% { clip-path: inset(30% 0 40% 0); }
}

.hero-sub {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  letter-spacing: 0.12em;
  color: var(--text-dim);
  min-height: 1.8em;
}
.hero-sub-static { color: var(--accent); margin-right: 0.5rem; }
.hero-sub-type { color: var(--text); }
.caret { color: var(--accent); animation: blink 0.9s steps(2) infinite; }

.hero-actions {
  margin-top: 2.6rem;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  position: relative;
  transition: color 0.3s, box-shadow 0.3s, background 0.3s;
  display: inline-block;
}
.btn-primary {
  background: var(--accent-soft);
}
.btn:hover {
  background: var(--accent);
  color: #04141a;
  box-shadow: 0 0 28px rgba(0, 224, 255, 0.5);
}
.btn-ghost { border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 18px rgba(0, 224, 255, 0.25);
}
.btn-arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
}
.scroll-hint-bar {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* HUD corners (shared) */
.hud-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 224, 255, 0.4);
  pointer-events: none;
}
.hud-corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.hud-corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.hud-corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.hud-corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

.hero > .hud-corner.tl, .hero > .hud-corner.tr { top: 76px; }

/* ============ MARQUEE ============ */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  background: rgba(10, 14, 20, 0.5);
}
.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--text-dim);
}
.marquee-track span { flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ SECTIONS ============ */

.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 9rem) clamp(1.2rem, 5vw, 3rem) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}
.section-title {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.accent { color: var(--accent); }
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  align-self: center;
}

/* ============ ABOUT ============ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait-wrap { max-width: 340px; margin: 0 auto; }
}

.portrait-wrap { perspective: 900px; }

.portrait-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 10px;
}

.portrait-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.85) contrast(1.05);
}

.portrait-overlay {
  position: absolute;
  inset: 10px;
  background:
    linear-gradient(to top, rgba(7, 9, 13, 0.55), transparent 40%),
    linear-gradient(120deg, rgba(0, 224, 255, 0.12), transparent 45%, rgba(124, 92, 255, 0.12));
  mix-blend-mode: normal;
  pointer-events: none;
}

.portrait-hud {
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.8rem;
  pointer-events: none;
}
.portrait-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  background: rgba(7, 9, 13, 0.7);
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(0, 224, 255, 0.3);
}

.big-text {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.55;
  margin-bottom: 1.4rem;
}
.about-text p:not(.big-text) {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

/* stats */
.stats { display: grid; gap: 1.1rem; }
.stat-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.stat-val { color: var(--accent); }
.stat-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 10px rgba(0, 224, 255, 0.6);
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.in-view .stat-fill { width: var(--w); }

/* ============ CARDS ============ */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  padding: 2.2rem 1.8rem;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 224, 255, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 224, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 224, 255, 0.12);
}

.card-icon { font-size: 1.8rem; margin-bottom: 1.1rem; }
.card h3 {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}
.card p { color: var(--text-dim); font-size: 0.92rem; }
.card-num {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(0, 224, 255, 0.45);
  letter-spacing: 0.15em;
}

/* ============ TIMELINE ============ */

.timeline {
  border-left: 1px solid var(--line);
  margin-left: 0.4rem;
  padding-left: clamp(1.4rem, 4vw, 2.6rem);
  display: grid;
  gap: 2.6rem;
}

.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.4rem, 4vw, 2.6rem) - 5.5px);
  top: 0.45em;
  width: 10px;
  height: 10px;
  background: var(--bg);
  border: 2px solid var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(0, 224, 255, 0.6);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  color: var(--accent);
}
.timeline-body h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}
.timeline-body p { color: var(--text-dim); font-size: 0.95rem; max-width: 56ch; }

/* ============ CONTACT ============ */

.section-contact { padding-bottom: clamp(4rem, 10vh, 7rem); }

.contact-inner {
  text-align: center;
  padding: clamp(2rem, 6vh, 4rem) 1rem;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  position: relative;
}

.contact-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

.contact-mail {
  display: inline-block;
  font-size: clamp(1.2rem, 4.5vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.3s, text-shadow 0.3s;
  word-break: break-all;
}
.contact-mail:hover {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 224, 255, 0.55);
}
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.contact-mail:hover::after { transform: scaleX(1); }

.contact-note {
  margin-top: 1.6rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ============ FOOTER ============ */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.footer-mid { color: rgba(0, 224, 255, 0.5); }

/* ============ REVEAL ANIMATIONS ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.cards .reveal:nth-child(2) { transition-delay: 0.12s; }
.cards .reveal:nth-child(3) { transition-delay: 0.24s; }

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-name .char { opacity: 1; transform: none; }
  .in-view .stat-fill, .stat-fill { width: var(--w); }
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}
