/* ==========================================================================
   Amy Rose — "Petal Runway" Editorial Design
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  --bg: #FFF5F7;
  --bg-deep: #FFF0F3;
  --rose-hot: #FF3D7F;
  --rose-deep: #C2185B;
  --rose-neon: #FF6B9D;
  --rose-petal: #FFD6E0;
  --rose-blush: #FFECF1;
  --rose-glow: rgba(255, 61, 127, 0.35);
  --text: #1A1118;
  --text-muted: #6B5563;
  --white: #FFFFFF;
  --white-alpha-60: rgba(255, 255, 255, 0.6);
  --white-alpha-20: rgba(255, 255, 255, 0.2);

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --sp-xs: 0.5rem;
  --sp-sm: 0.75rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;
  --sp-4xl: 6rem;

  /* Radii */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-full: 50%;
  --r-pill: 60px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Film Grain Overlay
   -------------------------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* --------------------------------------------------------------------------
   Ambient Gradient Orbs
   -------------------------------------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: var(--r-full);
  filter: blur(100px);
  will-change: transform;
}

.ambient-orb--1 {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, var(--rose-petal) 0%, transparent 70%);
  top: -15%;
  right: -10%;
  animation: drift 25s ease-in-out infinite;
}

.ambient-orb--2 {
  width: 40vw;
  height: 40vw;
  max-width: 480px;
  max-height: 480px;
  background: radial-gradient(circle, rgba(255, 61, 127, 0.12) 0%, transparent 70%);
  bottom: 5%;
  left: -15%;
  animation: drift 30s ease-in-out infinite reverse;
}

.ambient-orb--3 {
  width: 30vw;
  height: 30vw;
  max-width: 360px;
  max-height: 360px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.1) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: drift 20s ease-in-out infinite 5s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(30px, -20px) scale(1.05); }
  50%      { transform: translate(-20px, 30px) scale(0.95); }
  75%      { transform: translate(15px, 15px) scale(1.03); }
}

/* --------------------------------------------------------------------------
   HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-4xl) var(--sp-xl) var(--sp-3xl);
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xl);
}

/* ---- Photo ---- */
.hero-photo {
  position: relative;
  display: inline-block;
  animation: heroPhotoIn 1s var(--ease-out-expo) 0.2s both;
}

.hero-photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: var(--r-full);
  background: conic-gradient(
    from 0deg,
    var(--rose-hot),
    var(--rose-neon),
    var(--rose-petal),
    var(--rose-deep),
    var(--rose-hot)
  );
  animation: ringRotate 8s linear infinite;
  z-index: -1;
}

.hero-photo-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: var(--r-full);
  background: var(--bg);
}

.hero-photo-img {
  width: clamp(160px, 30vw, 220px);
  height: clamp(160px, 30vw, 220px);
  border-radius: var(--r-full);
  object-fit: cover;
  object-position: center top;
  display: block;
  position: relative;
  z-index: 1;
  border: 5px solid var(--bg);
}

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

@keyframes heroPhotoIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---- Title ---- */
.hero-text {
  animation: heroTextIn 0.9s var(--ease-out-expo) 0.5s both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: normal;
  font-optical-sizing: auto;
  line-height: 0.88;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title-line {
  display: block;
}

.hero-title-line--1 {
  font-size: clamp(4.5rem, 15vw, 9rem);
  font-variation-settings: 'opsz' 144;
}

.hero-title-line--2 {
  font-size: clamp(5rem, 17vw, 10rem);
  font-style: italic;
  font-weight: 600;
  color: var(--rose-hot);
  font-variation-settings: 'opsz' 144;
  margin-top: -0.05em;
}

.hero-tagline {
  margin-top: var(--sp-md);
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: heroTaglineIn 0.8s var(--ease-out-expo) 0.8s both;
}

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

@keyframes heroTaglineIn {
  from {
    opacity: 0;
    letter-spacing: 0.6em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.25em;
  }
}

/* ---- Social Badges ---- */
.social-badges {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-2xl);
  animation: badgeIn 0.7s var(--ease-out-expo) 1s both;
}

.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 61, 127, 0.15);
  border-radius: var(--r-pill);
  color: var(--rose-deep);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: all 0.35s var(--ease-out-expo);
}

.social-badge:hover {
  background: var(--rose-hot);
  color: var(--white);
  border-color: var(--rose-hot);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--rose-glow);
}

.social-badge:focus-visible {
  outline: 2px solid var(--rose-hot);
  outline-offset: 3px;
}

.social-badge-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-badge-label {
  font-family: var(--font-body);
}

@keyframes badgeIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- Link Cards Grid ---- */
.links-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  width: 100%;
  max-width: 560px;
  margin-top: var(--sp-md);
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px var(--sp-lg);
  padding: var(--sp-lg) var(--sp-xl);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 61, 127, 0.1);
  border-radius: var(--r-lg);
  transition: all 0.4s var(--ease-out-expo);
  cursor: pointer;
  overflow: hidden;
}

/* Gradient shimmer on hover */
.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--rose-blush), var(--rose-petal), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.link-card:hover::before,
.link-card:focus-visible::before {
  opacity: 0.6;
}

.link-card:hover {
  border-color: var(--rose-hot);
  box-shadow:
    0 8px 32px rgba(255, 61, 127, 0.12),
    0 2px 8px rgba(255, 61, 127, 0.08);
}

.link-card:focus-visible {
  outline: 2px solid var(--rose-hot);
  outline-offset: 3px;
}

.link-card-brand {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.link-card-code {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--rose-deep);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.link-card-arrow {
  grid-column: 2;
  grid-row: 1 / -1;
  font-size: 1.4rem;
  color: var(--rose-hot);
  transition: transform 0.35s var(--ease-spring);
  position: relative;
  z-index: 1;
  opacity: 0.5;
}

.link-card:hover .link-card-arrow {
  transform: translateX(5px);
  opacity: 1;
}

/* ---- Staggered Entrance ---- */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.adopt-banner--stagger {
  animation: cardIn 0.7s var(--ease-out-expo) 1.1s both;
}

.link-card--stagger:nth-child(1) { animation: cardIn 0.7s var(--ease-out-expo) 1.25s both; }
.link-card--stagger:nth-child(2) { animation: cardIn 0.7s var(--ease-out-expo) 1.4s both; }
.link-card--stagger:nth-child(3) { animation: cardIn 0.7s var(--ease-out-expo) 1.55s both; }

/* --------------------------------------------------------------------------
   ADOPTION BANNER
   -------------------------------------------------------------------------- */
.adopt-banner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px var(--sp-lg);
  padding: var(--sp-lg) var(--sp-xl);
  background: linear-gradient(135deg, var(--rose-hot), var(--rose-deep));
  border-radius: var(--r-xl);
  color: var(--white);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  margin-top: var(--sp-xl);
  cursor: pointer;
  transition: all 0.4s var(--ease-out-expo);
  text-decoration: none;
}

.adopt-banner:hover {
  box-shadow:
    0 8px 32px rgba(255, 61, 127, 0.25),
    0 2px 8px rgba(255, 61, 127, 0.15);
}

/* Decorative soft glow */
.adopt-banner::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  top: -60px;
  right: -40px;
  pointer-events: none;
}

.adopt-banner-heart {
  position: absolute;
  left: var(--sp-lg);
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  animation: heartbeat 2.5s ease-in-out infinite;
  z-index: 1;
}

.adopt-banner-heart-svg {
  width: 32px;
  height: 32px;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.15); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.1); }
  56%      { transform: scale(1); }
}

.adopt-banner-content {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.adopt-banner-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
}

.adopt-banner-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--white);
}

.adopt-banner:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: var(--r-xl);
}

.adopt-banner-arrow {
  grid-column: 2;
  grid-row: 1 / -1;
  font-size: 1.4rem;
  color: var(--white);
  transition: transform 0.35s var(--ease-spring);
  position: relative;
  z-index: 1;
  opacity: 0.5;
}

.adopt-banner:hover .adopt-banner-arrow {
  transform: translateX(5px);
  opacity: 1;
}

.adopt-banner-sub {
  font-size: 0.78rem;
  opacity: 0.75;
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .ambient-orb,
  .hero-photo-ring {
    animation: none !important;
  }
}

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

/* Small phones */
@media (max-width: 380px) {
  .hero {
    padding: var(--sp-lg) var(--sp-md);
  }

  .link-card {
    padding: var(--sp-md) var(--sp-lg);
  }

  .adopt-banner {
    padding: var(--sp-md) var(--sp-lg);
  }
}

/* Tablets and up — allow wider cards */
@media (min-width: 640px) {
  .links-grid {
    max-width: 620px;
  }

  .adopt-banner {
    max-width: 620px;
  }

  .link-card {
    padding: var(--sp-lg) var(--sp-2xl);
  }

  .adopt-banner {
    padding: var(--sp-xl) var(--sp-2xl);
  }
}

/* Desktop — subtle layout shift */
@media (min-width: 1024px) {
  .hero-inner {
    flex-direction: row;
    gap: var(--sp-3xl);
    text-align: left;
  }

  .hero-title {
    text-align: left;
  }

  .hero-tagline {
    text-align: left;
  }
}
