/* =========================================================================
   SHORTIFYE — ShareMe Page Stylesheet
   Structure:
     1. Reset & Root Tokens
     2. Base / Accessibility
     3. Motion System (keyframes + scroll reveal)
     4. Header / Navigation
     5. Hero
     6. Choice Cards
     7. Info Strip
     8. Footer
     9. Responsive
   ========================================================================= */

/* ---------- 1. Reset & Root Tokens ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand */
  --primary: #5146df;
  --primary-dark: #161650;
  --accent: #2d8edb;

  /* Text */
  --text-dark: #202044;
  --text-heading: #20204c;
  --text-muted: #77778d;
  --text-soft: #858599;
  --text-faint: #9292a3;
  --text-feature: #5b5b72;

  /* Surfaces */
  --bg-page: #f5f7ff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-soft: rgba(255, 255, 255, 0.68);
  --bg-feature: #f6f6ff;
  --bg-hover: #f4f3ff;

  /* Borders */
  --border: rgba(81, 70, 223, 0.10);
  --border-soft: rgba(81, 70, 223, 0.08);
  --border-feature: #ecebfa;
  --border-hover: rgba(81, 70, 223, 0.24);

  /* Elevation */
  --shadow-sm: 0 8px 20px rgba(81, 70, 223, 0.25);
  --shadow-nav: 0 12px 35px rgba(46, 42, 120, 0.07);
  --shadow-card: 0 12px 35px rgba(46, 42, 120, 0.07);
  --shadow-card-hover: 0 22px 48px rgba(46, 42, 120, 0.13);

  /* Radius */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 25px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --speed-fast: 0.2s;
  --speed: 0.3s;
  --speed-slow: 0.6s;
}

/* ---------- 2. Base / Accessibility ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at 90% 0%, rgba(92, 75, 230, 0.14), transparent 32%),
    radial-gradient(circle at 0% 45%, rgba(45, 142, 219, 0.08), transparent 28%),
    var(--bg-page);
}

a {
  color: inherit;
}

/* Custom scrollbar to match the brand gradient */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-page);
}

::selection {
  background: var(--primary);
  color: #fff;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 55px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(81, 70, 223, 0.35);
  outline-offset: 3px;
}

/* ---------- 3. Motion System ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatDot {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

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

@keyframes shimmer {
  from {
    transform: translateX(-120%) skewX(-15deg);
  }
  to {
    transform: translateX(220%) skewX(-15deg);
  }
}

/* Load-in choreography — works everywhere, no JS required */
header,
.hero > *,
.choices > .choice,
.info > .info-item {
  animation: fadeInUp var(--speed-slow) var(--ease) both;
}

header { animation-delay: 0s; }
.hero > *:nth-child(1) { animation-delay: 0.08s; }
.hero > *:nth-child(2) { animation-delay: 0.16s; }
.hero > *:nth-child(3) { animation-delay: 0.24s; }

.choices > .choice:nth-child(1) { animation-delay: 0.3s; }
.choices > .choice:nth-child(2) { animation-delay: 0.38s; }

.info > .info-item:nth-child(1) { animation-delay: 0.44s; }
.info > .info-item:nth-child(2) { animation-delay: 0.5s; }
.info > .info-item:nth-child(3) { animation-delay: 0.56s; }

/* Progressive enhancement: real scroll-linked reveals on browsers that
   support CSS scroll-driven animations (Chromium 115+). */
@supports (animation-timeline: view()) {
  .choices > .choice,
  .info > .info-item {
    animation: fadeInUp both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- 4. Header / Navigation ----------
   Markup now comes from /includes/home_header.php (shared across
   Shortifye and ShareMe), so these styles match that shared structure
   — header / .logo / nav / .login-btn / .quick-btn|.shareme-btn —
   themed with ShareMe's own palette instead of the homepage's. */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  margin-bottom: 48px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-nav);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 12px;
  z-index: 100;
}

.logo img {
  height: 36px;
  object-fit: contain;
  transition: transform var(--speed-fast) var(--ease);
}

.logo:hover img {
  transform: scale(1.04);
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
  position: relative;
  transition: color var(--speed-fast) ease;
}

nav a:hover {
  color: var(--primary);
}

.login-btn {
  background: var(--primary);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  transition: background var(--speed-fast) ease, transform var(--speed-fast) ease;
}

.login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Supports either `.quick-btn` (legacy) or `.shareme-btn` (current) markup */
.quick-btn,
.shareme-btn {
  background: #fff;
  color: var(--primary) !important;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--primary);
  transition: background var(--speed-fast) ease, color var(--speed-fast) ease,
    transform var(--speed-fast) ease;
}

.quick-btn:hover,
.shareme-btn:hover {
  background: var(--primary);
  color: #fff !important;
  transform: translateY(-2px);
}

/* ---------- 5. Hero ---------- */
.hero {
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  margin-bottom: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--primary);
  background: var(--bg-glass-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(81, 70, 223, 0.10);
  animation: floatDot 1.8s ease-in-out infinite;
}

.hero h1 {
  color: var(--primary-dark);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 17px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}

.hero p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 500;
}

/* ---------- 6. Choice Cards ---------- */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 940px;
  margin: 0 auto;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 355px;
  padding: 29px;
  overflow: hidden;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    border-color var(--speed) ease;
}

.choice::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -70px;
  bottom: -80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(81, 70, 223, 0.09), rgba(45, 142, 219, 0.11));
  pointer-events: none;
  transition: transform var(--speed-slow) var(--ease);
}

.choice:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}

.choice:hover::after {
  transform: scale(1.15) rotate(12deg);
}

.icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 9px 22px rgba(81, 70, 223, 0.25);
  transition: transform var(--speed) var(--ease-snap);
}

.choice:hover .icon {
  transform: scale(1.08) rotate(-6deg);
}

.choice h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 9px;
  color: var(--text-heading);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}

.choice p {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.feature {
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--text-feature);
  background: var(--bg-feature);
  border: 1px solid var(--border-feature);
  font-size: 11px;
  font-weight: 700;
  transition: background var(--speed-fast) ease, transform var(--speed-fast) ease;
}

.choice:hover .feature {
  background: #eeecff;
}

.choice-action {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.arrow {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: transform var(--speed) var(--ease-snap);
}

.choice:hover .arrow {
  transform: translateX(4px);
}

/* Shine sweep across the arrow on hover, mirroring the main site's buttons */
.arrow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-120%) skewX(-15deg);
}

.choice:hover .arrow::before {
  animation: shimmer 0.8s ease;
}

/* ---------- 7. Info Strip ---------- */
.info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 940px;
  margin: 22px auto 0;
}

.info-item {
  padding: 18px;
  text-align: center;
  background: var(--bg-glass-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) ease,
    background var(--speed-fast) ease;
}

.info-item:hover {
  transform: translateY(-3px);
  background: var(--bg-card);
  box-shadow: var(--shadow-nav);
}

.info-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 800;
}

.info-item span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

/* ---------- 8. Footer ----------
   The page-wide footer markup now comes from /includes/home_footer.php.
   .shareme-credit is the one ShareMe-specific line kept on this page,
   sitting just above that shared footer. */
.shareme-credit {
  margin-top: 42px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
}

.shareme-credit a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: opacity var(--speed-fast) ease;
}

.shareme-credit a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 560px);
    padding-top: 12px;
  }

  header {
    margin-bottom: 34px;
    border-radius: 17px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .choices {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .choice {
    min-height: 320px;
    padding: 23px;
    border-radius: 20px;
  }

  .info {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero {
    margin-bottom: 30px;
  }
}

@media (max-width: 420px) {
  .page {
    width: calc(100% - 20px);
  }

  header {
    padding: 10px;
  }

  .logo img {
    height: 30px;
  }

  .hero h1 {
    font-size: 35px;
  }

  .hero p {
    font-size: 13px;
  }

  .choice {
    min-height: 300px;
  }
}
