/* ==========================================================================
   links.lenny-michel.de — "Liquid Glass"
   Static, dependency-free. Light/dark follows the system setting.
   ========================================================================== */

/* Inter is only a fallback for devices without SF Pro (Android, Windows).
   Browsers download it lazily — on Apple devices it is never fetched. */
@font-face {
  font-family: "InterVariable";
  src: url("fonts/InterVariable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "InterVariable", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --link: #0066cc;
  --button: #0071e3;
  --button-hover: #0077ed;
  --focus: rgba(0, 113, 227, 0.6);

  --glass: rgba(255, 255, 255, 0.72);
  --glass-filter: blur(24px) saturate(180%);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-solid: #ffffff;
  --glass-border: rgba(0, 0, 0, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -14px rgba(0, 0, 0, 0.16);
  --glass-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 22px 44px -16px rgba(0, 0, 0, 0.22);
  --well: rgba(0, 0, 0, 0.045);
  --well-hover: rgba(0, 0, 0, 0.08);
  --spot: rgba(255, 255, 255, 0.6);

  /* soft, colourless light — white highlights and pale grey shade */
  --blob-1: #ffffff;
  --blob-2: #d9d9de;
  --blob-3: #ffffff;
  --blob-4: #d9d9de;
  --blob-opacity: 0.8;

  --radius: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* soft spring, similar to SwiftUI's .smooth */
    --ease-spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%,
      0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%,
      1.017 63.9%, 1.001 85.6%, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --link: #2997ff;
    --focus: rgba(41, 151, 255, 0.75);

    --glass: rgba(30, 30, 32, 0.7);
    --glass-filter: blur(24px) saturate(140%);
    --glass-strong: rgba(36, 36, 40, 0.78);
    --glass-solid: #1c1c1e;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 18px 40px -18px rgba(0, 0, 0, 0.85);
    --glass-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 48px -18px rgba(0, 0, 0, 0.95);
    --well: rgba(255, 255, 255, 0.06);
    --well-hover: rgba(255, 255, 255, 0.11);
    --spot: rgba(255, 255, 255, 0.1);

    --blob-1: #3a3a3c;
    --blob-2: #1c1c1e;
    --blob-3: #3a3a3c;
    --blob-4: #1c1c1e;
    --blob-opacity: 0.7;
  }
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--link);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.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;
}

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

/* ---------- Animated backdrop ---------- */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.blob {
  position: absolute;
  width: 72vmax;
  height: 72vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c), transparent);
  opacity: var(--blob-opacity);
  will-change: transform;
}

.blob--1 { --c: var(--blob-1); top: -30vmax; left: -26vmax; }
.blob--2 { --c: var(--blob-2); top: -14vmax; right: -34vmax; }
.blob--3 { --c: var(--blob-3); bottom: -34vmax; left: -20vmax; }
.blob--4 { --c: var(--blob-4); bottom: -30vmax; right: -30vmax; }

/* fine grain against gradient banding */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Glass material ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 0 0 1px var(--glass-border), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
}

.glass--strong {
  background: var(--glass-strong);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- Layout ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: calc(64px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 28px
    max(16px, env(safe-area-inset-left));
}

/* ---------- Share button ---------- */
.share {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 5;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.5s var(--ease-spring);
}

.share svg {
  width: 21px;
  height: 21px;
  margin-top: -2px;
}

.share:active {
  transform: scale(0.92);
  transition-duration: 0.15s;
}

/* ---------- Profile ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  position: relative;
  width: 112px;
  height: 112px;
  margin-bottom: 20px;
}

.avatar img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--glass-strong), 0 12px 30px -10px rgba(0, 0, 0, 0.45);
}

.name {
  margin: 0;
  font-size: clamp(2rem, 1.55rem + 2.2vw, 2.75rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.handle {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

/* ---------- Link cards ---------- */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 18px 14px 14px;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.55s var(--ease-spring), box-shadow 0.4s var(--ease-out);
}

/* pointer-following light (desktop only, position set in main.js) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.card > * {
  position: relative;
}

.card:active {
  transform: scale(0.98);
  transition-duration: 0.18s;
}

.card:focus-visible {
  outline-offset: 2px;
}

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

.label .title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.022em;
}

.label .sub {
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.55s var(--ease-spring), color 0.25s;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px var(--glass-border), inset 0 1px 0 var(--glass-highlight), var(--glass-shadow-hover);
  }

  .card:hover::before {
    opacity: 1;
  }

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

  .card:active {
    transform: scale(0.98);
  }
}

/* ---------- App icons (iOS-style tiles) ---------- */
.app-icon {
  position: relative; /* contains the gloss overlay below */
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12),
    0 6px 14px -6px rgba(0, 0, 0, 0.4);
}

/* subtle top gloss like iOS 26 icons */
.app-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.app-icon svg {
  position: relative;
  width: 24px;
  height: 24px;
}

.app-icon--youtube {
  background: linear-gradient(180deg, #ff4b3e, #e00000);
}

.app-icon--youtube svg {
  width: 27px;
  height: 27px;
}

.app-icon--instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.app-icon--tiktok {
  background: linear-gradient(180deg, #2a2a2e, #000);
}

.app-icon--tiktok svg {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.app-icon--mail {
  background: linear-gradient(180deg, #3ab8ff, #0a6cff);
}

.app-icon--mail svg {
  width: 26px;
  height: 26px;
}

/* ---------- Collaboration card ---------- */
.collab {
  border-radius: 26px;
  padding: 20px 20px 20px;
}

.collab-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.collab-head .eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}

.collab h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.collab p {
  margin: 14px 0 16px;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--text-2);
}

.mail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 16px;
  border-radius: 14px;
  background: var(--well);
}

.mail-address {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

.copy-btn {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.2s, transform 0.5s var(--ease-spring);
}

.copy-btn svg {
  width: 20px;
  height: 20px;
}

.copy-btn:hover {
  background: var(--well-hover);
}

.copy-btn:active {
  transform: scale(0.9);
  transition-duration: 0.15s;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  margin-top: 12px;
  padding: 0 22px;
  border-radius: 980px;
  background: var(--button);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.022em;
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -10px rgba(0, 113, 227, 0.8);
  transition: background-color 0.25s, transform 0.5s var(--ease-spring);
}

.btn-primary:hover {
  background: var(--button-hover);
}

.btn-primary:active {
  transform: scale(0.97);
  transition-duration: 0.15s;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 4px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--text-2);
}

.footer nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.footer a {
  color: inherit;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}

.footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer p {
  margin: 2px 0 0;
}

/* ---------- Toast (iOS HUD) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.94);
  box-shadow: inset 0 0 0 1px var(--glass-border), inset 0 1px 0 var(--glass-highlight), 0 14px 36px -10px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s var(--ease-out), transform 0.55s var(--ease-spring);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.toast svg {
  width: 22px;
  height: 22px;
  flex: none;
}

/* ---------- Legal pages & 404 ---------- */
.page--doc {
  justify-content: flex-start;
  max-width: 720px;
  gap: 18px;
  padding-top: calc(28px + env(safe-area-inset-top));
}

.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.5s var(--ease-spring);
}

.back svg {
  width: 18px;
  height: 18px;
}

.back:active {
  transform: scale(0.95);
  transition-duration: 0.15s;
}

.doc {
  border-radius: 28px;
  padding: clamp(22px, 5vw, 44px);
}

.doc h1 {
  margin: 0;
  font-size: clamp(2rem, 1.55rem + 2vw, 2.6rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.doc .meta {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
}

.doc h2 {
  margin: 34px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.doc p,
.doc li,
.doc address {
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.012em;
}

.doc p,
.doc address {
  margin: 0 0 12px;
  font-style: normal;
}

.doc ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

.notfound {
  text-align: center;
  border-radius: 28px;
  padding: 40px 24px 28px;
}

.notfound .code {
  margin: 0;
  font-size: clamp(4rem, 3rem + 6vw, 5.5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text);
  background: linear-gradient(180deg, var(--text) 35%, var(--text-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.notfound h1 {
  margin: 14px 0 6px;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.notfound p {
  margin: 0 0 20px;
  color: var(--text-2);
}

@media (forced-colors: active) {
  .notfound .code {
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ---------- Motion (only when the user hasn't asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .blob--1 { animation: drift-1 26s ease-in-out infinite alternate; }
  .blob--2 { animation: drift-2 31s ease-in-out infinite alternate; }
  .blob--3 { animation: drift-3 28s ease-in-out infinite alternate; }
  .blob--4 { animation: drift-4 34s ease-in-out infinite alternate; }

  /* staggered entrance — applied to the glass elements themselves, never to
     their wrappers, so backdrop-filter keeps seeing the background */
  .reveal {
    animation: rise 0.9s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 70ms + 60ms);
  }

  .avatar.reveal {
    animation-name: pop;
    animation-duration: 1.1s;
  }

  .r1 { --i: 1; }
  .r2 { --i: 2; }
  .r3 { --i: 3; }
  .r4 { --i: 4; }
  .r5 { --i: 5; }
  .r6 { --i: 6; }
  .r7 { --i: 7; }
  .r8 { --i: 8; }
  .r9 { --i: 9; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
}

@keyframes drift-1 {
  50% { transform: translate3d(14vmax, 10vmax, 0) scale(1.12); }
  100% { transform: translate3d(4vmax, 22vmax, 0) scale(0.94); }
}

@keyframes drift-2 {
  50% { transform: translate3d(-16vmax, 12vmax, 0) scale(0.92); }
  100% { transform: translate3d(-8vmax, 26vmax, 0) scale(1.1); }
}

@keyframes drift-3 {
  50% { transform: translate3d(12vmax, -14vmax, 0) scale(1.08); }
  100% { transform: translate3d(22vmax, -6vmax, 0) scale(0.96); }
}

@keyframes drift-4 {
  50% { transform: translate3d(-12vmax, -16vmax, 0) scale(1.14); }
  100% { transform: translate3d(-22vmax, -4vmax, 0) scale(0.92); }
}
