/* =========================================================
   nesov.fr — editorial cream & ink
   ========================================================= */

:root {
  --bg:      #ede4cf;        /* warm cream */
  --paper:   #f5edd8;        /* lighter cream for blocks */
  --ink:     #141414;        /* near-black */
  --muted:   #6d665a;        /* taupe */
  --rule:    #141414;
  --gold:    #b68a2e;        /* muted gold */
  --orange:  #d46a2e;        /* burnt orange, used sparingly */

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 38rem;

  /* Fluid type scale (1.25 ratio, clamped for mobile/desktop) */
  --step--1: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --step-0:  clamp(1rem, 0.94rem + 0.3vw, 1.0625rem);
  --step-1:  clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --step-2:  clamp(1.375rem, 1.22rem + 0.7vw, 1.625rem);
  --step-3:  clamp(1.75rem, 1.45rem + 1.4vw, 2.375rem);
  --step-4:  clamp(2.5rem, 1.9rem + 2.8vw, 4rem);
  --step-5:  clamp(3.5rem, 2.6rem + 4.3vw, 6.5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11", "kern";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 4rem 0;
}

::selection { background: var(--ink); color: var(--bg); }

/* -------- typography -------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: var(--step-5); font-weight: 900; letter-spacing: -0.035em; }
h2 { font-size: var(--step-4); font-weight: 700; }
h3 { font-size: var(--step-2); font-weight: 600; }
h4 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table { max-width: var(--measure); }

.prose ul,
.prose ol { padding-left: 1.2em; margin: 0 0 1.15em; }
.prose li + li { margin-top: 0.35em; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease;
}
a:hover { color: var(--gold); }

blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-1);
  color: var(--ink);
}

/* -------- code -------- */
pre, code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
:not(pre) > code {
  background: var(--paper);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  border: 1px solid rgba(20,20,20,0.08);
}
pre {
  background: var(--paper);
  border: 1px solid rgba(20,20,20,0.1);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 2px;
  line-height: 1.55;
}
pre code { background: transparent; border: 0; padding: 0; }

/* -------- layout -------- */
.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 6rem;
}

/* -------- header -------- */
.site-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  border-bottom: 1px solid var(--rule);
}
.site-header .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
}
.site-header .brand:hover { color: var(--ink); }
.site-header .brand .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(20,20,20,0.08);
}
.site-header nav {
  display: flex;
  gap: 1.75rem;
}
.site-header nav a {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--ink);
}
.site-header nav a.active,
.site-header nav a:hover { color: var(--gold); }

@media (max-width: 560px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .site-header nav { gap: 1.25rem; flex-wrap: wrap; }
}

/* -------- footer -------- */
.site-footer {
  max-width: 72rem;
  margin: 6rem auto 2.5rem;
  padding: 1.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: var(--step--1);
  color: var(--muted);
}
.site-footer a {
  color: var(--ink);
  text-decoration: none;
  margin-left: 1.5rem;
}
.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { color: var(--gold); }
.site-footer .colophon {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-0);
  color: var(--ink);
  letter-spacing: -0.005em;
}

/* -------- home hero -------- */
.hero {
  padding: 6vh 0 5vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.hero h1 {
  font-size: var(--step-5);
  max-width: 12ch;
  margin: 0;
}
.hero h1 .dot,
.cv-header h1 .dot,
h1 .dot { color: var(--gold); }
.hero .lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.2;
  max-width: 22ch;
  margin: 0;
  color: var(--ink);
}
.hero .bio {
  max-width: var(--measure);
  color: var(--ink);
  font-size: var(--step-1);
  line-height: 1.55;
  margin: 0;
}

/* -------- section label (shared) -------- */
.section-label {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* -------- post list -------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.post-list li {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 2rem;
  align-items: baseline;
}
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list time {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.post-list h3 {
  font-size: var(--step-2);
  font-weight: 600;
  margin: 0 0 0.3em;
  letter-spacing: -0.015em;
}
.post-list h3 a { text-decoration: none; }
.post-list h3 a:hover { color: var(--gold); }
.post-list .excerpt {
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}

@media (max-width: 640px) {
  .post-list li { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* Compact post list (used inside CV writing section) */
.post-list--compact { margin-top: 0; }
.post-list--compact li {
  padding: 1.25rem 0;
  grid-template-columns: 9rem 1fr;
}
.post-list--compact h3 { font-size: var(--step-1); }

/* -------- CV page -------- */
.cv-header {
  padding: 4vh 0 2vh;
}
.cv-header h1 {
  font-size: var(--step-5);
  margin: 0 0 0.5rem;
}
.cv-header .headline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.15;
  max-width: 32ch;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.cv-header .tagline {
  font-family: var(--font-body);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0 0 2rem;
}
.cv-header .summary {
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.6;
  margin: 0 0 1rem;
}
.cv-header .summary:last-of-type { margin-bottom: 0; }

.cv-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 2rem;
}
.cv-section > h2 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}

.cv-entry { margin-bottom: 2.25rem; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}
.cv-entry h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.cv-entry h3 .loc {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: none;
  margin-left: 0.25rem;
}
.cv-entry .dates {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: var(--step--1);
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.cv-entry .role {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--ink);
  margin: 0 0 0.6rem;
}
.cv-entry ul {
  padding-left: 1em;
  margin: 0.25rem 0 0;
  color: var(--ink);
}
.cv-entry li { margin-bottom: 0.25rem; }

/* sub-roles within a single company */
.cv-role {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dotted rgba(20,20,20,0.2);
}
.cv-role:first-of-type {
  margin-top: 0.4rem;
  padding-top: 0;
  border-top: 0;
}
.cv-role .role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.cv-role .role-head .role { margin: 0; }
.cv-role .role-head .dates { font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }

/* services menu ("How I help") */
.services { margin: 0; max-width: var(--measure); }
.service {
  padding: 1rem 0;
  margin: 0;
  border-top: 1px dotted rgba(20,20,20,0.2);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink);
}
.service:first-child { border-top: 0; padding-top: 0.25rem; }
.service-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-right: 0.25em;
}

@media (max-width: 720px) {
  .cv-section { grid-template-columns: 1fr; gap: 0.75rem; }
  .cv-entry .head { flex-direction: column; gap: 0; }
  .cv-role .role-head { flex-direction: column; gap: 0; }
}

/* -------- article -------- */
article.post header {
  padding: 4vh 0 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
article.post h1 {
  font-size: var(--step-4);
  margin: 0 0 1rem;
  max-width: 22ch;
}
article.post .meta {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
article.post .meta > * + *::before {
  content: "·";
  margin: 0 0.5em;
}

article.post .prose {
  margin-top: 1.5rem;
}
article.post .prose h2 {
  font-size: var(--step-3);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
article.post .prose h3 {
  font-size: var(--step-2);
  margin-top: 2rem;
}
article.post .post-tags {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* -------- tag chips -------- */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--ink);
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
  text-decoration: none;
  color: var(--ink);
}
.tag:hover { background: var(--ink); color: var(--bg); }

/* -------- pagination -------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.pagination a { text-decoration: none; }
.pagination a:hover { color: var(--gold); }

/* -------- Prism (warm ink on cream) -------- */
code[class*="language-"],
pre[class*="language-"] {
  color: var(--ink);
  text-shadow: none;
  background: var(--paper);
  font-family: var(--font-mono);
}
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--muted); font-style: italic; }
.token.punctuation { color: var(--ink); }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: var(--orange); }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: var(--gold); }
.token.atrule, .token.attr-value, .token.keyword { color: var(--ink); font-weight: 600; }
.token.function, .token.class-name { color: var(--ink); font-style: italic; }
.token.regex, .token.important, .token.variable { color: var(--orange); }

/* -------- tag index -------- */
.tag-header h1 {
  font-size: var(--step-4);
  margin: 0 0 0.5rem;
}
.tag-header h1::before { content: "#"; color: var(--gold); margin-right: 0.1em; }

/* -------- utilities -------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
