@layer components;

/* ==========================================
NAVBAR
========================================== */

@layer components {
  .navbar {
    position: sticky;

    top: 0;

    z-index: 1000;

    background: color-mix(in srgb, var(--color-bg) 92%, transparent);

    backdrop-filter: blur(16px);

    border-bottom: 1px solid var(--color-border);
  }

  .navbar__container {
    display: flex;

    align-items: center;

    justify-content: space-between;

    height: 80px;
  }

  .navbar__brand {
    color: var(--color-text);

    text-decoration: none;

    font-family: var(--font-heading);

    font-size: 1.3rem;

    font-weight: var(--weight-bold);

    letter-spacing: 0.08em;

    text-transform: uppercase;
  }

  .navbar__menu {
    display: flex;
    align-items: center;
    gap: 2rem;

    margin: 0;
    padding: 0;

    list-style: none;
  }

  .navbar__menu li {
    margin: 0;
    padding: 0;
    list-style: none;

    display: flex;
    align-items: center;
  }

  .navbar__link {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0.6rem 1rem;

    border-radius: 999px;

    color: var(--color-text-muted);

    text-decoration: none;

    font-size: var(--text-body);

    font-weight: var(--weight-medium);

    transition:
      color var(--duration-fast),
      background-color var(--duration-normal),
      border-color var(--duration-normal);
  }

  .navbar__link:hover {
    color: var(--color-text);
  }

  .navbar__link--active {
    color: var(--color-text);

    background: var(--color-surface);

    border: 1px solid var(--color-border);
  }
}

/* ==========================================
HERO
========================================== */

@layer components {
  .hero {
    padding-top: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .hero__grid {
    display: grid;

    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);

    align-items: center;

    gap: var(--space-6);
  }

  .hero__content {
    max-width: 46rem;
  }

  .hero__eyebrow {
    margin-bottom: 1.5rem;

    color: var(--color-text-muted);

    font-family: var(--font-mono);

    font-size: 1rem;

    font-weight: var(--weight-medium);

    letter-spacing: 0.12em;

    text-transform: uppercase;
  }

  .hero__title {
    font-family: var(--font-heading);

    font-size: var(--fs-display-md);

    font-weight: var(--fw-medium);

    text-wrap: balance;

    max-width: auto;

    margin-bottom: var(--space-3);

    line-height: var(--lh-display);

    letter-spacing: var(--ls-display);
  }

  .hero__description {
    max-width: auto;

    margin-bottom: var(--space-4);

    color: var(--color-text-soft);

    font-size: var(--fs-body-lg);

    line-height: var(--lh-body);
  }

  .hero__actions {
    display: flex;

    gap: var(--space-3);

    margin-top: 2.5rem;

    flex-wrap: wrap;
  }

  .hero__media {
    display: flex;

    justify-content: center;

    align-items: center;

    width: 100%;
  }

  .hero__visual {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    max-width: clamp(320px, 42vw, 560px);

    aspect-ratio: 1;

    padding: var(--space-4);

    background: color-mix(in srgb, var(--color-surface) 45%, transparent);

    border-radius: var(--radius-lg);

    border: 2px solid color-mix(in srgb, var(--color-border) 60%, transparent);

    overflow: visible;
  }

  .hero__visual img,
  .hero__visual svg {
    width: 100%;

    height: 100%;

    object-fit: cover;

    color: var(--color-text);
  }

  .hero-svg {
    display: flex;

    justify-content: center;

    align-items: center;

    width: 100%;

    height: 100%;

    color: var(--color-illustration);
  }

  .hero-svg svg {
    width: 100%;

    height: auto;

    max-width: 100%;

    color: inherit;

    stroke: currentColor;
  }
}

/* ==========================================
BUTTONS
========================================== */

@layer components {
  .btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 0.6rem;

    padding: 1rem 1.75rem;

    border: 1px solid transparent;

    border-radius: var(--radius-md);

    cursor: pointer;

    font-family: inherit;

    font-size: var(--text-body);

    font-weight: var(--weight-semibold);

    text-decoration: none;

    transition:
      transform var(--duration-normal) var(--ease-standard),
      background-color var(--duration-normal),
      border-color var(--duration-normal),
      box-shadow var(--duration-normal);
  }

  .btn:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow-sm);
  }

  .btn--primary {
    background: var(--color-accent);

    color: #fff;
  }

  .btn--primary:hover {
    background: var(--color-accent-hover);
  }

  .btn--secondary {
    background: transparent;

    color: var(--color-text);

    border-color: var(--color-border);
  }

  .btn--secondary:hover {
    background: var(--color-surface);
  }

  .btn--ghost {
    padding-inline: 0;

    background: transparent;

    color: var(--color-accent);
  }
}

/* ==========================================
TAGS
========================================== */

@layer components {
  .tag {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0.5rem 1rem;

    border: 1px solid var(--color-border);

    border-radius: 999px;

    background: var(--color-surface);

    color: var(--color-text-muted);

    font-family: var(--font-mono);

    font-size: 0.9rem;

    font-weight: var(--weight-medium);

    letter-spacing: 0.08em;

    text-transform: uppercase;
  }
}

.content {
  max-width: 760px;
}

.content p {
  margin-bottom: var(--space-4);
}

/* ==========================================
CLICKABLE CARD
========================================== */

@layer components {
  .clickable-card {
    display: flex;

    flex-direction: column;

    min-height: 22rem;

    padding: var(--space-4);

    border: 1px solid var(--color-border);

    border-radius: var(--radius-lg);

    background: var(--color-surface);

    color: inherit;

    text-decoration: none;

    transition:
      transform var(--duration-normal) var(--ease-standard),
      border-color var(--duration-normal),
      box-shadow var(--duration-normal);
  }

  .clickable-card:hover {
    transform: translateY(-4px);

    border-color: var(--color-accent);

    box-shadow: var(--shadow-md);
  }
}

/* ==========================================
CONTENT CARD
========================================== */

@layer components {
  .content-card {
    display: flex;

    flex-direction: column;

    height: 100%;
  }

  .content-card__title {
    margin-bottom: var(--space-2);

    color: var(--color-text);

    font-family: var(--font-display);

    font-size: var(--fs-h3);

    font-weight: var(--fw-medium);

    line-height: var(--lh-subheading);

    letter-spacing: var(--ls-heading);

    text-wrap: balance;
  }

  .content-card__summary {
    flex: 1;

    color: var(--color-text-soft);

    font-size: var(--fs-body-lg);

    line-height: var(--lh-body);
  }

  .content-card__footer {
    display: flex;

    flex-direction: column;

    gap: var(--space-1);

    margin-top: auto;

    padding-top: var(--space-4);
  }

  .content-card__impact {
    color: var(--color-text-muted);

    font-family: var(--font-mono);

    font-size: var(--fs-caption);

    font-weight: var(--fw-medium);

    letter-spacing: var(--ls-label);

    text-transform: uppercase;
  }

  .content-card__cta {
    color: var(--color-accent);

    font-size: var(--fs-body);

    font-weight: var(--fw-medium);

    transition: color var(--duration-fast);
  }

  .content-card--aligned .content-card__title {
    min-height: var(--title-block-height);

    text-wrap: initial;
  }
  .clickable-card:hover .content-card__cta {
    color: var(--color-accent-hover);
  }
}

/* ==========================================
SECTION HEADER
========================================== */

@layer components {
  .section-header {
    display: block;

    margin-bottom: 3rem;
  }

  .section-label {
    display: block;

    margin-bottom: 1rem;

    color: var(--color-text-muted);

    font-family: var(--font-mono);

    font-size: 0.95rem;

    font-weight: var(--weight-medium);

    letter-spacing: 0.1em;

    text-transform: uppercase;
  }

  .section-header h2 {
    position: relative;

    display: block;

    max-width: none;

    margin: 0;

    font-size: 2rem;

    font-weight: var(--weight-semibold);

    line-height: 1.2;
  }

  .section-header h2::after {
    content: '';

    position: absolute;

    left: 0;

    bottom: -0.7rem;

    width: 72px;

    height: 4px;

    border-radius: 999px;

    background: var(--color-accent);
  }

  .section-description {
    max-width: 100%;

    margin-top: var(--space-4);

    color: var(--color-text-soft);

    font-size: var(--fs-body-lg);

    line-height: var(--lh-body);
  }
}

/* ==========================================
METRICS
========================================== */

@layer components {
  .metric {
    text-align: center;
  }

  .metric__value {
    margin-bottom: 0.5rem;

    color: var(--color-accent);

    font-size: 3rem;

    font-weight: var(--weight-bold);

    line-height: 1;
  }

  .metric__label {
    color: var(--color-text-muted);

    font-size: 1rem;
  }
}

/* ==========================================
CTA
========================================== */

@layer components {
  /* ==========================================
   CTA SECTION
========================================== */

  .cta {
    padding-block: var(--space-3);

    text-align: center;
  }

  .cta__container {
    max-width: auto;

    margin-inline: auto;
  }

  .cta__title {
    max-width: auto;

    margin: 0 auto var(--space-3);

    margin-bottom: var(--space-2);

    font-size: var(--fs-h1);

    line-height: var(--lh-heading);

    letter-spacing: var(--ls-heading);
  }

  .cta__description {
    max-width: 36rem;

    margin: 0 auto var(--space-4);

    color: var(--color-text-soft);

    font-size: var(--fs-body-lg);

    line-height: var(--lh-body);
  }

  .cta__actions {
    display: flex;

    justify-content: center;

    gap: var(--space-2);

    flex-wrap: wrap;
  }
}

/* ==========================================
FOOTER
========================================== */

@layer components {
  .footer {
    margin-top: var(--space-2);

    padding-block: var(--space-3);

    border-top: 1px solid var(--color-border);
  }

  .footer__content {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 2rem;
  }

  .footer__copyright {
    color: var(--color-text-muted);

    font-size: 1rem;
  }

  .footer__social {
    display: flex;

    align-items: center;

    gap: 1rem;
  }

  .footer__social a {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 48px;

    height: 48px;

    border-radius: 999px;

    color: var(--color-text-muted);

    transition:
      color var(--duration-normal),
      background-color var(--duration-normal),
      transform var(--duration-normal);
  }

  .footer__social a:hover {
    color: var(--color-text);

    background: var(--color-surface-alt);

    transform: translateY(-2px);
  }

  .footer__social svg {
    width: 20px;

    height: 20px;

    fill: currentColor;
  }
}

/* ==========================================
THEME TOGGLE
========================================== */

@layer components {
  .theme-toggle {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 48px;

    height: 48px;

    border: 1px solid var(--color-border);

    border-radius: 999px;

    background: var(--color-surface);

    color: var(--color-text);

    cursor: pointer;

    transition:
      background-color var(--duration-normal),
      border-color var(--duration-normal),
      transform var(--duration-normal);
  }

  .theme-toggle:hover {
    border-color: var(--color-accent);

    transform: rotate(10deg);
  }
}

/* ==========================================
CONTACT
========================================== */

@layer components {
  .contact-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 2rem;
  }

  .contact-card {
    display: flex;

    flex-direction: column;

    min-height: 320px;

    padding: 2rem;

    border: 1px solid var(--color-border);

    border-radius: var(--radius-lg);

    background: var(--color-surface);
  }

  .contact-card h3 {
    margin-bottom: 1rem;

    font-size: 1.5rem;
  }

  .contact-card p {
    color: var(--color-text-muted);

    line-height: 1.8;
  }

  .contact-card a {
    margin-top: auto;

    font-weight: var(--weight-semibold);
  }
}

/* ==========================================
TIMELINE
========================================== */

@layer components {
  .timeline {
    position: relative;
  }

  .timeline::before {
    content: '';

    position: absolute;

    top: 0;

    bottom: 0;

    left: 14px;

    width: 2px;

    background: var(--color-border);
  }

  .timeline-item {
    position: relative;

    padding-left: 3.5rem;

    margin-bottom: 4rem;
  }

  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-item::before {
    content: '';

    position: absolute;

    top: 0.5rem;

    left: 7px;

    width: 16px;

    height: 16px;

    border-radius: 50%;

    background: var(--color-accent);
  }
}

/* ==========================================
IMPACT CARD
========================================== */

@layer components {
  .impact-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 2rem;
  }

  .impact-card {
    display: flex;

    flex-direction: column;

    min-height: 300px;

    padding: 2rem;

    border: 1px solid var(--color-border);

    border-radius: var(--radius-lg);

    background: var(--color-surface);

    transition:
      transform var(--duration-normal),
      border-color var(--duration-normal),
      box-shadow var(--duration-normal);
  }

  .impact-card:hover {
    transform: translateY(-6px);

    border-color: var(--color-accent);

    box-shadow: var(--shadow-md);
  }

  .impact-card__metric {
    margin-bottom: 1rem;

    color: var(--color-accent);

    font-size: 3rem;

    font-weight: var(--weight-bold);

    line-height: 1;
  }

  .impact-card h4 {
    margin-bottom: 1rem;

    font-size: 1.5rem;
  }

  .impact-card p {
    color: var(--color-text-muted);

    line-height: 1.8;
  }

  .impact-card__cta {
    margin-top: auto;

    color: var(--color-accent);

    font-weight: var(--weight-semibold);
  }
}

/* ==========================================
FLIP CARD
========================================== */

@layer components {
  .flip-card {
    width: 340px;

    aspect-ratio: 1;

    perspective: 1600px;
  }

  .flip-card__inner {
    position: relative;

    width: 100%;

    height: 100%;

    transform-style: preserve-3d;

    transition: transform 0.7s ease;
  }

  .flip-card.is-flipped .flip-card__inner {
    transform: rotateY(180deg);
  }

  .flip-card__front,
  .flip-card__back {
    position: absolute;

    inset: 0;

    backface-visibility: hidden;
  }

  .flip-card__back {
    transform: rotateY(180deg);
  }

  .flip-card img {
    width: 100%;

    height: 100%;

    object-fit: contain;
  }
}
