/* Layout: one ruled column of stories under a danfo-yellow lead story; article view replaces the home view in place. */
:root {
  --bg: #F8F8F4;
  --surface: #FFFFFF;
  --ink: #15130F;
  --mute: #5C5A52;
  --line: #DCDAD0;
  --yellow: #F5B50A;
  --on-yellow: #15130F;
  --stripe: #15130F;
  --green: #0A6A3C;
  --green-soft: #DDEFE3;
  --focus: #0A6A3C;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11100E; --surface: #1B1A17; --ink: #F2F0E8; --mute: #A8A499; --line: #302E29;
    --green: #4CC184; --green-soft: #15291D; --focus: #F5B50A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11100E; --surface: #1B1A17; --ink: #F2F0E8; --mute: #A8A499; --line: #302E29;
  --green: #4CC184; --green-soft: #15291D; --focus: #F5B50A; color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.6; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { width: 100%; max-width: 70rem; margin-inline: auto; padding-inline: 16px; }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; text-decoration: none; margin-right: auto; background: none; border: 0; padding: 0; cursor: pointer; }
.brand i { width: 26px; height: 16px; border-radius: 3px; background: linear-gradient(var(--yellow) 0 35%, var(--stripe) 35% 62%, var(--yellow) 62%); border: 1px solid var(--stripe); }
.clock { font-family: var(--mono); font-size: 0.78rem; color: var(--mute); white-space: nowrap; }
.theme { font-family: var(--mono); font-size: 0.78rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; cursor: pointer; min-height: 34px; }

/* intro and lead story */
.intro { padding-block: 28px 20px; display: grid; gap: 10px; }
.intro h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1.02; letter-spacing: -0.025em; margin: 0; text-wrap: balance; max-width: 16ch; }
.intro p { margin: 0; color: var(--mute); max-width: 52ch; }

.hero { position: relative; background: var(--yellow); color: var(--on-yellow); border-radius: 4px; padding: 46px 20px 22px; display: grid; gap: 14px; overflow: hidden; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 12px; background: var(--stripe); }
.hero .plate { justify-self: start; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; border: 2px solid var(--stripe); border-radius: 3px; padding: 2px 8px; }
.hero h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 6vw, 2.8rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; max-width: 22ch; }
.hero p { margin: 0; max-width: 48ch; }
.hero .meta { font-family: var(--mono); font-size: 0.78rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); }
.hero .btn { justify-self: start; background: var(--stripe); border-color: var(--stripe); color: #FFFFFF; }
.hero :focus-visible { outline-color: var(--stripe); }

/* toolbar */
.tools { padding-block: 30px 6px; display: grid; gap: 14px; }
.tools h2, .more h2, .pidgin h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.015em; margin: 0; }
.search { display: block; }
.search input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { font-family: var(--mono); font-size: 0.78rem; color: var(--mute); margin: 0; }

/* story list */
.list { display: grid; gap: 0 40px; grid-template-columns: 1fr; padding-block: 8px 24px; }
@media (min-width: 760px) { .list { grid-template-columns: 1fr 1fr; } }
.post { display: grid; gap: 6px; align-content: start; padding-block: 22px; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.kicker { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin: 0; }
.post h3 { font-family: var(--display); font-weight: 800; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
.post h3 a { text-decoration: none; }
.post:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post p { margin: 0; color: var(--mute); font-size: 0.98rem; }
.post .meta, .meta { font-family: var(--mono); font-size: 0.76rem; color: var(--mute); }
.empty { padding-block: 30px; color: var(--mute); }

/* pidgin */
.pidgin { background: var(--green-soft); border-radius: 4px; padding: 22px 20px; display: grid; gap: 8px; margin-block: 8px 36px; }
.pidgin .kicker { color: var(--green); }
.pidgin .phrase { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
.pidgin p { margin: 0; }
.pidgin .eg { color: var(--mute); font-size: 0.98rem; }
.pidgin .btn { justify-self: start; margin-top: 6px; background: transparent; color: var(--ink); }

/* article */
.art { max-width: 40rem; margin-inline: auto; padding-block: 22px 8px; display: grid; gap: 14px; min-width: 0; }
.back { justify-self: start; background: none; border: 0; padding: 8px 0; font-family: var(--mono); font-size: 0.82rem; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.art h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.05; letter-spacing: -0.022em; margin: 0; text-wrap: balance; }
.prose { display: grid; gap: 16px; font-size: 1.08rem; line-height: 1.7; max-width: 65ch; }
.prose p { margin: 0; }
.prose h3 { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin: 10px 0 0; letter-spacing: -0.01em; }
.prose blockquote { margin: 6px 0; padding: 0; font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.prose blockquote::before { content: ""; display: block; width: 44px; height: 8px; background: var(--yellow); margin-bottom: 12px; }
.prose a { color: var(--green); text-underline-offset: 3px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.tablewrap table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.95rem; line-height: 1.45; }
.tablewrap th, .tablewrap td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tablewrap th { font-family: var(--mono); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.tablewrap tr:last-child td { border-bottom: 0; }
.dek { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.35; color: var(--mute); margin: 0; max-width: 40ch; text-wrap: balance; }
.prose h2.day { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.018em; margin: 28px 0 0; padding-top: 16px; border-top: 6px solid var(--yellow); text-wrap: balance; }
.prose h2.day:first-child { margin-top: 0; }
.prose h4 { font-family: var(--mono); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); margin: 8px 0 -6px; }
.bul { margin: 0; padding-left: 1.3rem; display: grid; gap: 8px; }
.bul li::marker { color: var(--green); }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: tip; }
.tips li { counter-increment: tip; display: grid; gap: 4px; padding-left: 44px; position: relative; }
.tips li::before { content: counter(tip); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 0.85rem; display: grid; place-items: center; }
.tips h3 { margin: 0; font-size: 1.1rem; }
.grades { display: grid; gap: 18px; }
.grade { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; padding-top: 16px; border-top: 1px solid var(--line); }
.grade h3 { margin: 0 0 6px; font-size: 1.15rem; }
.grade p { margin: 0 0 10px; }
.mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 4px; font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.mark.g-A, .mark.g-B { background: var(--green); color: var(--bg); }
.mark.g-C { background: var(--yellow); color: var(--on-yellow); }
.mark.g-D { background: var(--ink); color: var(--bg); }
.score { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; border-block: 1px solid var(--line); padding-block: 18px; }
.score li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 1rem; line-height: 1.35; }
.score b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.score .track { grid-column: 1 / -1; height: 8px; background: var(--line); border-radius: 2px; }
.score .track i { display: block; height: 100%; background: var(--green); border-radius: 2px; }
.score .total { font-family: var(--mono); font-size: 0.82rem; color: var(--mute); grid-column: 1 / -1; }
.share { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 10px 6px; }
.linkbox { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-family: var(--mono); font-size: 0.8rem; }
.more { padding-block: 26px 0; }
.more h2 { margin-bottom: 4px; }

.foot { border-top: 1px solid var(--line); padding-block: 22px 28px; color: var(--mute); font-size: 0.9rem; display: grid; gap: 6px; }
.foot p { margin: 0; }
.foot .mono { font-family: var(--mono); font-size: 0.76rem; }

@media (prefers-reduced-motion: no-preference) {
  .chip, .btn, .theme { transition: background-color 0.15s, color 0.15s; }
}

[hidden]:not([hidden=until-found i]){display:none!important}

[hidden]:not([hidden=until-found i]) { display: none !important; }

/* newsletter signup */
.join { margin-block: 40px 8px; background: var(--yellow); color: var(--on-yellow); border-radius: 4px; padding: 46px 20px 24px; position: relative; overflow: hidden; display: grid; gap: 12px; }
.join::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 12px; background: var(--stripe); }
.join h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0; max-width: 22ch; text-wrap: balance; }
.join p { margin: 0; max-width: 46ch; }
.join label { display: block; font-family: var(--display); font-weight: 600; margin-bottom: 8px; }
.join .row { display: flex; flex-wrap: wrap; gap: 10px; max-width: 34rem; }
.join input[type="email"] { flex: 1 1 14rem; min-width: 0; min-height: 48px; padding: 0 14px; border: 2px solid var(--stripe); border-radius: 4px; background: #fff; color: #15130F; font-size: 1.05rem; }
.join button { min-height: 48px; padding: 0 22px; border-radius: 4px; border: 2px solid var(--stripe); background: var(--stripe); color: #fff; font-family: var(--display); font-weight: 800; font-size: 1rem; cursor: pointer; }
.join button:disabled { opacity: 0.6; cursor: progress; }
.join .fine { font-size: 0.9rem; }
.join .msg { font-family: var(--display); font-weight: 600; min-height: 1.4em; }
.join :focus-visible { outline-color: var(--stripe); }
.hp { position: absolute; left: -9999px; }

/* page-per-story additions */
a.back { display: inline-block; text-decoration: underline; }
a.brand { color: inherit; }
.post h3 a { color: inherit; }

/* first-article signup dialog */
dialog#joinDialog { border: 0; padding: 0; background: transparent; width: calc(100% - 32px); max-width: 34rem; color: var(--on-yellow); overflow: visible; }
dialog#joinDialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog#joinDialog .join { margin: 0; }
.join h2:focus { outline: none; }
.join .later { justify-self: start; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--on-yellow); font-family: var(--display); font-weight: 600; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Pidgin of the day: source + actions */
.pidgin .src { font-family: var(--mono); font-size: 0.76rem; color: var(--mute); }
.pidgin .src a { color: var(--green); text-underline-offset: 3px; }
.pidgin .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pidgin .actions .btn { margin-top: 6px; }

/* Pidgin of Nigeria page */
.gl-group { padding-block: 10px 6px; }
.gl-group h2 { font-family: var(--display); font-weight: 800; font-size: 1.6rem; margin: 18px 0 0; padding-top: 14px; border-top: 6px solid var(--yellow); }
.gl-list { margin: 0; display: grid; gap: 0 40px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gl-list { grid-template-columns: 1fr 1fr; } }
.gl-item { padding: 16px 10px 16px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 76px; min-width: 0; }
.gl-item:target { background: var(--green-soft); padding-left: 12px; border-radius: 4px; }
.gl-item dt { font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.15; letter-spacing: -0.01em; }
.gl-item dd { margin: 4px 0 0; }
.gl-item dd.ge { color: var(--mute); font-size: 0.98rem; }
.gl-src { color: var(--mute); font-size: 0.95rem; padding-block: 24px 8px; max-width: 44rem; }
.gl-src a { color: var(--green); text-underline-offset: 3px; }
