/* ==========================================================================
   Biohacker Life — magazine blog theme
   Palette and type scale follow the Business Blog reference design:
   Lora 700 headings, Lato body, #1818dc accent on an #f7f7f8 field.
   ========================================================================== */

:root {
  --accent:      #1818dc;
  --accent-soft: #c3f0fe;
  --ink:         #111218;
  --ink-2:       #22242f;
  --body:        #45485f;
  --muted:       #686d8b;   /* AA (4.5:1) on both #fff and the #f7f7f8 field */
  --line:        #e8e8ee;
  --field:       #f7f7f8;
  --white:       #ffffff;

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans:  'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --wrap: 1200px;
  --gap: 30px;
}

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

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

body {
  margin: 0;
  background: var(--field);
  color: var(--body);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 20px;
}
.skip:focus { left: 0; }

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

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

.masthead { background: var(--white); border-bottom: 1px solid var(--line); }

.masthead__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 26px 0 18px;
}

.masthead__tools { display: flex; align-items: center; gap: 14px; }
.masthead__tools--end { justify-content: flex-end; }

.brand { text-align: center; }
.brand__name {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: block;
}
.brand__name:hover { text-decoration: none; }
.brand__tag {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.btn {
  display: inline-block;
  font: 700 13px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--white); text-decoration: none; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--white); }
.btn--accent:hover { background: var(--ink); border-color: var(--ink); }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; background: none;
  color: var(--ink-2); cursor: pointer; padding: 0;
}
.iconbtn:hover { color: var(--accent); }

.nav { border-top: 1px solid var(--line); }
.nav__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 30px;
}
.nav__list a {
  display: block; padding: 15px 0;
  color: var(--ink); font-size: 15px;
  border-bottom: 2px solid transparent;
}
.nav__list a:hover { color: var(--accent); text-decoration: none; }
.nav__list a[aria-current] { border-bottom-color: var(--accent); color: var(--accent); }

.navtoggle { display: none; }

/* ---------- Search ---------------------------------------------------- */

.search { display: none; padding: 0 0 22px; }
.search[data-open] { display: block; }
.search__field {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); background: var(--white);
  font: 400 16px var(--sans); color: var(--ink);
}
.search__results { list-style: none; margin: 10px 0 0; padding: 0; }
.search__results li { border-bottom: 1px solid var(--line); }
.search__results a { display: block; padding: 10px 2px; color: var(--ink); }
.search__results a:hover { color: var(--accent); text-decoration: none; }
.search__results .k { font-family: var(--serif); font-weight: 700; display: block; }
.search__results .m { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Shared card furniture -------------------------------------- */

.tag {
  display: inline-block;
  background: var(--body); color: var(--white);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; margin: 0 4px 4px 0;
}
.tag:hover { background: var(--accent); color: var(--white); text-decoration: none; }
.tag--flag { background: var(--accent); }
.tag--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.meta {
  font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.meta a { color: var(--muted); }
.meta a:hover { color: var(--accent); }
.meta__dot::before { content: '·'; margin-right: 8px; }

.thumb { display: block; overflow: hidden; background: var(--line); position: relative; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.thumb:hover img { transform: scale(1.04); }

.card__title { font-size: 21px; margin: 10px 0 8px; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--accent); text-decoration: none; }
.card__excerpt { margin: 0 0 10px; font-size: 15px; }

/* ---------- Hero -------------------------------------------------------- */

.hero { padding: 34px 0 10px; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--gap);
}

.lead { position: relative; display: block; overflow: hidden; }
.lead .thumb { aspect-ratio: 16 / 11; }
.lead__body {
  position: absolute; inset: auto 0 0 0;
  padding: 30px;
  background: linear-gradient(to top, rgba(17,18,24,.92) 12%, rgba(17,18,24,.55) 55%, rgba(17,18,24,0));
  color: var(--white);
  pointer-events: none;
}
.lead__body .tag { pointer-events: auto; }
.lead__title { font-size: 34px; color: var(--white); margin: 10px 0 10px; }
.lead__title a { color: var(--white); }
.lead__title a:hover { color: var(--accent-soft); text-decoration: none; }
.lead__body .meta { color: rgba(255,255,255,.8); }
.lead__body .meta a { color: rgba(255,255,255,.8); pointer-events: auto; }

.stack { display: grid; grid-template-rows: repeat(3, 1fr); gap: 22px; }
.stack__item { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.stack__item .thumb { aspect-ratio: 16 / 10; }
.stack__item .card__title { font-size: 18px; margin: 8px 0 6px; }

/* ---------- Rails / section headers ------------------------------------ */

.rule { border: 0; border-top: 1px solid var(--line); margin: 46px 0 0; }

.sechead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; margin: 44px 0 24px; padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.sechead h2 { font-size: 26px; }
.sechead__link {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  white-space: nowrap;
}

/* ---------- Editors' pick strip ---------------------------------------- */

.strip {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px;
}
.strip .card__title { font-size: 15px; line-height: 1.4; margin: 10px 0 0; }
.strip .thumb { aspect-ratio: 1 / 1; }

/* ---------- Category blocks -------------------------------------------- */

.block { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.block .thumb { aspect-ratio: 16 / 10; }

.block--split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.block--split .feature .thumb { aspect-ratio: 16 / 10; }
.block--split .feature .card__title { font-size: 27px; }
.block--split .sidelist { display: grid; gap: 20px; }
.block--split .sidelist .stack__item { grid-template-columns: 130px 1fr; }
.block--split .sidelist .card__title { font-size: 17px; }

/* ---------- Newsletter band -------------------------------------------- */

.band {
  background: var(--ink); color: var(--white);
  padding: 52px 0; margin: 52px 0;
}
.band__inner { display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: 40px; align-items: center; }
.band h2 { color: var(--white); font-size: 30px; margin-bottom: 10px; }
.band p { color: rgba(255,255,255,.72); margin: 0; }
.band--accent { background: var(--accent); }

.subscribe { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe input {
  flex: 1 1 220px; padding: 15px 16px; border: 0;
  font: 400 15px var(--sans); color: var(--ink); background: var(--white);
}
.subscribe .btn { border-color: var(--white); color: var(--white); }
.subscribe .btn:hover { background: var(--white); color: var(--ink); }
.subscribe__note { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 12px; }
.formmsg { font-size: 14px; margin-top: 12px; color: var(--accent-soft); }

/* ---------- Guest CTA --------------------------------------------------- */

.pitch {
  border: 1px solid var(--line); background: var(--white);
  padding: 34px; text-align: center;
}
.pitch h3 { font-size: 22px; margin-bottom: 10px; }
.pitch p { margin: 0 auto 20px; max-width: 44ch; }

/* ---------- Must-read list --------------------------------------------- */

.readlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.readlist article {
  background: var(--white); border: 1px solid var(--line);
  padding: 26px; display: flex; flex-direction: column; gap: 10px;
}
.readlist .card__title { font-size: 20px; margin: 4px 0; }
.readlist .num {
  font-family: var(--serif); font-size: 30px; font-weight: 700;
  color: var(--line); line-height: 1;
}

/* ---------- Stats ------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); text-align: center; }
.stats div { background: var(--white); border: 1px solid var(--line); padding: 30px 20px; }
.stats .v { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--ink); display: block; }
.stats .l { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

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

.article { background: var(--white); }
.article__head { padding: 46px 0 30px; text-align: center; }
.article__head h1 { font-size: 42px; max-width: 20ch; margin: 14px auto 16px; }
.article__head .meta { justify-content: center; }
.article__lede { font-size: 19px; max-width: 62ch; margin: 0 auto; color: var(--body); }

.article__hero { margin: 0 0 8px; }
.article__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__credit { font-size: 12px; color: var(--muted); padding: 8px 0 0; }

.prose { max-width: 720px; margin: 0 auto; padding: 34px 20px 10px; font-size: 17.5px; }
.prose h2 { font-size: 27px; margin: 40px 0 14px; }
.prose h3 { font-size: 20px; margin: 30px 0 10px; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 9px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.prose strong { color: var(--ink-2); }
.prose blockquote {
  margin: 28px 0; padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 20px; color: var(--ink-2);
}
.prose blockquote p { margin: 0; }
.prose .callout {
  background: var(--field); border-left: 3px solid var(--accent);
  padding: 22px 24px; margin: 30px 0;
}
.prose .callout p:last-child, .prose .callout ul:last-child { margin-bottom: 0; }
.prose .note {
  font-size: 14px; color: var(--muted); font-style: italic;
  border-top: 1px solid var(--line); padding-top: 18px; margin-top: 30px;
}

.byline {
  max-width: 720px; margin: 20px auto 0; padding: 26px 20px;
  display: grid; grid-template-columns: 62px 1fr; gap: 18px; align-items: start;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--ink); color: var(--white);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.byline h4 { font-size: 17px; margin-bottom: 2px; }
.byline .role { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.byline p { font-size: 15px; margin: 8px 0 0; }

.sharebar { display: flex; gap: 10px; align-items: center; max-width: 720px; margin: 0 auto; padding: 0 20px 30px; }
.sharebar span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sharebar a, .sharebar button {
  font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--white); color: var(--body);
  padding: 8px 13px; cursor: pointer;
}
.sharebar a:hover, .sharebar button:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

/* ---------- Page (about/contact/etc) ------------------------------------ */

.page { background: var(--white); padding: 10px 0 40px; }
.pagehead { text-align: center; padding: 48px 0 8px; }
.pagehead h1 { font-size: 40px; margin-bottom: 12px; }
.pagehead p { max-width: 58ch; margin: 0 auto; font-size: 18px; }

.teamgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; max-width: 860px; margin: 0 auto; }
.teamgrid article { display: grid; grid-template-columns: 62px 1fr; gap: 16px; align-items: start; }

/* ---------- Archive ------------------------------------------------------ */

.archive { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.archive article { background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; }
.archive .thumb { aspect-ratio: 16 / 10; }
.archive .pad { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.archive .card__title { margin: 4px 0; font-size: 19px; }

.emptynote { text-align: center; color: var(--muted); padding: 40px 0; }

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

.footer { background: var(--white); border-top: 1px solid var(--line); margin-top: 60px; }
.footer__grid {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 40px;
  padding: 52px 0 40px;
}
.footer h4 {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  margin-bottom: 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; }
.footer li a { color: var(--body); font-size: 15px; }
.footer li a:hover { color: var(--accent); }
.footer__about p { font-size: 15px; margin: 0 0 14px; max-width: 40ch; }
.footer__legal {
  border-top: 1px solid var(--line); padding: 22px 0;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted);
}
.footer__legal a { color: var(--muted); }
.footer__legal a:hover { color: var(--accent); }

.disclaimer {
  background: var(--field); border: 1px solid var(--line);
  padding: 18px 22px; font-size: 13.5px; color: var(--muted);
  margin: 0 0 30px;
}

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

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stack { grid-template-rows: none; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .block, .readlist, .archive { grid-template-columns: repeat(2, 1fr); }
  .block--split { grid-template-columns: 1fr; }
  .band__inner { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .article__head h1 { font-size: 34px; }
}

@media (max-width: 720px) {
  .masthead__bar { grid-template-columns: auto 1fr auto; padding: 14px 0; gap: 8px; }
  .brand { text-align: right; min-width: 0; }
  .brand__name { font-size: 21px; }
  /* the tagline cannot wrap gracefully beside the controls at this width */
  .brand__tag { display: none; }
  .masthead__tools--end .btn { padding: 10px 13px; font-size: 11px; }
  .brand__name { white-space: nowrap; }

  .navtoggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 0; background: none; color: var(--ink); cursor: pointer;
  }
  .nav__list {
    display: none; flex-direction: column; gap: 0; padding: 6px 0 14px;
  }
  .nav__list[data-open] { display: flex; }
  .nav__list a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav__list a[aria-current] { border-bottom-color: var(--accent); }

  .lead__title { font-size: 24px; }
  .lead__body { padding: 20px; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .block, .readlist, .archive, .stats, .teamgrid { grid-template-columns: 1fr; }
  .stack__item { grid-template-columns: 112px 1fr; gap: 14px; }
  .stack__item .card__title,
  .block--split .sidelist .card__title { font-size: 16px; }
  .block--split .sidelist .stack__item { grid-template-columns: 104px 1fr; }
  .block--split .feature .card__title { font-size: 22px; }
  .card__title { font-size: 19px; }
  .meta { font-size: 12.5px; gap: 6px; }
  .tag { font-size: 10px; padding: 3px 7px; }
  .article__head h1 { font-size: 28px; }
  .prose { font-size: 17px; }
  .pagehead h1 { font-size: 30px; }
  .footer__grid { grid-template-columns: 1fr; }
  .sechead { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .brand { text-align: center; }
  .masthead__tools--end { display: none; }
  .lead__title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .masthead, .footer, .band, .sharebar, .search { display: none; }
  body { background: #fff; }
}
