/* Filtyr home page only. Linked from index.html alone, so the legal pages cannot regress.
   Editorial, type-led layout: Archivo (variable width) for display and body, IBM Plex Mono for
   the "system" details inside the product illustrations. All corners are square, on purpose.
   Palette is Brand's: teal #0B5C52, charcoal, cream. Every text pair below clears WCAG AA
   (lowest is muted on panel, about 6.1:1 light and 7:1 dark). */

:root {
  --h-paper: #F6F1E6;         /* cream */
  --h-panel: #ECE4D3;
  --h-surface: #FBF8F1;
  --h-ink: #1E2321;           /* charcoal */
  --h-muted: #4E5450;
  --h-line: #D6CDBA;
  --h-accent-text: #0B5C52;   /* teal: about 7:1 on cream, safe for body text */
  --h-accent-fill: #0B5C52;
  --h-on-accent: #FBF8F1;
  --h-btn-bg: #1E2321;
  --h-btn-text: #F6F1E6;
  --h-display: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --h-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --h-gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --h-paper: #131715;
    --h-panel: #1A1F1C;
    --h-surface: #202623;
    --h-ink: #ECE6DA;
    --h-muted: #A9B0AB;
    --h-line: #333B37;
    --h-accent-text: #5EBFAE;  /* lifted teal: teal #0B5C52 is too dark to read on charcoal */
    --h-accent-fill: #3A9E8E;
    --h-on-accent: #0F1312;
    --h-btn-bg: #ECE6DA;
    --h-btn-text: #131715;
  }
}

@media (min-width: 720px) {
  :root {
    --h-gutter: 40px;
  }
}

/* Base */

body.home {
  background: var(--h-paper);
  color: var(--h-ink);
  font-family: var(--h-display);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

.home a {
  color: var(--h-accent-text);
}

.home a:focus-visible {
  outline: 2px solid var(--h-accent-text);
  outline-offset: 3px;
}

.home h1,
.home h2,
.home h3 {
  color: var(--h-ink);
  margin: 0;
}

.frame {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: var(--h-gutter);
  padding-right: var(--h-gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--h-btn-bg);
  color: var(--h-btn-text);
  padding: 8px 12px;
  z-index: 10;
}

.home .skip:focus {
  left: 8px;
  color: var(--h-btn-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.display-2 {
  font-size: clamp(2rem, 5.2vw, 4.25rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.display-3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 750;
  font-stretch: 80%;
  line-height: 1.05;
}

.caption {
  font-family: var(--h-mono);
  font-size: 0.75rem;
  color: var(--h-muted);
  margin-top: 12px;
}

/* Header */

.home .site-header {
  border-bottom: 1px solid var(--h-line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.home .wordmark {
  font-family: var(--h-display);
  color: var(--h-ink);
  font-size: 1.6rem;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.home .site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.home .site-nav a {
  margin: 0;
  color: var(--h-ink);
  font-size: 0.95rem;
  text-decoration: none;
}

.home .site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home .site-nav .nav-signin {
  border: 1.5px solid var(--h-ink);
  padding: 6px 14px;
  font-weight: 600;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(48px, 7vw, 96px);
}

.hero-title {
  grid-column: 1 / -1;
  font-size: clamp(3rem, 10.5vw, 10rem);
  font-weight: 850;
  font-stretch: 66%;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.hero-title .line {
  display: block;
}

.hero-title .line-accent {
  color: var(--h-accent-text);
  padding-left: 0.9em;
}

.hero-side {
  grid-column: 1 / -1;
  margin-top: 32px;
}

.hero-lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  max-width: 38ch;
  margin: 0 0 28px;
}

/* Filter motif: five rules of shrinking length, stacked like a fold, under the hero copy. */
.filter-lines {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: clamp(40px, 6vw, 72px);
}

.filter-lines span {
  display: block;
  height: 3px;
  background: var(--h-ink);
  transform-origin: left center;
}

.filter-lines span:nth-child(1) { width: 100%; }
.filter-lines span:nth-child(2) { width: 78%; }
.filter-lines span:nth-child(3) { width: 54%; }
.filter-lines span:nth-child(4) { width: 30%; }

.filter-lines span:nth-child(5) {
  width: 10%;
  min-width: 40px;
  height: 6px;
  background: var(--h-accent-fill);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.cta-note {
  margin: 0;
  color: var(--h-muted);
  font-size: 0.95rem;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.home .btn-primary {
  background: var(--h-btn-bg);
  color: var(--h-btn-text);
  border: 1.5px solid var(--h-btn-bg);
}

.home .btn-primary:hover,
.home .btn-primary:focus-visible {
  background: var(--h-accent-text);
  border-color: var(--h-accent-text);
  color: var(--h-on-accent);
}

.home .btn-secondary {
  background: transparent;
  color: var(--h-ink);
  border: 1.5px solid var(--h-ink);
}

.home .btn-secondary:hover,
.home .btn-secondary:focus-visible {
  color: var(--h-accent-text);
  border-color: var(--h-accent-text);
}

.btn:active {
  transform: translateY(1px);
}

@media (min-width: 900px) {
  .hero-side {
    grid-column: 7 / -1;
    margin-top: 40px;
  }
}

/* The inbox mock */

.inbox-section {
  padding-bottom: clamp(64px, 10vw, 140px);
}

.inbox-figure {
  margin: 0;
}

.mock {
  display: grid;
  grid-template-columns: 1fr;
  border: 1.5px solid var(--h-ink);
  background: var(--h-surface);
  font-size: 0.875rem;
  box-shadow: 14px 14px 0 var(--h-panel);
}

.mock-rail,
.mock-list,
.mock-side {
  display: none;
}

.mock-rail {
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  border-right: 1px solid var(--h-line);
  background: var(--h-panel);
}

.rail-mark {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.rail-head {
  font-family: var(--h-mono);
  font-size: 0.6875rem;
  color: var(--h-muted);
  margin-top: 14px;
}

.rail-item {
  padding: 4px 8px;
}

.rail-on {
  background: var(--h-ink);
  color: var(--h-paper);
}

.mock-list {
  flex-direction: column;
  border-right: 1px solid var(--h-line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--h-line);
}

.row-on {
  box-shadow: inset 4px 0 0 var(--h-accent-fill);
  background: var(--h-paper);
}

.row-from {
  font-weight: 700;
}

.row-subj {
  grid-column: 1;
  color: var(--h-muted);
}

.row-owner {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--h-mono);
  font-size: 0.6875rem;
  color: var(--h-accent-text);
}

.mock-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
}

.msg-mail {
  border: 1px solid var(--h-line);
  background: var(--h-paper);
}

.msg-event {
  font-family: var(--h-mono);
  font-size: 0.75rem;
  color: var(--h-accent-text);
  padding: 2px 14px;
}

.msg-comment {
  border-left: 3px solid var(--h-ink);
  background: var(--h-panel);
}

.msg-owner {
  border-left-color: var(--h-accent-fill);
  margin-left: 24px;
}

.who {
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.org {
  font-family: var(--h-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 1px 6px;
  border: 1px solid var(--h-muted);
  color: var(--h-muted);
}

.org-note {
  border-color: var(--h-ink);
  color: var(--h-ink);
}

.org-owner {
  background: var(--h-accent-text);
  border-color: var(--h-accent-text);
  color: var(--h-on-accent);
}

.at {
  font-weight: 700;
  color: var(--h-accent-text);
}

.mock-side {
  flex-direction: column;
  padding: 16px;
  border-left: 1px solid var(--h-line);
}

.side-label {
  font-family: var(--h-mono);
  font-size: 0.6875rem;
  color: var(--h-muted);
  margin-top: 12px;
}

.side-label:first-child {
  margin-top: 0;
}

.side-value {
  font-weight: 600;
}

@media (min-width: 760px) {
  .mock {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .mock-list {
    display: flex;
  }
}

@media (min-width: 1080px) {
  .mock {
    grid-template-columns: 150px 250px minmax(0, 1fr) 170px;
  }

  .mock-rail,
  .mock-side {
    display: flex;
  }
}

/* Problem */

.problem-section {
  background: var(--h-ink);
  color: var(--h-paper);
  padding: clamp(64px, 10vw, 140px) 0;
}

.home .problem-section h2 {
  color: var(--h-paper);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.problem-body p {
  margin: 0 0 18px;
  max-width: 52ch;
}

.problem-lead {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  line-height: 1.4;
}

.problem-close {
  font-weight: 700;
  border-top: 1.5px solid var(--h-paper);
  padding-top: 18px;
}

@media (min-width: 1000px) {
  .problem-grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 64px;
  }
}

/* How it works */

.how-section {
  padding-top: clamp(64px, 10vw, 140px);
  padding-bottom: clamp(64px, 10vw, 140px);
}

.steps {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 40px;
}

.steps li {
  border-top: 1.5px solid var(--h-ink);
  padding-top: 14px;
}

.step-num {
  display: block;
  font-family: var(--h-mono);
  font-size: 0.8125rem;
  color: var(--h-accent-text);
  margin-bottom: 8px;
}

.steps h3 {
  font-size: 1.4rem;
  font-weight: 800;
  font-stretch: 78%;
  line-height: 1.1;
}

.steps p {
  color: var(--h-muted);
  margin: 10px 0 0;
  max-width: 44ch;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.route-figure {
  margin: 64px 0 0;
}

.route-svg {
  display: block;
  width: 100%;
  height: auto;
}

.route-svg-tall {
  display: none;
  max-width: 300px;
}

.route-line {
  stroke: var(--h-ink);
  stroke-width: 2;
  stroke-dasharray: 6 8;
  fill: none;
}

.route-packet {
  fill: var(--h-accent-fill);
}

.node rect {
  fill: var(--h-surface);
  stroke: var(--h-ink);
  stroke-width: 2;
}

.node-end rect {
  fill: var(--h-accent-text);
  stroke: var(--h-accent-text);
}

.node-k {
  font-family: var(--h-display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 34px;
  fill: var(--h-ink);
}

.node-v {
  font-family: var(--h-mono);
  font-size: 18px;
  fill: var(--h-muted);
}

.node-end .node-k,
.node-end .node-v {
  fill: var(--h-on-accent);
}

.online {
  fill: var(--h-on-accent);
}

@media (max-width: 639px) {
  .route-svg-wide {
    display: none;
  }

  .route-svg-tall {
    display: block;
  }
}

/* Feature blocks */

.features-section {
  border-top: 1.5px solid var(--h-ink);
  padding: clamp(64px, 10vw, 140px) 0;
}

.feature-list {
  margin: 0;
}

.feature-list div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 22px 0;
  border-top: 1px solid var(--h-line);
}

.feature-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.feature-list dt {
  font-size: clamp(1.75rem, 3.8vw, 3rem);
  font-weight: 800;
  font-stretch: 70%;
  line-height: 1;
}

.feature-list dd {
  margin: 0;
  color: var(--h-muted);
  max-width: 52ch;
  align-self: end;
}

@media (min-width: 900px) {
  .feature-list div {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 40px;
  }

  .feature-list div:nth-child(even) dt {
    padding-left: 8vw;
  }
}

.val-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-top: clamp(48px, 7vw, 96px);
  padding: clamp(32px, 5vw, 64px) var(--h-gutter);
  margin-left: calc(var(--h-gutter) * -1);
  margin-right: calc(var(--h-gutter) * -1);
  background: var(--h-panel);
}

.val-at {
  color: var(--h-accent-text);
}

.val-copy p {
  color: var(--h-muted);
  max-width: 44ch;
  margin: 20px 0 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
}

.val-figure {
  margin: 0;
  align-self: center;
}

.val-card {
  background: var(--h-surface);
  border: 1.5px solid var(--h-ink);
  padding: 24px;
  max-width: 460px;
  box-shadow: 14px 14px 0 var(--h-accent-fill);
}

.vc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--h-line);
  padding-bottom: 12px;
}

.vc-name {
  font-weight: 900;
  font-stretch: 110%;
  font-size: 1.125rem;
  color: var(--h-accent-text);
}

.vc-src,
.vc-key,
.vc-k {
  font-family: var(--h-mono);
  font-size: 0.75rem;
  color: var(--h-muted);
}

.vc-load {
  display: flex;
  flex-direction: column;
  margin: 18px 0 14px;
}

.vc-num {
  font-weight: 850;
  font-stretch: 62%;
  font-size: clamp(3.5rem, 9vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.vc-rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-items: baseline;
}

.vc-v {
  font-weight: 600;
}

.vc-ok {
  color: var(--h-accent-text);
}

.vc-draft {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 14px;
  border: 1.5px dashed var(--h-accent-text);
}

.vc-draft-tag {
  font-family: var(--h-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--h-accent-text);
}

.vc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vc-btn {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 6px 10px;
  background: var(--h-btn-bg);
  color: var(--h-btn-text);
}

.vc-btn-ghost {
  background: transparent;
  color: var(--h-ink);
  border: 1px solid var(--h-ink);
}

@media (min-width: 1000px) {
  .val-block {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
  }

  .val-figure {
    justify-self: end;
  }
}

/* Logistics use-case strip */

.desks-section {
  padding-bottom: clamp(64px, 10vw, 140px);
}

.desks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 32px 0 0;
  border-top: 1.5px solid var(--h-ink);
}

.desks div {
  padding: 20px 0;
  border-bottom: 1px solid var(--h-line);
}

.desks dt {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  font-stretch: 72%;
  line-height: 1;
  color: var(--h-accent-text);
}

.desks dd {
  margin: 10px 0 0;
  color: var(--h-muted);
}

@media (min-width: 720px) {
  .desks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

@media (min-width: 1100px) {
  .desks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .desks div {
    border-bottom: 0;
    border-left: 1px solid var(--h-line);
    padding: 20px 20px 4px;
  }

  .desks div:first-child {
    border-left: 0;
    padding-left: 0;
  }
}

/* FAQ */

.faq-section {
  background: var(--h-panel);
  padding: clamp(64px, 10vw, 140px) 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.faq {
  margin: 0;
}

.faq div {
  padding: 20px 0;
  border-top: 1px solid var(--h-line);
}

.faq div:first-child {
  border-top: 1.5px solid var(--h-ink);
}

.faq dt {
  font-weight: 800;
  font-stretch: 85%;
  font-size: 1.25rem;
  line-height: 1.2;
}

.faq dd {
  margin: 8px 0 0;
  color: var(--h-muted);
  max-width: 60ch;
}

@media (min-width: 1000px) {
  .faq-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 64px;
  }
}

/* Final CTA */

.close-section {
  padding-top: clamp(64px, 10vw, 140px);
  padding-bottom: clamp(56px, 8vw, 112px);
}

.close-title {
  font-size: clamp(2.5rem, 7.5vw, 7rem);
  font-weight: 850;
  font-stretch: 66%;
  line-height: 0.92;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.close-section > p {
  color: var(--h-muted);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  max-width: 48ch;
  margin: 24px 0 32px;
}

/* Data use */

.data-section {
  border-top: 1px solid var(--h-line);
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(56px, 8vw, 100px);
}

.data-body {
  max-width: 64ch;
  margin-top: 20px;
}

.data-body p {
  margin: 0 0 14px;
}

/* Footer */

.home .site-footer {
  border-top: 1px solid var(--h-line);
  margin-top: 0;
  padding: 32px 0 40px;
  overflow: hidden;
  color: var(--h-muted);
}

.footer-mark {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(4rem, 18vw, 16rem);
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: var(--h-accent-text);
  margin: 0 0 28px !important;
}

.home .site-footer a {
  color: var(--h-ink);
}

/* Motion: CSS only, and only when the reader has not asked for less. */

@keyframes h-rise {
  from {
    opacity: 0;
    transform: translateY(0.25em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes h-filter {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes h-travel-x {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(720px);
    opacity: 0;
  }
}

@keyframes h-travel-y {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(420px);
    opacity: 0;
  }
}

@keyframes h-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title .line {
    animation: h-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .hero-title .line-accent {
    animation-delay: 0.12s;
  }

  .hero-side {
    animation: h-rise 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* The rules draw in one after another, shortest last: mail filtered down to one owner. */
  .filter-lines span {
    animation: h-filter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .filter-lines span:nth-child(1) { animation-delay: 0.35s; }
  .filter-lines span:nth-child(2) { animation-delay: 0.45s; }
  .filter-lines span:nth-child(3) { animation-delay: 0.55s; }
  .filter-lines span:nth-child(4) { animation-delay: 0.65s; }
  .filter-lines span:nth-child(5) { animation-delay: 0.8s; }

  .route-svg-wide .route-packet {
    animation: h-travel-x 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }

  .route-svg-tall .route-packet {
    animation: h-travel-y 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }

  .online {
    animation: h-pulse 2s ease-in-out infinite;
  }

  /* The thread builds up as it scrolls into view, where the browser supports it. */
  @supports (animation-timeline: view()) {
    .mock-stream .msg {
      animation: h-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
  }
}

@media (max-width: 479px) {
  .mock {
    box-shadow: 8px 8px 0 var(--h-panel);
  }

  .val-card {
    box-shadow: 8px 8px 0 var(--h-accent-fill);
  }
}

@media (max-width: 399px) {
  .home .wordmark {
    font-size: 1.35rem;
  }

  .home .site-nav {
    gap: 12px;
  }

  .home .site-nav a {
    font-size: 0.875rem;
  }

  .home .site-nav .nav-signin {
    padding: 5px 10px;
  }
}
