<template>
  <section id="capabilities" class="content-section" aria-labelledby="capabilities-title">
    <div class="section-heading">
      <p class="section-kicker mono">{{ content.capabilitySection.kicker }}</p>
      <h2 id="capabilities-title">{{ content.capabilitySection.heading }}</h2>
      <p>{{ content.capabilitySection.description }}</p>
    </div>
    <div class="card-grid">
      <article v-for="capability in content.capabilities" :key="capability.title" class="info-card">
        <div class="icon-badge mono" aria-hidden="true">{{ capability.icon }}</div>
        <h3>{{ capability.title }}</h3>
        <p>{{ capability.description }}</p>
      </article>
    </div>
  </section>

  <section id="services" class="content-section" aria-labelledby="services-title">
    <div class="section-heading">
      <p class="section-kicker mono">{{ content.serviceSection.kicker }}</p>
      <h2 id="services-title">{{ content.serviceSection.heading }}</h2>
      <p>{{ content.serviceSection.description }}</p>
    </div>
    <div class="service-list">
      <article v-for="service in content.services" :key="service.title" class="service-card">
        <h3>{{ service.title }}</h3>
        <p><strong>Build path:</strong> {{ service.investigation }}</p>
        <p><strong>Outcome:</strong> {{ service.outcome }}</p>
      </article>
    </div>
  </section>

  <section id="work" class="content-section" aria-labelledby="work-title">
    <div class="section-heading">
      <p class="section-kicker mono">{{ content.workSection.kicker }}</p>
      <h2 id="work-title">{{ content.workSection.heading }}</h2>
      <p>{{ content.workSection.description }}</p>
    </div>
    <div class="work-grid">
      <article
        v-for="item in content.selectedWork"
        :key="item.title"
        class="work-card card"
        :class="{ minor: item.weight === 'minor' }"
      >
        <div class="work-card-top">
          <div class="work-icon mono" aria-hidden="true">{{ item.icon }}</div>
          <div>
            <p class="work-kind mono">{{ item.kind }}</p>
            <h3>{{ item.title }}</h3>
          </div>
        </div>
        <p>{{ item.description }}</p>
        <div v-if="item.points?.length || item.links?.length" class="work-proof">
          <div v-if="item.points?.length" class="work-points" aria-label="Selected proof points">
            <span v-for="point in item.points" :key="point" class="pill mono">{{ point }}</span>
          </div>
          <div v-if="item.links?.length" class="work-links">
            <a
              v-for="link in item.links"
              :key="link.href"
              class="work-link mono"
              :href="link.href"
              target="_blank"
              rel="noopener noreferrer"
            >
              {{ link.label }}
            </a>
          </div>
        </div>
      </article>
    </div>
  </section>

  <section id="engagement" class="content-section" aria-labelledby="engagement-title">
    <div class="section-heading centered">
      <p class="section-kicker mono">Engagement</p>
      <h2 id="engagement-title">Ways to Work Together</h2>
      <p>
        Fixed-scope and contract pricing is based on the problem, access requirements, urgency, and expected deliverables.
      </p>
    </div>
    <div class="engagement-grid">
      <article v-for="item in content.engagementTypes" :key="item.title" class="info-card">
        <h3>{{ item.title }}</h3>
        <p>{{ item.description }}</p>
        <div class="duration mono">{{ item.duration }}</div>
      </article>
    </div>
  </section>

  <section id="process" class="content-section" aria-labelledby="process-title">
    <div class="section-heading">
      <p class="section-kicker mono">Process</p>
      <h2 id="process-title">A Practical Engagement Process</h2>
    </div>
    <ol class="process-list">
      <li v-for="(step, index) in content.processSteps" :key="step.title" class="process-step">
        <span class="step-number mono">{{ index + 1 }}</span>
        <div>
          <h3>{{ step.title }}</h3>
          <p>{{ step.description }}</p>
        </div>
      </li>
    </ol>
    <p class="safety-note">
      Do not email passwords, private keys, tokens, customer data, or other secrets. Secure access can be arranged after
      scope is confirmed.
    </p>
  </section>
</template>

<script setup>
defineProps({
  content: Object,
});
</script>

<style scoped>
.content-section {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  scroll-margin-top: 0;
  margin-top: 0;
  padding: clamp(58px, 7vh, 88px) 0;
}

.section-kicker {
  color: var(--accent-cyan);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-heading.centered {
  width: min(100%, 920px);
  margin-left: auto;
  margin-right: auto;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 0;
}

.section-heading p {
  font-size: 17px;
  line-height: 1.65;
}

.card-grid,
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.work-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(100%, 920px);
  margin: 0 auto;
}

.info-card,
.service-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.work-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.work-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 229, 197, 0.7), rgba(120, 180, 255, 0.4), transparent);
  opacity: 0.5;
}

.work-card.minor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(280px, 1fr) minmax(250px, 0.8fr);
  gap: 14px 22px;
  align-items: start;
}

.work-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.work-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 197, 0.25);
  color: var(--accent-cyan);
  background:
    linear-gradient(135deg, rgba(0, 229, 197, 0.1), rgba(120, 180, 255, 0.08)),
    rgba(255, 255, 255, 0.035);
}

.work-kind {
  margin: 0 0 4px;
  color: var(--accent-cyan);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-card h3,
.service-card h3,
.work-card h3,
.process-step h3 {
  margin: 0 0 8px;
  letter-spacing: 0;
}

.info-card p,
.service-card p,
.work-card p,
.process-step p {
  line-height: 1.6;
}

.work-card p {
  color: var(--text-muted);
  font-size: 15px;
}

.work-proof {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.work-links,
.work-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.work-points {
  gap: 7px;
}

.work-points .pill {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.work-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 197, 0.22);
  color: var(--accent-cyan);
  text-decoration: none;
  background: rgba(0, 229, 197, 0.05);
  font-size: 12px;
}

.work-card.minor .work-card-top {
  margin-bottom: 0;
}

.work-card.minor .work-proof {
  padding-top: 0;
}

.icon-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 197, 0.22);
  color: var(--accent-cyan);
  background: rgba(0, 229, 197, 0.06);
  margin-bottom: 12px;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.service-card strong {
  color: var(--text-strong);
}

.duration {
  color: var(--accent-cyan);
  margin-top: 12px;
  font-size: 13px;
}

.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.process-step {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.step-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 229, 197, 0.1);
  border: 1px solid rgba(0, 229, 197, 0.22);
  color: var(--accent-cyan);
}

.safety-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid rgba(255, 220, 120, 0.45);
  background: rgba(255, 220, 120, 0.05);
}

@media (max-width: 1080px) {
  .card-grid,
  .work-grid,
  .service-list,
  .engagement-grid,
  .process-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .card-grid,
  .engagement-grid,
  .work-grid,
  .service-list,
  .process-list {
    grid-template-columns: 1fr;
  }

  .content-section {
    margin-top: 0;
    padding: 50px 0;
  }

  .work-card.minor {
    grid-template-columns: 1fr;
  }
}
</style>
