/* ============================================================
   Legacy Fund Limited — main.css
   Custom layers on top of Tailwind (Play CDN)
   ============================================================ */

@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  ::selection {
    background: #2a593f;
    color: #ffffff;
  }

  :focus-visible {
    outline: 2px solid #2a593f;
    outline-offset: 2px;
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: #2a593f;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 0.75rem 0;
    font-weight: 600;
  }
  .skip-link:focus {
    left: 0;
  }
}

@layer components {
  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Animated underlines for nav */
  .nav-link {
    position: relative;
  }
  .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 1px;
    width: 100%;
    background: #7bbf95;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
  }
  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    transform: scaleX(1);
  }

  /* Green hairline rule above titles */
  .eyebrow-rule {
    display: inline-block;
    width: 3.5rem;
    height: 1px;
    background: #2a593f;
  }

  /* Hero texture */
  .hero-grid {
    background-image:
      linear-gradient(rgba(136, 198, 163, 0.08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(136, 198, 163, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
  }

  /* Card hairline hover */
  .lift-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .lift-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -18px rgba(12, 31, 22, 0.25);
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    padding: 0.75rem 1.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  .btn-primary {
    background: #2a593f;
    color: #ffffff;
  }
  .btn-primary:hover {
    background: #3a7352;
    transform: translateY(-1px);
  }
  .btn-ghost-light {
    color: #a9d4b8;
    box-shadow: inset 0 0 0 1px rgba(123, 191, 149, 0.55);
  }
  .btn-ghost-light:hover {
    background: rgba(123, 191, 149, 0.12);
  }
  .btn-ghost-dark {
    color: #0c1f16;
    box-shadow: inset 0 0 0 1px rgba(12, 31, 22, 0.25);
  }
  .btn-ghost-dark:hover {
    background: rgba(12, 31, 22, 0.05);
  }

  /* Inputs */
  .field {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(12, 31, 22, 0.15);
    background: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
    color: #0c1f16;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .field:focus {
    outline: none;
    border-color: #2a593f;
    box-shadow: 0 0 0 3px rgba(42, 89, 63, 0.25);
  }

  /* Blog prose */
  .prose-legacy h2 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #0c1f16;
    margin: 2.25rem 0 1rem;
  }
  .prose-legacy h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0c1f16;
    margin: 1.75rem 0 0.75rem;
  }
  .prose-legacy p {
    color: #3a4a42;
    line-height: 1.8;
    margin: 1.1rem 0;
  }
  .prose-legacy ul {
    color: #3a4a42;
    line-height: 1.8;
    margin: 1.1rem 0;
    padding-left: 1.5rem;
    list-style: disc;
  }
  .prose-legacy li {
    margin: 0.45rem 0;
  }
  .prose-legacy blockquote {
    border-left: 3px solid #2a593f;
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 1.75rem 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.5;
    color: #1a3a29;
  }
  .prose-legacy a {
    color: #2a593f;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
  .text-pretty {
    text-wrap: pretty;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .lift-card:hover {
    transform: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
