/* ============================================
   Matt Bylett — Digital Business Card
   ============================================ */

:root {
  --bg: #0f1119;
  --bg-card: #161822;
  --teal: #2fbfb0;
  --teal-glow: rgba(47, 191, 176, 0.15);
  --white: #f0f0f0;
  --muted: #8a8fa0;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 16px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
}

/* ---- Animated grid background ---- */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.grid-container {
  position: absolute;
  bottom: -40px;
  right: -40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  width: 90vw;
  max-width: 900px;
  opacity: 0.35;
}

@media (max-width: 639px) {
  .grid-container {
    width: 110vw;
    bottom: -20px;
    right: -30px;
  }
}

.grid-tile {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--teal);
  opacity: 0.08;
  animation: breathe var(--duration, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes breathe {
  0%, 100% { opacity: 0.04; }
  50% { opacity: 0.35; }
}

/* ---- Card ---- */

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* ---- Photo ---- */

.photo-wrapper {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  margin-bottom: 28px;
  position: relative;
}

.photo-wrapper::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  opacity: 0;
  animation: ring-pulse 4s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.03); }
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(47, 191, 176, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder::before {
  content: 'MB';
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--teal);
  letter-spacing: -0.02em;
}

/* ---- Typography ---- */

.name {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.title-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--teal);
}

.title-bar {
  display: block;
  width: 40px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.logo-trust {
  color: var(--white);
}

.logo-tech {
  color: var(--teal);
}

.tagline {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 320px;
}

/* ---- Contact rows ---- */

.contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 28px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.contact-row:hover {
  border-color: rgba(47, 191, 176, 0.3);
  box-shadow: 0 0 20px var(--teal-glow);
  transform: translateY(-1px);
}

.contact-row .icon {
  flex-shrink: 0;
  color: var(--teal);
}

/* ---- Action buttons ---- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease, background 0.3s ease;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--white);
}

.action-btn:hover {
  border-color: rgba(47, 191, 176, 0.3);
  box-shadow: 0 0 20px var(--teal-glow);
  transform: translateY(-1px);
}

.action-btn--primary {
  background: var(--teal);
  color: var(--bg);
  border-color: var(--teal);
}

.action-btn--primary:hover {
  background: #26a89a;
  border-color: #26a89a;
  box-shadow: 0 0 30px rgba(47, 191, 176, 0.3);
}

/* ---- Icons ---- */

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---- Fade-in animation ---- */

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */

@media (min-width: 640px) {
  .photo-wrapper {
    width: 150px;
    height: 150px;
  }

  .name {
    font-size: 2.4rem;
  }

  .logo {
    font-size: 1.75rem;
  }

  .grid-container {
    width: 50vw;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .grid-tile {
    animation: none;
    opacity: 0.12;
  }

  .photo-wrapper::after {
    animation: none;
  }

  .contact-row,
  .action-btn {
    transition: none;
  }
}
