/* kpmehta.com. Colours, type and layout follow docs/DESIGN-BRIEF.md */

:root {
  --oxblood: #6B1E2A;
  --bone: #F1ECE3;
  --ink: #080808;
  --night: #1C1415;
  --taupe: #6E6461;
  --sand: #DCD3C8;
  --blush: #F3E9E7;
  --rose: #DDBFC0;
  --ash: #A39893;
  --white: #FFFFFF;

  --serif: "EB Garamond", Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --measure: 68ch;
  --wide: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.6;
}
h1, h2, h3, h4 { font-weight: 400; margin: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--oxblood); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; }
strong { font-weight: inherit; }
em, cite { font-style: italic; }

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

.skip { position: absolute; left: -9999px; top: 0; background: var(--white); padding: 8px 12px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; }

/* Mono labels: kickers, dates, tags, metadata */
.kicker, .meta, .crumbs {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker { color: var(--oxblood); }
.meta, .crumbs { color: var(--taupe); }
.crumbs a { color: var(--taupe); text-decoration: none; }
.crumbs a:hover { color: var(--oxblood); text-decoration: underline; }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--sand); background: var(--bone); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 15px; padding-bottom: 15px; }
.brand { display: block; text-decoration: none; flex-shrink: 0; }
.brand .lockup { height: 60px; width: auto; }
.brand .mark { display: none; height: 36px; width: auto; }
.site-menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.site-menu a { font-family: var(--mono); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.site-menu a:hover, .site-menu a[aria-current="page"] { color: var(--oxblood); border-bottom-color: var(--oxblood); }
.menu-btn { display: none; }

@media (max-width: 1000px) {
  .head-inner { padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap; }
  .brand .lockup { display: none; }
  .brand .mark { display: block; }
  .menu-btn {
    display: block; background: none; border: 1px solid var(--sand); color: var(--ink);
    font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 9px 14px; cursor: pointer; border-radius: 0;
  }
  .js .site-menu { display: none; width: 100%; }
  .js .site-menu.open { display: block; }
  .site-menu ul { flex-direction: column; gap: 0; border-top: 1px solid var(--sand); margin-top: 9px; }
  .site-menu li { border-bottom: 1px solid var(--sand); }
  .site-menu li:last-child { border-bottom: 0; }
  .site-menu a { display: block; padding: 14px 0; border-bottom: 0; }
}

/* ---------- Home: the opening note ---------- */
.hero { padding-top: 88px; padding-bottom: 64px; border-bottom: 1px solid var(--sand); }
.hero h1, .page-head h1, .article-head h1 { color: var(--oxblood); font-size: clamp(36px, 5vw, 52px); line-height: 1.12; margin-top: 14px; max-width: 26ch; }
.hero h1 { max-width: 24ch; }
.hero .lede, .page-head .lede { margin-top: 20px; max-width: 60ch; font-size: 22px; line-height: 1.5; }
.hero .note { margin-top: 28px; padding-left: 16px; border-left: 2px solid var(--oxblood); max-width: 60ch; font-style: italic; color: var(--taupe); }
.hero .note a { font-style: normal; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-left: 6px; white-space: nowrap; }
.page-head { padding-top: 56px; padding-bottom: 32px; }
.page-head .crumbs { margin-bottom: 22px; }

/* ---------- Sections ---------- */
.block { padding-top: 40px; padding-bottom: 64px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; margin-bottom: 28px; border-bottom: 1px solid var(--sand); }
.block-head h2 { font-size: 30px; }
.block-head a { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.empty { padding: 24px 0; color: var(--taupe); font-style: italic; }

/* ---------- Article cards: 3 × 3 ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--white); border: 1px solid var(--sand); border-top: 2px solid var(--oxblood); transition: background-color .15s; }
.card:hover { background: var(--blush); }
.card a { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 280px; padding: 24px 24px 18px; color: var(--ink); text-decoration: none; }
.card-title { font-size: 25px; line-height: 1.25; }
.card a:hover .card-title { color: var(--oxblood); }
.card-desc { color: var(--taupe); font-size: 17px; line-height: 1.5; flex: 1; }
.card-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--sand); font-size: 12px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; gap: 16px; } .card a { min-height: 0; } }

/* ---------- Article ---------- */
.article { padding-top: 48px; padding-bottom: 64px; }
.article-head { max-width: 760px; }
.article-head .crumbs { margin-bottom: 22px; }
.standfirst { margin-top: 20px; font-size: 23px; line-height: 1.5; max-width: var(--measure); }
.article-meta { margin-top: 22px; padding: 12px 0; border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); }
.ref { margin: 20px 0 0; padding: 16px 20px; background: var(--blush); border-left: 2px solid var(--oxblood); display: grid; gap: 6px; }
.ref div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.ref dt { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--taupe); }
.ref dd { margin: 0; }

.article.has-toc { display: grid; grid-template-columns: minmax(0, var(--measure)) 240px; grid-template-areas: "head head" "body toc" "rel rel"; column-gap: 64px; }
.article.has-toc .article-head { grid-area: head; }
.article.has-toc .article-body { grid-area: body; }
.article.has-toc .toc { grid-area: toc; }
.article.has-toc .related { grid-area: rel; }
.toc { align-self: start; position: sticky; top: 24px; margin-top: 40px; padding-left: 20px; border-left: 1px solid var(--sand); font-size: 16px; line-height: 1.4; }
.toc ol { margin: 10px 0 0; padding-left: 18px; }
.toc li { margin-bottom: 8px; color: var(--taupe); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--oxblood); text-decoration: underline; }
@media (max-width: 1000px) {
  .article.has-toc { display: block; }
  .toc { position: static; margin: 32px 0 0; padding: 16px 20px; border: 1px solid var(--sand); }
}

.prose { max-width: var(--measure); }
.article-body { padding-top: 16px; }
.prose p { margin-bottom: 1.1em; }
.prose h2 { font-size: 30px; line-height: 1.25; margin: 2em 0 0.6em; padding-top: 0.9em; border-top: 1px solid var(--sand); }
.prose h3 { font-size: 22px; font-style: italic; margin: 1.6em 0 0.5em; }
.prose h4 { font-size: 19px; font-style: italic; margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin-bottom: 0.45em; }
.prose ol > li::marker { font-family: var(--mono); font-size: 15px; color: var(--oxblood); }
.prose li > ul { margin: 0.4em 0 0; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--oxblood); font-style: italic; }
.prose blockquote p { margin-bottom: 0.6em; }
.prose blockquote cite { display: block; font-family: var(--mono); font-style: normal; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--taupe); }
.prose hr { border: 0; border-top: 1px solid var(--sand); margin: 2em 0; }
.prose code { font-family: var(--mono); font-size: 0.85em; }
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
.prose th, .prose td { border: 1px solid var(--sand); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { font-family: var(--mono); font-weight: 400; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--taupe); background: var(--bone); }
.prose tbody tr:nth-child(even) td { background: var(--blush); }

.disclaimer { margin-top: 2.4em; padding: 18px 22px; background: var(--blush); font-size: 17px; }
.disclaimer p:last-child { margin: 6px 0 0; }
.cite { margin-top: 18px; font-size: 12px; text-transform: none; letter-spacing: 0.02em; word-break: break-word; }

.related { margin-top: 56px; }
.related h2 { font-size: 30px; padding-bottom: 12px; margin-bottom: 28px; border-bottom: 1px solid var(--sand); }

/* ---------- Footer ---------- */
.site-foot { margin-top: 40px; border-top: 1px solid var(--sand); }
.foot-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 28px; }
.foot-firm p { margin-bottom: 4px; }
.foot-name { font-size: 22px; }
.foot-firm .kicker { margin-top: 14px; }
.foot-links { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 32px; align-content: start; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { color: var(--oxblood); text-decoration: underline; }
.foot-copy { border-top: 1px solid var(--sand); padding-top: 16px; padding-bottom: 32px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--taupe); }

@media (max-width: 760px) {
  body { font-size: 18px; }
  .wrap { padding: 0 20px; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
  .hero .lede, .page-head .lede { font-size: 20px; }
  .page-head { padding-top: 36px; }
  .article { padding-top: 32px; }
  .standfirst { font-size: 20px; }
  .ref div { grid-template-columns: 1fr; gap: 0; }
  .foot-links { grid-template-columns: repeat(2, auto); }
}

/* ---------- Print: clean A4, no navigation ---------- */
@media print {
  @page { size: A4; margin: 18mm 18mm 20mm; }
  body { background: #fff; font-size: 11.5pt; line-height: 1.5; }
  .site-head, .site-foot nav, .toc, .related, .skip, .crumbs, .menu-btn { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .article.has-toc { display: block; }
  .prose { max-width: none; }
  .article-head h1 { font-size: 24pt; max-width: none; }
  .standfirst { font-size: 13.5pt; }
  .article-meta, .ref dt, .kicker, .meta { font-size: 8.5pt; }
  .ref { font-size: 11pt; }
  .prose h2 { font-size: 15pt; break-after: avoid; }
  .prose h3 { font-size: 13pt; break-after: avoid; }
  .prose table, .prose blockquote, .ref, .disclaimer { break-inside: avoid; }
  .prose tbody tr:nth-child(even) td, .ref, .disclaimer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prose a { color: var(--ink); }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: var(--taupe); }
  .site-foot { margin-top: 12mm; border: 0; }
  .foot-inner { padding: 0; }
  .foot-copy { padding: 6px 0 0; }
}
