/* ── Forest Color Scheme (Neumorphic) ── */
:root {
  --bg: #E8F5E9;
  --bg-alt1: #dff0d8;
  --bg-alt2: #d4edda;
  --text: #385b2a;
  --accent: #7A8471;
  --success: #26A69A;
  --destructive: #FF4444;
  --shadow-light: rgba(255, 255, 255, 0.35);
  --shadow-dark: rgba(56, 91, 42, 0.2);
  --ripple-color: rgba(38, 166, 154, 0.1);
  --modal-backdrop: rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A241F;
    --bg-alt1: #1e2923;
    --bg-alt2: #172420;
    --text: #e4efce;
    --accent: #6B7B6B;
    --success: #1E8E82;
    --destructive: #FF6B6B;
    --shadow-light: rgba(255, 255, 255, 0.02);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --ripple-color: rgba(30, 142, 130, 0.12);
    --modal-backdrop: rgba(0, 0, 0, 0.55);
  }
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Epilogue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt1) 25%, var(--bg) 50%, var(--bg-alt2) 75%, var(--bg) 100%);
  background-size: 400% 400%;
  animation: aurora 20s ease infinite;
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Animations ── */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  65% {
    opacity: 1;
    transform: translateY(4px);
  }
  85% {
    transform: translateY(-1.5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes headerFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) skewX(-15deg);
  }
  40%, 100% {
    transform: translateX(200%) skewX(-15deg);
  }
}

@keyframes aurora {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes nudgeRight {
  0%, 82%, 100% { transform: translateX(0); }
  88% { transform: translateX(3px); }
  94% { transform: translateX(0.5px); }
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 440px;
  padding: 48px 0 64px;
}

/* ── Header ── */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
  animation: headerFade 0.5s ease-out both;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  user-select: none;
  object-fit: cover;
  border: none;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: var(--text);
}

.name-at {
  font-size: 17px;
  font-weight: 700;
}

.tagline {
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  opacity: 0.7;
  margin-top: 6px;
  letter-spacing: 0.2px;
  min-height: 1.35em;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--text);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

/* ── Link Cards ── */
.links {
  display: flex;
  flex-direction: column;
  gap: 20px;
  perspective: 800px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: none;
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  transform-style: preserve-3d;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  animation: fadeInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  position: relative;
  overflow: hidden;
}

.haptic-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ripple-color) 0%, transparent 70%);
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  pointer-events: none;
  animation: ripple 0.5s ease-out forwards;
}

.link-card:hover,
.link-card:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.link-card:hover .image-well,
.link-card:active .image-well {
  box-shadow: 3px 3px 5px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.link-card:hover .image-well::after,
.link-card:active .image-well::after {
  box-shadow: inset -3px -3px 5px var(--shadow-dark), inset 2px 2px 4px var(--shadow-light);
}

/* Card image / placeholder — recessed well */
.image-well {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease;
}

.image-well::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow: inset 3px 3px 5px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  transition: box-shadow 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

.hero-image-well {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  z-index: 1;
}

.hero-image-well::after {
  border-radius: 12px;
}

.link-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

.link-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  user-select: none;
  border: none;
}

/* Card text */
.link-content {
  flex: 1;
  min-width: 0;
}

.link-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.3;
  margin-bottom: 2px;
}

.link-desc {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.75;
  line-height: 1.35;
  white-space: normal;
}

/* Chevron */
.link-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease;
  animation: nudgeRight 4.5s ease-in-out infinite;
}

.link-card:hover .link-chevron {
  opacity: 0.7;
  transform: translateX(2px);
  animation: none;
}

/* ── Hero Card Wrapper ── */
.hero-card-wrapper {
  border-radius: 16px;
  animation: fadeInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  opacity: 0;
  transform-style: preserve-3d;
  will-change: transform;
  box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.hero-card-wrapper:hover,
.hero-card-wrapper:active {
  box-shadow: none;
}

.hero-card-wrapper .hero-card {
  animation: none;
  opacity: 1;
}

/* ── Hero Card ── */
.hero-card {
  padding: 16px;
  box-shadow: none;
  border: none;
  position: relative;
  overflow: hidden;
}

.hero-card:hover,
.hero-card:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 60%
  );
  animation: shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-image {
  border-radius: 0;
}

.hero-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  opacity: 0.5;
  margin-bottom: 2px;
}

.hero-title {
  font-size: 18px;
  font-weight: 900;
}

/* ── App Store Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  padding: 20px;
}

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

.modal {
  background: var(--bg);
  border: none;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.15s ease;
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  opacity: 0.8;
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  border: none;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15), inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-family: 'Epilogue', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  transition: box-shadow 0.15s ease;
}

.store-btn:hover {
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.store-btn:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.ios-btn {
  background: var(--text);
  color: var(--bg);
}

.android-btn {
  background: var(--bg);
  color: var(--text);
}

/* ── Touch Devices ── */
@media (hover: none) {
  .link-card:hover {
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  }

  .link-card:hover .image-well {
    box-shadow: none;
  }

  .link-card:hover .image-well::after {
    box-shadow: inset 3px 3px 5px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  }

  .hero-card:hover {
    box-shadow: none;
  }

  .hero-card-wrapper:hover {
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  }
}
