:root {
  color-scheme: dark;
  --text: #fff;
  --muted: rgba(255,255,255,.72);
  --line: rgba(255,255,255,.28);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: #050505;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 5px;
  border-radius: 2px;
}

.background,
.slide,
.shade {
  position: fixed;
  inset: 0;
}

.background {
  z-index: -2;
  overflow: hidden;
  background: #000;
}

/*
  No keyframe zoom here. The old animation was removed when a slide lost
  .is-active, so its transform snapped back while the image was fading out.
  A long transform transition keeps both fade and movement continuous.
*/
.slide {
  opacity: 0;
  background-size: cover;
  background-position: center center;
  transform: scale(1.025) translate3d(0, 0, 0);
  transition:
    opacity 2.2s ease-in-out,
    transform 11s cubic-bezier(.2,.65,.25,1);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.slide.is-active {
  opacity: 1;
  transform: scale(1.06) translate3d(-.45%, -.25%, 0);
}

.shade {
  z-index: 10;
  background:
    linear-gradient(90deg, rgba(0,0,0,.58) 0%, rgba(0,0,0,.27) 45%, rgba(0,0,0,.16) 100%),
    linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.20) 65%, rgba(0,0,0,.46) 100%);
}

.page-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 88px);
}

.hero {
  width: min(940px, 100%);
  animation: intro .9s ease-out both;
}

h1 {
  display: inline-flex;
  align-items: baseline;
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.035em;
  text-shadow: 0 2px 24px rgba(0,0,0,.38);
  white-space: nowrap;
}

.typed-text {
  white-space: pre;
}

/* The cursor is a real element directly after the typed text, so it can
   never run beyond the final character as happened with the old width/ch trick. */
.caret {
  display: inline-block;
  width: .055em;
  height: .88em;
  margin-left: .055em;
  background: rgba(255,255,255,.78);
  transform: translateY(.06em);
  animation: caret-blink .78s steps(1, end) infinite;
}

/* Subtle title glitch: mostly calm, occasionally a tiny digital hiccup. */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
}

.glitch::before {
  text-shadow: 2px 0 rgba(0, 210, 255, .75);
}

.glitch::after {
  text-shadow: -2px 0 rgba(255, 40, 110, .72);
}

.glitch.glitch-now::before {
  opacity: .8;
  animation: glitch-before .38s steps(2, end) both;
}

.glitch.glitch-now::after {
  opacity: .72;
  animation: glitch-after .38s steps(2, end) both;
}

@keyframes glitch-before {
  0%   { clip-path: inset(8% 0 72% 0); transform: translate(-2px, 0); }
  25%  { clip-path: inset(68% 0 12% 0); transform: translate(3px, 0); }
  50%  { clip-path: inset(36% 0 42% 0); transform: translate(-1px, 0); }
  75%  { clip-path: inset(14% 0 60% 0); transform: translate(2px, 0); }
  100% { clip-path: inset(42% 0 30% 0); transform: translate(0, 0); opacity: 0; }
}

@keyframes glitch-after {
  0%   { clip-path: inset(58% 0 20% 0); transform: translate(2px, 0); }
  25%  { clip-path: inset(18% 0 58% 0); transform: translate(-3px, 0); }
  50%  { clip-path: inset(76% 0 8% 0); transform: translate(1px, 0); }
  75%  { clip-path: inset(30% 0 48% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(50% 0 28% 0); transform: translate(0, 0); opacity: 0; }
}

.primary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.primary-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(12,12,12,.18);
  color: rgba(255,255,255,.82);
  font-size: clamp(.9rem, 1.15vw, 1.02rem);
  font-weight: 500;
  letter-spacing: .01em;
  text-shadow: 0 1px 12px rgba(0,0,0,.38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .2s ease;
}

.primary-links a:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.32);
  color: #fff;
  transform: translateY(-1px);
}

.primary-links a:active {
  transform: translateY(0);
}

.footer {
  position: fixed;
  left: clamp(28px, 6vw, 88px);
  bottom: clamp(24px, 4vw, 52px);
}

.icons {
  display: flex;
  gap: 18px;
  align-items: center;
}

.icons a {
  color: rgba(255,255,255,.52);
  font-size: 1.05rem;
  transition: color .2s ease, transform .2s ease, opacity .2s ease;
}

.icons a:hover {
  color: #fff;
  transform: translateY(-2px);
}

@keyframes caret-blink {
  0%, 47% { opacity: 1; }
  48%, 100% { opacity: 0; }
}

@keyframes intro {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .page-shell {
    justify-content: flex-end;
    padding-bottom: 110px;
  }

  .primary-links {
    gap: 8px;
  }

  .primary-links a {
    min-height: 40px;
    padding: 0 14px;
    width: max-content;
    max-width: 100%;
  }

  .footer {
    left: clamp(24px, 7vw, 36px);
    bottom: 28px;
  }

  .icons { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .caret { display: none; }
}

/* Secondary multi-line terminal typewriter. */
.typewriter-line {
  min-height: 9.2em;
  width: min(760px, 88vw);
  margin: 2px 0 20px;
  color: rgba(255,255,255,.66);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(.80rem, 1.15vw, .98rem);
  line-height: 1.48;
  letter-spacing: .012em;
  text-shadow: 0 1px 12px rgba(0,0,0,.58);
}

.rotating-text { display: block; width: 100%; }
.terminal-row { display: flex; align-items: baseline; min-height: 1.48em; width: 100%; }
.prompt { flex: 0 0 auto; width: 1.25em; color: rgba(255,255,255,.34); user-select: none; }
.terminal-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sub-caret {
  display: inline-block;
  flex: 0 0 auto;
  width: .08em;
  height: 1em;
  margin-left: .16em;
  transform: translateY(.12em);
  background: rgba(255,255,255,.5);
  animation: caret-blink .78s steps(1, end) infinite;
}

/* Brief Ctrl+A-style selection before the complete block disappears. */
.rotating-text.selecting .terminal-row {
  background: rgba(215,225,235,.72);
  color: rgba(20,25,30,.96);
  text-shadow: none;
}
.rotating-text.selecting .prompt { color: rgba(20,25,30,.58); }

@media (max-width: 720px) {
  .typewriter-line { width: 92vw; min-height: 10.5em; margin-bottom: 16px; font-size: .78rem; }
}

/* V5: the old primary menu has intentionally left the building. */
.primary-links { display: none !important; }

/* V12: Esterbauer.at stays on screen after typing. Only the title caret
   disappears; the headline remains available for the occasional glitch. */
h1.glitch.title-done .caret {
  display: none;
}


/* V13: the four original destinations make a short guest appearance after
   the title has finished typing, then quietly get out of the typewriter's way. */
.startup-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .42em .72em;
  width: min(900px, 92vw);
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  color: rgba(255,255,255,.68);
  font-size: clamp(.82rem, 1.12vw, .98rem);
  font-weight: 450;
  letter-spacing: .005em;
  text-shadow: 0 1px 12px rgba(0,0,0,.55);
  transition: opacity .55s ease, transform .55s ease, max-height .55s ease, margin .55s ease;
}
.startup-links.is-visible {
  max-height: 5em;
  margin: 0 0 24px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.startup-links.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}
.startup-links a {
  color: rgba(255,255,255,.72);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease, opacity .18s ease;
}
.startup-links a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.55);
}
.startup-links > span { color: rgba(255,255,255,.25); user-select: none; }
@media (max-width: 720px) {
  .startup-links { gap: .35em .58em; line-height: 1.55; }
  .startup-links.is-visible { margin-bottom: 18px; }
}
