/* tabstack.alethi.dev: the tabstack extension's home page and privacy
   policy (internal/views/tabstack.templ). Separate from site.css: none of
   the blog's rules apply here. The look lives in the tokens on :root, dark
   by default, light when the reader's system asks for it. The icon's
   animation is CSS only, and holds still under prefers-reduced-motion. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-latin-wght.woff2?v=9b6f5ff45b27") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* for the alethi.dev wordmark in the footer */
@font-face {
  font-family: "Fira Code";
  src: url("/static/fonts/FiraCode-latin-wght.woff2?v=771bf4b79a97") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-latin-wght.woff2?v=5f3d6ad60f29") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --ts-bg: #0a0c12;
  --ts-surface: #11141d;
  --ts-surface-2: #181c28;
  --ts-border: #232a3b;
  --ts-text: #e8ebf3;
  --ts-muted: #9aa1b4;
  --ts-accent: #6f93ff;
  --ts-accent-text: #8aa8ff;
  --ts-shadow: rgba(0, 0, 0, 0.5);
  --ts-key: #1b2030;
  --ts-key-edge: #0a0c12;
  --ts-alethi: #e95678;

  --ts-font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ts-font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ts-width: 70rem;
  --ts-gutter: 1.5rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --ts-bg: #f7f8fb;
    --ts-surface: #ffffff;
    --ts-surface-2: #eef1f7;
    --ts-border: #dde2ec;
    --ts-text: #0f1320;
    --ts-muted: #535b6e;
    --ts-accent: #3b6cf6;
    --ts-accent-text: #2a56d6;
    --ts-shadow: rgba(20, 30, 60, 0.14);
    --ts-key: #ffffff;
    --ts-key-edge: #cfd5e2;
    --ts-alethi: #c0365a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.ts {
  margin: 0;
  background: var(--ts-bg);
  color: var(--ts-text);
  font-family: var(--ts-font-body);
  font-size: 1rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ts a {
  color: var(--ts-accent-text);
  text-underline-offset: 0.15em;
}

.ts :focus-visible {
  outline: 2px solid var(--ts-accent);
  outline-offset: 2px;
}

.ts h1,
.ts h2,
.ts h3 {
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.ts h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.ts h3 {
  font-size: 1.25rem;
}

.ts p {
  margin: 0;
}

.ts-wrap {
  width: 100%;
  max-width: var(--ts-width);
  margin: 0 auto;
  padding: 0 var(--ts-gutter);
}

.ts-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ts-skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.ts-skip:focus {
  left: var(--ts-gutter);
  top: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
  border-radius: 8px;
}

main {
  flex: 1;
}

/* header */

.ts-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.ts .ts-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ts-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.ts-brand img {
  display: block;
}

.ts-nav {
  display: flex;
  align-items: center;
  gap: 1.125rem;
}

.ts .ts-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  color: var(--ts-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.ts .ts-nav a:hover {
  color: var(--ts-text);
}

.ts .ts-repo {
  color: var(--ts-text);
}

/* hero */

.ts-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.ts-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 48rem;
}

.ts-hero p {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ts-muted);
}

/* The icon's three tabs, in percentages of its 128-unit grid. Each tab runs
   the same 6.6s loop a third out of step with the next: it rests in front,
   steps back, steps back again, then lifts clear of the stack (its z-index
   changing only once it's above the others) and settles in front. */

.ts-icon {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 4.5rem 0 0.5rem;
  filter: drop-shadow(0 16px 28px var(--ts-shadow));
}

.ts-tab {
  position: absolute;
  left: 12.5%;
  top: 32.81%;
  width: 75%;
  height: 56.25%;
  border-radius: 26px;
  background: #3b6cf6;
  animation: ts-cycle 6.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ts-tab-bar {
  position: absolute;
  left: 14.6%;
  height: 12.5%;
  border-radius: 999px;
  animation: ts-bars 6.6s ease infinite;
}

.ts-tab-bar-1 {
  top: 22%;
  width: 43.75%;
  background: rgba(255, 255, 255, 0.92);
}

.ts-tab-bar-2 {
  top: 44.4%;
  width: 27%;
  background: rgba(255, 255, 255, 0.55);
}

.ts-tab-1,
.ts-tab-1 .ts-tab-bar {
  animation-delay: -2.2s;
}

.ts-tab-2,
.ts-tab-2 .ts-tab-bar {
  animation-delay: -4.4s;
}

@keyframes ts-cycle {
  0%,
  21.33% {
    left: 12.5%;
    top: 32.81%;
    width: 75%;
    height: 56.25%;
    border-radius: 26px;
    background: #3b6cf6;
    z-index: 4;
  }
  21.34% {
    z-index: 3;
  }
  33.33%,
  54.67% {
    left: 19.53%;
    top: 21.09%;
    width: 60.94%;
    height: 46.88%;
    border-radius: 22px;
    background: #7c9bf8;
    z-index: 3;
  }
  54.68% {
    z-index: 2;
  }
  66.67%,
  88% {
    left: 26.56%;
    top: 10.94%;
    width: 46.88%;
    height: 39.06%;
    border-radius: 19px;
    background: #b8c9fc;
    z-index: 2;
  }
  88.01% {
    z-index: 1;
  }
  94% {
    left: 23.44%;
    top: -32.81%;
    width: 53.13%;
    height: 40.63%;
    border-radius: 20px;
    background: #7c9bf8;
    z-index: 1;
  }
  94.01% {
    z-index: 5;
  }
  100% {
    left: 12.5%;
    top: 32.81%;
    width: 75%;
    height: 56.25%;
    border-radius: 26px;
    background: #3b6cf6;
    z-index: 5;
  }
}

/* the white lines show only on the front tab */
@keyframes ts-bars {
  0%,
  21.33% {
    opacity: 1;
  }
  27%,
  95% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* keys */

.ts-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--ts-key);
  border: 1px solid var(--ts-border);
  box-shadow: inset 0 -2px 0 var(--ts-key-edge);
  font: 500 0.9375rem var(--ts-font-mono);
  color: var(--ts-text);
}

.ts-key-held {
  border-color: var(--ts-accent);
  color: var(--ts-accent-text);
}

/* each feature: its heading and key legend, then its recording at full
   width */

.ts-feature {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 6rem;
}

.ts-demo {
  order: 2;
}

.ts-demo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--ts-border);
  background: var(--ts-surface);
  box-shadow: 0 24px 60px var(--ts-shadow);
}

.ts-demo-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  color: var(--ts-muted);
  font-family: var(--ts-font-mono);
  font-size: 0.875rem;
}

.ts-feature-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* one tile per action: its keys, then what they do */
.ts-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.ts-legend > div {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  border: 1px solid var(--ts-border);
  background: var(--ts-surface);
}

.ts-legend dt {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ts-legend dd {
  margin: 0;
  font-size: 1rem;
}

.ts-legend mark {
  background: none;
  color: var(--ts-accent-text);
  font-weight: 600;
}

.ts-query {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--ts-border);
  background: var(--ts-surface-2);
  font: 500 0.9375rem var(--ts-font-mono);
}

.ts-hero-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
}

.ts-combo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ts-combo-label {
  margin-left: 6px;
  font-size: 1.0625rem;
}

.ts .ts-platforms {
  margin-top: -0.5rem;
  color: var(--ts-muted);
  font-size: 0.875rem;
}

.ts-section {
  padding-bottom: 6rem;
}

/* privacy */

.ts-privacy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem;
  border-radius: 18px;
  background: var(--ts-surface);
  border: 1px solid var(--ts-border);
}

.ts-privacy > div {
  flex: 1 1 26rem;
}

.ts-privacy h2 {
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
}

.ts-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.ts-checks li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ts-checks svg {
  color: var(--ts-accent-text);
}

.ts .ts-button {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--ts-border);
  color: var(--ts-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.ts .ts-button:hover {
  background: var(--ts-surface-2);
}

/* FAQ */

.ts-faq {
  margin-top: 1.5rem;
  border-top: 1px solid var(--ts-border);
}

.ts-faq details {
  border-bottom: 1px solid var(--ts-border);
}

.ts-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  font-size: 1.0625rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.ts-faq summary::-webkit-details-marker {
  display: none;
}

.ts-plus {
  flex: none;
  color: var(--ts-muted);
  transition: transform 200ms ease;
}

.ts-faq details[open] .ts-plus {
  transform: rotate(45deg);
}

.ts-faq p {
  max-width: 45rem;
  padding-bottom: 1.375rem;
  color: var(--ts-muted);
  line-height: 1.65;
}

.ts code {
  font-family: var(--ts-font-mono);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  background: var(--ts-surface-2);
  border: 1px solid var(--ts-border);
  border-radius: 4px;
}

/* privacy policy (rendered markdown) and the 404 */

.ts-legal {
  max-width: 46rem;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.ts-legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.ts-updated {
  color: var(--ts-muted);
  font-size: 0.875rem;
}

.ts .ts-updated {
  margin-bottom: 1rem;
}

.ts-prose {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.ts-prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.ts .ts-prose p {
  margin-bottom: 1rem;
}

.ts-prose ul,
.ts-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.ts-prose li {
  margin-bottom: 0.5rem;
}

.ts-prose strong {
  font-weight: 600;
}

/* the markdown renderer's heading anchors */
.ts-prose .site-heading-anchor {
  margin-left: 0.4rem;
  color: var(--ts-muted);
  text-decoration: none;
  opacity: 0;
}

.ts-prose h2:hover .site-heading-anchor,
.ts-prose .site-heading-anchor:focus-visible {
  opacity: 1;
}

/* footer */

.ts-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  /* the rule spans the content, not the gutters */
  background: linear-gradient(var(--ts-border), var(--ts-border)) var(--ts-gutter) 0 / calc(100% - 2 * var(--ts-gutter)) 1px no-repeat;
  font-size: 0.875rem;
  color: var(--ts-muted);
}

.ts .ts-footer a {
  color: var(--ts-text);
  text-decoration: none;
}

/* "Made by //alethi.dev", the blog's wordmark (views.wordmark) */
.ts .ts-footer .ts-made {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--ts-muted);
}

.ts-made .wordmark {
  font: 600 0.9375rem "Fira Code", var(--ts-font-mono);
  color: var(--ts-text);
}

.ts-made .accent {
  color: var(--ts-alethi);
}

.ts .ts-made:hover .wordmark-name {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* The wordmark types itself out (tabstack.js). While data-reveal is set,
   the script keeps --ts-typed at the number of characters showing (of
   --ts-len) and the wordmark is clipped to them: Fira Code is monospaced,
   so that's --ts-typed ch. The caret is a sibling of the wordmark, out of
   the flow (so the link never changes size), its right edge set back from
   the wordmark's end by the characters not yet typed.
   "pending": not yet in view, nothing showing. "typing": the caret holds
   solid. "done": it blinks twice and is gone. Without the script, or under
   reduced motion, none of this applies. */
.ts-made[data-reveal] .wordmark {
  clip-path: inset(-0.3em calc((var(--ts-len) - var(--ts-typed)) * 1ch) -0.3em -0.3em);
}

.ts-made-by {
  transition: opacity 320ms ease-out;
}

.ts-made[data-reveal="pending"] .ts-made-by {
  opacity: 0;
}

.ts-caret {
  display: none;
}

.ts-made[data-reveal] .ts-caret {
  display: block;
  position: absolute;
  top: 50%;
  right: calc((var(--ts-len) - var(--ts-typed)) * 1ch - 3px);
  width: 2px;
  height: 1.15em;
  transform: translateY(-50%);
  border-radius: 1px;
  background: var(--ts-alethi);
  font: 600 0.9375rem "Fira Code", var(--ts-font-mono);
}

.ts-made[data-reveal="pending"] .ts-caret {
  opacity: 0;
}

/* Two blinks, then gone: on, off, on, off. */
.ts-made[data-reveal="done"] .ts-caret {
  animation: ts-caret-done 2s step-end forwards;
}

@keyframes ts-caret-done {
  25% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  75%,
  to {
    opacity: 0;
  }
}

/* Types the wordmark again: shown by tabstack.js once it has typed, faint
   until the pointer is over "Made by //alethi.dev" (or it has focus). */
.ts-made-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.ts-replay {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ts-muted);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 200ms ease-out,
    color 150ms ease-out;
}

.ts-replay[hidden] {
  display: none;
}

.ts-made-wrap:hover .ts-replay,
.ts-replay:focus-visible {
  opacity: 1;
}

.ts-replay:hover {
  color: var(--ts-text);
}

/* Touch screens have no hover to reveal it: always there, faintly, with a
   bigger target for a finger. */
@media (hover: none) {
  .ts-replay {
    width: 40px;
    height: 40px;
    opacity: 0.5;
  }
}

.ts-footer-links {
  display: flex;
  gap: 1.25rem;
}

.ts .ts-footer-links a {
  color: var(--ts-muted);
}

.ts .ts-footer-links a:hover {
  color: var(--ts-text);
}

@media (max-width: 40rem) {
  .ts-wrap {
    --ts-gutter: 1rem;
  }

  .ts-feature {
    padding-bottom: 4rem;
  }

  .ts-privacy {
    padding: 1.5rem;
  }
}

/* Still: the icon as drawn. tabstack.js pauses the recordings. */
@media (prefers-reduced-motion: reduce) {
  .ts-tab,
  .ts-tab-bar {
    animation: none;
  }

  .ts-tab-1 {
    left: 19.53%;
    top: 21.09%;
    width: 60.94%;
    height: 46.88%;
    border-radius: 22px;
    background: #7c9bf8;
    z-index: 2;
  }

  .ts-tab-2 {
    left: 26.56%;
    top: 10.94%;
    width: 46.88%;
    height: 39.06%;
    border-radius: 19px;
    background: #b8c9fc;
    z-index: 1;
  }

  .ts-tab-0 {
    z-index: 3;
  }

  .ts-tab-1 .ts-tab-bar,
  .ts-tab-2 .ts-tab-bar {
    opacity: 0;
  }
}
