/* public/css/card.css — Pixel-Perfect Glassmorphic Digital Business Card */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --wine: #421518;
  --gold: #d2af80;
  --cream: #f8eee2;
  --muted: #d8bfb2;
  --bg-start: #733c3e;
  --bg-mid: #421518;
  --bg-end: #300d10;
  
  --shell-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.012) 65%);
  --shell-border: rgba(210, 175, 128, 0.25);
  --shell-shadow: 0 30px 90px rgba(26, 6, 8, 0.5);
  --link-bg: rgba(31, 7, 11, 0.28);
  --link-border: rgba(210, 175, 128, 0.34);
  --link-hover-bg: rgba(210, 175, 128, 0.12);
  --link-shadow: 0 10px 28px rgba(26, 6, 8, 0.35);
  --iconwrap-bg: rgba(210, 175, 128, 0.12);
  --logo-blend: screen;
  --intro-color: #ead4ca;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--cream);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(ellipse at 50% -10%, var(--bg-start) 0%, var(--bg-mid) 55%, var(--bg-end) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle organic noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--noise-opacity, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  z-index: 1;
}

main {
  max-width: 540px;
  margin: auto;
  padding: 44px 20px 32px;
  position: relative;
  z-index: 2;
}

/* Glassmorphic card container */
.shell {
  border: 1px solid var(--shell-border);
  border-radius: 28px;
  padding: 35px 28px 25px;
  background: var(--shell-bg);
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
}

/* Top utility bar (Share, QR, Save Contact) */
.utility-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--iconwrap-bg);
  border: 1px solid var(--link-border);
  color: var(--cream);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.util-btn:hover {
  background: var(--link-hover-bg);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.util-btn svg {
  width: 13px;
  height: 13px;
  stroke: var(--gold);
}

.topline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.33em;
  text-transform: uppercase;
  justify-content: center;
}

.topline::before,
.topline::after {
  content: '';
  height: 1px;
  width: 30px;
  background: var(--gold);
  opacity: 0.6;
}

.brand {
  text-align: center;
}

.logo {
  display: block;
  width: min(100%, 310px);
  max-height: 120px;
  object-fit: contain;
  margin: 20px auto 12px;
  mix-blend-mode: var(--logo-blend);
}

.category {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 15px;
}

.rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 19px;
}

.intro {
  font-size: 13px;
  line-height: 1.7;
  color: var(--intro-color);
  margin: 0 auto 27px;
  max-width: 330px;
  white-space: pre-line;
}

/* Links collection */
.links {
  display: grid;
  gap: 11px;
}

.link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--cream);
  border: 1px solid var(--link-border);
  border-radius: 15px;
  padding: 14px 15px;
  background: var(--link-bg);
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: var(--link-hover-bg);
  box-shadow: var(--link-shadow);
  outline: none;
}

.iconwrap {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--iconwrap-bg);
  color: var(--gold);
}

.iconwrap svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.desc {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.arrow {
  color: var(--gold);
  font-size: 21px;
  font-weight: 300;
  line-height: 1;
}

/* Footer elements */
.footer {
  text-align: center;
  margin: 29px 0 0;
}

.tagline {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--gold);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.footnote {
  font-size: 10px;
  letter-spacing: 0.19em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 12px;
}

.copyright {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
}

/* Modal Popup (QR Code) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 2, 4, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: linear-gradient(155deg, rgba(50, 15, 20, 0.95), rgba(30, 8, 12, 0.98));
  border: 1px solid var(--gold);
  border-radius: 24px;
  padding: 30px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--gold);
}

.qr-image-container {
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  display: inline-block;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.qr-image-container img {
  display: block;
  width: 200px;
  height: 200px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.action-btn {
  background: var(--gold);
  color: #2b0b0e;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.action-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Toast alert notification */
.toast-msg {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 8, 12, 0.95);
  border: 1px solid var(--gold);
  color: var(--cream);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Loading & Empty states */
.loading-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--gold);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(210, 175, 128, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  main {
    padding: 20px 13px 24px;
  }
  .shell {
    padding: 27px 18px 23px;
    border-radius: 23px;
  }
  .utility-bar {
    gap: 8px;
    margin-bottom: 18px;
  }
  .util-btn {
    padding: 6px 11px;
    font-size: 10.5px;
  }
  .logo {
    width: min(100%, 275px);
  }
  .link {
    padding: 12px;
  }
  .category {
    font-size: 10px;
    letter-spacing: 0.19em;
  }
}

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