/* ── Design tokens ── */
:root {
  --accent:  #2b4a6b;
  --bg:      #f5f4ef;
  --ink:     #18180f;
  --muted:   #52524c;
  --faint:   #e4e2d8;
  --mono:    'JetBrains Mono', ui-monospace, monospace;
  --serif:   'Instrument Serif', Georgia, serif;
  --sans:    'Inter Tight', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  height: 100%;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

/* ── Shared ── */
.mono-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.accent-color { color: var(--accent); }
.accent       { color: var(--accent); }

.btn {
  display: inline-block;
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
}
.btn--dark {
  background: var(--ink);
  color: var(--bg);
  border: none;
}
.btn--dark:hover { background: #2a2a28; }

/* ── Page layout ── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  border-right: 1px solid var(--faint);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__top { display: flex; flex-direction: column; gap: 0; }

/* Identity */
.sidebar__identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  flex-shrink: 0;
}
.sidebar__name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

/* Nav */
.sidebar__nav {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: transparent;
  transition: background 0.1s;
}
.sidebar__link:hover { background: var(--faint); }
.sidebar__link--active {
  background: var(--ink);
  color: var(--bg);
}
.sidebar__link--active:hover { background: var(--ink); }
.sidebar__num { opacity: 0.4; }
.sidebar__link--active .sidebar__num { opacity: 0.6; }
.sidebar__dot { margin-left: auto; }

/* Mobile footer (currently + elsewhere) — hidden on desktop */
.mobile-footer { display: none; }

/* Status widget */
.sidebar__widget { margin-top: 40px; }
.sidebar__status-card {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--ink);
  font-size: 12px;
  line-height: 1.5;
}
.sidebar__status-card--stacked {
  margin-top: 0;
  border-top: none;
}
.sidebar__status-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.sidebar__status-text {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
}

/* Elsewhere links */
.sidebar__bottom { }
.sidebar__links {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  line-height: 2;
}
.sidebar__links a:hover { color: var(--accent); }

/* ── Main content ── */
.main-content {
  padding: 64px 72px;
  min-height: 100vh;
}

/* ── Page typography ── */
.page-hero {
  font-family: var(--serif);
  font-size: 76px;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -1.5px;
  margin-top: 16px;
}
.page-h1 {
  font-family: var(--serif);
  font-size: 60px;
  font-weight: 400;
  margin-top: 16px;
  line-height: 1;
  letter-spacing: -1px;
}
.page-intro {
  margin-top: 28px;
  max-width: 580px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
}
.page-sub {
  margin-top: 14px;
  color: var(--muted);
  max-width: 540px;
  font-size: 16px;
  line-height: 1.7;
}

/* ── Hero ── */
.hero {
  padding-top: 24px;
}
.hero__top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.hero__tagline {
  color: var(--muted);
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 99px;
}
.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.hero__headline {
  font-family: var(--serif);
  font-size: 80px;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -2px;
  max-width: 720px;
}
.hero__intro {
  margin-top: 32px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}
.hero__tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border: 1px solid var(--faint);
  color: var(--muted);
}

/* ── Home divider ── */
.home-divider {
  margin: 64px 0 0;
  border-top: 1px solid var(--ink);
}

/* ── Home section header ── */
.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 4px;
}
.home-section-header__link {
  color: var(--muted);
  transition: color 0.15s;
}
.home-section-header__link:hover { color: var(--ink); }

/* ── Home featured projects ── */
.home-projects { margin-top: 0; }
.home-project-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px 12px;
  margin: 0 -12px;
  border-top: 1px solid var(--faint);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.home-project-row:last-of-type { border-bottom: 1px solid var(--faint); }
.home-project-row:hover { background: var(--faint); }
.home-project-row:hover .home-project-row__arrow { transform: translateX(4px); }
.home-project-row__num { color: var(--muted); }
.home-project-row__body { display: flex; flex-direction: column; gap: 3px; }
.home-project-row__title { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.home-project-row__meta { color: var(--muted); }
.home-project-row__stat { color: var(--accent); }
.home-project-row__arrow { color: var(--muted); transition: transform 0.2s ease; }

/* ── Latest article ── */
.latest-article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
}
.latest-article:hover { background: #1e1e1c; }
.latest-article__title {
  font-family: var(--serif);
  font-size: 22px;
  margin-top: 6px;
}

/* ── About ── */
.about-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}
.photo-ph {
  height: 320px;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(135deg, #fff, #fff 8px, #ececec 8px, #ececec 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
}
.about-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.about-prose {
  font-size: 17px;
  line-height: 1.8;
  max-width: 560px;
}

.timeline {
  margin-top: 64px;
  border-top: 1px solid var(--ink);
  padding-top: 32px;
}
.timeline__entries { margin-top: 20px; }
.timeline__entry {
  display: grid;
  grid-template-columns: 160px 1fr 200px;
  padding: 18px 0;
  border-bottom: 1px solid var(--faint);
  align-items: baseline;
  gap: 32px;
}
.timeline__when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.timeline__role {
  font-family: var(--serif);
  font-size: 22px;
}
.timeline__where {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* ── Projects ── */
.cases { margin-top: 48px; }
.case-row {
  display: grid;
  grid-template-columns: 80px 1fr 220px 40px;
  gap: 24px;
  padding: 28px 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--ink);
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.case-row:hover {
  background: rgba(43, 74, 107, 0.05);
}
.case-row:hover .case-row__title { opacity: 0.75; }
.case-row:hover .case-row__arrow { transform: translateX(6px); }
.case-row__title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  transition: opacity 0.15s;
}
.case-row__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.case-row__stat {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--accent);
}
.case-row__arrow {
  font-family: var(--mono);
  font-size: 18px;
  text-align: right;
  transition: transform 0.2s ease;
}
.cases__border { border-top: 1px solid var(--ink); }

/* ── Certifications ── */
.certs-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--ink);
}
.cert-card {
  padding: 24px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cert-card:nth-child(even)                      { border-right: none; }
.cert-card:last-child                           { border-bottom: none; }
.cert-card:nth-last-child(2):nth-child(odd)     { border-bottom: none; }
.cert-card:last-child:nth-child(odd)            { grid-column: 1 / -1; border-right: none; }
.cert-card__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cert-card__name {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
}
.cert-card__org {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
}
.cert-card__scope {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  margin-top: 4px;
}

.cert-card--pending {
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    rgba(43, 74, 107, 0.04) 6px,
    rgba(43, 74, 107, 0.04) 12px
  );
}
.cert-card--pending .cert-card__org,
.cert-card--pending .cert-card__scope { color: var(--muted); }
.cert-card__name--pending {
  opacity: 0.2;
  letter-spacing: 4px;
}

/* ── Articles ── */
.articles-list { margin-top: 40px; }
.article-row {
  display: grid;
  grid-template-columns: 90px 1fr 130px 80px 40px;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--ink);
  align-items: center;
  cursor: pointer;
}
.article-row--last { border-bottom: 1px solid var(--ink); }
.article-row:hover .article-row__title { opacity: 0.7; }
.article-row__date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.article-row__title {
  font-family: var(--serif);
  font-size: 22px;
  transition: opacity 0.15s;
}
.article-row__tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.article-row__read {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.article-row__arrow {
  font-family: var(--mono);
  font-size: 18px;
  text-align: right;
}
.rss-box {
  margin-top: 32px;
  padding: 20px;
  border: 1px dashed var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rss-box__url {
  font-family: var(--serif);
  font-size: 18px;
  margin-top: 4px;
}

/* ── Button outline variant ── */
.btn--outline {
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ── Project detail ── */
.project-image {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  margin: 40px 0;
  display: block;
}
.project-image-ph {
  width: 100%;
  height: 340px;
  background: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.project-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ── Article header ── */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--faint);
}
.article-header__back {
  display: inline-block;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.article-header__back:hover { color: var(--ink); }
.article-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.article-header__title {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1.15;
  margin-bottom: 16px;
}

/* ── Article prose (rendered Markdown) ── */
.article-prose {
  max-width: 680px;
  margin-top: 40px;
}
.article-prose h1,
.article-prose h2,
.article-prose h3 {
  font-family: var(--serif);
  margin: 1.5em 0 0.5em;
}
.article-prose h1 { font-size: 36px; }
.article-prose h2 { font-size: 28px; }
.article-prose h3 { font-size: 22px; }
.article-prose p  { line-height: 1.75; }
.article-prose a  {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.article-prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--faint);
  padding: 2px 6px;
  border-radius: 3px;
}
.article-prose pre {
  background: var(--ink);
  color: var(--bg);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.5em 0;
  border-radius: 4px;
}
.article-prose pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: inherit;
}
.article-prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 8px 20px;
  color: var(--muted);
}
.article-prose ul,
.article-prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}
.article-prose li   { margin-bottom: 0.4em; }
.article-prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 15px;
}
.article-prose th,
.article-prose td {
  padding: 10px 16px;
  border: 1px solid var(--faint);
  text-align: left;
}
.article-prose th {
  background: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.article-prose hr {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 2em 0;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pagination__link {
  padding: 8px 14px;
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background 0.15s;
}
.pagination__link:hover {
  background: var(--ink);
  color: var(--bg);
}
.pagination__current {
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
}
.pagination__gap {
  padding: 8px 4px;
  color: var(--muted);
}

/* ── Colophon ── */
.meta-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.meta-card {
  border: 1px solid var(--ink);
  padding: 20px;
}
.meta-card__val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  margin-top: 10px;
  line-height: 1.8;
}
.contact-block {
  margin-top: 48px;
  padding: 28px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.contact-block__email {
  font-family: var(--serif);
  font-size: 28px;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--faint);
  }
  .sidebar__widget { display: none; }
  .sidebar__bottom { display: none; }
  .mobile-footer {
    display: block;
    padding: 32px 24px 48px;
    border-top: 1px solid var(--faint);
  }
  .mobile-footer__currently {
    margin-bottom: 32px;
  }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; margin-top: 24px; }
  .main-content { padding: 40px 24px; }
  .page-hero { font-size: 48px; }
  .page-h1   { font-size: 40px; }
  .about-grid { grid-template-columns: 1fr; }
  .case-row   { grid-template-columns: 60px 1fr 32px; }
  .case-row__stat { display: none; }
  .article-row { grid-template-columns: 70px 1fr 32px; }
  .article-row__tag, .article-row__read { display: none; }
  .certs-grid { grid-template-columns: 1fr; }
  .cert-card { border-right: none; }
  .cert-card:nth-last-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .cert-card:last-child { border-bottom: none; }
  .meta-grid { grid-template-columns: 1fr; }
  .contact-block { flex-direction: column; gap: 20px; align-items: flex-start; }
  .timeline__entry { grid-template-columns: 120px 1fr; }
  .timeline__where { display: none; }
  .hero__headline { font-size: 48px; letter-spacing: -1px; }
  .hero__intro { font-size: 16px; }
  .hero__top { flex-wrap: wrap; gap: 12px; }
  .home-project-row { grid-template-columns: 28px 1fr auto; }
  .home-project-row__stat { display: none; }
}
