/* =========================================================================
   Patrick Heffels — Landing Page
   Fonts: JetBrains Mono (headings) + Inter (body)
   ========================================================================= */

:root {
  --bg:            #ffffff;
  --hero-top:      #f1f1f4;
  --hero-bottom:   #ffffff;
  --ink:           #1d1d1f;   /* Apple near-black */
  --ink-soft:      #2b2b2f;
  --muted:         #86868b;   /* Apple secondary grey */
  --line:          #e7e7ec;
  --accent:        #0a84ff;   /* Apple blue */
  --radius:        40px;
  --maxw:          760px;

  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------- Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, .55rem + 1vw, 1.28rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

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

.nowrap { white-space: nowrap; }

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: .7em 1.2em;
  border-radius: 0 0 12px 0;
  font-family: var(--font-mono);
  font-size: .9rem;
}
.skip-link:focus { left: 0; }

/* ================================ HERO ================================ */
.hero {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-bottom) 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.hero__stage {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  height: clamp(560px, 78vh, 760px);
}

/* Center greeting -------------------------------------------------------- */
.hero__center {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  width: min(94%, 1040px);
  /* The greeting box is wider than its visible text and would otherwise
     sit on top of the side logos, swallowing their hover/click. It holds
     nothing interactive, so let pointer events fall through to the logos. */
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wave {
  display: inline-block;
  font-size: clamp(2.6rem, 1.4rem + 4vw, 4rem);
  transform-origin: 72% 78%;
  animation: wave 2.6s var(--ease) infinite;
  animation-delay: 1s;
  margin-bottom: .1em;
}

.hero__title {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.04;
  /* Fallback size for no-JS; script.js fine-tunes so the longest phrase always fits. */
  font-size: clamp(2.2rem, .8rem + 5.5vw, 4rem);
  color: var(--ink);
}

.hero__hey { display: block; }

.hero__typed-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  max-width: 100%;
}

.hero__typed { white-space: pre; }

/* Blinking typewriter caret */
.caret {
  display: inline-block;
  width: .06em;
  min-width: 3px;
  height: .92em;
  margin-left: .06em;
  background: var(--ink);
  border-radius: 2px;
  transform: translateY(.06em);
  animation: blink 1.05s steps(1) infinite;
}

/* Floating app logos ---------------------------------------------------- */
.logo {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--size, 110px);
  z-index: 2;
}

/* Keyboard focus ring only (mouse clicks stay ring-free) */
.logo:focus { outline: none; }
.logo:focus-visible {
  outline: 3px solid rgba(10, 132, 255, .7);
  outline-offset: 6px;
  border-radius: 16px;
}

/* Base (desktop) positions & sizes — kept in CSS (not inline) so the
   responsive media queries below can override them via the cascade. */
.logo--oben    { --x: 9%;  --y: 12%; --size: 118px; --splash: linear-gradient(160deg, #ffc16b 0%, #e77f1c 55%, #c9640a 100%); }
.logo--magic   { --x: 80%; --y: 10%; --size: 116px; --splash: linear-gradient(160deg, #7b3fb0 0%, #4a1d7a 60%, #2e0f52 100%); }
.logo--popcorn { --x: 8%;  --y: 46%; --size: 116px; --splash: linear-gradient(160deg, #c65ce6 0%, #8a29b8 60%, #5e1785 100%); }
.logo--arrow   { --x: 81%; --y: 44%; --size: 128px; --splash: linear-gradient(160deg, #a6d84f 0%, #6faa1e 55%, #4d8112 100%); }
.logo--avatar  { --y: 71%; --size: 98px; --splash: linear-gradient(160deg, #6cb0ec 0%, #3877c0 60%, #285a97 100%); }

/* The avatar is horizontally centered at the bottom of the hero */
.logo--avatar {
  left: 50%;
  transform: translateX(-50%);
}

.logo__float {
  animation: float var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .18));
  /* Force an own compositing layer so the drop-shadow rasterises against the
     icon's alpha from the first paint. Without this, Chromium/WebKit
     occasionally paints a rectangular "box" shadow that only cleared after a
     repaint (e.g. after opening/closing the overlay). */
  transform: translateZ(0);
  will-change: transform, filter;
  transition: transform .45s var(--ease), filter .45s var(--ease);
  cursor: pointer;
}

.logo img:hover,
.logo:focus-visible img {
  transform: translateZ(0) scale(1.13) rotate(-4deg);
  filter: drop-shadow(0 26px 42px rgba(0, 0, 0, .26));
}

/* Little press feedback on click / tap */
.logo img:active {
  transform: translateZ(0) scale(1.04) rotate(-2deg);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .22));
  transition-duration: .12s;
}

/* =============================== SECTIONS ============================= */
main { display: block; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 2rem + 6vw, 6.5rem) clamp(1.4rem, .5rem + 4vw, 2rem) 0;
}

.section__title {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: clamp(2rem, 1.2rem + 3vw, 3rem);
  margin: 0 0 1.1rem;
  color: var(--ink);
}

.section__lede {
  margin: 0 0 1.6rem;
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(1.15rem, .9rem + .6vw, 1.4rem);
  max-width: 42ch;
}

.section__text {
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.section__signature {
  margin: 1.6rem 0 0;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--muted);
}

.heart { display: inline-block; animation: heartbeat 1.8s ease-in-out infinite; }

/* ------------------------------ Kontakt ------------------------------- */
/* Intro text runs full width (like "Wer ich bin"); below it the contact
   details sit left and the portrait right. A little breathing room is
   added under the section so the address isn't cramped against the footer. */
#kontakt { padding-bottom: clamp(1.6rem, 3vw, 2.6rem); }

.kontakt__row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin-top: clamp(1.8rem, 3vw, 2.6rem);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  align-self: center;   /* centre the short list against the taller portrait */
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--font-mono);
  font-size: clamp(1rem, .7rem + .6vw, 1.15rem);
  font-weight: 500;
}

.contact-list__icon { font-size: 1.15em; width: 1.4em; text-align: center; flex: none; }

.contact-list a {
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }

.kontakt__figure {
  justify-self: center;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, .20));
}

.contact-character {
  width: 100%;
  max-width: 300px;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

/* ================================ FOOTER ============================== */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem clamp(1.4rem, .5rem + 4vw, 2rem) 3rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
}

.footer__line { margin: .2rem 0; }
.footer__line strong { color: var(--ink-soft); font-weight: 600; }
.footer__muted { color: var(--muted); }

.footer__links {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .85rem;
}

.footer__links a {
  color: var(--muted);
  transition: color .25s var(--ease);
}
.footer__links a:hover { color: var(--ink); }
.footer__sep { color: var(--line); }

.footer__credit {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--muted);
}

/* ===================== App-Teaser splash overlay ===================== */
/* Animatable sweep position for the soft diagonal reveal. */
@property --sweep {
  syntax: "<percentage>";
  inherits: false;
  initial-value: -40%;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  color: #fff;
  background: #333; /* replaced per-logo via JS */
  visibility: hidden;
  pointer-events: none;
  /* Colour is introduced by a very soft diagonal gradient edge that sweeps
     from the bottom-left corner up to the top-right (wide feather = ganz weich). */
  --sweep: -40%;
  -webkit-mask-image: linear-gradient(to top right, #000 calc(var(--sweep) - 30%), transparent calc(var(--sweep) + 30%));
          mask-image: linear-gradient(to top right, #000 calc(var(--sweep) - 30%), transparent calc(var(--sweep) + 30%));
  transition: --sweep 1.15s cubic-bezier(.33, 0, .15, 1), visibility 0s linear 1.15s;
}
.splash.is-open {
  visibility: visible;
  pointer-events: auto;
  --sweep: 140%;
  transition: --sweep 1.15s cubic-bezier(.33, 0, .15, 1), visibility 0s;
}

body.splash-open { overflow: hidden; }

.splash__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  transition: background .25s var(--ease), transform .35s var(--ease);
}
.splash__close:hover,
.splash__close:focus-visible { background: rgba(255, 255, 255, .30); transform: rotate(90deg); }
.splash__close svg {
  width: 22px; height: 22px;
  stroke: #fff; stroke-width: 2.4;
  fill: none; stroke-linecap: round;
}

.splash__content {
  max-width: 32ch;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease) .6s, transform .55s var(--ease) .6s;
}
.splash.is-open .splash__content { opacity: 1; transform: none; }

.splash__title {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem);
  margin: 0 0 1rem;
  text-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.splash__text {
  font-size: clamp(1.1rem, .9rem + .6vw, 1.4rem);
  line-height: 1.55;
  margin: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .16);
}

/* ========================= LEGAL SUB-PAGES =========================== */
.legal {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 1.5rem + 5vw, 5rem) clamp(1.4rem, .5rem + 4vw, 2rem) 4rem;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color .25s var(--ease), gap .25s var(--ease);
}
.legal__back:hover { color: var(--ink); gap: .8rem; }

.legal h1 {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: clamp(2rem, 1.2rem + 3vw, 3rem);
  margin: 0 0 1.5rem;
}

.legal h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 2.4rem 0 .6rem;
}

.legal p, .legal li { color: var(--ink-soft); max-width: 68ch; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }

.legal__note {
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--hero-top);
  color: var(--muted);
  font-size: .9rem;
}

/* ============================= ANIMATIONS ============================= */
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
  45% { transform: scale(1.14); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================ RESPONSIVE ============================== */
@media (max-width: 720px) {
  .hero__stage { height: clamp(500px, 78vh, 600px); }

  .hero__center { top: 37%; }

  /* On mobile the greeting spans nearly the full width, so the four app
     logos sit in the top corners and a bottom row flanking the avatar —
     never in the greeting's vertical band. */
  .logo { width: var(--size-m, 66px); }
  .logo--oben    { --x: 5%;  --y: 6%;  }
  .logo--magic   { --x: 74%; --y: 5%;  }
  .logo--popcorn { --x: 5%;  --y: 62%; }
  .logo--arrow   { --x: 74%; --y: 62%; }
  .logo--avatar  { --y: 82%; width: 74px; }

  .kontakt__row {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .contact-list { align-self: start; }
  .kontakt__figure { justify-self: center; max-width: 240px; margin-top: 1.5rem; }
  .contact-list li { font-size: 1rem; }
}

@media (max-width: 460px) {
  .logo--oben    { --size-m: 60px; }
  .logo--magic   { --size-m: 58px; }
  .logo--popcorn { --size-m: 58px; }
  .logo--arrow   { --size-m: 64px; }
}

/* Larger logos on wide screens */
@media (min-width: 1024px) {
  .logo--oben    { --size: 132px; }
  .logo--magic   { --size: 128px; }
  .logo--popcorn { --size: 128px; }
  .logo--arrow   { --size: 144px; }
  .logo--avatar  { --size: 108px; }
}

/* ===================== Reduced-motion (accessibility) ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave,
  .logo__float,
  .heart,
  .caret { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret { opacity: 1; }
  .splash, .splash__content, .splash__close { transition: none !important; }
  .splash__content { transform: none; }
  .splash { -webkit-mask-image: none !important; mask-image: none !important; }
}
