<script setup lang="ts">
import BrandWordmark from '@/components/BrandWordmark.vue'
</script>

<template>
  <main class="home-page">
    <div class="home-page__glow home-page__glow--left" aria-hidden="true"></div>
    <div class="home-page__glow home-page__glow--right" aria-hidden="true"></div>

    <header class="site-header">
      <BrandWordmark theme="dark" />

      <nav aria-label="Account navigation">
        <RouterLink class="site-header__login" to="/login">Log in</RouterLink>
        <RouterLink class="button button--small" to="/signup">Get started</RouterLink>
      </nav>
    </header>

    <section class="hero">
      <div class="hero__copy">
        <p class="hero__eyebrow">
          <span aria-hidden="true"></span>
          Progress with purpose
        </p>
        <h1>Make big goals feel possible.</h1>
        <p class="hero__description">
          Attainly turns meaningful ambitions into clear, manageable steps so you always know what
          to do next.
        </p>

        <div class="hero__actions">
          <RouterLink class="button" to="/signup">
            Get started
            <span aria-hidden="true">→</span>
          </RouterLink>
          <RouterLink class="hero__login" to="/login"> I already have an account </RouterLink>
        </div>

        <ul class="hero__benefits" aria-label="Attainly benefits">
          <li><span aria-hidden="true">✓</span> Clear daily steps</li>
          <li><span aria-hidden="true">✓</span> Flexible scheduling</li>
          <li><span aria-hidden="true">✓</span> Visible progress</li>
        </ul>
      </div>

      <div class="goal-preview" aria-label="Example goal progress">
        <div class="goal-preview__accent" aria-hidden="true"></div>

        <div class="goal-preview__top">
          <div>
            <p>Current goal</p>
            <h2>Read 24 books this year</h2>
          </div>
          <span>68%</span>
        </div>

        <div
          class="goal-preview__progress"
          role="progressbar"
          aria-label="Example goal progress"
          aria-valuemin="0"
          aria-valuemax="100"
          aria-valuenow="68"
        >
          <span></span>
        </div>

        <div class="goal-preview__summary">
          <span>16 books completed</span>
          <span>8 remaining</span>
        </div>

        <div class="today-card">
          <div class="today-card__header">
            <div>
              <p>Today&apos;s steps</p>
              <span>Friday, July 31</span>
            </div>
            <span class="today-card__count">2 of 3</span>
          </div>

          <ul>
            <li class="is-complete">
              <span class="task-marker" aria-hidden="true">✓</span>
              Read 20 pages
            </li>
            <li class="is-complete">
              <span class="task-marker" aria-hidden="true">✓</span>
              Add reading notes
            </li>
            <li>
              <span class="task-marker" aria-hidden="true"></span>
              Choose the next chapter
            </li>
          </ul>
        </div>

        <div class="streak-card" aria-hidden="true">
          <span>✦</span>
          <div>
            <strong>12 day streak</strong>
            <small>Keep the momentum going</small>
          </div>
        </div>
      </div>
    </section>
  </main>
</template>

<style scoped>
.home-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: #183029;
  background: linear-gradient(rgb(252 249 241 / 95%), rgb(242 239 229 / 94%)), #f4f1e7;
}

.home-page::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(24 58 49 / 8%) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  content: '';
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  pointer-events: none;
}

.home-page__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.home-page__glow--left {
  bottom: -14rem;
  left: -10rem;
  width: 34rem;
  height: 34rem;
  background: rgb(205 218 115 / 16%);
}

.home-page__glow--right {
  top: 8rem;
  right: -12rem;
  width: 32rem;
  height: 32rem;
  background: rgb(197 119 78 / 10%);
}

.site-header,
.hero {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 3rem), 76rem);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6.5rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-header__login,
.hero__login {
  color: #365047;
  font-size: 0.86rem;
  font-weight: 700;
  text-underline-offset: 0.25rem;
}

.site-header__login {
  text-decoration: none;
}

.site-header__login:hover,
.hero__login:hover {
  color: #183a31;
}

.site-header__login:focus-visible,
.hero__login:focus-visible,
.button:focus-visible {
  border-radius: 0.3rem;
  outline: 3px solid rgb(86 127 112 / 34%);
  outline-offset: 0.25rem;
}

.button {
  display: inline-flex;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.9rem 1.35rem;
  border-radius: 0.85rem;
  color: #fffdf7;
  background: #183a31;
  box-shadow: 0 0.8rem 1.6rem rgb(24 58 49 / 17%);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  background: #285c4e;
  box-shadow: 0 1rem 1.8rem rgb(24 58 49 / 22%);
  transform: translateY(-1px);
}

.button--small {
  min-height: 2.75rem;
  padding: 0.7rem 1.05rem;
  border-radius: 0.7rem;
  box-shadow: none;
  font-size: 0.8rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(30rem, 1.1fr);
  align-items: center;
  gap: clamp(4rem, 8vw, 8rem);
  min-height: calc(100vh - 6.5rem);
  min-height: calc(100svh - 6.5rem);
  padding: 3rem 0 6rem;
}

.hero__copy {
  max-width: 38rem;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
  color: #926044;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__eyebrow span {
  width: 1.8rem;
  height: 1px;
  background: #bd7b55;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(4rem, 6.4vw, 6.5rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.hero__description {
  max-width: 34rem;
  margin: 1.8rem 0 0;
  color: #62716b;
  font-size: 1.06rem;
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.hero__benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  margin: 2.5rem 0 0;
  padding: 0;
  color: #68776f;
  font-size: 0.74rem;
  font-weight: 650;
  list-style: none;
}

.hero__benefits li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__benefits span {
  display: grid;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  border-radius: 50%;
  color: #285c4e;
  background: #dfe8c0;
  font-size: 0.62rem;
}

.goal-preview {
  position: relative;
  width: min(100%, 34rem);
  margin-left: auto;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid rgb(24 58 49 / 10%);
  border-radius: 1.8rem;
  background: rgb(255 254 250 / 92%);
  box-shadow: 0 2.5rem 6rem rgb(49 61 53 / 15%);
}

.goal-preview__accent {
  position: absolute;
  top: -1.8rem;
  right: -1.8rem;
  width: 6rem;
  height: 6rem;
  border: 1rem solid rgb(199 216 113 / 28%);
  border-radius: 50%;
}

.goal-preview__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.goal-preview__top p,
.today-card__header p {
  margin: 0 0 0.45rem;
  color: #8b9691;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.goal-preview__top h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.goal-preview__top > span {
  color: #285c4e;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
}

.goal-preview__progress {
  height: 0.45rem;
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #e8e9e2;
}

.goal-preview__progress span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: #afc55d;
}

.goal-preview__summary {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  color: #8a938f;
  font-size: 0.67rem;
}

.today-card {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid #e6e8e1;
  border-radius: 1.1rem;
  background: #fbfaf6;
}

.today-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.today-card__header > div > span {
  color: #51645c;
  font-size: 0.83rem;
  font-weight: 700;
}

.today-card__count {
  padding: 0.4rem 0.65rem;
  border-radius: 2rem;
  color: #4c685e;
  background: #e7ebda;
  font-size: 0.65rem;
  font-weight: 750;
}

.today-card ul {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0 0;
  padding: 0;
  color: #344a42;
  font-size: 0.78rem;
  font-weight: 650;
  list-style: none;
}

.today-card li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.today-card .is-complete {
  color: #98a09d;
  text-decoration: line-through;
}

.task-marker {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #cfd5d1;
  border-radius: 50%;
  color: #fff;
  font-size: 0.62rem;
}

.is-complete .task-marker {
  border-color: #819d66;
  background: #819d66;
}

.streak-card {
  position: absolute;
  right: -2rem;
  bottom: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(24 58 49 / 9%);
  border-radius: 0.9rem;
  background: #fffdf7;
  box-shadow: 0 1rem 2rem rgb(49 61 53 / 15%);
}

.streak-card > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.65rem;
  color: #8e5d40;
  background: #f0dfd0;
}

.streak-card strong,
.streak-card small {
  display: block;
}

.streak-card strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  font-weight: 600;
}

.streak-card small {
  margin-top: 0.12rem;
  color: #8c9591;
  font-size: 0.57rem;
}

@media (max-width: 68rem) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .streak-card {
    right: -1rem;
  }
}

@media (max-width: 53rem) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 4rem;
  }

  .hero__copy {
    text-align: center;
  }

  .hero__eyebrow,
  .hero__actions,
  .hero__benefits {
    justify-content: center;
  }

  h1,
  .hero__description {
    margin-right: auto;
    margin-left: auto;
  }

  .goal-preview {
    margin: 0 auto;
  }
}

@media (max-width: 35rem) {
  .site-header,
  .hero {
    width: min(calc(100% - 2rem), 76rem);
  }

  .site-header {
    min-height: 5.5rem;
  }

  .site-header nav {
    gap: 0.9rem;
  }

  .site-header__login {
    display: none;
  }

  .hero {
    gap: 3.5rem;
    padding: 2.5rem 0 4rem;
  }

  h1 {
    font-size: clamp(3.3rem, 16vw, 4.5rem);
  }

  .hero__description {
    font-size: 0.95rem;
  }

  .hero__actions {
    flex-direction: column;
    gap: 1.15rem;
  }

  .hero__actions .button {
    width: 100%;
  }

  .goal-preview__accent,
  .streak-card {
    display: none;
  }

  .goal-preview {
    padding: 1.25rem;
    border-radius: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
</style>
