/* Johannes Lundström — digital business card */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600.woff2") format("woff2");
}

:root {
  --bg: #07080a;
  --card: rgba(16, 17, 20, 0.8);
  --text: #f7f5f0;
  --muted: #c9c6be;
  --accent: #e6d3b4;
  --primary: #f7f4ee;
  --primary-ink: #141416;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px rgba(0, 0, 0, 0.28), 0 40px 90px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

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

html {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(228, 208, 174, 0.35);
  color: #fff;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--text);
  color: var(--bg);
  padding: 0.55rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  z-index: 20;
}

.skip:focus {
  transform: translateY(1rem);
}

html:not([lang="en"]) [lang="en"] {
  display: none;
}

html[lang="en"] [lang="sv"] {
  display: none;
}

.lang {
  position: fixed;
  z-index: 5;
  top: max(0.85rem, env(safe-area-inset-top));
  right: max(0.9rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(201, 198, 190, 0.45);
  font: inherit;
  letter-spacing: inherit;
  padding: 0.45rem 0.28rem;
  min-width: 1.8rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lang-sep {
  color: rgba(201, 198, 190, 0.35);
}

html[lang="sv"] .lang [data-set-lang="sv"],
html[lang="en"] .lang [data-set-lang="en"] {
  color: var(--text);
}

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

.glow {
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 34% at 50% 30%, rgba(230, 211, 180, 0.2), transparent 60%),
    radial-gradient(ellipse 34% 28% at 84% 86%, rgba(92, 118, 162, 0.14), transparent 64%),
    radial-gradient(ellipse 130% 90% at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.5) 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 2;
  width: min(27.5rem, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero {
  text-align: center;
  padding: 0 0.35rem;
}

.eyebrow,
.place {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.place {
  margin-top: 1.35rem;
}

.place::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 1px;
  margin: 0 auto 0.9rem;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.eyebrow::after {
  content: "";
  display: block;
  width: 1.5rem;
  height: 1px;
  margin: 0.75rem auto 0;
  background: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(3.15rem, 13.2vw, 4.5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.048em;
  color: var(--text);
}

.eyebrow + h1 {
  margin-top: 0.95rem;
}

.title {
  font-size: clamp(2.35rem, 9vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.tagline {
  margin: 1rem auto 0;
  max-width: 18rem;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: balance;
}

.card {
  position: relative;
  border-radius: 1.7rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015) 26%, transparent 48%),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 28%, rgba(255, 255, 255, 0.04));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem;
}

.btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 4.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  margin-left: auto;
  margin-right: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  opacity: 0.35;
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.btn-copy {
  min-width: 0;
}

.btn-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.btn-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, #ffffff 0%, var(--primary) 100%);
  color: var(--primary-ink);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(0, 0, 0, 0.22);
}

.btn-primary .btn-icon {
  background: rgba(18, 19, 22, 0.06);
  color: var(--primary-ink);
}

.btn-primary .btn-meta {
  color: #3f3f3c;
}

.pay-name {
  margin: 0;
  font-size: clamp(2.65rem, 11vw, 3.6rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.048em;
}

.pay-name + .title {
  margin-top: 1.05rem;
  font-size: clamp(1.7rem, 6vw, 2.05rem);
  letter-spacing: -0.03em;
  text-indent: 0;
  text-transform: none;
  font-weight: 600;
  color: var(--text);
}

.pay-alt {
  display: block;
  margin: 0.15rem 0 0;
  padding: 0.7rem 0.5rem 0.35rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.pay-alt:hover {
  color: var(--text);
}

.pay-methods {
  margin: 0.15rem 0.35rem 0.45rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.domain {
  align-self: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
}

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

.projects {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.projects-heading {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.85rem 0.95rem 0.85rem 1.05rem;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015) 26%, transparent 48%),
    rgba(16, 17, 20, 0.62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.045) inset, 0 10px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06) 28%, rgba(255, 255, 255, 0.03));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.project-copy {
  min-width: 0;
  flex: 1;
}

.project-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.project-text {
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.project-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary) 100%);
  color: var(--primary-ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.project-btn:active {
  transform: translateY(0);
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  }

  .btn:hover::after {
    opacity: 0.75;
    transform: translateX(3px) rotate(45deg);
  }

  .btn:hover .btn-icon {
    background: rgba(255, 255, 255, 0.12);
  }

  .btn-primary:hover {
    background: #fff;
    border-color: transparent;
    box-shadow: inset 0 1px 0 #fff, 0 14px 28px rgba(0, 0, 0, 0.28);
  }

  .btn-primary:hover .btn-icon {
    background: rgba(18, 19, 22, 0.1);
  }

  .project-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(0, 0, 0, 0.26);
  }
}

.btn:active {
  transform: scale(0.975);
  transition-duration: 0.08s;
}

.btn:active:not(.btn-primary) {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary:active {
  background: #e8e4db;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn:focus-visible,
.project-btn:focus-visible,
.domain:focus-visible,
.qr-close:focus-visible,
.qr-downloads a:focus-visible,
.lang button:focus-visible,
.skip:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

dialog {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(100%, 28rem);
  max-width: calc(100vw - 2rem);
  overflow: visible;
  color: var(--text);
  background: transparent;
}

dialog::backdrop {
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

dialog[open]::backdrop {
  animation: fade-in 0.28s ease;
}

dialog[open] .qr-sheet {
  animation: sheet-in 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

dialog.is-closing::backdrop {
  animation: fade-out 0.2s ease forwards;
}

dialog.is-closing .qr-sheet {
  animation: sheet-out 0.2s ease forwards;
}

.qr-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.qr-kicker::after {
  content: "";
  display: block;
  width: 1.5rem;
  height: 1px;
  margin: 0.7rem auto 0;
  background: var(--accent);
}

.qr-sheet:focus {
  outline: none;
}

.qr-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  padding: 3.4rem 1.25rem 1.4rem;
  border-radius: 1.75rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%),
    rgba(12, 13, 16, 0.96);
  box-shadow: var(--shadow);
}

.qr-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.qr-lead {
  margin: 0;
  max-width: 18rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.qr-frame {
  background: #fff;
  padding: 0.9rem;
  border-radius: 1.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.qr-frame img {
  display: block;
  width: min(72vw, 18.5rem);
  height: auto;
}

.qr-downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.qr-downloads a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.qr-downloads a,
.qr-close {
  transition: background 0.18s ease, transform 0.18s ease;
}

.qr-downloads a:hover,
.qr-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qr-downloads a:active,
.qr-close:active {
  transform: scale(0.97);
}

.noscript {
  position: relative;
  z-index: 2;
  margin: 1rem;
  text-align: center;
  color: var(--muted);
}

.noscript a {
  color: var(--text);
}

@media (max-width: 640px) {
  dialog {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
  }

  .qr-sheet {
    min-height: 100%;
    border-radius: 0;
    justify-content: center;
    padding:
      max(4.5rem, calc(env(safe-area-inset-top) + 3.5rem))
      1.25rem
      max(1.5rem, env(safe-area-inset-bottom));
    background: #07080a;
  }

  .qr-frame img {
    width: min(82vw, 22rem);
  }
}

@media (min-width: 800px) {
  .stage {
    width: min(30rem, 100%);
    gap: 2rem;
  }

  h1 {
    font-size: 4.5rem;
  }

  .tagline {
    font-size: 1.125rem;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 1.5%, 0) scale(1.05);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .btn:hover,
  .btn:active {
    transform: none;
  }
}
