@layer components, utilities;

@layer components {
  /* Ruled section titles */
  .section > .container > h2.h-ruled:first-child {
    margin-top: 0.2rem;
  }

  /* Founder block */
  #founder-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 900px;
    margin: 40px auto;
  }
  .card {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    background: #f9f9f9;
    padding: 28px 28px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 900px;
    column-gap: 1.25rem;
  }

  .card img.profile-picture {
    max-width: 140px;
    height: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-left: 24px;
  }

  .card-content {
    flex: 1;
  }
  .card-content p {
    margin-bottom: 1rem;
  }

  @media (max-width: 820px) {
    .card {
      flex-direction: column;
      align-items: flex-start;
      text-align: left;
    }
    .card img.profile-picture {
      margin: 0 auto 20px;
      max-width: 120px;
    }

    #founder-card .card-content {
      font-size: 1.0625rem; /* ~17px */
      line-height: 1.7;
      max-width: 64ch;
    }
    #founder-card .card-content p {
      margin-bottom: 1.1rem;
    }
    #founder-card .card-content > :last-child {
      margin-bottom: 0;
    }
  }

  @media (max-width: 600px) {
    #founder-card .card-content {
      max-width: 60ch;
    }
  }

  /* Expertise grid */
  .section.expertise > .container {
    border-top: 2px solid var(--line);
    width: min(1500px, 100% - 2 * var(--gutter));
    padding-top: 5rem;
  }
  .expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3.5em;
  }
  @media (max-width: 980px) {
    .expertise-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 820px) {
    .section.expertise .feature-card .content {
      font-size: 1.0625rem;
      line-height: 1.7;
      max-width: 58ch;
    }
    .section.expertise .feature-card .content p {
      margin-bottom: 1.1rem;
    }
    .section.expertise .feature-card .content > :last-child {
      margin-bottom: 0;
    }
  }

  @media (max-width: 600px) {
    .section.expertise .feature-card .content {
      max-width: 60ch;
    }
  }

  /* Cards with icon on top */
  .feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25em;
    padding: 0.6em;
    transition:
      transform 0.3s ease,
      box-shadow 0.3s ease,
      background-color 0.3s ease;
  }
  .feature-card:hover {
    transform: translateY(-5px) scale(1.02);
    background-color: rgba(240, 242, 245, 0.5);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  }

  /* Icon block */
  .icon-wrap {
    position: relative;
    width: 10em;
    height: 10em;
    display: grid;
    place-items: center;
    margin-bottom: 0.25em;
  }
  .icon-wrap i {
    position: relative;
    z-index: 1;
    font-size: 2.75rem;
    color: var(--brand);
  }
  .icon-wrap::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 7em;
    height: 7em;
    border: 2px solid rgba(210, 215, 217, 0.75);
    border-radius: 0.25rem;
  }

  /* Expertise card headings */
  .section.expertise .feature-card h3 {
    font-size: 1.35rem;
    line-height: 1.3;
    color: var(--ink);
  }

  @media (max-width: 820px) {
    .section.expertise .feature-card h3 {
      font-size: 1.28rem;
    }
  }

  .feature-card .content {
    width: 100%;
    text-align: left;
  }
  .feature-card .content > :last-child {
    margin-bottom: 0;
  }
}

@layer utilities {
  .stack > * + * {
    margin-top: var(--space-2);
  }
}
