/* ==========================================================================
   Janosch Zimmer · personal site
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f1f0ee;
  --surface: #f7f6f4;
  --surface-2: #ebe9e6;
  --surface-3: #e2e0dc;
  --border: #e3e1dd;
  --text: #1c1b19;
  --text-2: #4d4a46;
  --muted: #77726c;
  --faint: #a7a199;
  --accent: #e5832a;
  --green: #35c46a;
  --inverse: #1c1b19;
  --on-inverse: #f7f6f4;
  --shadow: 0 1px 1px rgba(28, 27, 25, 0.03), 0 2px 6px -2px rgba(28, 27, 25, 0.05), 0 16px 32px -24px rgba(28, 27, 25, 0.18);
  --shadow-hover: 0 1px 1px rgba(28, 27, 25, 0.03), 0 6px 14px -6px rgba(28, 27, 25, 0.1), 0 28px 48px -28px rgba(28, 27, 25, 0.28);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 16px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1b1a19;
    --surface-2: #262523;
    --surface-3: #302f2c;
    --border: #2a2927;
    --text: #f1efeb;
    --text-2: #c9c5bf;
    --muted: #9b968f;
    --faint: #6b6660;
    --accent: #f08f36;
    --green: #3fd477;
    --inverse: #f1efeb;
    --on-inverse: #1b1a19;
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 16px 32px -24px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 1px 1px rgba(0, 0, 0, 0.2), 0 28px 48px -28px rgba(0, 0, 0, 0.8);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

h1, h2, h3, p, ol, ul, figure {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Language switch
   -------------------------------------------------------------------------- */

.lang-switch {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: var(--shadow);
}

.lang-switch button {
  position: relative;
  z-index: 1;
  min-width: 40px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.lang-switch button[aria-pressed="true"] {
  color: var(--on-inverse);
}

.lang-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--inverse);
  transition: transform 0.45s var(--ease);
}

html[lang="de"] .lang-indicator {
  transform: translateX(100%);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  width: 100%;
  max-width: 1168px;
  margin: 0 auto;
  padding: clamp(88px, 12vw, 128px) 24px 40px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  max-width: 860px;
}

.avatar {
  width: 116px;
  height: 116px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(28, 27, 25, 0.08), 0 12px 24px -16px rgba(28, 27, 25, 0.35);
}

.news {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 28px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--text-2);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.news:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.news-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.news-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-arrow {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.2s;
}

.news:hover .news-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.news:not([hidden]) + .hero-title {
  margin-top: 20px;
}

.hero-title {
  margin-top: 32px;
  font-size: clamp(30px, 1.2rem + 2.4vw, 46px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero-title .muted {
  color: var(--faint);
}

.hero-lead {
  margin-top: 20px;
  max-width: 740px;
  font-size: clamp(17px, 0.95rem + 0.35vw, 20px);
  line-height: 1.55;
  color: var(--muted);
  letter-spacing: -0.006em;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

/* Voice intro */

.voice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 452px);
  height: 54px;
  padding: 0 20px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.voice-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--accent);
  transition: transform 0.25s var(--ease), background-color 0.2s;
}

.voice-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.voice-btn:active {
  transform: scale(0.92);
}

.voice-btn svg {
  width: 22px;
  height: 22px;
}

.voice-btn[disabled] {
  color: var(--faint);
  cursor: not-allowed;
}

.icon-pause,
.is-playing .icon-play {
  display: none;
}

.is-playing .icon-pause {
  display: block;
}

.wave {
  flex: 1;
  min-width: 0;
  height: 30px;
  overflow: visible;
}

.wave rect {
  fill: var(--text-2);
  transition: fill 0.15s;
}

.wave rect.is-played {
  fill: var(--accent);
}

.voice-time {
  flex: none;
  min-width: 2.6em;
  text-align: right;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Bento grid
   -------------------------------------------------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 236px;
  grid-auto-flow: row dense;
  gap: var(--gap);
  margin-top: clamp(56px, 8vw, 80px);
}

.span-2 {
  grid-column: span 2;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.chip {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 450;
  line-height: 1;
  white-space: nowrap;
}

.chip svg {
  width: 12px;
  height: 12px;
}

.card-link {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), color 0.2s;
}

.card-link svg {
  width: 12px;
  height: 12px;
}

.card:hover .card-link,
.card-link:focus-visible {
  opacity: 1;
  transform: none;
}

.card-link:hover {
  color: var(--text);
}

/* Experience ---------------------------------------------------------------- */

.timeline {
  position: relative;
  flex: 1;
  margin: 8px -4px 0 0;
  padding: 10px 8px 18px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
}

.timeline::-webkit-scrollbar {
  width: 4px;
}

.timeline::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--surface-3);
}

.timeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 16px;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--surface);
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: -6px;
  left: -14px;
  width: 1px;
  background: var(--surface-3);
  z-index: -1;
}

.timeline li:last-child::after {
  display: none;
}

.timeline li:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent);
}

.tl-title {
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--text);
}

.tl-meta {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.tl-year::before {
  content: "·";
  margin: 0 5px;
  color: var(--faint);
}

/* Listening ----------------------------------------------------------------- */

.player {
  flex: 1;
  display: flex;
  gap: 24px;
  min-height: 0;
  margin-top: 4px;
}

.cover {
  position: relative;
  flex: none;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--cover-from, #1f2a44), var(--cover-to, #3d5a80));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 24px -14px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s var(--ease);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}

.cover-rings {
  position: absolute;
  right: -30%;
  bottom: -30%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 9px, color-mix(in srgb, var(--cover-accent, #e0b15b) 55%, transparent) 9px 10px);
  opacity: 0.7;
  transition: transform 8s linear;
}

.is-playing .cover-rings {
  animation: spin 14s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.has-art .cover-rings,
.cover.has-art .cover-mark {
  display: none;
}

.cover.has-art::after {
  z-index: 1;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, 0.12), transparent 55%);
}

.cover-mark {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--cover-accent, #e0b15b);
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 8px 2px 0;
}

.track-meta {
  flex: 1;
  min-height: 0;
}

.track-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.eq i {
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: var(--accent);
  transition: height 0.3s;
}

.is-playing .eq i {
  animation: eq 0.9s ease-in-out infinite alternate;
}

.is-playing .eq i:nth-child(2) { animation-delay: -0.3s; }
.is-playing .eq i:nth-child(3) { animation-delay: -0.6s; }

@keyframes eq {
  0% { height: 2px; }
  100% { height: 10px; }
}

.track-title {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-date:not(:empty)::before {
  content: "·";
  margin-right: 6px;
}

.track-artist {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-bar {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  cursor: pointer;
}

.track-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--text-2);
}

.track-progress time {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.ctrl {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-2);
  transition: color 0.2s, background-color 0.2s, transform 0.2s var(--ease);
}

.ctrl svg {
  width: 15px;
  height: 15px;
}

.ctrl:hover {
  background: color-mix(in srgb, var(--text) 14%, var(--surface-2));
}

.ctrl:active {
  transform: scale(0.9);
}

.ctrl--main {
  width: 44px;
  height: 44px;
  color: var(--bg, #fff);
  background: var(--text);
}

.ctrl--main:hover {
  background: var(--text);
  opacity: 0.85;
}

.ctrl--main svg {
  width: 18px;
  height: 18px;
}

.track-count {
  margin-left: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ctrl--open {
  margin-left: auto;
  background: none;
  color: var(--muted);
}

.queue {
  flex: none;
  min-width: 0;
  max-height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  scrollbar-width: none;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px;
  border-radius: 10px;
  text-align: left;
  color: var(--muted);
  transition: background-color 0.2s, color 0.2s;
}

.queue-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.queue-item.is-current {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

.queue-item img {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.queue-item > span {
  display: none;
  min-width: 0;
  flex-direction: column;
}

.queue-show {
  font-size: 11px;
  line-height: 1.3;
  color: var(--faint);
}

.queue-title {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-loading .ctrl--main {
  animation: loading 1s ease-in-out infinite alternate;
}

@keyframes loading {
  to { opacity: 0.35; }
}

.has-error .ctrl--main {
  color: var(--faint);
}

.has-error .track-bar span {
  background: var(--faint);
}

/* Reading ------------------------------------------------------------------- */

.book-title {
  position: relative;
  z-index: 2;
  margin: 18px 4px 0;
  max-width: 72%;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.book-author {
  position: relative;
  z-index: 2;
  margin: 6px 4px 0;
  font-size: 14px;
  color: var(--muted);
}

.book-title.is-long {
  max-width: 66%;
  font-size: 18px;
  line-height: 1.2;
}

.book-list-btn {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 4px 0;
  height: 26px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
  transition: border-color 0.2s, color 0.2s;
}

.book-list-btn:hover {
  border-color: var(--surface-3);
  color: var(--text);
}

.book-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.book {
  position: absolute;
  right: -22px;
  bottom: -26px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 112px;
  height: 160px;
  padding: 14px 12px 12px 18px;
  border-radius: 3px 6px 6px 3px;
  background: var(--book-bg, #23395b);
  color: var(--book-fg, #f4efe6);
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), inset 7px 0 0 rgba(255, 255, 255, 0.08), -10px 14px 28px -12px rgba(0, 0, 0, 0.45);
  transform: rotate(9deg);
  transform-origin: bottom right;
  transition: transform 0.6s var(--ease);
}

.card--reading:hover .book {
  transform: rotate(4deg) translateY(-8px);
}

.book-l1,
.book-l2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.book-l2 {
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  margin-top: 5px;
}

.book-rule {
  width: 22px;
  height: 3px;
  margin-top: 10px;
  background: var(--book-accent, #e5832a);
}

.book-by {
  margin-top: auto;
  font-size: 7.5px;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

/* Map ----------------------------------------------------------------------- */

.card--map {
  padding: 12px;
}

.map-img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  transform-origin: 52% 48%;
  transition: transform 1.2s var(--ease);
}

.card--map:hover .map-img {
  transform: scale(1.24);
}

.map-pin {
  position: absolute;
  top: 48%;
  left: 52%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0, 0, 0, 0.25);
}

.map-pin i {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ping 2.6s var(--ease) infinite;
}

.map-city {
  position: absolute;
  top: 48%;
  left: 52%;
  transform: translate(-50%, 14px);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #8d8881;
  text-shadow: 0 0 3px var(--map-halo, #fff), 0 0 8px var(--map-halo, #fff), 0 0 14px var(--map-halo, #fff);
  white-space: nowrap;
}

.map-time {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 11.5px;
  color: var(--muted);
}

.map-time time {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.map-osm {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 8.5px;
  color: var(--faint);
  opacity: 0.85;
}

/* Interests ----------------------------------------------------------------- */

.card--interests {
  padding: 8px;
}

.stage {
  position: relative;
  flex: 1;
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.9s var(--ease), transform 1.6s var(--ease);
}

.slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.slide svg {
  width: 100%;
  height: 100%;
}

.caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: #fff;
  color: #1c1b19;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.3);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.25s, transform 0.6s var(--ease) 0.25s;
}

.caption span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide.is-active .caption {
  opacity: 1;
  transform: none;
}

.dots {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 5px;
}

.dots button {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: width 0.4s var(--ease), background-color 0.3s;
}

.dots button[aria-current="true"] {
  width: 16px;
  background: #fff;
}

/* How I work ---------------------------------------------------------------- */

.how-panels {
  flex: 1;
  display: grid;
  align-items: end;
  padding: 0 4px;
}

.how-panel {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}

.how-panel.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.how-panel h2 {
  font-size: clamp(22px, 1rem + 1vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.how-num {
  font-variant-numeric: tabular-nums;
}

.how-panel p {
  margin-top: 8px;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.how-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 16px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}

.how-tabs button {
  position: relative;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.3s, background-color 0.3s;
}

.how-tabs button:hover {
  color: var(--text);
}

.how-tabs button[aria-selected="true"] {
  background: var(--inverse);
  color: var(--on-inverse);
}

.how-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

.how-tabs.is-auto button[aria-selected="true"]::after {
  animation: step-progress var(--step-duration, 6s) linear forwards;
}

.card--how:hover .how-tabs button[aria-selected="true"]::after,
.card--how:focus-within .how-tabs button[aria-selected="true"]::after {
  animation-play-state: paused;
}

@keyframes step-progress {
  to { transform: scaleX(1); }
}

/* Projects ------------------------------------------------------------------ */

.projects {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  margin-top: 6px;
}

.project {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 8px;
  border-radius: 10px;
  transition: background-color 0.25s;
}

a.project[href]:hover {
  background: var(--surface-2);
}

.app-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 19px;
  font-weight: 650;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 10px -4px rgba(0, 0, 0, 0.35);
}

img.app-icon {
  object-fit: cover;
  background: var(--surface-2);
}

.app-icon--karl {
  background: linear-gradient(150deg, #2b3d5f, #121a2b);
}

.app-icon--jbook {
  background: linear-gradient(150deg, #f09a4a, #d4641c);
}

.app-icon--soon {
  background: transparent;
  color: var(--faint);
  border: 1px dashed var(--surface-3);
  box-shadow: none;
}

.app-icon--soon svg {
  width: 18px;
  height: 18px;
}

.project-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.project-text strong {
  font-size: 14px;
  font-weight: 500;
}

.project-text span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project--soon .project-text strong {
  color: var(--text-2);
}

.tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.tag--soon {
  border-style: dashed;
}

.project-arrow {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.2s;
}

a.project:not([href]) .project-arrow {
  visibility: hidden;
}

a.project[href]:hover .project-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

/* Latest post --------------------------------------------------------------- */

.card--post {
  flex-direction: row;
  gap: 20px;
}

.post-media {
  position: relative;
  flex: none;
  width: 34%;
  max-width: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.card--post:hover .post-media img {
  transform: scale(1.04);
}

.post-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 4px 2px 0;
}

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-date {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.post-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}

.post-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.post-title {
  margin-top: 6px;
  font-size: clamp(19px, 0.9rem + 0.6vw, 23px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-excerpt {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 90px;
  margin: -45px 0 0 -36px;
}

.has-image .paper {
  display: none;
}

.paper i {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  background-image: repeating-linear-gradient(to bottom, transparent 0 10px, var(--surface-3) 10px 11px);
  background-size: 68% calc(100% - 26px);
  background-position: 50% 20px;
  background-repeat: no-repeat;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.25);
  transition: transform 0.6s var(--ease);
}

.paper i:nth-child(1) { transform: rotate(-12deg) translate(-10px, 4px); }
.paper i:nth-child(2) { transform: rotate(-4deg) translate(-4px, 2px); }
.paper i:nth-child(3) { transform: rotate(5deg); }

.paper i:nth-child(3)::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 9px;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.card--post:hover .paper i:nth-child(1) { transform: rotate(-18deg) translate(-18px, 6px); }
.card--post:hover .paper i:nth-child(2) { transform: rotate(-7deg) translate(-8px, 2px); }
.card--post:hover .paper i:nth-child(3) { transform: rotate(8deg) translate(4px, -4px); }

/* Buttons ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
  width: 13px;
  height: 13px;
}

a.btn:hover {
  transform: translateY(-1px);
}

.btn--dark {
  background: var(--inverse);
  color: var(--on-inverse);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text-2);
}

.btn--ghost:hover {
  border-color: var(--surface-3);
  color: var(--text);
}

.btn--muted {
  border: 1px dashed var(--surface-3);
  color: var(--faint);
  font-weight: 400;
}

a.btn:not([href]) {
  display: none;
}

/* Contact ------------------------------------------------------------------- */

.card--contact {
  background: var(--inverse);
  border-color: transparent;
  color: var(--on-inverse);
}

.card--contact .chip {
  background: color-mix(in srgb, var(--on-inverse) 10%, transparent);
  color: color-mix(in srgb, var(--on-inverse) 70%, transparent);
}

.card--contact::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -40%;
  z-index: -1;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 65%);
  opacity: 0.55;
  transition: transform 1.2s var(--ease), opacity 0.6s;
}

.card--contact:hover::before {
  transform: translate(-12%, 12%) scale(1.15);
  opacity: 0.8;
}

.contact-body {
  margin-top: auto;
  padding: 0 4px 4px;
}

.card--banner {
  gap: 24px;
  min-height: 180px;
  margin-top: var(--gap);
  padding: 16px;
}

.card--banner::before {
  top: -80%;
  right: -10%;
  width: 55%;
}

.card--banner .contact-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 0 8px 8px;
}

.card--banner .contact-body h2 {
  font-size: clamp(32px, 1.4rem + 2.6vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.card--banner .contact-body p {
  margin-top: 10px;
  font-size: 15px;
}

.card--banner .contact-actions {
  margin-top: 0;
}

.card--banner .btn {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
}

.contact-body h2 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.contact-body p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--on-inverse) 62%, transparent);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn--light {
  background: var(--on-inverse);
  color: var(--inverse);
}

.btn--outline {
  border: 1px solid color-mix(in srgb, var(--on-inverse) 22%, transparent);
  color: var(--on-inverse);
}

.btn--outline:hover {
  border-color: color-mix(in srgb, var(--on-inverse) 45%, transparent);
}

/* Footer -------------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 40px;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--faint);
}

.footer-amazon::before {
  content: "·";
  margin-right: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-left: auto;
}

.footer-links a {
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--muted);
}

/* Reading list dialog ------------------------------------------------------- */

.reading-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 64px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
}

.reading-dialog::backdrop {
  background: rgba(20, 20, 19, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.reading-dialog[open] {
  animation: dialog-in 0.4s var(--ease);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.reading-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px 4px;
}

.reading-dialog-head h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.reading-dialog-head .ctrl {
  font-size: 20px;
  line-height: 1;
}

.reading-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
}

.rl-status {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.rl-status.is-now {
  color: var(--accent);
}

.reading-list strong {
  font-size: 15px;
  font-weight: 500;
}

.rl-author {
  font-size: 13px;
  color: var(--muted);
}

.rl-link {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--surface-3);
  text-underline-offset: 3px;
}

.rl-link:hover {
  text-decoration-color: currentColor;
}

.reading-note {
  margin-top: 8px;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--faint);
}

/* Contact form ------------------------------------------------------------- */

.contact-form {
  display: grid;
  gap: 14px;
  padding: 4px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.contact-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  font-size: 12px;
  color: var(--faint);
}

.form-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-status {
  font-size: 13px;
  color: var(--text-2);
}

.contact-form .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* --------------------------------------------------------------------------
   Entrance animation
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 80ms);
}

@keyframes reveal {
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Dark mode details
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  .map-city {
    --map-halo: #1d1c1a;
    color: #8f8a83;
  }

  .map-pin {
    box-shadow: 0 0 0 3px #1d1c1a, 0 4px 10px rgba(0, 0, 0, 0.5);
  }

  .card--contact {
    border-color: transparent;
  }

  .caption {
    background: rgba(27, 26, 25, 0.92);
    color: #f1efeb;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 639px) {
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .hero-title {
    margin-top: 26px;
  }

  .hero-actions {
    gap: 10px;
  }

  .voice {
    width: 100%;
  }

  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(236px, auto);
  }

  .span-2 {
    grid-column: auto;
  }

  .card--post {
    flex-direction: column;
    gap: 12px;
  }

  .post-media {
    order: 2;
    width: 100%;
    max-width: none;
    height: 180px;
  }

  .post-body {
    display: contents;
  }

  .post-top {
    order: 1;
  }

  .post-text {
    order: 3;
    padding: 0 4px;
  }

  .post-actions {
    order: 4;
    padding: 0 4px 4px;
  }

  .player {
    gap: 16px;
    flex-wrap: wrap;
  }

  .queue {
    flex: 1 0 100%;
    max-height: none;
  }

  .queue-item {
    width: 100%;
    padding: 6px 8px;
  }

  .queue-item > span {
    display: flex;
  }

  .cover {
    height: auto;
    align-self: center;
    width: 42%;
  }

  .card--how {
    min-height: 260px;
  }

  .how-tabs button .how-step-word,
  .how-tabs button > span {
    display: none;
  }

  .card--projects {
    min-height: 0;
  }

  .projects {
    justify-content: flex-start;
  }

  .tag {
    display: none;
  }

  .footer-links {
    margin-left: 0;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Legal pages and 404
   -------------------------------------------------------------------------- */

html[lang="de"] [data-only="en"],
html[lang="en"] [data-only="de"] {
  display: none !important;
}

.legal {
  max-width: 760px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}

.legal-back:hover {
  color: var(--text);
  border-color: var(--surface-3);
}

.legal-body {
  margin-top: 40px;
}

.legal-body h1 {
  font-size: clamp(30px, 1.2rem + 2.2vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.028em;
}

.legal-body h2 {
  margin-top: 36px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal-body p {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.legal-body a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--surface-3);
  text-underline-offset: 3px;
}

.legal-body a:not(.btn):hover {
  text-decoration-color: currentColor;
}

.legal-note {
  font-size: 13.5px !important;
  color: var(--muted) !important;
}

.legal-todo {
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.legal-page .site-footer {
  margin-top: 64px;
}

.notfound {
  margin-top: 12vh;
}

.notfound-code {
  font-size: 13px !important;
  letter-spacing: 0.12em;
  color: var(--accent) !important;
}

.notfound .btn {
  margin-top: 12px;
}
