:root{
  --bg0:#0a0a0c; --bg1:#060607;
  --fg:#e9e7e2;
  --dim:rgba(233,231,226,.42);
  --line:rgba(233,231,226,.14);
  --accent:#d8c08d;
  --glow:rgba(233,231,226,.05);
  --grid:rgba(233,231,226,.055);
  --surface-1:rgba(233,231,226,.035);
  --surface-2:rgba(233,231,226,.13);
  --surface-3:rgba(233,231,226,.42);
  --faint:rgba(233,231,226,.26);
  --glow-gold:rgba(216,192,141,.5);
  --glow-white:rgba(233,231,226,.26);
  --accent-dim:rgba(216,192,141,.4);
  --accent-bright:rgba(244,238,224,.95);
}
body.invert{
  --bg0:#f4f1ea; --bg1:#e9e6de;
  --fg:#16150f;
  --dim:rgba(22,21,15,.5);
  --line:rgba(22,21,15,.16);
  --accent:#8a6a1c;
  --glow:rgba(22,21,15,.06);
  --grid:rgba(22,21,15,.09);
  --surface-1:rgba(22,21,15,.045);
  --surface-2:rgba(22,21,15,.16);
  --surface-3:rgba(22,21,15,.45);
  --faint:rgba(22,21,15,.28);
  --glow-gold:rgba(138,106,28,.42);
  --glow-white:rgba(22,21,15,.16);
  --accent-dim:rgba(138,106,28,.5);
  --accent-bright:rgba(22,21,15,.9);
}

*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; }
body{
  background:
    radial-gradient(1000px 680px at 50% 38%, var(--glow), transparent 62%),
    var(--bg0);
  color:var(--fg);
  font-family:"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  overflow:hidden;
  user-select:none;
  -webkit-user-select:none;
}
body::before{
  content:''; position:fixed; inset:0; z-index:0;
  pointer-events:none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:54px 54px;
  filter:blur(1.4px);
  -webkit-mask-image:radial-gradient(ellipse 72% 62% at 50% 44%, black 22%, transparent 78%);
  mask-image:radial-gradient(ellipse 72% 62% at 50% 44%, black 22%, transparent 78%);
}

#clockScreen{
  position:fixed; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:34px;
}
#clockScreen h1{
  font-weight:200;
  font-size:clamp(44px, 9vw, 96px);
  letter-spacing:.45em; margin-right:-.45em;
  color:var(--fg);
  transition:letter-spacing .9s ease, margin-right .9s ease;
}
#clockScreen h1 .ch{
  opacity:1; filter:blur(0);
  transition:opacity .7s ease, filter .7s ease;
  transition-delay:calc(var(--i) * 110ms);
}
#mail{
  font-size:clamp(16px, 2.2vw, 21px);
  letter-spacing:.32em; margin-right:-.32em;
  color:var(--dim);
  text-decoration:none;
  white-space:nowrap;
  transition:opacity .9s ease .55s, transform .9s ease .55s, color .3s ease;
}
#mail:hover{ color:var(--accent); }
#mail .cx{
  display:inline-block;
  width:1ch;
  max-width:1ch;
  overflow:hidden;
  text-align:center;
  color:var(--accent-dim);
  text-shadow:0 0 4px transparent, 0 0 4px transparent;
  animation:mailPulse 2.6s ease-in-out infinite;
  animation-delay:calc(var(--i, 0) * 110ms);
  transition:color .15s ease, text-shadow .15s ease;
}
@keyframes mailPulse{
  0%, 100%{
    color:var(--accent-dim);
    text-shadow:0 0 4px transparent, 0 0 4px transparent;
  }
  42%, 58%{
    color:var(--accent-bright);
    text-shadow:0 0 9px var(--glow-gold), 0 0 20px var(--glow-white);
  }
}
#mail .cx.lit{
  animation:none;
  color:var(--fg);
  text-shadow:0 0 12px var(--glow);
}
#mail:hover .cx,
#mail:focus-visible .cx{
  animation:none;
  color:var(--fg);
  text-shadow:0 0 6px var(--glow-white);
}
@media (prefers-reduced-motion: reduce){
  #mail .cx{
    animation:none;
    color:var(--accent-bright);
    text-shadow:0 0 9px var(--glow-gold), 0 0 20px var(--glow-white);
  }
}
#clockScreen.pre h1{ letter-spacing:.62em; margin-right:-.62em; }
#clockScreen.pre h1 .ch{ opacity:0; filter:blur(12px); }
#clockScreen.pre #mail{ opacity:0; transform:translateY(10px); }

#logo{
  position:fixed;
  top:clamp(16px, 2.2vw, 26px);
  left:clamp(18px, 2.6vw, 34px);
  z-index:3;
  padding:.5rem;
  margin:-.5rem;
  font-size:16px; line-height:1;
  color:var(--dim);
  text-decoration:none;
  transition:opacity .9s ease .55s, color .25s ease;
}
#logo:hover, #logo:focus-visible{ color:var(--fg); }
#logo svg{ display:block; width:40px; height:40px; }
#clockScreen.pre #logo{ opacity:0; }
body.standalone #logo{ animation:logoIn .9s ease .3s both; }
@keyframes logoIn{ from{ opacity:0; } to{ opacity:1; } }
@media (prefers-reduced-motion: reduce){
  body.standalone #logo{ animation:none; }
}

#copy{
  position:fixed;
  right:clamp(18px, 2.6vw, 34px);
  bottom:clamp(16px, 2.2vw, 26px);
  z-index:3;
  font-size:11px;
  letter-spacing:.24em;
  margin-right:-.24em;
  color:var(--faint);
  transition:opacity .9s ease .55s, color .25s ease;
}
#copy:hover{ color:var(--dim); }
#clockScreen.pre #copy{ opacity:0; }

#stars{
  position:fixed; inset:0; z-index:1;
  pointer-events:none;
  image-rendering:pixelated;
}
#clockScreen{ z-index:2; }

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

.cards{
  --space:1rem;
  --ease-out:cubic-bezier(.5,1,.89,1);
  --ease-in-out:cubic-bezier(.45,0,.55,1);
  --count:2;
  display:grid;
  grid-template-columns:repeat(var(--count), 1fr);
  gap:var(--space);
  inline-size:min(38rem, 92vw, 68vh);
}

.cards .card{
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-areas:"card";
  place-items:center;
  aspect-ratio:4/5;
  border:1px solid var(--surface-2);
  isolation:isolate;
  background:transparent;
  cursor:pointer;
  color:inherit;
  text-decoration:none;
  user-select:none;
  -webkit-user-select:none;
  transition:
    border-color 200ms var(--ease-out),
    opacity 1s var(--ease-out) calc(var(--i, 0) * 130ms),
    transform 1s var(--ease-out) calc(var(--i, 0) * 130ms);
}
.cards .card::before{
  content:"";
  position:absolute; inset:0;
  background:radial-gradient(circle at bottom left, transparent 55%, var(--surface-1));
  pointer-events:none;
  transition:opacity 900ms var(--ease-out);
}
.cards .card > *{ grid-area:card; }
.cards .card svg{
  position:relative; z-index:1;
  width:30%; height:auto;
  color:var(--surface-3);
  transition:300ms var(--ease-out);
  transition-property:color, scale;
}
.cards .card button{ opacity:0; }
.cards .card:focus-within{
  outline:5px auto Highlight;
  outline:5px auto -webkit-focus-ring-color;
}
.cards .card:where(:hover, :focus-within){
  border-color:var(--active-color, var(--fg));
  transition:border-color 800ms var(--ease-in-out);
}
.cards .card:where(:hover, :focus-within) svg{
  color:var(--active-color, var(--fg));
  scale:1.1;
  transition:300ms var(--ease-in-out);
}
.cards .card .card-img{
  position:relative; z-index:1;
  inline-size:56%;
  aspect-ratio:360/117;
  background-color:var(--surface-3);
  -webkit-mask-image:var(--icon);
          mask-image:var(--icon);
  -webkit-mask-repeat:no-repeat;
          mask-repeat:no-repeat;
  -webkit-mask-position:center;
          mask-position:center;
  -webkit-mask-size:contain;
          mask-size:contain;
  transition:300ms var(--ease-out);
  transition-property:background-color, scale;
}
.cards .card:where(:hover, :focus-within) .card-img{
  background-color:var(--active-color, var(--fg));
  scale:1.1;
  transition:300ms var(--ease-in-out);
}
.cards .card:where(:hover, :focus-within)::before{ opacity:0; }

#clockScreen.pre .cards .card{ opacity:0; transform:translateY(18px); }

/* ---------- About-Seite (GitHub-Look) ---------- */
body.standalone{
  overflow:auto;
  background-repeat:no-repeat;
  background-attachment:fixed;
}

.about{
  --gh-fg:#e6edf3;
  --gh-muted:#9198a1;
  --gh-border:#3d444d;
  --gh-link:#4493f8;
  --gh-btn:#212830;
  --gh-btn-hover:#262c36;
  --gh-card:rgba(13,17,23,.72);

  position:relative; z-index:2;
  max-width:1012px;
  margin:0 auto;
  padding:96px 24px 64px;
  color:var(--gh-fg);
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size:14px;
  line-height:1.5;
  user-select:text;
  -webkit-user-select:text;
}
.about a{ color:var(--gh-link); text-decoration:none; }
.about a:hover{ text-decoration:underline; }
.about a:focus-visible{
  outline:2px solid var(--gh-link);
  outline-offset:2px;
  border-radius:4px;
}
.about .ico{
  width:16px; height:16px;
  flex:none;
  fill:none; stroke:currentColor; stroke-width:1.5;
  stroke-linecap:round; stroke-linejoin:round;
}

.about .gh-layout{
  display:grid;
  grid-template-columns:296px minmax(0, 1fr);
  gap:32px;
  align-items:start;
}

.about .gh-side{ min-width:0; }
.about .gh-names{ margin:0; padding:0; font-weight:400; }
.about .gh-name{
  display:block;
  font-size:26px; line-height:1.25; font-weight:600;
  color:var(--gh-fg);
  overflow-wrap:anywhere;
}
.about .gh-login{
  display:block;
  font-size:20px; line-height:24px; font-weight:300;
  color:var(--gh-muted);
}

.about .gh-btn{
  display:block;
  margin-top:16px;
  padding:5px 16px;
  text-align:center;
  font-size:14px; font-weight:500; line-height:20px;
  color:var(--gh-fg);
  background:var(--gh-btn);
  border:1px solid rgba(240,246,252,.1);
  border-radius:6px;
}
.about .gh-btn:hover{ background:var(--gh-btn-hover); text-decoration:none; }

.about .gh-meta{ list-style:none; margin-top:16px; }
.about .gh-meta li{
  display:flex; align-items:center; gap:8px;
  min-height:22px;
  color:var(--gh-fg);
  overflow-wrap:anywhere;
}
.about .gh-meta .ico{ color:var(--gh-muted); }
.about .gh-meta a{ color:var(--gh-fg); }
.about .gh-meta a:hover{ color:var(--gh-link); }

.about .gh-main{ min-width:0; }
.about .gh-h2{
  margin:0 0 8px;
  font-size:16px; font-weight:400; line-height:1.5;
  color:var(--gh-fg);
}
.about .gh-repos{
  list-style:none;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
}
.about .gh-repo{
  display:flex; flex-direction:column;
  padding:16px;
  background:var(--gh-card);
  border:1px solid var(--gh-border);
  border-radius:6px;
}
.about .gh-repo-head{ display:flex; align-items:center; gap:8px; min-width:0; }
.about .gh-repo-head .ico{ color:var(--gh-muted); }
.about .gh-repo-name{
  font-size:14px; font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.about .gh-badge{
  margin-left:auto;
  padding:0 7px;
  font-size:12px; font-weight:500; line-height:18px;
  color:var(--gh-muted);
  border:1px solid var(--gh-border);
  border-radius:2em;
}
.about .gh-desc{
  margin-top:8px;
  font-size:12px; color:var(--gh-muted);
}

@media (max-width:767px){
  .about{ padding:72px 16px 48px; }
  .about .gh-layout{ grid-template-columns:minmax(0, 1fr); gap:24px; }
  .about .gh-repos{ grid-template-columns:minmax(0, 1fr); }
}

/* ---------- 404-Seite ---------- */
.notfound{
  position:fixed; inset:0; z-index:2;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:18px;
  text-align:center;
}
.notfound h1{
  font-weight:200;
  font-size:clamp(44px, 9vw, 96px);
  letter-spacing:.45em; margin-right:-.45em;
  color:var(--fg);
}
.notfound p{
  font-size:clamp(14px, 1.8vw, 18px);
  letter-spacing:.32em; margin-right:-.32em;
  color:var(--dim);
}
.notfound a{
  margin-top:10px;
  font-size:12px;
  letter-spacing:.3em; margin-right:-.3em;
  color:var(--faint);
  text-decoration:none;
  transition:color .25s ease;
}
.notfound a:hover, .notfound a:focus-visible{ color:var(--accent); }
