{{- $quotes := (index hugo.Data "quotes").quotes -}}

<footer class="mt-16 frosted-bar border-t py-12 relative z-20">
  <div class="container mx-auto px-4">
    <div class="grid grid-cols-1 md:grid-cols-3 gap-8 mb-8">

      <!-- Column 1: Fortune Cookie -->
      <div>
        <p class="font-mono text-xs text-text-dim mb-2">$ fortune</p>
        <div id="fortune-quote" aria-live="polite" data-quotes='{{ $quotes | jsonify }}'>
          <blockquote>
            <p class="fortune-text font-mono text-sm text-text italic leading-relaxed">
              "{{ (index $quotes 0).text }}"
            </p>
            <cite class="fortune-author font-mono text-xs text-text-dim not-italic mt-2 block text-right">
              — {{ (index $quotes 0).author }}
            </cite>
          </blockquote>
        </div>
      </div>
      <hr class="md:hidden border-border my-6" />

      <!-- Column 2: Stack & Feature Badges -->
      <div>
        <p class="text-text-dim font-mono text-xs mb-1">{{ i18n "footer_built_with" }}</p>
        <div class="flex flex-wrap gap-1.5 mb-3">
          <span class="badge-footer-accent">Hugo</span>
          <span class="badge-footer-accent">Tailwind CSS</span>
          <span class="badge-footer-accent">Alpine.js</span>
          <span class="badge-footer-accent">HTML5</span>
          <span class="badge-footer-accent">CSS3</span>
          <span class="badge-footer-accent">JavaScript</span>
          <span class="badge-footer-accent">Claude Code</span>
        </div>

        <p class="text-text-dim font-mono text-xs mb-1">{{ i18n "footer_features" }}</p>
        <div class="flex flex-wrap gap-1.5">
          <a href="{{ .Site.LanguagePrefix }}/is/a11y-compliant/" class="badge-footer-accent2 hover:opacity-80 transition-opacity">WCAG 2.1 AA</a>
          <span class="badge-footer-accent2">Open Source</span>
          <span class="badge-footer-accent2">Privacy Friendly</span>
          <span class="badge-footer-accent2">Keyboard Accessible</span>
          <span class="badge-footer-accent2">Screen Reader Compatible</span>
        </div>
      </div>
      <hr class="md:hidden border-border my-6" />

      <!-- Column 3: About (Terminal Readout) -->
      <div>
        <dl class="space-y-1">
          <div class="flex gap-2">
            <dt class="text-text-dim font-mono text-xs w-20 shrink-0">{{ i18n "footer_about_name" }}:</dt>
            <dd class="text-text font-mono text-xs">{{ .Site.Params.author }}</dd>
          </div>
          <div class="flex gap-2">
            <dt class="text-text-dim font-mono text-xs w-20 shrink-0">{{ i18n "footer_about_role" }}:</dt>
            <dd class="text-text font-mono text-xs">{{ i18n "footer_about_role_value" }}</dd>
          </div>
          <div class="flex gap-2">
            <dt class="text-text-dim font-mono text-xs w-20 shrink-0">{{ i18n "footer_about_cert" }}:</dt>
            <dd class="text-accent2 font-mono text-xs font-semibold">eJPT</dd>
          </div>
          <div class="flex gap-2">
            <dt class="text-text-dim font-mono text-xs w-20 shrink-0">{{ i18n "footer_about_os" }}:</dt>
            <dd class="text-text font-mono text-xs">{{ i18n "footer_about_os_value" }} <span class="text-text-dim">({{ i18n "footer_about_os_year" }})</span></dd>
          </div>
          <div class="flex gap-2">
            <dt class="text-text-dim font-mono text-xs w-20 shrink-0">{{ i18n "footer_about_focus" }}:</dt>
            <dd class="text-text font-mono text-xs">{{ i18n "footer_about_focus_value" }}</dd>
          </div>
        </dl>
      </div>
    </div>
    <div class="border-t border-border pt-8 mb-8 flex flex-col items-center">
      {{- partial "contribution-graph.html" (dict "cellSize" 12 "page" .) -}}
    </div>

    <!-- Copyright Bar -->
    <div class="pt-8 border-t border-border text-center text-xs text-text-dim space-y-1">
      <p>
        {{ i18n "footer_made_with" }} <span aria-hidden="true">❤️</span><span class="sr-only">{{ i18n "footer_love" }}</span>,
        {{ i18n "footer_lack_of" }} <span aria-hidden="true">🛏️</span><span class="sr-only">{{ i18n "footer_sleep" }}</span>,
        {{ i18n "footer_lots_of" }} <span aria-hidden="true">☕</span><span class="sr-only">{{ i18n "footer_coffee" }}</span>
        {{ i18n "footer_by" }} <a href="{{ .Site.LanguagePrefix }}/is/" class="text-accent hover:text-accent2 transition-colors py-2 px-1">danix</a>
      </p>
      <p>&copy; {{ now.Year }} {{ .Site.Params.author }}. {{ i18n "allRightsReserved" }}</p>
    </div>
  </div>

  <!-- Fortune.js: Pick a random quote on each page load -->
  {{- $fortuneJS := resources.Get "js/fortune.js" | minify -}}
  <script src="{{ $fortuneJS.RelPermalink }}"></script>
</footer>
