/* Insights, the blog of Michael Obeng.
   Same family as michaelobeng.com: plum and rust, Bricolage Grotesque for display, Literata for reading.
   The blog leans editorial: a wide lead story and a quiet 40em reading column. */

:root {
    --ink: #1f1027;
    --plum: #4a1468;
    --violet: #7a22a6;
    --rust: #b4452c;
    --rust-deep: #96361f;
    --paper: #f7f4fa;
    --white: #ffffff;
    --lilac: #ece3f3;
    --line: #dcd0e6;
    --muted: #5f5169;
    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --text: "Literata", Georgia, "Times New Roman", serif;
    --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
    --step-0: clamp(1.02rem, 0.98rem + 0.2vw, 1.14rem);
    --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
    --step-2: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
    --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 3.1rem);
    --step-4: clamp(2.3rem, 1.4rem + 3.8vw, 4.4rem);
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --section: clamp(3rem, 7vw, 6rem);
    --corner: clamp(1.75rem, 4vw, 3.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: var(--step-0); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--plum); color: var(--white); }
.wrap { width: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--plum); color: var(--white); padding: .6rem 1rem; z-index: 50; font-family: var(--display); }
.skip:focus { top: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: var(--step-0); line-height: 1.2; padding: .8em 1.4em; border-radius: 999px; border: 2px solid var(--plum); background: var(--plum); color: var(--white); text-decoration: none; cursor: pointer; transition: background-color .18s, border-color .18s, color .18s; }
.btn:hover { background: var(--violet); border-color: var(--violet); }
.btn--light { background: var(--white); border-color: var(--white); color: var(--plum); }
.btn--light:hover { background: var(--rust); border-color: var(--rust); color: var(--white); }
.textlink { font-family: var(--display); font-weight: 600; color: var(--plum); text-decoration: underline; text-decoration-color: var(--rust); text-decoration-thickness: 2px; text-underline-offset: .3em; }
.kicker, .card__cat { display: inline-block; font-family: var(--display); font-weight: 600; font-size: var(--step--1); color: var(--rust-deep); text-decoration: none; margin: 0 0 .6rem; }
a.card__cat:hover { text-decoration: underline; text-underline-offset: .25em; }
.meta { font-family: var(--display); font-size: var(--step--1); color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: 0; }

/* Masthead */
.masthead { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 93%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.6rem; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: .6rem; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: -0.04em; color: var(--plum); line-height: 1; position: relative; }
.brand__name::after { content: ""; position: absolute; left: 0; bottom: -.35rem; width: 1.6rem; height: 4px; background: var(--rust); }
.brand__by { font-family: var(--display); font-size: .88rem; color: var(--muted); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(.8rem, 1.6vw, 1.5rem); }
.nav a { font-family: var(--display); font-weight: 500; font-size: .95rem; text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--rust); color: var(--plum); font-weight: 600; }
.nav__out a { color: var(--plum); font-weight: 600; }
.search input { font: inherit; font-family: var(--display); font-size: .92rem; width: 9rem; padding: .45rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); transition: width .2s, border-color .15s; }
.search input:focus { outline: none; border-color: var(--plum); width: 13rem; }
.menu-toggle { display: none; align-items: center; gap: .6rem; background: none; border: 2px solid var(--plum); color: var(--plum); border-radius: 999px; padding: .5rem 1rem; font-family: var(--display); font-weight: 600; font-size: .95rem; cursor: pointer; }
.menu-toggle__bars { width: 1.1rem; height: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
@media (max-width: 64rem) {
    .menu-toggle { display: inline-flex; }
    .brand__by { display: none; }
    .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem var(--gutter) 1.75rem; }
    .nav.is-open { display: block; }
    .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .nav a { display: block; font-size: 1.2rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
    .search { margin: 1rem 0 .5rem; }
    .search input, .search input:focus { width: 100%; font-size: 1.05rem; padding: .75rem 1rem; }
}

/* Lead story */
.lead { padding: clamp(2rem, 5vw, 4rem) 0 0; }
.lead__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; }
.lead__media { grid-column: 1 / 2; grid-row: 1; display: block; border-radius: var(--corner) .75rem .75rem .75rem; overflow: hidden; aspect-ratio: 4 / 3; background: var(--plum); }
.lead__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.lead__media:hover img { transform: scale(1.03); }
.lead__card { grid-column: 2; grid-row: 1; margin-left: -4rem; margin-bottom: 2.5rem; background: var(--plum); color: var(--white); border-radius: .9rem; padding: clamp(1.5rem, 3vw, 2.5rem); position: relative; box-shadow: 0 30px 50px -30px rgba(31, 16, 39, .8); }
.lead__card .card__cat { color: #f0b8a6; }
.lead__card h1 { font-size: var(--step-3); letter-spacing: -0.035em; margin-bottom: 1rem; }
.lead__card h1 a { text-decoration: none; }
.lead__card h1 a:hover { text-decoration: underline; text-decoration-color: var(--rust); text-decoration-thickness: 3px; text-underline-offset: .15em; }
.lead__card > p:not(.meta) { color: #ece0f3; }
.lead__card .meta { color: #d4c3e0; margin-bottom: 1.5rem; }
@media (max-width: 54rem) { .lead__grid { grid-template-columns: 1fr; } .lead__media, .lead__card { grid-column: 1; } .lead__card { grid-row: 2; margin: -3rem 1rem 0; } }

/* Grid of cards */
.block { padding: var(--section) 0; }
.block--tint { background: var(--lilac); }
.block__title { font-size: var(--step-2); color: var(--plum); margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem); }
.card__link { display: grid; gap: 1rem; text-decoration: none; height: 100%; align-content: start; }
.card__media { aspect-ratio: 16 / 10; border-radius: 1.4rem .5rem .5rem .5rem; overflow: hidden; background: var(--plum); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card__link:hover .card__media img { transform: scale(1.04); }
.card__placeholder { display: flex; align-items: flex-end; width: 100%; height: 100%; padding: 1.25rem; font-family: var(--display); font-weight: 700; font-size: var(--step-1); line-height: 1.15; color: var(--white); background: linear-gradient(160deg, var(--plum), var(--violet)); border-bottom: 6px solid var(--rust); }
.card h3 { font-size: var(--step-1); line-height: 1.2; margin-bottom: .5rem; }
.card__link:hover h3 { color: var(--plum); text-decoration: underline; text-decoration-color: var(--rust); text-underline-offset: .2em; }
.card__excerpt { color: var(--muted); margin-bottom: .75rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-family: var(--display); }
.pager span { color: var(--muted); }
.empty { background: var(--white); border-left: 6px solid var(--rust); border-radius: 0 .75rem .75rem 0; padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 44rem; }
.empty h1 { font-size: var(--step-2); color: var(--plum); margin-bottom: .75rem; }
.empty p:last-child { margin: 0; }

/* List heads */
.listhead { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.listhead__row { display: flex; gap: 1.75rem; align-items: center; }
.listhead h1 { font-size: var(--step-3); color: var(--plum); letter-spacing: -0.035em; }
.listhead__intro { font-size: var(--step-1); line-height: 1.5; max-width: 36em; margin: 1rem 0 0; }
.search--big { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.search--big input, .search--big input:focus { width: min(100%, 28rem); font-size: 1.05rem; padding: .75rem 1.1rem; }
.avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; object-fit: cover; background: var(--plum); }
.avatar--big { width: 6rem; height: 6rem; flex: none; }
.avatar--initials { display: grid; place-items: center; color: var(--white); font-family: var(--display); font-weight: 700; }

/* Article */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--rust); }
.previewbar { background: #f2b544; color: #2a1e00; text-align: center; font-family: var(--display); font-weight: 600; padding: .6rem 1rem; margin: 0; }
.article { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.article__head { max-width: 52rem; }
.article__head h1 { font-size: var(--step-4); color: var(--plum); letter-spacing: -0.04em; line-height: 1.02; }
.article__standfirst { font-size: var(--step-1); line-height: 1.5; margin: 1.25rem 0 0; max-width: 38em; }
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; padding: 1.1rem 0; border-block: 1px solid var(--line); }
.byline__who { display: flex; align-items: center; gap: .8rem; text-decoration: none; font-family: var(--display); line-height: 1.25; }
.byline__who strong { display: block; }
.byline__who small { color: var(--muted); font-size: .86rem; }
.article__cover { margin: clamp(1.75rem, 4vw, 3rem) auto 0; }
.article__cover img { width: 100%; max-height: 38rem; object-fit: cover; border-radius: var(--corner) .75rem .75rem .75rem; }
.article__cover figcaption { font-family: var(--display); font-size: var(--step--1); color: var(--muted); padding-top: .6rem; }
.article__layout { display: grid; grid-template-columns: 14rem minmax(0, 40rem); gap: clamp(2rem, 6vw, 6rem); justify-content: center; padding: clamp(2rem, 5vw, 3.5rem) 0 var(--section); }
.article__side { position: sticky; top: 6rem; align-self: start; display: grid; gap: 2rem; font-family: var(--display); font-size: .92rem; }
.toc p, .share p { font-weight: 700; color: var(--plum); margin-bottom: .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem .9rem; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); line-height: 1.3; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--plum); font-weight: 600; border-left-color: var(--rust); }
.share ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.share a, .share button { display: inline-block; font: inherit; font-size: .85rem; font-weight: 600; padding: .35rem .8rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); color: var(--plum); text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--plum); }
@media (max-width: 60rem) { .article__layout { grid-template-columns: minmax(0, 40rem); } .article__side { position: static; order: 2; } .toc { display: none; } }

.prose { font-size: 1.12em; line-height: 1.78; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.3em; }
.prose h2 { font-size: var(--step-2); color: var(--plum); margin: 2.2em 0 .7em; }
.prose h3 { font-size: var(--step-1); margin: 1.8em 0 .5em; }
.prose a { color: var(--plum); text-decoration-color: var(--rust); text-underline-offset: .2em; }
.prose blockquote { margin: 2em 0; padding: .25rem 0 .25rem 1.5rem; border-left: 6px solid var(--rust); font-family: var(--display); font-weight: 600; font-size: var(--step-1); line-height: 1.38; color: var(--plum); }
.prose blockquote p:last-child { margin: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--rust); font-weight: 700; }
.prose img { border-radius: .6rem; margin: 1.75em 0; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-family: var(--display); font-size: var(--step--1); color: var(--muted); }
.prose hr { border: 0; height: 4px; width: 3rem; background: var(--rust); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--display); font-size: .9em; margin: 1.5em 0; }
.prose th, .prose td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--line); }
.tags { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--display); font-size: .88rem; }
.tags a { display: inline-block; padding: .3rem .8rem; background: var(--lilac); border-radius: 999px; text-decoration: none; color: var(--plum); }
.authorbox { display: flex; gap: 1.5rem; align-items: flex-start; margin-top: 3rem; padding: 1.75rem; background: var(--white); border-radius: 1.4rem .6rem .6rem .6rem; font-size: .9em; }
.authorbox__name { font-family: var(--display); font-weight: 700; font-size: var(--step-1); color: var(--plum); margin-bottom: .4rem; }
.authorbox__links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; }
@media (max-width: 40rem) { .authorbox { flex-direction: column; } }

/* Newsletter and footer */
.newsletter { background: var(--plum); color: var(--white); padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.newsletter__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: center; }
.newsletter h2 { font-size: var(--step-3); letter-spacing: -0.035em; margin-bottom: .75rem; }
.newsletter p { color: #e3d4ee; margin: 0; max-width: 30em; }
.inline-form { display: flex; flex-wrap: wrap; gap: .75rem; }
.inline-form input[type="email"] { flex: 1 1 14rem; font: inherit; font-family: var(--display); padding: .85rem 1.25rem; border-radius: 999px; border: 2px solid transparent; background: var(--white); color: var(--ink); }
.inline-form input[type="email"]:focus { outline: none; border-color: var(--rust); }
.newsletter .btn { background: var(--rust); border-color: var(--rust); }
.newsletter .btn:hover { background: var(--rust-deep); border-color: var(--rust-deep); }
.notice { font-family: var(--display); font-weight: 600; border-left: 5px solid var(--rust); padding-left: 1rem; }
.field-error { font-family: var(--display); color: #ffc9bd; margin: .5rem 0 0; }
@media (max-width: 54rem) { .newsletter__row { grid-template-columns: 1fr; } }
.footer { background: var(--ink); color: #e9dff0; padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; font-family: var(--display); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem 4rem; }
.footer__name { font-weight: 800; font-size: var(--step-2); letter-spacing: -0.03em; color: var(--white); margin: 0 0 .5rem; }
.footer__name span { font-weight: 500; font-size: .5em; color: #c9b9d4; letter-spacing: 0; }
.footer__note { color: #c9b9d4; max-width: 26em; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; text-decoration-color: var(--rust); text-underline-offset: .3em; text-decoration-thickness: 2px; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; align-content: start; }
.socials { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.socials a { display: inline-block; font-size: var(--step--1); font-weight: 600; padding: .35rem .9rem; border: 1.5px solid #4a3358; border-radius: 999px; }
.socials a:hover { background: var(--rust); border-color: var(--rust); text-decoration: none; }
.footer__base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3a2646; font-size: var(--step--1); color: #a996b6; }
.footer__base p { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--reveal-delay, 0ms); }
    .js [data-reveal].is-in { opacity: 1; transform: none; }
    .lead__card { animation: rise .7s .15s cubic-bezier(.2, .7, .2, 1) both; }
    @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .masthead, .newsletter, .footer, .article__side, .progress { display: none; } body { background: #fff; } .article__layout { display: block; } }
