/* bisexualmen.uk — editorial visual system
   Tokens, primitives, and shared component styles.
   Source Serif 4 for body, Inter for headings/UI. */

:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --body: #1A1A1A;
  --head: #0F2A44;
  --accent: #0E5D6C;
  --accent-hover: #0A4651;
  --highlight: #B8763B;
  --border: #E8E2D8;
  --cta-bg: #0F2A44;
  --cta-text: #FAF7F2;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1080px;
  --gutter: 40px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-weight: 500; font-family: var(--sans); color: var(--head); }

a { color: inherit; }

::selection { background: var(--highlight); color: #fff; }

/* ---------- Layout primitives ---------- */

/* Sections own the horizontal gutter; .container is just max-width + centering */
.container { max-width: var(--container); margin: 0 auto; }
.container-tight { max-width: 720px; margin: 0 auto; }

.rule { height: 1px; background: var(--border); width: 100%; }
.rule--accent { background: var(--highlight); }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--head);
}
.eyebrow--accent { color: var(--highlight); }
.eyebrow--muted { color: rgba(15, 42, 68, 0.55); }
.eyebrow--inverse { color: rgba(250, 247, 242, 0.55); }
.eyebrow--inverse-soft { color: rgba(250, 247, 242, 0.6); }
.eyebrow--link { color: var(--accent); }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--head);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.wordmark__dot { color: var(--highlight); }

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--head);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  letter-spacing: -0.005em;
}
.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--head);
  display: block;
}

/* ---------- Hero / page intros ---------- */

.section { padding: 96px var(--gutter) 80px; }
.section--tight { padding: 56px var(--gutter) 64px; }
.section--flush-top { padding-top: 0; }

.hero__eyebrow-row { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
.hero__eyebrow-row .rule { width: 48px; flex: 0 0 48px; }

.h1 {
  font-family: var(--sans);
  font-size: 4rem;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--head);
  margin: 0;
  max-width: 880px;
  text-wrap: balance;
}
.h1--md { font-size: 3.5rem; line-height: 1.08; }
.h1--sm { font-size: 3rem; line-height: 1.1; }

.lede {
  font-size: 21px;
  line-height: 1.55;
  color: var(--body);
  margin-top: 32px;
  max-width: 640px;
  text-wrap: pretty;
}
.lede--wide { max-width: 720px; margin-top: 28px; }

.cta-row { display: flex; gap: 16px; margin-top: 44px; align-items: center; flex-wrap: wrap; }
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 22px;
  text-decoration: none;
  letter-spacing: 0.005em;
  display: inline-block;
}
.btn--primary { background: var(--head); color: var(--cta-text); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--inverse { background: var(--cta-text); color: var(--cta-bg); padding: 16px 24px; }
.btn--ghost {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- Breadcrumb ---------- */

.crumbs {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--head);
  opacity: 0.7;
  margin-bottom: 56px;
}
.crumbs a { color: inherit; text-decoration: none; }
.crumbs .sep { margin: 0 10px; opacity: 0.5; }
.crumbs .here { color: var(--head); opacity: 1; }

/* ---------- Pillars row ---------- */

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}
.row-head .meta { font-family: var(--sans); font-size: 13px; color: var(--head); opacity: 0.6; }

.pillars { display: grid; grid-template-columns: repeat(5, 1fr); }
.pillar {
  padding: 28px 18px 24px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: var(--body);
  display: flex;
  flex-direction: column;
  min-height: 240px;
}
.pillar:last-child { border-right: 0; }
.pillar__num {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--highlight);
}
.pillar__title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  color: var(--head);
  margin: 14px 0 10px;
  letter-spacing: -0.015em;
}
.pillar__blurb { font-size: 15.5px; line-height: 1.55; margin: 0; color: var(--body); }
.pillar__cta {
  margin-top: auto;
  padding-top: 22px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Start-here list ---------- */

.split-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
}
.split-2--wide-gap { gap: 80px; }
.split-2 h2 {
  font-family: var(--sans);
  font-size: 1.875rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--head);
  margin: 20px 0 18px;
  letter-spacing: -0.02em;
}

.starter {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--body);
  align-items: baseline;
}
.starter:last-of-type { border-bottom: 1px solid var(--border); }
.starter__num {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--head);
  opacity: 0.55;
  letter-spacing: 0.1em;
}
.starter__title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  color: var(--head);
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.starter__blurb { font-size: 16px; line-height: 1.6; margin: 0; }
.starter__cta {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
}

/* ---------- Editorial note (homepage) ---------- */

.editorial {
  background: var(--surface);
  padding: 72px 80px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 80px;
}
.editorial__quote {
  font-family: var(--serif);
  font-size: 88px;
  line-height: 0.9;
  color: var(--head);
  margin-top: 24px;
  font-style: italic;
  letter-spacing: -0.04em;
}
.editorial__lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.55;
  color: var(--head);
  margin: 0;
  text-wrap: pretty;
}
.editorial__body { font-size: 17px; line-height: 1.7; margin-top: 28px; color: var(--body); }
.editorial__owner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.editorial__owner p { font-family: var(--sans); font-size: 13px; margin: 0; color: var(--head); }
.editorial__owner strong { font-weight: 600; }

/* ---------- Pillar (intro split) ---------- */

.intro-split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}
.intro-split p { margin: 0 0 20px; }
.intro-split p:last-child { margin-bottom: 0; }

/* ---------- Article grid ---------- */

.article-grid { display: grid; grid-template-columns: 1fr 1fr; }
.article-card {
  padding: 32px 28px 32px 0;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: var(--body);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-grid > .article-card:nth-child(2n) {
  border-right: 0;
  padding-left: 28px;
}
.article-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.article-card__time {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--head);
  opacity: 0.5;
}
.article-card__title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  color: var(--head);
  margin: 4px 0;
  letter-spacing: -0.015em;
}
.article-card__blurb { font-size: 16px; line-height: 1.6; margin: 0; }
.article-card__cta {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* ---------- Funnel CTA (dark block) ---------- */

.funnel {
  background: var(--cta-bg);
  color: var(--cta-text);
  padding: 72px 80px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
  align-items: center;
}
.funnel h2 {
  font-family: var(--sans);
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 500;
  color: var(--cta-text);
  margin: 18px 0 14px;
  max-width: 520px;
  letter-spacing: -0.02em;
}
.funnel p {
  font-family: var(--serif);
  font-size: 17px;
  color: rgba(250, 247, 242, 0.78);
  margin: 0;
  max-width: 520px;
  line-height: 1.65;
}
.funnel a.btn--inverse { justify-self: end; }

/* ---------- Article template ---------- */

.article-hero { padding: 56px var(--gutter); }
.article-hero .container-tight { max-width: 720px; }

.article-meta {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--head);
  opacity: 0.7;
}

.toc {
  background: var(--surface);
  padding: 24px 28px;
  border-left: 2px solid var(--highlight);
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.toc li {
  display: flex;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
}
.toc li > span {
  color: var(--head);
  opacity: 0.5;
  min-width: 20px;
}
.toc li a { color: var(--accent); text-decoration: none; }

.prose { font-family: var(--serif); font-size: 18px; line-height: 1.75; color: var(--body); }
.prose p { margin: 0 0 1.4em; }
.prose h2 {
  font-family: var(--sans);
  font-size: 1.875rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--head);
  margin: 2.4em 0 0.6em;
  letter-spacing: -0.02em;
}
.prose h3 {
  font-family: var(--sans);
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--head);
  margin: 2em 0 0.5em;
  letter-spacing: -0.015em;
}
.prose .dropcap-letter {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 0.9;
  float: left;
  margin-right: 12px;
  margin-top: 6px;
  color: var(--highlight);
  font-weight: 600;
  display: inline-block;
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.prose ul.dash-list { margin: 0 0 1.6em; padding-left: 0; list-style: none; }
.prose ul.dash-list li {
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 18px;
}
.prose ul.dash-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 1.5px;
  background: var(--highlight);
}

.callout {
  background: var(--surface);
  padding: 28px 32px;
  margin: 2em 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.callout p {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--head);
  margin: 14px 0 0;
  font-style: italic;
}

.mid-cta {
  margin: 3em 0;
  padding: 36px 40px;
  background: var(--cta-bg);
  color: var(--cta-text);
}
.mid-cta h3 {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  color: var(--cta-text);
  margin: 12px 0 8px;
  letter-spacing: -0.015em;
}
.mid-cta p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: rgba(250, 247, 242, 0.8);
  margin: 0;
}

.reading-meta {
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.reading-meta p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--head);
  margin: 8px 0 0;
}
.reading-meta a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--accent);
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* ---------- Related grid (3-up) ---------- */

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.related-card {
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--body);
}
.related-grid > .related-card:nth-child(n+2) { padding-left: 24px; }
.related-grid > .related-card:last-child { border-right: 0; }
.related-card h3 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 500;
  color: var(--head);
  margin: 12px 0 8px;
  letter-spacing: -0.015em;
}
.related-card p { font-size: 15.5px; line-height: 1.6; margin: 0; }

/* ---------- About bullets / Contact list ---------- */

.bullets { list-style: none; padding: 0; margin: 0; }
.bullets li {
  padding: 14px 0 14px 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 18px;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  width: 14px;
  height: 1.5px;
  background: var(--highlight);
}

.ownership-card {
  background: var(--surface);
  padding: 56px 64px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}
.ownership-card p:first-of-type {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.55;
  color: var(--head);
  margin: 0 0 0.8em;
}
.ownership-card p:last-of-type { font-size: 16px; line-height: 1.7; margin: 0; color: var(--body); }

/* ---------- Contact form ---------- */

.contact-list { list-style: none; padding: 0; margin: 20px 0 0; }
.contact-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--head);
}
.contact-foot {
  font-size: 14px;
  color: var(--body);
  opacity: 0.85;
  margin-top: 28px;
  line-height: 1.6;
}

.contact-form {
  background: var(--surface);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.field { display: flex; flex-direction: column; gap: 10px; }
.field label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--head);
  letter-spacing: 0.01em;
}
.field input,
.field textarea {
  font-family: var(--serif);
  font-size: 17px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--body);
  outline: none;
}
.field textarea { line-height: 1.6; resize: vertical; }
.field input:focus,
.field textarea:focus { border-bottom-color: var(--accent); }
.contact-form__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
}
.contact-form__row span {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--head);
  opacity: 0.6;
}
.contact-form button {
  background: var(--head);
  color: var(--cta-text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 28px;
  border: 0;
  cursor: pointer;
}
.contact-form button:hover { background: var(--accent-hover); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--cta-bg);
  color: var(--cta-text);
  padding: 64px var(--gutter) 36px;
}
.site-footer__inner { max-width: var(--container); margin: 0 auto; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(250, 247, 242, 0.14);
}
.site-footer__brand {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  color: var(--cta-text);
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.site-footer__lede {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: rgba(250, 247, 242, 0.78);
  margin-top: 16px;
  max-width: 320px;
}
.site-footer ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 11px; }
.site-footer li a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--cta-text);
  text-decoration: none;
}
.site-footer li a:hover { color: var(--highlight); }
.site-footer__bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(250, 247, 242, 0.6);
  letter-spacing: 0.01em;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .pillar { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .pillar:nth-child(2n) { border-right: 0; }

  .article-grid { grid-template-columns: 1fr; }
  .article-grid > .article-card,
  .article-grid > .article-card:nth-child(2n) {
    border-right: 0;
    padding: 32px 0;
  }

  .related-grid { grid-template-columns: 1fr; }
  .related-grid > .related-card { border-right: 0; padding: 28px 0; }

  .split-2,
  .intro-split,
  .editorial,
  .funnel,
  .ownership-card { grid-template-columns: 1fr; gap: 32px; }

  .editorial,
  .ownership-card { padding: 48px 32px; }
  .funnel { padding: 48px 32px; }
  .funnel a.btn--inverse { justify-self: start; }

  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root { --gutter: 24px; }
  .h1 { font-size: 2.5rem; }
  .h1--md { font-size: 2.25rem; }
  .h1--sm { font-size: 2rem; }
  .section { padding: 64px var(--gutter) 48px; }
  .section--tight { padding: 40px var(--gutter) 40px; }

  .site-nav { display: none; }
  .menu-toggle { display: flex; }

  .toc ol { grid-template-columns: 1fr; }
  .reading-meta { grid-template-columns: 1fr; gap: 20px; }
  .article-meta { flex-direction: column; gap: 8px; }

  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__bottom { flex-direction: column; gap: 8px; }
}

@media (max-width: 520px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: 0; }
  .starter { grid-template-columns: 40px 1fr; }
  .starter__cta { display: none; }
}


/* ---------- Mobile menu (overlay) ---------- */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--surface);
    flex-direction: column;
    padding: 12px 0;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 32px rgba(15, 42, 68, 0.06);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 16px var(--gutter);
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .site-nav a:last-child { border-bottom: 0; }
  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  body.menu-open { overflow: hidden; }
  /* keep sticky behaviour on mobile — sticky already establishes a containing
     block for the .site-nav absolute dropdown, so no `position: relative` override needed. */
}

/* iOS Safari sticky safety nets ---------------------------------------------
   Three things older / quirky iOS Safari builds need to engage `position: sticky`:
   1. The legacy `-webkit-sticky` value (cheap to add; modern Safari ignores).
   2. The `top` declared right after `position` so the rules are colocated.
   3. A guaranteed document min-height so the body is taller than the viewport
      and the sticky element actually has something to stick TO.
   Putting the rule outside the @media block applies it at every breakpoint. */
html { min-height: 100%; }
body { min-height: 100vh; }
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
}

/* Glossary anchor offset for sticky header */
section[id^="a-f"], section[id^="g-m"], section[id^="n-z"] { scroll-margin-top: 80px; }

/* Glossary headings density — section dividers */
.glossary-batch + .glossary-batch { padding-top: 24px; border-top: 1px solid var(--border); margin-top: 8px; }

/* 404 / utility tweaks */
.menu-open .site-header { z-index: 10; }
