/* Shared styles for every e-namecard page — generated pages link this file (see build.py) */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-latin.woff2') format('woff2');
}

:root {
  /* Rights Cracker Official Brand Palette */
  --bg-color: #0E1529;
  --card-bg: #15203F;
  --card-border: rgba(197, 208, 239, 0.12);
  --card-hover: rgba(197, 208, 239, 0.05);
  --text-main: #FFFFFF;
  --text-muted: #9CA8C7;
  --text-dim: #6B7A9F;
  
  --brand-blue: #2B4BAF;
  --brand-blue-hover: #1E3580;
  --brand-blue-light: #3B62D6;
  --accent-gradient: linear-gradient(135deg, #3B62D6 0%, #2B4BAF 100%);
  
  --button-bg: #1A284D;
  --button-border: rgba(197, 208, 239, 0.15);
  
  --wechat-color: #07C160;
  --line-color: #06C755;
  --facebook-color: #1877F2;
  --success: #10B981;
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Brand Glow */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(43, 75, 175, 0.22) 0%, rgba(14, 21, 41, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* ====================================================
   ANIMATED LOGO ELEMENTS SPLASH (Interactive ~2.2s)
   ==================================================== */
.splash-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 20px;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.logo-assembly {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

/* Ambient glow behind mark */
.logo-assembly::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 30px;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(43, 75, 175, 0.4) 0%, rgba(14, 21, 41, 0) 70%);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  display: none;
}

@keyframes glowFade {
  to { opacity: 1; }
}

.assembly-mark {
  height: 56px;
  width: auto;
  overflow: visible;
}

/* SVG Elements - Geometric Puzzle Assembly */
.elem-red, .elem-yellow, .elem-blue, .elem-white {
  transform-box: fill-box;
  transform-origin: center;
}

/* 1. Red Semicircle: drops from top */
.elem-red {
  opacity: 0;
  transform: translateY(-45px) scale(0.65);
  animation: assembleRed 0.65s 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

/* 2. Yellow Polygon: slides from right */
.elem-yellow {
  opacity: 0;
  transform: translate(45px, -15px) scale(0.65);
  animation: assembleYellow 0.65s 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

/* 3. Blue Polygon: slides from bottom-left */
.elem-blue {
  opacity: 0;
  transform: translate(-45px, 20px) scale(0.65);
  animation: assembleBlue 0.65s 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

/* 4. White Semicircle: pops up from bottom */
.elem-white {
  opacity: 0;
  transform: translateY(45px) scale(0.65);
  animation: assembleWhite 0.65s 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

/* 5. Typography "Rights Cracker": fades & slides in as shapes connect */
.assembly-text {
  height: 52px;
  width: auto;
  object-fit: contain;
  opacity: 0;
  transform: translateX(-14px);
  filter: blur(3px);
  animation: revealLogoText 0.6s 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes assembleRed {
  0% { opacity: 0; transform: translateY(-45px) scale(0.65); }
  70% { opacity: 1; transform: translateY(2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes assembleYellow {
  0% { opacity: 0; transform: translate(45px, -15px) scale(0.65); }
  70% { opacity: 1; transform: translate(-2px, 1px) scale(1.04); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes assembleBlue {
  0% { opacity: 0; transform: translate(-45px, 20px) scale(0.65); }
  70% { opacity: 1; transform: translate(2px, -1px) scale(1.04); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes assembleWhite {
  0% { opacity: 0; transform: translateY(45px) scale(0.65); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes revealLogoText {
  0% { opacity: 0; transform: translateX(-14px); filter: blur(3px); }
  100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

/* Container: Fades in smoothly right as splash dissolves */
.container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.container.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Company Logo Banner at the top */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 2px;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Profile Card */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5);
}

.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 18px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand-blue-light);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background-color: var(--button-bg);
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #1D2B52, #131E3D);
  border: 2px solid rgba(197, 208, 239, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin-bottom: 4px;
  line-height: 1.3;
}

.profile-title {
  font-size: 15px;
  font-weight: 600;
  color: #93B2FF;
  margin-bottom: 4px;
}

.profile-company {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Official Pokémon Licensing Agent Showcase */
.pokemon-badge-container {
  margin-top: 18px;
  padding: 16px 14px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(30, 48, 96, 0.45) 0%, rgba(18, 28, 56, 0.75) 100%);
  border: 1px solid rgba(255, 203, 5, 0.25);
  box-shadow: 0 6px 22px -6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pokemon-logo-img {
  height: 48px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pokemon-badge-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #EBF1FF;
  text-align: center;
  line-height: 1.35;
  background: rgba(14, 21, 41, 0.7);
  border: 1px solid rgba(197, 208, 239, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: -0.01em;
}

.pokemon-shield-icon {
  color: #FFCB05;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Save Contact Button (Main Action) */
.save-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: var(--accent-gradient);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(43, 75, 175, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}

.save-contact-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(43, 75, 175, 0.3);
}

.save-contact-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Direct Contact List (Call, Email, LINE, WeChat) — values shown in full */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 4px 4px 8px;
}

.contact-list {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.contact-row + .contact-row {
  border-top: 1px solid var(--card-border);
}

.contact-row:active {
  background: var(--card-hover);
}

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.contact-row.call .contact-icon { color: #60A5FA; }
.contact-row.email .contact-icon { color: #93B2FF; }
.contact-row.line .contact-icon,
.contact-row.wechat .contact-icon {
  background: transparent;
  border: none;
}
.contact-row.line .contact-icon img,
.contact-row.wechat .contact-icon img {
  width: 38px;
  height: 38px;
  display: block;
}

.contact-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.contact-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-value {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
}

.contact-value.is-empty {
  color: var(--text-dim);
  font-weight: 600;
}

.contact-hint {
  color: var(--text-dim);
  display: flex;
  flex-shrink: 0;
}

.contact-hint svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Links & Connect — large icon buttons */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.link-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.link-tile:active {
  transform: scale(0.95);
  background: var(--card-hover);
  border-color: rgba(197, 208, 239, 0.3);
}

.link-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.link-tile-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.link-tile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
}

.link-tile-label {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.link-tile-handle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Footer & Utility Actions */
.footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.action-btn:active {
  transform: scale(0.97);
  color: #FFFFFF;
  border-color: rgba(197, 208, 239, 0.3);
  background: var(--card-hover);
}

.action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-credit {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1A284D;
  border: 1px solid rgba(197, 208, 239, 0.25);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

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

.toast-icon {
  color: var(--success);
  display: flex;
  align-items: center;
}

/* Modals (WeChat & QR Code) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 23, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay {
  /* Tall modals (WeChat QR) stay scrollable on short screens */
  overflow-y: auto;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.qr-container {
  background: #FFFFFF;
  padding: 14px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 18px;
}

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

.modal-close-btn {
  width: 100%;
  padding: 12px;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* WeChat QR modal (shown when a card has a WeChat QR image) */
.modal-icon-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  overflow: hidden;
}

.modal-icon-badge img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-container .wechat-qr-img {
  width: 220px;
  height: 220px;
  display: block;
  /* Long-press "Scan QR Code in Image" in WeChat needs a real, unclipped <img> */
  -webkit-touch-callout: default;
}

.wechat-id-box {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.wechat-id-value {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  overflow-wrap: anywhere;
  text-align: left;
}

.wechat-copy-btn {
  background: var(--brand-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.wechat-copy-btn:active {
  background: var(--brand-blue-hover);
}

.wechat-steps {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.wechat-steps li {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.wechat-steps strong {
  color: #FFFFFF;
  font-weight: 700;
}

.wechat-steps .zh {
  display: block;
  color: var(--text-dim);
}
