{{ define "title" }}tangled &middot; tightly-knit social coding{{ end }}

{{ define "extrameta" }}
    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="tangled · tightly-knit social coding" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://tangled.org" />
    <meta property="og:description" content="The next-generation social coding platform." />
    <meta property="og:image" content="https://assets.tangled.network/tangled_og.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />

    <!-- Twitter Card Meta Tags -->
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Tangled" />
    <meta name="twitter:description" content="The next-generation social coding platform." />
    <meta name="twitter:image" content="https://assets.tangled.network/tangled_og.png" />

    <!-- Additional SEO -->
    <meta name="description" content="The next-generation social coding platform. Host repos on your infrastructure with knots, use stacked pull requests, and run CI with spindles." />
    <link rel="canonical" href="https://tangled.org" />
{{ end }}


{{ define "content" }}
  <div class="flex flex-col gap-20 md:gap-40 my-20 md:my-32">
    {{ template "timeline/fragments/hero" . }}
    {{ template "timeline/fragments/preview" . }}
    {{ template "features1" . }}
    {{ template "features2" . }}
    {{ template "recentUpdates" . }}
    {{ if .ShowNewsletter }}{{ template "newsletter" . }}{{ end }}
  </div>
{{ end }}

{{ block "topbarLayout" . }}
  <header class="max-w-screen-xl mx-auto w-full col-span-full md:col-span-1 md:col-start-2" style="z-index: 20;">
     {{ if .LoggedInUser }}
      <div id="upgrade-banner"
           hx-get="/upgradeBanner"
           hx-trigger="load"
           hx-swap="innerHTML">
      </div>
    {{ end }}
    {{ template "layouts/fragments/topbar" . }}
  </header>
{{ end }}

{{ block "footerLayout" . }}
  <footer class="z-10">
    {{ template "layouts/fragments/footerFull" . }}
  </footer>
{{ end }}

{{ block "bodyClasses" . }}
  bg-transparent bg-gradient-to-b from-white to-slate-100 dark:bg-none dark:bg-gray-900
{{ end }}

{{ block "mainLayout" . }}
  <div class="flex-grow relative">
    <div
      class="absolute opacity-50 dark:opacity-5 inset-x-0 top-0 bottom-[-50px] md:bottom-[-150px] pointer-events-none bg-slate-200 dark:bg-slate-400 [mask-image:url('https://assets.tangled.network/yarn_ball_mask.svg')] [mask-repeat:no-repeat] [mask-position:right_bottom] [-webkit-mask-image:url('https://assets.tangled.network/yarn_ball_mask.svg')] [-webkit-mask-repeat:no-repeat] [-webkit-mask-position:right_bottom] w-full">
    </div>
    <div class="max-w-screen-xl mx-auto flex flex-col gap-4 relative z-10">
      {{ block "contentLayout" . }}
      <main>
        {{ block "content" . }}{{ end }}
      </main>
      {{ end }}

      {{ block "contentAfterLayout" . }}
      <main>
        {{ block "contentAfter" . }}{{ end }}
      </main>
      {{ end }}
    </div>
  </div>
{{ end }}

{{ define "features1" }}
  {{ $labelStyle := "normal-case cursor-pointer w-auto md:w-full p-4 md:px-6 rounded bg-white dark:bg-gray-800 font-medium text-base md:text-lg opacity-50 border border-gray-200 dark:border-gray-700 relative overflow-hidden" }}
  {{ $spanStyle := "z-10 items-center justify-between gap-2 w-full" }}
  {{ $connectorStyle := "w-0.5 h-6 bg-gray-300 dark:bg-gray-600 opacity-0 mx-auto" }}
  {{ $contentStyle := "hidden bg-white dark:bg-gray-800 rounded shadow-sm border border-gray-200 dark:border-gray-700 grid-cols-1 animate-fadein" }}
  {{ $progressOverlayStyle := "absolute inset-0 bg-gray-600/10 dark:bg-gray-100/10 w-0 transition-none" }}

  <style>
    @media (max-width: 768px) {
      .features-grid:has(#feature-prs:checked) {
        grid-template-columns: 1fr auto auto;
      }

      .features-grid:has(#feature-knots:checked) {
        grid-template-columns: auto 1fr auto;
      }

      .features-grid:has(#feature-spindles:checked) {
        grid-template-columns: auto auto 1fr;
      }

      #feature-prs:checked ~ label[for="feature-prs"] .label-text,
      #feature-knots:checked ~ label[for="feature-knots"] .label-text,
      #feature-spindles:checked ~ label[for="feature-spindles"] .label-text {
        display: inline-flex !important;
      }
      #feature-prs:checked ~ label[for="feature-prs"] .icon-only,
      #feature-knots:checked ~ label[for="feature-knots"] .icon-only,
      #feature-spindles:checked ~ label[for="feature-spindles"] .icon-only {
        display: none !important;
      }
    }
  </style>

  <div class="features-grid w-full grid grid-cols-3 gap-x-6 px-2">
    <input type="radio" id="feature-prs" name="feature" class="peer/prs hidden" checked />
    <input type="radio" id="feature-knots" name="feature" class="peer/knots hidden" />
    <input type="radio" id="feature-spindles" name="feature" class="peer/spindles hidden" />

    <label for="feature-prs" class="{{ $labelStyle }} peer-checked/prs:opacity-100 peer-checked/prs:shadow-sm">
      <span class="label-text hidden md:inline-flex {{ $spanStyle }}">A better way to review {{ i "git-pull-request" "size-5" }}</span>
      <span class="icon-only inline-flex md:hidden {{ $spanStyle }}">{{ i "git-pull-request" "size-5" }}</span>
      <div class="{{ $progressOverlayStyle }}" data-progress="prs"></div>
    </label>

    <label for="feature-knots" class="{{ $labelStyle }} peer-checked/knots:opacity-100 peer-checked/knots:shadow-sm">
      <span class="label-text hidden md:inline-flex {{ $spanStyle }}">Completely self-hostable {{ i "hard-drive" "size-5" }}</span>
      <span class="icon-only inline-flex md:hidden {{ $spanStyle }}">{{ i "hard-drive" "size-5" }}</span>
      <div class="{{ $progressOverlayStyle }}" data-progress="knots"></div>
    </label>

    <label for="feature-spindles" class="{{ $labelStyle }} peer-checked/spindles:opacity-100 peer-checked/spindles:shadow-sm">
      <span class="label-text hidden md:inline-flex {{ $spanStyle }}">Quick and easy CI {{ i "layers-2" "size-5" }}</span>
      <span class="icon-only inline-flex md:hidden {{ $spanStyle }}">{{ i "layers-2" "size-5" }}</span>
      <div class="{{ $progressOverlayStyle }}" data-progress="spindles"></div>
    </label>

    <div class="{{ $connectorStyle }} peer-checked/prs:opacity-100"></div>
    <div class="{{ $connectorStyle }} peer-checked/knots:opacity-100"></div>
    <div class="{{ $connectorStyle }} peer-checked/spindles:opacity-100"></div>

    {{ $titleStyle := "text-2xl md:text-6xl my-2 md:mb-4 text-black dark:text-white font-medium" }}
    {{ $textContentStyle := "p-4 md:p-6 md:text-xl" }}
    {{ $imgContentStyle := "w-full overflow-hidden place-content-center bg-gradient-to-b from-slate-50 to-slate-100 dark:from-gray-800 dark:to-gray-900 border-t border-gray-200 dark:border-gray-700" }}
    {{ $linkDesktopStyle := "hover:no-underline items-center gap-2 p-3 text-base btn" }}

    <div class="col-span-3 {{ $contentStyle }} peer-checked/prs:grid">
      <div class="{{ $textContentStyle }} flex gap-4 md:gap-8">
        <section class="space-y-4">
          <h1 class="{{ $titleStyle }}">Pull requests, reimagined</h1>
          <p class="text-gray-600 dark:text-gray-400">
          Break down large features into small, reviewable chunks. Stack pull
          requests on top of each other and ship faster with round-based code
          reviews. Tangled natively supports stacking using Jujutsu.
          </p>
          <a href="https://blog.tangled.org/stacking" class="hover:no-underline inline-flex items-center gap-2 text-sm md:text-base text-black dark:text-white font-medium">
            Learn more
            {{ i "arrow-right" "size-4" }}
          </a>
        </section>
        <div class="w-fit hidden md:flex items-center">
          <div class="size-32 rounded-full flex items-center justify-center bg-yellow-100 dark:bg-yellow-900 -mr-4" >
            {{ i "wand-sparkles" "size-16 text-yellow-500 dark:text-yellow-500" }}
          </div>
          <div class="size-40 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 z-10">
            {{ i "git-pull-request-arrow" "size-24 text-green-500 dark:text-green-500 rotate-12" }}
          </div>
        </div>
      </div>
      <div class="{{ $imgContentStyle }} relative overflow-hidden flex items-center justify-center">
        <div class="w-[120%] md:w-full flex">
          <picture class="w-full">
            <source srcset="https://assets.tangled.network/home-page-prs-dark.svg" media="(prefers-color-scheme: dark)" />
            <img src="https://assets.tangled.network/home-page-prs-light.svg" class="w-full block" />
          </picture>
        </div>
      </div>
    </div>

    <div class="col-span-3 {{ $contentStyle }} peer-checked/knots:grid">
      <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8">
        <section class="space-y-4">
          <h1 class="{{ $titleStyle }}">Run it at home</h1>
          <p class="text-gray-600 dark:text-gray-400">
            Host your repositories on your own infrastructure with <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="no-underline">knots</a>.
            Run CI on your own machines with <a href="https://docs.tangled.org/spindles.html#self-hosting-guide" class="no-underline">spindles</a>.
            <br>
            Don't want to self-host? All are welcome on our hosted instances.
          </p>
          <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="hover:no-underline inline-flex items-center gap-2 text-sm md:text-base text-black dark:text-white font-medium">
            Learn more
            {{ i "arrow-right" "size-4" }}
          </a>
        </section>
        <div class="w-fit hidden md:flex items-center">
          <div class="size-32 rounded-full flex items-center justify-center bg-blue-100 dark:bg-blue-900 -mr-4" >
            {{ i "workflow" "size-16 text-blue-500 dark:text-blue-500" }}
          </div>
          <div class="size-40 rounded-full flex items-center justify-center bg-yellow-100 dark:bg-yellow-900 z-10">
            {{ i "server" "size-24 text-yellow-500 dark:text-yellow-500" }}
          </div>
        </div>
      </div>
      <div class="{{ $imgContentStyle }} relative overflow-hidden flex items-center justify-center">
        <div class="w-[120%] md:w-full flex">
          <picture class="w-full">
            <source srcset="https://assets.tangled.network/home-page-self-host-dark.svg" media="(prefers-color-scheme: dark)" />
            <img src="https://assets.tangled.network/home-page-self-host-light.svg" class="w-full block" />
          </picture>
        </div>
      </div>
    </div>

    <div class="col-span-3 {{ $contentStyle }} peer-checked/spindles:grid">
      <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8">
        <section class="space-y-4">
          <h1 class="{{ $titleStyle }}">Nix-powered CI</h1>
          <p class="text-gray-600 dark:text-gray-400">
            Pick and choose dependencies for your CI pipelines from <a
              href="https://docs.tangled.org/spindles.html#dependencies"
              class="no-underline"><code>nixpkgs</code></a>, one of the biggest
            package repositories.
            <br>
            Support for Docker and MicroVM based runners coming soon!
          </p>
          <a href="https://docs.tangled.org/spindles.html#pipelines" class="hover:no-underline inline-flex items-center gap-2 text-sm md:text-base text-black dark:text-white font-medium">
            Learn more
            {{ i "arrow-right" "size-4" }}
          </a>
        </section>
        <div class="w-fit hidden md:flex items-center">
          <div class="size-32 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 -mr-4" >
            {{ i "package" "size-16 text-green-500 dark:text-green-500" }}
          </div>
          <div class="size-40 rounded-full flex items-center justify-center bg-indigo-100 dark:bg-indigo-900 z-10">
            {{ i "snowflake" "size-24 text-indigo-500 dark:text-indigo-500 rotate-12" }}
          </div>
        </div>
      </div>
      <div class="{{ $imgContentStyle }} flex items-end justify-center pb-0 overflow-hidden">
        <div class="w-[120%] md:w-full flex">
          <picture class="w-full">
            <source srcset="https://assets.tangled.network/home-page-ci-dark.svg" media="(prefers-color-scheme: dark)" />
            <img src="https://assets.tangled.network/home-page-ci-light.svg" class="w-full block" />
          </picture>
        </div>
      </div>
    </div>
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      const featureIds = ['feature-prs', 'feature-knots', 'feature-spindles'];
      const progressNames = ['prs', 'knots', 'spindles'];
      let currentIndex = 0;
      let timerInterval = null;

      function stopTimer() {
        if (timerInterval) {
          clearInterval(timerInterval);
          timerInterval = null;
        }
        document.querySelectorAll('[data-progress]').forEach(el => {
          el.classList.remove('animate-progress');
        });
      }

      const firstProgress = document.querySelector('[data-progress="prs"]');
      if (firstProgress) {
        firstProgress.classList.add('animate-progress');
      }

      document.querySelectorAll('label[for^="feature-"]').forEach(label => {
        label.addEventListener('click', stopTimer);
      });

      timerInterval = setInterval(function() {
        document.querySelectorAll('[data-progress]').forEach(el => {
          el.classList.remove('animate-progress');
          void el.offsetWidth; // force reflow
        });

        currentIndex = (currentIndex + 1) % featureIds.length;
        document.getElementById(featureIds[currentIndex]).checked = true;

        const activeProgress = document.querySelector('[data-progress="' + progressNames[currentIndex] + '"]');
        if (activeProgress) {
          activeProgress.classList.add('animate-progress');
        }
      }, 10000);
    });
  </script>
{{ end }}

{{ define "features2" }}
  {{ $cardStyle := "bg-white dark:bg-gray-800 rounded shadow-sm border border-gray-200 dark:border-gray-700" }}
  {{ $cardInnerStyle := "flex flex-row items-center gap-4 md:gap-6 p-4 md:p-6 md:pt-8 relative" }}
  {{ $contentStyle := "flex-1 flex flex-col" }}
  {{ $titleStyle := "text-xl md:text-2xl font-bold mb-2 md:mb-3 text-gray-900 dark:text-gray-100" }}
  {{ $descriptionStyle := "text-gray-600 dark:text-gray-300 text-sm md:text-base leading-relaxed mb-5 md:mb-0" }}
  {{ $linkMobileStyle := "hover:no-underline inline-flex md:hidden items-center gap-2 text-sm text-black dark:text-white font-medium" }}
  {{ $iconContainerStyle := "relative shrink-0 w-24 h-24 md:w-48 md:h-48" }}
  {{ $iconCircleStyle := "rounded-full flex items-center justify-center border border-gray-200 dark:border-gray-700" }}
  {{ $linkDesktopStyle := "hover:no-underline hidden md:inline-flex absolute -bottom-10 -right-14 items-center gap-2 p-3 text-base btn" }}

  <div class="w-full flex flex-col gap-6 md:gap-40 max-w-5xl mx-auto px-2">
    <div class="{{ $cardStyle }} md:mr-32">
      <div class="{{ $cardInnerStyle }}">
        {{ $moreLink := "https://docs.tangled.org/quick-start-guide.html#login-or-sign-up" }}
        <div class="{{ $contentStyle }}">
          <h3 class="{{ $titleStyle }}">Built on AT Protocol</h3>
          <p class="{{ $descriptionStyle }}">
            <a class="underline" href="https://atproto.com/">AT Protocol</a> enables federated code-collaboration. Submit
            pull-requests or bug-reports to any repository hosted on any
            server.
            <br>
            <br>
            Bring an existing AT Protocol account (such as your Bluesky
            account), or signup for one with us.
          </p>
          <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}">
            Learn more
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
        <div class="{{ $iconContainerStyle }}">
          <div class="{{ $iconCircleStyle }} w-full h-full bg-blue-100 dark:bg-blue-900/50">
            {{ i "at-sign" "size-12 md:size-24" "text-blue-500 dark:text-blue-500" "rotate-12" }}
          </div>
          <div class="{{ $iconCircleStyle }} absolute -top-2 -left-2 w-10 h-10 md:w-16 md:h-16 rounded-full bg-white dark:bg-gray-800 -rotate-12">
            {{ i "globe" "size-4 md:size-8" "text-blue-500 dark:text-blue-500" }}
          </div>
          <a href="{{ $moreLink }}" class="{{ $linkDesktopStyle }}">
            Learn more
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
      </div>
    </div>

    <div class="{{ $cardStyle }} md:ml-32">
      <div class="{{ $cardInnerStyle }}">
        {{ $moreLink := "https://tangled.org/core" }}
        <div class="{{ $contentStyle }}">
          <h3 class="{{ $titleStyle }}">Free and open source</h3>
          <p class="{{ $descriptionStyle }}">
            All of Tangled is open source and built with the community!
            Check out the <a class="underline" href="https://tangled.org/core">monorepo</a> and join in on the fun.
            <br>
            <br>
            We welcome contributions however big or small. You can start contributing by picking up a
            <a class="underline" href="https://tangled.org/tangled.org/core/issues?q=state%3Aopen+label%3Agood-first-issue">good-first-issue</a>.
          </p>
          <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}">
            View source
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
        <div class="{{ $iconContainerStyle }}">
          <div class="{{ $iconCircleStyle }} w-full h-full bg-green-100 dark:bg-green-900/50">
            {{ i "package-open" "size-12 md:size-24" "text-green-500 dark:text-green-500" "-rotate-12" }}
          </div>
          <div class="absolute -top-2 -left-2 w-10 h-10 md:w-16 md:h-16 rounded-full bg-white dark:bg-gray-800 flex items-center justify-center border border-gray-200 dark:border-gray-700 rotate-12">
            {{ i "heart" "size-4 md:size-8" "text-green-500 dark:text-green-500" }}
          </div>
          <a href="{{ $moreLink }}" class="{{ $linkDesktopStyle }}">
            View source
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
      </div>
    </div>

    <div class="{{ $cardStyle }} md:mr-32">
      <div class="{{ $cardInnerStyle }}">
        {{ $moreLink := "/timeline" }}
        <div class="{{ $contentStyle }}">
          <h3 class="{{ $titleStyle }}">Social coding is back</h3>
          <p class="{{ $descriptionStyle }}">
            Discover trending projects, follow your friends and star your favourite repositories. Coding is better together!
          </p>
          <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}">
            Explore timeline
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
        <div class="{{ $iconContainerStyle }}">
          <div class="{{ $iconCircleStyle }} w-full h-full bg-amber-100 dark:bg-amber-900/50">
            {{ i "message-circle-heart" "size-12 md:size-24" "text-amber-500 dark:text-amber-500" "rotate-12" }}
          </div>
          <div class="absolute -top-2 -left-2 w-10 h-10 md:w-16 md:h-16 rounded-full bg-white dark:bg-gray-800 flex items-center justify-center border border-gray-200 dark:border-gray-700 -rotate-12">
            {{ i "users" "size-4 md:size-8" "text-amber-500 dark:text-amber-500" }}
          </div>
          <a href="{{ $moreLink }}" class="{{ $linkDesktopStyle }}">
            Explore timeline
            {{ i "arrow-right" "size-4" }}
          </a>
        </div>
      </div>
    </div>
  </div>
{{ end }}

{{ define "changelog" }}
  <div class="w-full px-2 py-16 md:py-24">
    <h2 class="text-3xl md:text-4xl font-bold mb-8 text-gray-900 dark:text-gray-100">Changelog</h2>

    <div class="grid grid-cols-1 gap-6 mb-6">
      {{ range $index := list 0 1 2 3 }}
        <div class="bg-white dark:bg-gray-800 rounded shadow-sm border border-gray-200 dark:border-gray-700 p-6">
          <div class="flex items-center gap-2 mb-3">
            <span class="text-xs font-medium text-gray-500 dark:text-gray-400">v1.{{ sub 3 $index }}.0</span>
            <span class="text-xs text-gray-400 dark:text-gray-500">•</span>
            <span class="text-xs text-gray-500 dark:text-gray-400">Feb {{ sub 16 $index }}, 2026</span>
          </div>
          <h3 class="text-lg font-semibold mb-2 text-gray-900 dark:text-gray-100">Feature Update {{ sub 4 $index }}</h3>
          <p class="text-sm text-gray-600 dark:text-gray-300 leading-relaxed">
            Improvements to the platform including bug fixes, performance enhancements, and new features.
          </p>
        </div>
      {{ end }}
    </div>

    <div class="flex justify-end">
      <a href="/changelog" class="hover:no-underline inline-flex items-center gap-2 px-4 py-2 text-base btn">
        View full changelog
        {{ i "arrow-right" "size-4" }}
      </a>
    </div>
  </div>
{{ end }}

{{ define "recentUpdates" }}
  <div class="w-full px-2 py-16 md:py-24">
    <h2 class="px-4 text-3xl md:text-4xl font-bold text-gray-900 dark:text-gray-100 mb-2">Recent updates</h2>
    <p class="px-4 mb-8 text-gray-500 dark:text-gray-400">
      Follow <a href="https://bsky.app/profile/tangled.org">@tangled.org</a> on Bluesky for more!
    </p>
    <div class="columns-1 md:columns-2 lg:columns-3 gap-6">
      {{ range $index, $post := .BlueskyPosts }}
        <div class="{{ if ge $index 3 }}hidden md:block{{ end }}">
          {{ template "post" $post }}
        </div>
      {{ end }}
    </div>
  </div>
{{ end }}

{{ define "post" }}
  <div class="bg-white dark:bg-gray-800 rounded shadow-sm border border-gray-200 dark:border-gray-700 px-6 py-4 flex flex-col gap-2 break-inside-avoid mb-6">
    <div class="flex items-center justify-between text-sm text-gray-500 dark:text-gray-400">
      <span class="flex items-center gap-2">
        {{ template "user/fragments/picHandle" "tangled.org" }}
      </span>
      <span>{{ template "repo/fragments/shortTimeAgo" .CreatedAt }}</span>
    </div>
    <p class="text-gray-900 dark:text-gray-100 text-base leading-relaxed whitespace-pre-wrap">{{ .Text }}</p>

    {{ if .Embed }}
      {{ if .Embed.EmbedImages_View }}
        <div class="grid {{ if eq (len .Embed.EmbedImages_View.Images) 1 }}grid-cols-1{{ else if eq (len .Embed.EmbedImages_View.Images) 2 }}grid-cols-2{{ else }}grid-cols-2{{ end }} gap-2">
          {{ range .Embed.EmbedImages_View.Images }}
            <img src="{{ .Fullsize }}" alt="{{ .Alt }}" class="rounded w-full h-auto object-cover border border-gray-200 dark:border-gray-700" loading="lazy" />
          {{ end }}
        </div>
      {{ else if .Embed.EmbedExternal_View }}
        <a href="{{ .Embed.EmbedExternal_View.External.Uri }}" target="_blank" rel="noopener noreferrer" class="hover:no-underline block border border-gray-200 dark:border-gray-700 rounded overflow-hidden hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
          {{ if .Embed.EmbedExternal_View.External.Thumb }}
            <img src="{{ .Embed.EmbedExternal_View.External.Thumb }}" alt="" class="w-full h-48 object-cover" loading="lazy" />
          {{ end }}
          <div class="p-3">
            <div class="font-medium text-gray-900 dark:text-gray-100 text-sm mb-1">{{ .Embed.EmbedExternal_View.External.Title }}</div>
            <div class="text-xs text-gray-600 dark:text-gray-400 line-clamp-2">{{ .Embed.EmbedExternal_View.External.Description }}</div>
            <div class="text-xs text-gray-500 dark:text-gray-500 mt-1">{{ .Embed.EmbedExternal_View.External.Uri }}</div>
          </div>
        </a>
      {{ else if .Embed.EmbedVideo_View }}
        <div class="rounded overflow-hidden bg-gray-100 dark:bg-gray-700 aspect-video flex items-center justify-center">
          <span class="text-gray-500 dark:text-gray-400 text-sm">Video embed</span>
        </div>
      {{ end }}
    {{ end }}

    <a href="https://bsky.app/profile/tangled.org/post/{{ .Rkey }}"
      target="_blank"
      rel="noopener noreferrer"
      class="flex items-center justify-between gap-4 text-sm text-gray-500 dark:text-gray-400 pt-2 no-underline hover:no-underline">
      <div class="flex items-center gap-4">
        <div class="flex items-center gap-1">
          {{ i "heart" "size-4" }}
          <span>{{ .LikeCount }}</span>
        </div>
        <div class="flex items-center gap-1">
          {{ i "repeat-2" "size-4" }}
          <span>{{ .RepostCount }}</span>
        </div>
        <div class="flex items-center gap-1">
          {{ i "message-square" "size-4 -scale-x-1" }}
          <span>{{ add64 .ReplyCount .QuoteCount }}</span>
        </div>
      </div>
      {{ i "arrow-up-right" "size-4" }}
    </a>
  </div>
{{ end }}

{{ define "newsletter" }}
  <div class="w-full px-2 py-16 md:py-24">
    <div class="max-w-2xl mx-auto text-center space-y-6">
      <h2 class="text-3xl md:text-6xl font-bold text-gray-900 dark:text-gray-100">Stay in the loop</h2>
      <p class="text-xl text-gray-600 dark:text-gray-300">
        We've got a newsletter! Punch in your email to stay updated on what we're shipping at Tangled.
      </p>
      {{ template "timeline/fragments/newsletterForm" (dict "Id" "home" "Variant" "hero") }}
    </div>
  </div>
{{ end }}
