/* JM Brais
   Late-Swiss / mid-century systems editorial.
   Paper canvas + near-black ink + single hot vermillion accent.
*/

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&f[]=jetbrains-mono@400,500&display=swap');

:root {
  --paper:   #F5F2EC;
  --paper-2: #EFEBE2;
  --ink:     #111111;
  --ink-2:   #2A2A2A;
  --muted:   #6B6661;
  --hairline:#C8C2B5;
  --accent:  #E5341E;
  --accent-2:#C72A14;

  --col-max: 1200px;
  --col-text: 720px;
  --gap: 24px;

  --fs-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-sans: 'General Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--fs-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--fs-sans);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(40px, 5.6vw, 76px); font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; margin-top: 2em; }
h3 { font-size: 19px; font-weight: 600; margin-top: 1.6em; }

p { margin: 0 0 1.1em; }
p + p { margin-top: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 120ms;
}
a:hover { color: var(--accent); }

ul, ol { padding-left: 1.4em; margin: 0 0 1.2em; }
li { margin: 0.35em 0; }

strong { font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 2.5em 0;
}

::selection { background: var(--accent); color: var(--paper); }

.mono { font-family: var(--fs-mono); }
.eyebrow {
  font-family: var(--fs-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- chrome ---------- */

.shell {
  max-width: var(--col-max);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

.masthead {
  border-bottom: 1px solid var(--hairline);
  padding: 22px 0;
  margin-bottom: 56px;
}
.masthead .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-family: var(--fs-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .bracket { color: var(--accent); font-weight: 500; }
.wordmark:hover { color: var(--ink); }

nav.primary {
  display: flex;
  gap: 28px;
  font-family: var(--fs-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav.primary a {
  text-decoration: none;
  color: var(--ink-2);
}
nav.primary a:hover { color: var(--accent); }

/* running meta strip just under the masthead on the homepage */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-top: -24px;
  margin-bottom: 64px;
  padding: 14px 0;
}
.meta-strip > div { padding: 0 16px; border-left: 1px solid var(--hairline); }
.meta-strip > div:first-child { border-left: 0; padding-left: 0; }
.meta-strip .label {
  display: block;
  font-family: var(--fs-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.meta-strip .val { font-size: 14px; font-weight: 500; }

/* ---------- hero / masthead block ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 24px 0 56px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 56px;
}
.hero h1 {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 14ch;
}
.hero .lede {
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}
.hero .meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.hero .meta .dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
}

/* ---------- article plates (type-only) ---------- */

.plate {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  border: 1px solid var(--hairline);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  overflow: hidden;
}
.plate .plate-num {
  position: absolute;
  top: 18px;
  left: 22px;
  font-family: var(--fs-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.plate .plate-cat {
  position: absolute;
  top: 18px;
  right: 22px;
  font-family: var(--fs-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.plate .plate-title {
  font-family: var(--fs-sans);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  max-width: 22ch;
}

.plate.ink   { background: var(--ink);    color: var(--paper); border-color: var(--ink); }
.plate.ink   .plate-title { color: var(--paper); }
.plate.ink   .plate-num,
.plate.ink   .plate-cat { color: var(--paper); }
.plate.ink   .plate-cat { color: var(--accent); }

.plate.paper { background: var(--paper-2); color: var(--ink); }
.plate.paper .plate-num { color: var(--accent); }

.plate.accent { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.plate.accent .plate-title,
.plate.accent .plate-num,
.plate.accent .plate-cat { color: var(--paper); }

/* ---------- article (post body) ---------- */

article.post {
  padding-top: 8px;
  padding-bottom: 64px;
}
article.post + article.post {
  margin-top: 80px;
  border-top: 1px solid var(--hairline);
  padding-top: 64px;
}

.post-head {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}
.post-head .num {
  font-family: var(--fs-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 8px;
}
.post-head .num::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  background: var(--ink);
  margin-top: 18px;
}
.post-head h1 {
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 20px;
}
.post-head .meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--fs-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.post-head .meta .sep { color: var(--hairline); }

.post-plate {
  margin-bottom: 48px;
}

.post-body {
  max-width: var(--col-text);
}
.post-body p { font-size: 18px; line-height: 1.65; }
.post-body p:first-of-type {
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 1.4em;
}
.post-body h2 {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--hairline);
}
.post-body ul, .post-body ol { font-size: 18px; line-height: 1.65; }
.post-body li { margin: 0.45em 0; }

.related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--fs-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.related .label { color: var(--muted); }
.related a {
  font-family: var(--fs-sans);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

/* ---------- about page ---------- */

.about {
  padding-bottom: 80px;
}
.about h1 {
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  max-width: 14ch;
}
.about .lede {
  font-size: 21px;
  line-height: 1.5;
  max-width: 60ch;
  margin: 0 0 48px;
  color: var(--ink-2);
}
.about .principles {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px 32px;
  border-top: 1px solid var(--hairline);
  padding-top: 32px;
  max-width: var(--col-text);
}
.about .principles .num {
  font-family: var(--fs-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-top: 6px;
}
.about .principles .body { padding-bottom: 28px; border-bottom: 1px solid var(--hairline); }
.about .principles .body h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
}
.about .principles .body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}
.about .principles > *:nth-last-child(-n+2) .body { border-bottom: 0; padding-bottom: 0; }

/* ---------- footer ---------- */

footer.colophon {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
  font-family: var(--fs-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
footer.colophon .row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
footer.colophon a { color: var(--muted); text-decoration: none; }
footer.colophon a:hover { color: var(--accent); }

/* ---------- 404 ---------- */

.notfound {
  padding: 120px 0;
  text-align: center;
}
.notfound .code {
  font-family: var(--fs-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 24px;
}
.notfound h1 {
  font-size: clamp(48px, 6vw, 96px);
  margin: 0 auto 24px;
  max-width: 14ch;
}
.notfound p {
  max-width: 40ch;
  margin: 0 auto 32px;
  color: var(--ink-2);
  font-size: 18px;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .shell { padding: 0 20px; }
  .masthead { margin-bottom: 32px; padding: 18px 0; }
  .hero { padding-bottom: 32px; margin-bottom: 32px; }
  .meta-strip {
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
    margin-bottom: 40px;
  }
  .meta-strip > div { padding: 8px 12px; border-left: 0; border-bottom: 1px solid var(--hairline); }
  .meta-strip > div:nth-child(2n) { border-left: 1px solid var(--hairline); }
  .meta-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .post-head { grid-template-columns: 1fr; gap: 16px; }
  .post-head .num::after { width: 32px; margin-top: 10px; }
  .about .principles { grid-template-columns: 1fr; gap: 12px 0; }
  .about .principles .num { padding-top: 0; }
  .about .principles .body { padding-bottom: 20px; }
  .plate { aspect-ratio: 4 / 3; padding: 18px; }
  .plate .plate-title { font-size: 26px; }
  nav.primary { gap: 18px; font-size: 11px; }
}
