/* Editorial interior pages: Products, Team, Syntrophia, Inside, Build yours, Legal */

.editorial {
  --gutter: clamp(1.5rem, 4vw, 4rem);
  --split: minmax(0, 0.85fr) minmax(0, 1.15fr);
  min-height: 70vh;
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}

.editorial .page-mast {
  display: grid;
  grid-template-columns: var(--split);
  align-items: end;
  gap: 1.25rem var(--gutter);
  padding: clamp(3rem, 6.5vw, 5.5rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.page-mast h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.page-mast > p {
  max-width: 42ch;
  margin-bottom: 0.1em;
  font-size: clamp(1.1rem, 1.55vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.editorial h2 {
  letter-spacing: -0.032em;
  line-height: 1.1;
}

.editorial .primary,
.editorial .secondary {
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  font-size: 0.95rem;
}

/* Sticky pill category index on Products */
.category-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--inner-highlight);
}

.category-index a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--ink);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.category-index a:hover,
.category-index a:focus-visible {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.category-index img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.jump-direction {
  width: 7px;
  height: 7px;
  margin-inline-start: auto;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* Category sections & modern product card grid */
.category {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1.58fr);
  gap: 1.75rem var(--gutter);
  padding-block: clamp(2.8rem, 5vw, 4.8rem);
}

.category + .category {
  border-top: 1px solid var(--line);
}

.category-intro h2 {
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  letter-spacing: -0.04em;
}

.category-intro p {
  margin-top: 0.6rem;
  max-width: 24ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 0;
}

.product-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-accent, var(--line-strong));
  background: var(--surface);
  box-shadow: var(--inner-highlight);
  overflow: hidden;
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease), background-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

/* Official brand colours per product from brand-palette.json */
#syntories { --brand-accent: var(--c-syntories); }
#synphone { --brand-accent: var(--c-synphone); }
#synflicks { --brand-accent: var(--c-synflicks); }
#synshot { --brand-accent: var(--c-synshot); }
#syntoon { --brand-accent: var(--c-syntoon); }
#synclass { --brand-accent: var(--c-synclass); }
#trybytest { --brand-accent: var(--c-trybytest); }
#mathedos-desk { --brand-accent: var(--c-mathedos); }
#mathedos-books { --brand-accent: var(--c-mathedos); }
#mathedos-proof { --brand-accent: var(--c-mathedos-proof); }
#syntrofos-create { --brand-accent: var(--c-create); }
#syntrofos-space { --brand-accent: var(--c-space); }

.product-entry:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: var(--card-shadow);
}

.product-entry > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  width: 100%;
}

.product-entry p {
  max-width: 36ch;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.product-entry .secondary {
  margin-top: auto;
  min-height: 38px;
  font-size: 14px;
}

.product-mark img,
.step-mark img {
  width: auto;
  max-width: 100%;
  height: 36px;
  object-fit: contain;
  object-position: left center;
}

.product-entry:target {
  border-color: var(--brand-accent, var(--ink));
  box-shadow: 0 0 0 2px var(--brand-accent, var(--ink));
}

.category:focus-visible,
.product-entry:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.products-page {
  padding-bottom: 2rem;
}

/* Team closing & entity label */
.entity-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.team-closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(3rem, 6vw, 5.5rem);
  padding: clamp(24px, 3.6vw, 44px) clamp(24px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--inner-highlight);
}

.team-closing p {
  max-width: 24ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

/* Manifesto (Syntrophia) & reading pages */
.manifesto-page .page-mast {
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr);
  align-items: start;
  padding-bottom: clamp(2.5rem, 5.5vw, 5rem);
}

.manifesto-page .page-mast h1 {
  padding-top: 0.18em;
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  color: var(--muted);
}

.manifesto-page .page-mast p {
  max-width: 20ch;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.reading-spread {
  display: grid;
  grid-template-columns: var(--split);
  gap: 1.5rem var(--gutter);
  align-items: start;
  padding-block: clamp(2.2rem, 4.5vw, 4rem);
  border-top: 1px solid var(--line);
}

.reading-spread h2 {
  max-width: 18ch;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
}

.reading-copy {
  max-width: 56ch;
}

.reading-copy p {
  font-size: clamp(1.03rem, 1.25vw, 1.18rem);
  line-height: 1.65;
  color: var(--ink-2);
}

.reading-copy p + p {
  margin-top: 1em;
}

.reading-copy a {
  margin-top: 1.4rem;
}

.manifesto-page .reading-spread {
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr);
}

.inside-page .reading-spread {
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--inner-highlight);
}

.inside-page .reading-spread h2 {
  font-size: clamp(1.9rem, 3.5vw, 3.2rem);
  letter-spacing: -0.035em;
}

.privacy-page .reading-spread h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.privacy-date {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Build yours 3-step cards */
.work-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: work-step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.work-steps li {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--inner-highlight);
  counter-increment: work-step;
}

.work-steps li::before {
  content: counter(work-step, decimal-leading-zero);
  content: counter(work-step, decimal-leading-zero) / "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.work-steps h2 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.step-mark img {
  height: clamp(32px, 2.8vw, 42px);
}

.step-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.step-copy p {
  max-width: 38ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}

.step-copy a {
  margin-top: auto;
  padding-top: 0;
}

.step-copy p + a {
  margin-top: 22px;
}

@media (min-width: 58rem) and (min-height: 40rem) {
  .category-index {
    position: sticky;
    top: 86px;
    z-index: 10;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .category,
  .product-entry {
    scroll-margin-block-start: 156px;
  }
  .category-intro {
    position: sticky;
    top: 170px;
    align-self: start;
  }
}

@media (max-width: 960px) {
  .category {
    grid-template-columns: minmax(0, 1fr);
  }
  .work-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .editorial .page-mast,
  .editorial .reading-spread,
  .manifesto-page .page-mast,
  .manifesto-page .reading-spread,
  .product-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .editorial .page-mast {
    align-items: start;
    padding-block: 2.2rem 1.8rem;
  }
  .page-mast h1 {
    font-size: clamp(2.4rem, 11vw, 3.6rem);
  }
  .category-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }
  .category-index a {
    min-height: 44px;
    padding: 8px 12px;
  }
  .category-index img {
    width: 22px;
    height: 22px;
  }
  .jump-direction {
    display: none;
  }
  .team-closing {
    align-items: flex-start;
  }
  .manifesto-page .page-mast p {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }
}
