:root {
  --bg: #0a0a0b;
  --fg: #f2f2f2;
  --body-text: #c2c2c2;
  --muted: #9a9a9a;
  --muted-light: #6e6e6e;
  --border: rgba(255, 255, 255, 0.12);
  --border2: rgba(255, 255, 255, 0.16);
  --surface: rgba(255, 255, 255, 0.05);
  --accent-1: #7c8cff;
  --accent-2: #ff8fc7;
  --accent-3: #6be3d6;
  --accent-btn: #5865f2;
}

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

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  position: relative;
  opacity: 0;
  animation: page-in 0.5s ease forwards;
}

@keyframes page-in { to { opacity: 1; } }

/* The language switch itself fades rather than snapping: script.js adds this
   class for one short transition, swaps the text while invisible, then
   removes it. */
body.lang-fade { transition: opacity 0.14s ease; opacity: 0.25; }

@media (prefers-reduced-motion: reduce) {
  body { opacity: 1; animation: none; }
  body.lang-fade { transition: none; }
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
ul { list-style: none; }

/* Language switching: both languages live in the DOM, CSS hides the inactive one */
html[data-lang="de"] [data-lang="en"],
html[data-lang="en"] [data-lang="de"] { display: none !important; }

/* Animated background */
.bg-anim { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.orb {
  position: absolute; width: 46vw; height: 46vw; max-width: 560px; max-height: 560px;
  border-radius: 50%; filter: blur(90px); opacity: 0.28; will-change: transform;
}
.orb-1 { top: -10%; left: -10%; background: var(--accent-1); animation: float-1 22s ease-in-out infinite; }
.orb-2 { top: 20%; right: -15%; background: var(--accent-2); animation: float-2 26s ease-in-out infinite; }
.orb-3 { bottom: -15%; left: 25%; background: var(--accent-3); animation: float-3 30s ease-in-out infinite; }

@keyframes float-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw,10vh) scale(1.15); } }
@keyframes float-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-10vw,8vh) scale(1.1); } }
@keyframes float-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw,-8vh) scale(1.2); } }

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(128,128,128,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128,128,128,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 40%, transparent 90%);
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  html { scroll-behavior: auto; }
}

main, .footer, .topbar-inner { max-width: 880px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }

main {
  position: relative; margin-top: 24px; margin-bottom: 24px; border-radius: 28px;
  background: rgba(255,255,255,0.035); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 40px 80px -40px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 8px; font-size: 14px;
}
.skip-link:focus { left: 24px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,11,0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a { font-size: 14px; color: var(--muted); transition: color 0.2s ease; }
.topbar nav a:hover, .topbar nav a[aria-current="true"] { color: var(--fg); }
@media (max-width: 560px) { .nav-link-hideable { display: none; } }

.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 9999px; overflow: hidden; background: var(--surface); }
.lang-toggle button {
  font: inherit; font-size: 12px; font-weight: 500; letter-spacing: 0.4px; padding: 5px 11px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-toggle button:hover { color: var(--fg); }
.lang-toggle button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Hero */
.hero { padding-top: 88px; padding-bottom: 64px; }
@media (min-width: 640px) { .hero { padding-top: 140px; padding-bottom: 112px; } }

.eyebrow { font-size: 14px; font-weight: 400; color: var(--muted); margin-bottom: 24px; }

.hero-headline { display: flex; align-items: center; gap: 40px; }
.hero-headline > div:first-child { min-width: 0; }

.hero h1 { font-size: 36px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; max-width: 640px; }
@media (min-width: 640px) { .hero h1 { font-size: 48px; } }

/* A solid card frames the portrait: an actual opaque colour, not the
   translucent var(--surface) tint used for smaller list cards, and enough
   padding that the card itself reads as the dominant shape, with the photo
   sitting inside it rather than the photo with a thin decorative edge. */
.hero-portrait-wrap {
  flex: none;
  padding: 32px;
  border-radius: 28px;
  background: #1a1a1f;
  border: 1px solid var(--border2);
  box-shadow: 0 26px 55px -22px rgba(0,0,0,0.7);
}

.hero-portrait {
  display: block; width: 200px; height: 213px; border-radius: 14px; object-fit: cover; object-position: 50% 15%;
}
@media (min-width: 900px) { .hero-portrait { width: 240px; height: 256px; } }
@media (max-width: 620px) {
  .hero-headline { flex-direction: column; align-items: flex-start; gap: 28px; }
  .hero-portrait-wrap { order: -1; padding: 22px; border-radius: 22px; }
  .hero-portrait { width: 150px; height: 160px; border-radius: 12px; }
}

.hero-sub { margin-top: 32px; max-width: 520px; font-size: 18px; line-height: 32px; color: var(--muted); }
.hero-actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }

.btn, .btn-ghost {
  display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 9999px;
  font-size: 14px; font-weight: 500; transition: all 0.2s ease;
}
.btn { background: var(--accent-btn); color: #fff; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--fg); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border2); transform: translateY(-1px); }

.stats { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--border); display: grid; gap: 28px 32px; grid-template-columns: repeat(2,minmax(0,1fr)); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.stats dt { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; color: var(--fg); }
@media (min-width: 640px) { .stats dt { font-size: 34px; } }
.stats dd { margin-top: 8px; font-size: 14px; line-height: 21px; color: var(--muted); }

/* Sections */
.block { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--border); }
.contact { padding-top: 88px; padding-bottom: 88px; border-top: 1px solid var(--border); }

.block h2, .contact h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.35; max-width: 580px; margin-bottom: 40px; }
@media (min-width: 640px) { .block h2, .contact h2 { font-size: 30px; } }
.contact h2 { margin-bottom: 32px; }

.body-text { font-size: 18px; line-height: 32px; color: var(--body-text); max-width: 640px; margin-bottom: 20px; }
.body-text:last-child { margin-bottom: 0; }

.tag { display: block; font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-light); margin-bottom: 4px; }

.focus-list, .work-list { display: flex; flex-direction: column; gap: 32px; }
.focus-list li p { font-size: 16px; line-height: 26px; color: var(--body-text); max-width: 560px; }
.work-list li h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.025em; line-height: 28px; margin-bottom: 6px; }
.work-list li p { margin-top: 8px; font-size: 16px; line-height: 26px; color: var(--body-text); max-width: 580px; }

.skill-groups { display: grid; gap: 28px; }
@media (min-width: 640px) { .skill-groups { grid-template-columns: 1fr 1fr; gap: 32px 40px; } }
.skill-groups h3 { font-size: 14px; font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted-light); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 14px; line-height: 1; padding: 8px 13px; border: 1px solid var(--border); border-radius: 9999px; background: var(--surface); transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease; }
.chip:hover { border-color: var(--border2); background: rgba(255,255,255,0.08); transform: translateY(-1px); }

.case-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .case-grid { grid-template-columns: 1fr 1fr; } }
.case-card {
  display: block; padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.case-card:hover { transform: translateY(-2px); border-color: rgba(128,128,128,0.4); box-shadow: 0 18px 40px -24px rgba(0,0,0,0.5); }
.case-card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 10px; }
.case-card p { font-size: 15px; line-height: 24px; color: var(--body-text); margin-bottom: 16px; }
.read-more { font-size: 13px; font-weight: 600; color: var(--accent-btn); }

.contact-grid { display: grid; gap: 20px 32px; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); padding: 28px 0; margin-bottom: 32px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.contact-grid dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-light); margin-bottom: 6px; }
.contact-grid dd { font-size: 16px; line-height: 26px; color: var(--fg); overflow-wrap: anywhere; }
.contact-wide { grid-column: 1 / -1; }
.contact-wide dd { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 400px) { .contact-wide dd { font-size: 14px; } }
.contact-grid dd a { border-bottom: 1px solid var(--border); }
.contact-grid dd a:hover { border-bottom-color: var(--fg); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.footer {
  padding: 48px 28px 40px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 28px;
  font-size: 14px; color: var(--muted);
}
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 40px; }
.footer-brand { max-width: 360px; }
.footer-brand .brand { display: inline-block; margin-bottom: 8px; }
.footer-brand p { font-size: 14px; line-height: 22px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 32px; }
.footer-links h4 { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-light); margin-bottom: 12px; }
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--fg); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-light); }
.footer a:hover { color: var(--fg); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { transition: none; } }

/* Case study pages */
.case-head { padding-top: 72px; padding-bottom: 48px; }
@media (min-width: 640px) { .case-head { padding-top: 104px; padding-bottom: 64px; } }
.back-link { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 32px; transition: color 0.2s ease; }
.back-link:hover { color: var(--fg); }
.case-head h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; max-width: 640px; }
@media (min-width: 640px) { .case-head h1 { font-size: 42px; } }
.case-lede { margin-top: 24px; max-width: 600px; font-size: 18px; line-height: 30px; color: var(--muted); }

.case-section { padding: 40px 0; border-top: 1px solid var(--border); }
.case-section h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 24px; }
.prose p { font-size: 17px; line-height: 30px; color: var(--body-text); max-width: 660px; margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose a.ext { color: var(--accent-btn); border-bottom: 1px solid rgba(88,101,242,0.3); }

.bullets { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.bullets li { position: relative; padding-left: 22px; font-size: 17px; line-height: 30px; color: var(--body-text); }
.bullets li::before { content: ''; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-btn); }
.bullets li strong { color: var(--fg); }

.case-figure { margin: 44px auto 0; max-width: 860px; width: 100%; text-align: center; }
.case-figure a { display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); line-height: 0; transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s ease, box-shadow 0.25s ease; }
.case-figure a:hover { transform: translateY(-2px); border-color: rgba(128,128,128,0.4); box-shadow: 0 18px 40px -22px rgba(0,0,0,0.5); }
.case-figure img { display: block; width: 100%; height: auto; }
.case-figure figcaption { text-align: left; margin-top: 14px; font-size: 14px; line-height: 23px; color: var(--muted); }
.figcaption-hint { color: var(--muted-light); }

.lightbox { border: 0; padding: 0; background: transparent; overflow: visible; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; display: none; align-items: center; justify-content: center; }
.lightbox[open] { display: flex; animation: lightbox-in 0.22s cubic-bezier(0.22,1,0.36,1); }
@keyframes lightbox-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } }
.lightbox::backdrop { background: rgba(0,0,0,0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox-img { display: block; max-width: 94vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9); }
.lightbox-close { position: fixed; top: 18px; right: 20px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font: inherit; font-size: 26px; line-height: 1; color: #fff; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; cursor: pointer; transition: background 0.2s ease; }
.lightbox-close:hover { background: rgba(255,255,255,0.26); }

/* Work page */
.work-card {
  display: block; padding: 26px 28px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  max-width: 620px; transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.work-card:hover { transform: translateY(-2px); border-color: rgba(128,128,128,0.4); box-shadow: 0 18px 40px -24px rgba(0,0,0,0.5); }
.work-card-platform { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted-light); margin-bottom: 6px; }
.work-card-handle { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }
.work-card-text { display: block; font-size: 16px; line-height: 26px; color: var(--body-text); }
.work-card-cta { display: block; margin-top: 16px; font-size: 14px; color: var(--muted); }
.work-card:hover .work-card-cta { color: var(--fg); }

/* --- Broader animation coverage ---
   Children of an already-.reveal container fade/rise in their own right once
   the parent becomes .is-visible, staggered by nth-child. Pure CSS: no new
   elements or JS observer targets needed, so this is safe to layer on top of
   the existing reveal system without touching page markup. */
.bullets.reveal li,
.contact-grid.reveal > div,
.skill-groups > .reveal .chip {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.bullets.reveal.is-visible li,
.contact-grid.reveal.is-visible > div,
.skill-groups > .reveal.is-visible .chip {
  opacity: 1;
  transform: translateY(0);
}
/* The footer sits outside the scroll-reveal system (it is always near the
   bottom of a short page, so there is little to reveal), it only gets a
   plain hover transition. */
.footer-links ul li { transition: color 0.2s ease; }

.bullets.reveal li:nth-child(1), .contact-grid.reveal.is-visible > div:nth-child(1), .skill-groups > .reveal.is-visible .chip:nth-child(1) { transition-delay: 0.02s; }
.bullets.reveal li:nth-child(2), .contact-grid.reveal.is-visible > div:nth-child(2), .skill-groups > .reveal.is-visible .chip:nth-child(2) { transition-delay: 0.07s; }
.bullets.reveal li:nth-child(3), .contact-grid.reveal.is-visible > div:nth-child(3), .skill-groups > .reveal.is-visible .chip:nth-child(3) { transition-delay: 0.12s; }
.bullets.reveal li:nth-child(4), .contact-grid.reveal.is-visible > div:nth-child(4), .skill-groups > .reveal.is-visible .chip:nth-child(4) { transition-delay: 0.17s; }
.bullets.reveal li:nth-child(5), .contact-grid.reveal.is-visible > div:nth-child(5), .skill-groups > .reveal.is-visible .chip:nth-child(5) { transition-delay: 0.22s; }
.bullets.reveal li:nth-child(6), .skill-groups > .reveal.is-visible .chip:nth-child(6) { transition-delay: 0.27s; }
.bullets.reveal li:nth-child(n+7), .skill-groups > .reveal.is-visible .chip:nth-child(n+7) { transition-delay: 0.32s; }

/* Small interactive lift on more elements */
.work-list li h3 a, .prose a.ext { transition: color 0.2s ease, border-bottom-color 0.2s ease; }
.tag { transition: color 0.2s ease; }
.stats dt { transition: color 0.3s ease; }
.case-head h1, .hero h1 { transition: color 0.3s ease; }

/* Nav link underline sweeps in on hover instead of an instant color snap */
.topbar nav a:not(.lang-toggle button) {
  position: relative;
}
.topbar nav a:not(.lang-toggle button)::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: -4px;
  height: 1px;
  background: currentColor;
  transition: right 0.25s cubic-bezier(0.22,1,0.36,1);
}
.topbar nav a:not(.lang-toggle button):hover::after,
.topbar nav a[aria-current="true"]::after { right: 0; }

@media (prefers-reduced-motion: reduce) {
  .bullets.reveal li,
  .contact-grid.reveal > div,
  .skill-groups > .reveal .chip { opacity: 1; transform: none; transition: none; }
}
