/* ==========================================================================
   Link Hub - Tobias Nase
   Umsetzung der Design-Vorlage "Link Hub.dc.html" (Frames 2a mobil / 2b Web).
   Statisches HTML + Vanilla CSS, keine Fremd-Requests.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:            #07050A;
  --ink:           #FBF9FD;
  --ink-70:        rgba(251, 249, 253, 0.72);
  --ink-55:        rgba(251, 249, 253, 0.55);
  --ink-52:        rgba(251, 249, 253, 0.52);
  --ink-45:        rgba(251, 249, 253, 0.45);
  --ink-16:        rgba(251, 249, 253, 0.16);
  --ink-09:        rgba(251, 249, 253, 0.09);
  --ink-07:        rgba(251, 249, 253, 0.07);

  --accent:        oklch(0.66 0.2 300);
  --accent-deep:   oklch(0.5 0.2 290);
  --accent-mid:    oklch(0.55 0.2 292);
  --accent-line:   oklch(0.75 0.16 300);
  --accent-icon:   oklch(0.88 0.1 300);
  --accent-link:   oklch(0.86 0.12 300);
  --accent-label:  oklch(0.84 0.1 300);
  --aurora-a:      oklch(0.6 0.22 300);
  --aurora-b:      oklch(0.55 0.2 265);
  --live:          oklch(0.78 0.19 150);

  --r-card:   22px;
  --r-tile:   12px;
  --r-social: 20px;
  --r-avatar: 26px;
  --r-badge:   8px;

  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

/* Farb-Fallback fuer Browser ohne oklch (Safari < 15.4) */
@supports not (color: oklch(0.5 0.1 300)) {
  :root {
    --accent:       #A76EF8;
    --accent-deep:  #6741CA;
    --accent-mid:   #7850DA;
    --accent-line:  #BE94FF;
    --accent-icon:  #E1C9FF;
    --accent-link:  #DDBFFF;
    --accent-label: #D4BCFF;
    --aurora-a:     #9754ED;
    --aurora-b:     #3665E4;
    --live:         #40D872;
  }
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Schibsted Grotesk", Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a, button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); }

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

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

/* ---------- Hintergrund: Aurora + Punktraster ---------- */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.bg__blob--a {
  top: -120px; left: -90px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, color-mix(in oklab, var(--aurora-a) 75%, transparent) 0%, rgba(7, 5, 10, 0) 70%);
  filter: blur(30px);
  animation: auroraA 14s ease-in-out infinite;
}

.bg__blob--b {
  top: 180px; right: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, color-mix(in oklab, var(--aurora-b) 70%, transparent) 0%, rgba(7, 5, 10, 0) 70%);
  filter: blur(34px);
  animation: auroraB 18s ease-in-out infinite;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(251, 249, 253, 0.055) 1px, rgba(7, 5, 10, 0) 1px);
  background-size: 20px 20px;
  opacity: 0.7;
}

/* ---------- Grundgeruest ---------- */
.hub {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin-inline: auto;
  padding:
    26px
    calc(20px + env(safe-area-inset-right))
    calc(28px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
}

/* Auf Mobil loesen sich die beiden Spalten auf, die Reihenfolge macht order. */
.col, .stapel { display: contents; }

/* Reihenfolge nur mobil: Karten vor den Social-Kacheln. */
@media (max-width: 999px) {
  .profile     { order: 1; }
  .bio         { order: 2; }
  .dm          { order: 3; }
  .links       { order: 4; }
  .abschnitt   { order: 5; }
  .socials-nav { order: 6; }
  .spacer      { order: 7; }
  .legal       { order: 8; }
}

.spacer { flex: 1; min-height: 14px; }

/* ---------- Profil ---------- */
.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: riseIn 700ms var(--ease) both;
}

.profile__portrait {
  flex: none;
  width: 76px; height: 76px;
  border-radius: var(--r-avatar);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--ink-16), 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Das Portraet fuehrt auf die Webseite */
a.profile__portrait {
  display: block;
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}

a.profile__portrait:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--accent-line) 45%, transparent),
    0 16px 36px rgba(0, 0, 0, 0.55);
}

a.profile__portrait:active { transform: translateY(0) scale(0.99); }

.profile__portrait img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.profile__text {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profile__name {
  margin: 0;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.profile__role {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-label);
}

.profile__dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--live) 22%, transparent);
}

.bio {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-70);
  text-wrap: pretty;
  animation: riseIn 700ms var(--ease) 80ms both;
}

/* ---------- DM-Hinweis ---------- */
.dm {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  animation: riseIn 700ms var(--ease) 130ms both;
}

.dm__avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background-image: linear-gradient(160deg,
    color-mix(in oklab, var(--accent) 35%, transparent) 0%,
    color-mix(in oklab, var(--accent-deep) 15%, transparent) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent-line) 35%, transparent);
  color: var(--accent-icon);
}

.dm__avatar svg { width: 17px; height: 17px; }

.dm__bubble {
  flex: 1;
  padding: 14px 16px;
  border-radius: 20px 20px 20px 6px;
  background: var(--ink-07);
  box-shadow: inset 0 0 0 1px var(--ink-09);
}

.dm__bubble p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(251, 249, 253, 0.82);
  text-wrap: pretty;
}

.dm__handle {
  display: inline-block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent-link);
  transition: color 110ms ease-out;
}

.dm__handle:hover { color: var(--ink); }

/* ---------- Link-Karten ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  border-radius: var(--r-card);
  background-image: linear-gradient(160deg,
    rgba(251, 249, 253, 0.1) 0%,
    rgba(251, 249, 253, 0.035) 55%,
    rgba(251, 249, 253, 0.06) 100%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(251, 249, 253, 0.16),
    inset 0 0 0 1px var(--ink-07),
    0 6px 18px rgba(0, 0, 0, 0.35);
  animation: cardIn 620ms cubic-bezier(0.22, 0.9, 0.28, 1) both;
  animation-delay: calc(200ms + var(--i, 0) * 60ms);
  transition: box-shadow 110ms ease-out, transform 110ms ease-out, background-color 110ms ease-out;
}

a.link:hover {
  transform: translateY(-3px);
  background-color: color-mix(in oklab, var(--accent) 16%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(251, 249, 253, 0.22),
    inset 0 0 0 1px color-mix(in oklab, var(--accent-line) 45%, transparent),
    0 16px 36px color-mix(in oklab, var(--accent-deep) 40%, transparent);
}

a.link:active { transform: translateY(-1px) scale(0.99); }

.link--primary {
  background-image: linear-gradient(160deg,
    color-mix(in oklab, var(--accent) 22%, transparent) 0%,
    color-mix(in oklab, var(--accent-mid) 12%, transparent) 55%,
    color-mix(in oklab, var(--accent) 16%, transparent) 100%);
  box-shadow:
    inset 0 1px 0 rgba(251, 249, 253, 0.2),
    inset 0 0 0 1px color-mix(in oklab, var(--accent-line) 30%, transparent),
    0 6px 18px rgba(0, 0, 0, 0.35);
}

.link--soon {
  opacity: 0.72;
  cursor: default;
}

.link__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-tile);
  background-image: linear-gradient(160deg,
    color-mix(in oklab, var(--accent) 38%, transparent) 0%,
    color-mix(in oklab, var(--accent-deep) 18%, transparent) 100%);
  box-shadow: inset 0 1px 0 rgba(251, 249, 253, 0.18);
  color: var(--accent-link);
}

.link__icon svg { width: 19px; height: 19px; }
.link__icon .icon-brand { color: var(--accent-icon); }
/* Die ClosingHub-Marke ist breiter als hoch, deshalb etwas groesser gesetzt */
.link__icon svg.marke { width: 23px; height: 23px; }

.link__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.link__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.link__sub {
  font-size: 12.5px;
  color: var(--ink-52);
}

.link__chevron {
  flex: none;
  display: flex;
  color: var(--ink-45);
}

.badge {
  flex: none;
  padding: 5px 9px;
  border-radius: var(--r-badge);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent-line) 30%, transparent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-icon);
}

/* ---------- Leiterbahn (Basis-Look von kurs.tobiasnase.de, auf die Violett-Palette gebracht) ---------- */
.circuit {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.circuit rect {
  x: 1px; y: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  rx: 23px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.circuit .c-run1 {
  stroke: var(--accent-icon);
  stroke-dasharray: 12 88;
  filter: drop-shadow(0 0 3px color-mix(in oklab, var(--accent-line) 90%, transparent));
  animation: circuitRun 2.4s linear infinite;
}

.circuit .c-run2 {
  stroke: var(--accent-line);
  stroke-dasharray: 8 92;
  filter: drop-shadow(0 0 3px color-mix(in oklab, var(--accent) 90%, transparent));
  animation: circuitRun 2.4s linear infinite;
  animation-delay: -1.2s;
}

@keyframes circuitRun { to { stroke-dashoffset: -100; } }

/* Karteninhalt ueber die Leiterbahn legen */
.link--primary .link__icon,
.link--primary .link__text,
.link--primary .link__chevron { position: relative; z-index: 2; }

/* ---------- Abschnitte unter den Karten (Meine Software, Meine Tools) ---------- */
/* Die Zeilen darin nutzen bewusst .link, damit sie exakt so aussehen wie die Karten oben. */
.abschnitt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 22px;
  border-top: 1px solid var(--ink-09);
}

.abschnitt__kopf {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.abschnitt__label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-label);
}

.abschnitt__label svg {
  flex: none;
  width: 13px; height: 13px;
}

.abschnitt__note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-52);
  text-wrap: pretty;
}

/* ---------- Aktivitaets-Punkt auf der Telegram-Kachel ---------- */
/* Wie ein Mitteilungs-Punkt auf einem App-Symbol: sagt "hier ist was los",
   ohne eine Zahl zu behaupten, die veralten kann. */
.link--primary .link__icon {
  position: relative;
  overflow: visible;
}

.link--primary .link__icon::after {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow:
    0 0 0 2px #0F0A17,
    0 0 6px color-mix(in oklab, var(--live) 60%, transparent);
  animation: punktPuls 2.6s ease-in-out infinite;
}

@keyframes punktPuls {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.18); opacity: 0.82; }
}

/* ---------- Social ---------- */
.socials {
  display: flex;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: riseIn 700ms var(--ease) 320ms both;
}

.socials li { flex: 1; display: flex; }

.social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border-radius: var(--r-social);
  background: rgba(251, 249, 253, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(251, 249, 253, 0.12);
  color: var(--accent-icon);
  transition: background 110ms ease-out, transform 110ms ease-out;
}

.social svg { width: 25px; height: 25px; }

.social:hover {
  background: color-mix(in oklab, var(--accent) 24%, transparent);
  transform: translateY(-3px);
}

.social:active { transform: translateY(0) scale(0.96); }

/* ---------- Rechtliches ---------- */
.legal {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 6px;
}

.legal a {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-52);
  transition: color 110ms ease-out;
}

.legal a:hover { color: var(--ink); }

/* ---------- Webansicht (Frame 2b) ---------- */
@media (min-width: 1000px) {
  /* Zwei Spalten, aber beide gedeckelt und als Block mittig im Fenster.
     Ohne Deckel wuerden die Karten auf breiten Schirmen auf 800 px und mehr auseinandergezogen. */
  .hub {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 600px);
    justify-content: center;
    gap: 64px;
    max-width: 1160px;
    align-items: stretch;
    padding:
      60px
      calc(40px + env(safe-area-inset-right))
      44px
      calc(40px + env(safe-area-inset-left));
  }

  .col {
    display: flex;
    flex-direction: column;
  }

  .col--intro { gap: 26px; }
  .col--links { gap: 18px; }

  /* Karten mittig zur Spaltenhoehe, Fusszeile unten auf Linie mit den Social-Kacheln */
  .stapel {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
  }

  .profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .profile__portrait {
    width: 128px; height: 128px;
    border-radius: 38px;
    box-shadow: 0 0 0 1px var(--ink-16), 0 18px 40px rgba(0, 0, 0, 0.5);
  }

  .profile__text { gap: 12px; }

  .profile__name {
    font-size: 46px;
    letter-spacing: -0.04em;
    line-height: 0.95;
  }

  .profile__role { font-size: 12px; letter-spacing: 0.14em; gap: 8px; }
  .profile__dot { width: 7px; height: 7px; }

  .bio {
    max-width: 360px;
    font-size: 16.5px;
  }

  .dm { gap: 12px; }
  .dm__avatar { width: 36px; height: 36px; }
  .dm__avatar svg { width: 18px; height: 18px; }
  .dm__bubble { max-width: 340px; padding: 15px 18px; }
  .dm__bubble p { font-size: 14px; }
  .dm__handle { margin-top: 8px; font-size: 13.5px; }

  .spacer { display: block; flex: 1; }

  .socials { width: 150px; gap: 9px; }
  .social { height: 52px; border-radius: 18px; }
  .social svg { width: 23px; height: 23px; }

  .links { gap: 12px; }
  .link { padding: 20px 22px; }
  .link__title { font-size: 17px; }

  /* Groessere Karte, laengere Laufzeit: die Impulse laufen gleich schnell wie mobil */
  .circuit .c-run1, .circuit .c-run2 { animation-duration: 3.8s; }
  .circuit .c-run2 { animation-delay: -1.9s; }

  .legal {
    justify-content: flex-end;
    align-items: center;
    min-height: 52px;
    padding-top: 0;
  }

  .legal a { font-size: 10.5px; }

  .bg__blob--a {
    top: -160px; left: -120px;
    width: 520px; height: 520px;
    filter: blur(40px);
  }

  .bg__blob--b {
    top: auto; bottom: -180px; right: -140px;
    width: 520px; height: 520px;
    filter: blur(44px);
  }

  .bg__grid { background-size: 22px 22px; }
}

/* ---------- Motion ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes auroraA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, 60px) scale(1.15); }
}

@keyframes auroraB {
  0%, 100% { transform: translate(0, 0) scale(1.05); }
  50%      { transform: translate(-60px, -40px) scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 1ms !important;
  }
  a.link:hover, .social:hover { transform: none; }
}
