@font-face {
  font-family: Space;
  src: url("/assets/display.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: DM;
  src: url("/assets/body.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #090c12;
  --lime: #ccff00;
  --lilac: #c6b7ff;
  --mint: #b8f3d7;
  --cream: #f7f7ef;
  --olive: #536700;
  --muted: #5c6470;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: DM, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100svh;
}

a { color: inherit; }
button { font: inherit; }

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.orbit {
  position: absolute;
  width: 520px;
  height: 220px;
  background: var(--lilac);
  border-radius: 50%;
  top: 42%;
  left: -140px;
  transform: rotate(-28deg);
  pointer-events: none;
  z-index: 0;
}
.orbit-mint {
  position: absolute;
  width: 280px;
  height: 280px;
  background: var(--mint);
  border-radius: 50%;
  right: -90px;
  bottom: -80px;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5vw;
  background: var(--lime);
  border-bottom: 1px solid #090c1222;
}
.brand {
  text-decoration: none;
  font-family: Space, Arial, sans-serif;
  font-size: 22px;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.brand span:not(.brandmark) { color: var(--olive); }
.brandmark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 9px;
  font-size: 16px;
}
.topbar-meta {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 16px 48px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #090c1220;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 12px 24px 50px #090c1220;
}

.card-hero {
  background: var(--lime);
  padding: 24px 24px 20px;
  position: relative;
}
.card-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}
h1 {
  font-family: Space, Arial, sans-serif;
  font-size: clamp(34px, 8vw, 44px);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0 0 14px;
}
.avatar {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-family: Space, Arial, sans-serif;
  font-size: 26px;
  letter-spacing: -0.04em;
  transform: rotate(6deg);
  box-shadow: 6px 8px 0 #090c1230;
}

.card-body { padding: 22px 24px 26px; }

.rows { display: grid; gap: 14px; margin-bottom: 22px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #090c1220;
}
.icon svg { width: 18px; height: 18px; }
.icon.phone { background: var(--mint); }
.icon.email { background: var(--lilac); }
.icon.web { background: var(--lime); }
.row span, .row a {
  font-size: 15px;
  text-decoration: none;
}
.row:hover span { text-decoration: underline; text-underline-offset: 4px; }

.divider {
  height: 1px;
  background: #090c1220;
  margin: 0 0 20px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.qr-wrap { text-align: center; }
.qr-frame {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.qr-frame img { width: 100%; height: 100%; display: block; }
.qr-caption {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.spin {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-error { font-size: 11px; text-align: center; padding: 8px; color: var(--muted); }

.save {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 16px 18px;
  border-radius: 100px;
  font-family: Space, Arial, sans-serif;
  font-size: 16px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.save:hover {
  transform: translateY(-3px);
  box-shadow: 5px 6px 0 #090c1230;
}
.save .mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.meta {
  margin-top: 20px;
  text-align: center;
}
.ref {
  display: inline-block;
  border: 1px solid #090c1230;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.tagline {
  margin: 14px 0 0;
  font-family: Space, Arial, sans-serif;
  letter-spacing: -0.03em;
  font-size: 14px;
}

footer.page-foot {
  position: relative;
  z-index: 1;
  padding: 18px 5vw 24px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
footer.page-foot .brand span:not(.brandmark) { color: var(--lime); }
footer.page-foot .brandmark { background: var(--lime); color: var(--ink); }
footer.page-foot small { font-size: 12px; color: #a1aab8; }

/* Share / OG preview layout */
#share-view[hidden],
#card-view[hidden] {
  display: none !important;
}
#share-view {
  min-height: 100svh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#share-frame {
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1200 / 630;
  background: var(--lime);
  border-radius: 0;
  position: relative;
  overflow: hidden;
}
.share-orbit {
  position: absolute;
  width: 720px;
  height: 280px;
  background: var(--lilac);
  border-radius: 50%;
  left: -180px;
  bottom: -40px;
  transform: rotate(-30deg);
}
.share-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 64px 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.share-inner .eyebrow { margin-bottom: 18px; font-size: 13px; }
.share-inner h2 {
  font-family: Space, Arial, sans-serif;
  font-size: clamp(64px, 7vw, 96px);
  letter-spacing: -0.05em;
  line-height: 0.92;
  margin: 0 0 22px;
}
.share-url {
  margin-top: 28px;
  font-size: 18px;
}
.share-avatar {
  width: 200px;
  height: 200px;
  border-radius: 56px;
  background: var(--ink);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-family: Space, Arial, sans-serif;
  font-size: 72px;
  letter-spacing: -0.05em;
  transform: rotate(8deg);
  box-shadow: 12px 16px 0 #090c1230;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .topbar { padding: 16px 5vw; }
  .brand { font-size: 19px; }
  .main { padding: 24px 14px 36px; }
  .card-hero, .card-body { padding-left: 20px; padding-right: 20px; }
}
