/* abdu.codes/links: the page a QR code points at. Phone first: one column,
   big thumb-sized buttons, the contact card on top. From 900px wide it
   becomes a card beside a QR panel, so someone at a computer can hand the
   page over to their phone. Colours, fonts and dark mode all come from the
   tokens in styles.css. */

/* The page's two serif headings (the name, and the QR panel's line on
   desktop) only need one weight of plain Latin, so they use a 10 KiB cut
   of Source Serif 4 instead of the site's full 119 KiB variable font. */
@font-face {
  font-family: "Source Serif 4 Basic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-600-basic.woff2") format("woff2");
}

body.lk {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--c-pub) 12%, transparent), transparent 70%),
    var(--paper);
  line-height: 1.5;
}

.lk-shell { width: 100%; max-width: 440px; }

/* ── profile */
.lk-head { text-align: center; }
.lk-avatar {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover; display: block;
  margin: 0 auto 1rem; border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line-2), 0 10px 24px rgba(22, 26, 33, 0.14);
}
.lk-head h1 {
  font-family: "Source Serif 4 Basic", var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 0.3rem; line-height: 1.15;
}
.lk-role { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.lk-focus { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* ── the three main actions */
.lk-actions { display: grid; gap: 0.7rem; margin-top: 1.75rem; }
.lk-btn {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 0.9rem;
  min-height: 66px; padding: 0.75rem 1rem 0.75rem 1.1rem; border-radius: 12px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(22, 26, 33, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.lk-btn:hover { text-decoration: none; }
.lk-btn:active { transform: scale(0.985); }
.lk-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lk-btn svg.lk-go { width: 18px; height: 18px; color: var(--faint); transition: transform 0.16s ease; }
.lk-btn-text b { display: block; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.lk-btn-text small { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.35; margin-top: 0.1rem; }

.lk-btn-primary {
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 72px; color: #fff; background: var(--c-pub-fill); border-color: var(--c-pub-fill);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c-pub) 30%, transparent);
}
.lk-btn-primary .lk-btn-text small { color: rgba(255, 255, 255, 0.82); }
.lk-btn-primary svg { width: 24px; height: 24px; }

@media (hover: hover) {
  .lk-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--c-pub) 45%, var(--line-2)); box-shadow: 0 8px 20px rgba(22, 26, 33, 0.08); }
  .lk-btn:hover svg.lk-go { transform: translateX(3px); color: var(--c-pub); }
  .lk-btn-primary:hover { background: color-mix(in srgb, var(--c-pub-fill) 88%, #000); border-color: transparent; box-shadow: 0 10px 26px color-mix(in srgb, var(--c-pub) 38%, transparent); }
}

/* shown after "Save contact" on browsers that only download the .vcf */
.lk-hint {
  margin: -0.15rem 0 0.1rem; padding: 0.75rem 0.9rem; border-radius: 10px;
  font-size: 0.84rem; line-height: 1.45; color: var(--ink-2);
  background: color-mix(in srgb, var(--c-pub) 7%, var(--card));
  border: 1px solid color-mix(in srgb, var(--c-pub) 22%, transparent);
}
.lk-hint b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.lk-hint-alt { display: block; margin-top: 0.35rem; color: var(--muted); }
.lk-hint a { color: var(--c-pub); font-weight: 600; }

/* ── GitHub, LinkedIn, Email as three equal tiles */
.lk-social { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.lk-social a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 70px; border-radius: 12px; font-size: 0.82rem; font-weight: 500;
  color: var(--ink-2); background: var(--card); border: 1px solid var(--line);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.lk-social a:hover { text-decoration: none; }
.lk-social a:active { transform: scale(0.97); }
.lk-social svg { width: 22px; height: 22px; }
.lk-social svg:not([fill]) { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .lk-social a:hover { color: var(--ink); border-color: var(--ink-2); transform: translateY(-1px); }
}

/* ── footer: share, theme, wordmark */
.lk-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.6rem; }
.lk-share {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 2.25rem; padding: 0 0.85rem;
  font: 500 0.85rem var(--sans); color: var(--ink-2); cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
}
.lk-share:hover { color: var(--ink); border-color: var(--ink-2); }
.lk-share svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lk-share.is-done { color: #fff; background: var(--c-prj-fill); border-color: var(--c-prj-fill); }
.lk .lk-theme { width: 2.25rem; height: 2.25rem; color: var(--ink-2); border-color: var(--line-2); }
.lk .lk-theme:hover { color: var(--ink); border-color: var(--ink-2); }
.lk-privacy { font-size: 0.8rem; color: var(--faint); white-space: nowrap; padding: 0.4rem 0.15rem; }
.lk-privacy:hover { color: var(--ink-2); }
.lk-brand { margin-left: auto; font-family: var(--mono); font-size: 0.9rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.lk-brand:hover { text-decoration: none; }
.lk-brand .brand-sl { color: var(--faint); font-weight: 400; }

.lk-legal { margin: 1.1rem 0 0; text-align: center; font-size: 0.75rem; }
.lk-legal a { color: var(--faint); }

/* ── the QR panel only makes sense on a computer */
.lk-side { display: none; }

@media (min-width: 900px) {
  body.lk { padding: 3rem 1.5rem; }
  .lk-shell {
    max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem; align-items: stretch;
  }
  .lk-card, .lk-side {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(22, 26, 33, 0.04), 0 18px 40px rgba(22, 26, 33, 0.08);
  }
  .lk-card { padding: 2.4rem 2.4rem 1.6rem; }
  /* on the white card the tiles and buttons need the page tone to separate */
  .lk-card .lk-btn:not(.lk-btn-primary), .lk-card .lk-social a { background: var(--paper); }
  .lk-side {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 2rem 1.75rem;
  }
  .lk-side-k {
    margin: 0 0 0.4rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--c-pub);
  }
  .lk-side h2 {
    margin: 0 0 1.4rem; font-family: "Source Serif 4 Basic", var(--serif); font-size: 1.3rem; font-weight: 600;
    line-height: 1.3; color: var(--ink);
  }
  /* always dark-on-white, whatever the theme: phone cameras read that best */
  .lk-qr { width: 200px; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--line-2); }
  .lk-qr svg { display: block; width: 100%; height: auto; }
  .lk-side-url { margin: 1rem 0 0; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  .lk-btn, .lk-social a, .lk-btn svg.lk-go { transition: none; }
}

/* ── LinkedIn: a wide button in LinkedIn blue right under Save contact,
   with a slow glow and a sheen that sweeps across it now and then.
   White on #0a66c2 is 5.7:1, fine in both themes. */
.lk-btn-linkedin {
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff; background: #0a66c2; border-color: #0a66c2;
  box-shadow: 0 6px 18px rgba(10, 102, 194, 0.32);
}
.lk-card .lk-btn.lk-btn-linkedin { background: #0a66c2; }
.lk-btn-linkedin .lk-btn-text small { color: rgba(255, 255, 255, 0.82); }
.lk-btn-linkedin svg { fill: currentColor; stroke: none; }
.lk-btn-linkedin svg.lk-go { fill: none; stroke: currentColor; color: rgba(255, 255, 255, 0.85); }
.lk-btn-linkedin::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.24) 50%, transparent 70%);
  transform: translateX(-120%);
}
@media (hover: hover) {
  .lk-btn-linkedin:hover, .lk-card .lk-btn.lk-btn-linkedin:hover { background: #004182; border-color: #004182; color: #fff; }
  .lk-btn-linkedin:hover svg.lk-go { color: #fff; }
}
@media (prefers-reduced-motion: no-preference) {
  .lk-btn-linkedin { animation: lk-glow 2.8s ease-in-out infinite; }
  .lk-btn-linkedin::after { animation: lk-sheen 4.5s ease-in-out 1s infinite; }
  .lk-btn-linkedin:hover { animation-play-state: paused; }
}
@keyframes lk-glow {
  0%, 100% { box-shadow: 0 6px 18px rgba(10, 102, 194, 0.30); }
  50%      { box-shadow: 0 8px 26px rgba(10, 102, 194, 0.55), 0 0 0 3px rgba(10, 102, 194, 0.16); }
}
@keyframes lk-sheen {
  0%, 60% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

/* ── phones: the whole card fits on one screen (about 390 x 660 visible in
   Safari with its toolbar) without scrolling. Same content, tighter
   rhythm; every tap target stays at least 44px tall. */
@media (max-width: 600px) {
  body.lk { padding-top: max(0.9rem, env(safe-area-inset-top)); padding-bottom: max(0.9rem, env(safe-area-inset-bottom)); }
  .lk-avatar { width: 76px; height: 76px; margin-bottom: 0.6rem; border-width: 2px; }
  .lk-head h1 { font-size: 1.65rem; margin-bottom: 0.2rem; }
  .lk-role { font-size: 0.88rem; line-height: 1.4; }
  .lk-focus { font-size: 0.8rem; margin-top: 0.2rem; }

  .lk-actions { gap: 0.5rem; margin-top: 1.05rem; }
  .lk-btn { min-height: 56px; padding: 0.55rem 0.9rem; gap: 0.8rem; border-radius: 11px; }
  .lk-btn-primary { min-height: 58px; }
  .lk-btn-text b { font-size: 0.97rem; }
  .lk-btn-text small { font-size: 0.78rem; margin-top: 0; }
  .lk-btn svg { width: 21px; height: 21px; }

  /* icon beside the label instead of above it */
  .lk-social { margin-top: 0.5rem; gap: 0.5rem; }
  .lk-social a { flex-direction: row; gap: 0.45rem; min-height: 48px; font-size: 0.85rem; }
  .lk-social svg { width: 19px; height: 19px; }

  .lk-foot { margin-top: 0.85rem; }
  .lk-share, .lk .lk-theme { height: 2.1rem; }
  .lk .lk-theme { width: 2.1rem; }
  .lk-legal { margin-top: 0.55rem; }
}
/* very short screens (iPhone SE, landscape): smaller photo, no focus line */
@media (max-width: 600px) and (max-height: 620px) {
  .lk-avatar { width: 58px; height: 58px; margin-bottom: 0.45rem; }
  .lk-head h1 { font-size: 1.5rem; }
  .lk-focus { display: none; }
  .lk-actions { margin-top: 0.8rem; gap: 0.42rem; }
  .lk-btn, .lk-btn-primary { min-height: 50px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .lk-social a { min-height: 44px; }
  .lk-foot { margin-top: 0.6rem; }
  .lk-legal { margin-top: 0.35rem; }
}
/* laptops: the two-column card fits in a typical window height too */
@media (min-width: 900px) and (max-height: 920px) {
  body.lk { padding: 1.25rem 1.5rem; }
  .lk-card { padding: 1.7rem 2.2rem 1.2rem; }
  .lk-avatar { width: 84px; height: 84px; margin-bottom: 0.7rem; }
  .lk-head h1 { font-size: 1.8rem; }
  .lk-actions { gap: 0.55rem; margin-top: 1.2rem; }
  .lk-btn { min-height: 56px; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .lk-btn-primary { min-height: 60px; }
  .lk-social { margin-top: 0.55rem; }
  .lk-social a { flex-direction: row; gap: 0.45rem; min-height: 50px; }
  .lk-foot { margin-top: 1rem; }
  .lk-legal { margin-top: 0.6rem; }
}
@media (min-width: 900px) and (max-height: 700px) {
  body.lk { padding-top: 0.8rem; padding-bottom: 0.8rem; }
  .lk-card { padding-top: 1.3rem; padding-bottom: 1rem; }
  .lk-avatar { width: 68px; height: 68px; }
  .lk-focus { display: none; }
}
