/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --black: #0d0d0d;
  --gray-dark: #3a3a3a;
  --gray-mid: #6b6b6b;
  --gray-light: #b0b0b0;
  --gray-rule: #e2e2e2;
  --bg: #fafafa;
  --white: #ffffff;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', system-ui, sans-serif;

  --max-w: 780px;
  --nav-h: 60px;
}

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--black);
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-rule);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--black);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--black); }
.lang-switch {
  border-left: 1px solid var(--gray-rule);
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}

/* ─── MAIN ────────────────────────────────────────────────── */
.main {
  min-height: calc(100vh - var(--nav-h) - 80px);
}

/* ─── CV ──────────────────────────────────────────────────── */
.cv {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Hero */
.cv-hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--gray-rule);
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

/* Avatar */
.cv-avatar-wrap {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  min-width: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--gray-rule);
  background: var(--gray-rule);
}
.cv-avatar {
  width: 130px;
  height: 130px;
  display: block;
  object-fit: cover;
  object-position: center 15%;
  filter: grayscale(15%);
}

/* Hero text */
.cv-hero-text {
  flex: 1;
}
.cv-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 0.4rem;
}
.cv-role {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--gray-mid);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}
.cv-location {
  font-size: 0.8rem;
  color: var(--gray-light);
  margin-bottom: 0.75rem;
}
.cv-contacts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--gray-mid);
}
.cv-contacts a {
  color: var(--gray-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gray-rule);
  transition: color 0.2s;
}
.cv-contacts a:hover { color: var(--black); }
.cv-contacts-sep {
  color: var(--gray-rule);
}
.cv-stat {
  font-size: 0.78rem;
  color: var(--gray-mid);
}
.cv-stat strong {
  font-weight: 400;
  color: var(--black);
}

/* CV Body */
.cv-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--gray-rule);
}
.cv-section:last-child { border-bottom: none; }

.cv-section-title {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 2rem;
}

/* Entries */
.cv-entries { display: flex; flex-direction: column; gap: 2rem; }
.cv-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
}
.cv-entry-meta { padding-top: 0.15rem; }
.cv-entry-date {
  font-size: 0.75rem;
  color: var(--gray-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cv-entry-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}
.cv-entry-org {
  font-size: 0.82rem;
  color: var(--gray-mid);
  margin-bottom: 0.4rem;
}
.cv-entry-desc {
  font-size: 0.85rem;
  color: var(--gray-dark);
  font-weight: 300;
}

/* Tags */
.cv-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.cv-tag {
  font-size: 0.78rem;
  color: var(--gray-dark);
  border: 1px solid var(--gray-rule);
  padding: 0.35rem 0.75rem;
  border-radius: 2px;
  letter-spacing: 0.01em;
}

/* Publications */
.cv-pubs { display: flex; flex-direction: column; }
.cv-pub {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-rule);
}
.cv-pub:last-child { border-bottom: none; }
.cv-pub-year {
  font-size: 0.73rem;
  color: var(--gray-light);
  font-variant-numeric: tabular-nums;
  padding-top: 0.2rem;
}
.cv-pub-title {
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 0.2rem;
}
.cv-pub-journal {
  font-size: 0.76rem;
  color: var(--gray-mid);
  font-style: italic;
}
.cv-pub-note {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--gray-mid);
}
.cv-hindex {
  font-weight: 500;
  color: var(--black);
}

/* ─── BLOG LIST ───────────────────────────────────────────── */
.blog-list-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.blog-header {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--gray-rule);
}
.blog-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.blog-subtitle {
  font-size: 0.88rem;
  color: var(--gray-mid);
  font-weight: 300;
}

.posts-list { margin-top: 0; }

.post-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--gray-rule);
  align-items: start;
}
.post-item:last-child { border-bottom: none; }

/* Cover image */
.post-item-cover-link {
  display: block;
  flex-shrink: 0;
}
.post-item-cover {
  width: 200px;
  height: 130px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--gray-rule);
}
.post-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.2s;
}
.post-item-cover-link:hover .post-item-cover img {
  opacity: 0.85;
}

/* Right column */
.post-item-right {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.post-item-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.post-item-meta time {
  font-size: 0.74rem;
  color: var(--gray-light);
  font-variant-numeric: tabular-nums;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-mid);
  border: 1px solid var(--gray-rule);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}
.post-item-body h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}
.post-item-body h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.post-item-summary {
  font-size: 0.82rem;
  color: var(--gray-light);
  font-weight: 300;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.no-posts { color: var(--gray-mid); padding: 3rem 0; font-size: 0.9rem; }

/* ─── SINGLE POST ─────────────────────────────────────────── */
.post-single {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.post-header {
  padding: 5rem 0 2.5rem;
  border-bottom: 1px solid var(--gray-rule);
}
.post-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.post-header-meta time {
  font-size: 0.78rem;
  color: var(--gray-light);
}
.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.post-content {
  margin-top: 2.5rem;
  font-size: 1rem;
  line-height: 1.85;
  font-weight: 300;
  color: var(--black);
}
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 0.8rem;
}
.post-content h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.post-content p { margin-bottom: 1.3rem; }
.post-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gray-rule);
  transition: text-decoration-color 0.2s;
}
.post-content a:hover { text-decoration-color: var(--black); }
.post-content blockquote {
  border-left: 2px solid var(--black);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  color: var(--gray-dark);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.post-content pre {
  background: var(--white);
  border: 1px solid var(--gray-rule);
  padding: 1.2rem;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 1.5rem 0;
}
.post-content code {
  font-size: 0.87em;
  background: var(--white);
  border: 1px solid var(--gray-rule);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}
.post-content pre code { background: none; border: none; padding: 0; }

.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-rule);
}
.back-link {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
  transition: color 0.2s;
}
.back-link:hover { color: var(--black); }

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--gray-rule);
  padding: 1.5rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.75rem;
  color: var(--gray-light);
}
.footer-inner a { color: var(--gray-light); transition: color 0.2s; }
.footer-inner a:hover { color: var(--black); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .cv-hero { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .cv-avatar-wrap { width: 110px; height: 110px; min-width: 110px; }
  .cv-avatar { width: 110px; height: 110px; }
  .cv-entry { grid-template-columns: 1fr; gap: 0.3rem; }
  .cv-pub { grid-template-columns: 40px 1fr; gap: 1rem; }
  .post-item { grid-template-columns: 1fr; gap: 1rem; }
  .post-item-cover { width: 100%; height: 180px; }
  .post-item-cover-link { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .cv-contacts { gap: 0.3rem; }
}

/* ─── CONTACT PAGE ────────────────────────────────────────── */
.contact-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.contact-header {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--gray-rule);
}
.contact-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
}
.contact-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 5rem;
  padding-top: 3rem;
}
.contact-address-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 1rem;
}
address {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--gray-dark);
  font-weight: 300;
  line-height: 1.9;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-rule);
  border-radius: 2px;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--black);
}
.form-submit {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--black);
  border: none;
  border-radius: 2px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.75; }
.form-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.form-status {
  font-size: 0.83rem;
  font-weight: 300;
  min-height: 1.2rem;
}
.form-status--ok { color: #2d6a4f; }
.form-status--err { color: #c0392b; }

@media (max-width: 600px) {
  .contact-body {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ─── POST COVER IMAGE ────────────────────────────────────── */
.post-cover-wrap {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0 0;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-rule);
}
.post-cover {
  width: auto;
  max-width: 280px;
  max-height: 420px;
  object-fit: contain;
  filter: grayscale(10%);
}

@media (max-width: 600px) {
  .post-cover {
    max-width: 200px;
  }
}

/* ─── FORM CONSENT ────────────────────────────────────────── */
.form-consent {
  font-size: 0.78rem;
  color: var(--gray-light);
  font-weight: 300;
  line-height: 1.5;
}
.form-consent a {
  color: var(--gray-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gray-rule);
  transition: color 0.2s;
}
.form-consent a:hover { color: var(--black); }

/* ─── PRIVACY PAGE ────────────────────────────────────────── */
.privacy-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.privacy-content {
  margin-top: 2.5rem;
}
.privacy-content strong {
  font-weight: 500;
  display: block;
  margin-top: 2rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.privacy-content strong:first-child {
  margin-top: 0;
}
