/* Landscape introduction */
.fm-home-hero {
  --home-ink: #fffdf2;
  --home-muted: #e1eadc;
  --home-green: #e2edb8;
  --home-on-green: #18362a;
  --home-hover: #f1f6d7;
  --home-soft: #294a3c;
  --home-control: #c0d0c4;
  --home-focus: #f0f5c0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #173428;
}

.fm-home-hero-image,
.fm-home-hero::after { position: absolute; inset: 0; }

.fm-home-hero-image { z-index: -2; }
.fm-home-hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 55% 52%; }

.fm-home-hero::after {
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgb(8 24 17 / 91%) 0%, rgb(8 24 17 / 82%) 35%, rgb(8 24 17 / 58%) 56%, rgb(8 24 17 / 6%) 100%);
}

.fm-home-stage {
  display: grid;
  align-items: center;
  min-block-size: clamp(420px, 53vh, 510px);
  padding-block: clamp(36px, 4vw, 62px);
}

.fm-home-intro { max-width: min(100%, 705px); }

.fm-home-hero h1 {
  max-width: 20ch;
  color: var(--home-ink);
  font-size: clamp(2.4rem, 5.25vw, 4.55rem);
  line-height: 1.02;
  font-weight: 630;
  letter-spacing: -.057em;
  text-wrap: balance;
}

.fm-home .fm-home-lead {
  max-width: 48ch;
  margin-top: 22px;
  color: var(--home-ink);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.5;
}

.fm-home .fm-home-audience { margin-top: 18px; max-width: 58ch; }
.fm-home-hero .fm-home-button { min-height: 48px; }
.fm-home-hero .fm-home-button-outline { border-color: var(--home-control); }

/* Shared columns keep sector headings and individual apps aligned. */
.fm-home-catalog {
  --catalog-gap: clamp(15px, 2vw, 28px);
  --catalog-mark-width: min(202px, 17vw);
  padding-top: clamp(30px, 4.5vw, 62px);
}
.fm-home-catalog-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px 22px;
  margin-bottom: clamp(22px, 3vw, 38px);
  border: 0;
  background: none;
}
.fm-home-catalog-head h1 {
  font-size: clamp(2.2rem, 5.25vw, 4.15rem);
  line-height: 1.06;
  letter-spacing: -.05em;
  font-weight: 630;
}
.fm-home-catalog-head h1[data-portal-anchor]:focus { outline: none; }
.fm-home-catalog-head p {
  max-width: 58ch;
  margin-top: 9px;
  font-size: clamp(.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.55;
}
.fm-catalog-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--home-control);
  border-radius: 8px;
  background: var(--home-surface);
}
.fm-catalog-filter a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 6px;
  border-radius: 5px;
  color: var(--home-ink);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}
.fm-catalog-filter a:hover { background: var(--home-accent-soft, var(--home-line)); }
.fm-catalog-filter a[aria-current] { background: var(--home-green); color: var(--home-on-green); }

.fm-catalog-filter-stack {
  display: grid;
  gap: 8px;
  width: min(100%, 17rem);
}
.fm-catalog-category-menu {
  position: relative;
  min-width: 0;
}
.fm-catalog-category-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 7px 13px;
  border: 1px solid var(--home-control);
  border-radius: 8px;
  background: var(--home-surface);
  color: var(--home-ink);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
  list-style: none;
  cursor: pointer;
}
.fm-catalog-category-menu summary::-webkit-details-marker { display: none; }
.fm-catalog-category-menu summary:hover { background: var(--home-accent-soft, var(--home-line)); }
.fm-catalog-category-menu summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.fm-catalog-category-menu[open] summary::after { transform: translateY(3px) rotate(225deg); }
.fm-catalog-categories {
  position: absolute;
  z-index: 6;
  inset-block-start: calc(100% + 5px);
  inset-inline: 0;
  display: grid;
  max-height: min(43vh, 21rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--home-control);
  border-radius: 8px;
  background: var(--home-surface);
  box-shadow: 0 12px 34px rgb(5 20 13 / 23%);
}
.fm-catalog-categories a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--home-ink);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}
.fm-catalog-categories a:hover { background: var(--home-accent-soft, var(--home-line)); }
.fm-catalog-categories a:focus-visible { outline-offset: -2px; }
.fm-catalog-categories a[aria-current] {
  background: var(--home-green);
  color: var(--home-on-green);
}
.catalog-empty { padding-block: 16px 24px; color: var(--home-muted); }

.fm-home-sectors {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(21px, 3.2vw, 42px) var(--catalog-gap);
}
.fm-home-sector {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--home-control);
}
.fm-home-sector[data-sector="stand"], .fm-home-sector[data-sector="ai"] { grid-column: span 2; }
.fm-home-sector[data-sector="hazards"] { grid-column: span 3; }
.fm-home-sector[data-sector="operations"] { grid-column: span 4; }
.catalog-sector-heading { display: flex; align-items: center; gap: 8px; min-height: 49px; }
.catalog-sector-heading > svg { width: 18px; height: 18px; color: var(--home-green); }
.catalog-sector-heading h3 { font-size: clamp(1.05rem, 1.45vw, 1.24rem); line-height: 1.18; letter-spacing: -.02em; }
.fm-catalog-law-summary { margin: 0; font-size: .875rem; }

.fm-home-cards {
  display: grid;
  grid-template-columns: repeat(var(--catalog-columns, 1), minmax(0, 1fr));
  gap: var(--catalog-gap);
  margin-top: 9px;
}
[data-sector="stand"] .fm-home-cards { --catalog-columns: 2; }
[data-sector="hazards"] .fm-home-cards { --catalog-columns: 3; }
[data-sector="operations"] .fm-home-cards { --catalog-columns: 4; }
.fm-home-card { position: relative; min-width: 0; }
.fm-catalog-mark {
  display: flex;
  justify-content: center;
  border-radius: 5px;
}
.fm-catalog-mark img {
  display: block;
  width: min(100%, var(--catalog-mark-width));
  height: auto;
}

.fm-home-card:has(.fm-catalog-mark:is(:hover, :focus-visible)) .fm-home-text-link { text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .fm-catalog-mark img { transition: transform 180ms ease-out; }
  a.fm-catalog-mark:hover img { transform: translateY(-3px); }
}
.catalog-visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
}

.fm-catalog-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 10px; }
.catalog-project-state { margin: 0; color: var(--home-muted); font-size: .75rem; font-weight: 620; line-height: 1.35; }
.fm-home .fm-home-card .fm-home-text-link { justify-content: flex-start; padding: 4px 0; border: 0; font-size: .875rem; }
.fm-home .fm-home-card .fm-home-text-link:hover { background: none; text-decoration-thickness: 2px; }

.fm-catalog-meta { min-height: 44px; }
.fm-catalog-word {
  display: grid;
  place-items: center;
  width: min(100%, var(--catalog-mark-width));
  aspect-ratio: 390 / 319;
  text-align: center;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 720;
  overflow-wrap: anywhere;
}

@media (min-width: 1061px) {
  .fm-home-catalog:is([data-filter="free"], [data-filter="pro"]) .fm-home-sectors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-home-catalog[data-filter="pro"] [data-sector="operations"] { grid-column: span 3; }
  .fm-home-catalog[data-filter="pro"] [data-sector="operations"] .fm-home-cards { --catalog-columns: 3; }
}

@media (max-width: 1060px) {
  .fm-home-catalog { --catalog-mark-width: min(202px, 21vw); }
  .fm-home-sectors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-home-sectors .fm-home-sector { grid-column: span 2; }
  .fm-home-sectors [data-sector="operations"] { grid-column: 1 / -1; }
  .fm-home-sectors [data-sector="hazards"] { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .fm-home-catalog { --catalog-mark-width: min(194px, calc((100vw - 62px) / 2)); }
  .fm-home-sectors { grid-template-columns: minmax(0, 1fr); }
  .fm-home-sectors .fm-home-sector { grid-column: 1; }
  .catalog-sector-heading { min-height: 38px; }
  .fm-home-sector .fm-home-cards { --catalog-columns: 1; gap: 0; }
  .fm-home-sector:is([data-sector="stand"], [data-sector="operations"], [data-sector="hazards"]) .fm-home-cards { --catalog-columns: 2; gap: 12px; }
  .fm-home-hero::after {
    background: linear-gradient(180deg, rgb(8 24 17 / 90%) 0%, rgb(8 24 17 / 76%) 53%, rgb(8 24 17 / 29%) 100%);
  }
  .fm-home-stage { align-items: start; min-block-size: 440px; padding-block: 43px 80px; }
  .fm-home-hero h1 { font-size: clamp(2.2rem, 8.2vw, 3.7rem); }
}


@media (max-width: 380px) {
  .fm-home-stage { min-block-size: 0; padding-bottom: 96px; }
}

@media (prefers-reduced-motion: no-preference) {
  .fm-home-hero-image img { animation: forest-entrance 850ms cubic-bezier(.2,.72,.27,1) both; }
  .fm-home-intro { animation: forest-copy 380ms cubic-bezier(.23,1,.32,1) both; }
  @keyframes forest-entrance { from { transform: scale(1.045); } to { transform: scale(1); } }
  @keyframes forest-copy { from { transform: translateY(8px); } to { transform: translateY(0); } }
}

@media (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .fm-home-hero .fm-home-button { transition: transform 140ms cubic-bezier(.23,1,.32,1); }
  .fm-home-hero .fm-home-button:active { transform: translateY(2px); }
}
