/* ─── tokens ─────────────────────────────────────────────── */
:root {
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Lora', Georgia, serif;

  --ink:   #1a1a18;
  --ink-2: #4a4a46;
  --ink-3: #8a8a84;
  --paper: #f8f7f3;
  --rule:  #e0dfd8;
  --rule-strong: #c8c7be;
  --link:  #2255cc;

  --measure: 64ch;
  --gap: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:   #e8e7e0;
    --ink-2: #a8a79e;
    --ink-3: #68675e;
    --paper: #141412;
    --rule:  #2a2a26;
    --rule-strong: #3a3a36;
    --link:  #7aaaff;
  }
}

/* ─── reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

/* ─── header ─────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 0 1.25rem;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: var(--gap);
  gap: 1rem;
  flex-wrap: wrap;
}

.site-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--ink);
  animation: blink 1.1s step-end infinite;
  margin-left: 1px;
  vertical-align: -1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }

/* ─── main ───────────────────────────────────────────────── */
main { padding-bottom: 4rem; }

/* ─── footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2rem;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}

.site-footer a {
  color: var(--ink-3);
  text-decoration: none;
}

.site-footer a:hover { color: var(--link); }

/* ─── social row ───────────────────────────────────────────── */
.social-row {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.social-row-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  list-style: none;
}

.social-row-list li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: var(--ink-2);
  text-decoration: none;
}

.social-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.social-link:hover { color: var(--ink); }

.social-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  opacity: 0.6;
  filter: grayscale(1) brightness(0.55);
  transition: filter 0.15s, opacity 0.15s;
}

.social-link:hover .social-icon {
  filter: none;
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .social-icon {
    opacity: 0.85;
    filter: grayscale(1) brightness(1.75) contrast(0.92);
  }

  .social-link[data-icon="github"] .social-icon {
    opacity: 0.5;
    filter: grayscale(1);
  }

  .social-link:hover .social-icon {
    filter: none;
    opacity: 1;
  }
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 4px;
  vertical-align: 1px;
}

/* ─── hero ───────────────────────────────────────────────── */
.hero { margin-bottom: 3rem; }

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-now {
  text-transform: none;
  letter-spacing: 0.02em;
}

.hero-now a {
  color: var(--ink-3);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.hero-now a:hover { color: var(--ink-2); }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 1rem;
}

.hero-title em { font-style: italic; }

.hero-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 52ch;
}

.hero-body a {
  color: var(--ink-3);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.hero-body a:hover { color: var(--ink-2); }

.hero-tech {
  position: relative;
  display: inline;
  white-space: nowrap;
  color: var(--ink-2);
  transition: color 0.15s;
}

.hero-tech::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.hero-tech:hover { color: var(--ink); }

.hero-tech-icon {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.12em;
  vertical-align: -0.15em;
  object-fit: contain;
  opacity: 0.6;
  filter: grayscale(1) brightness(0.55);
  transition: filter 0.15s, opacity 0.15s;
}

.hero-tech:hover .hero-tech-icon {
  filter: none;
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .hero-tech-icon {
    opacity: 0.85;
    filter: grayscale(1) brightness(1.75) contrast(0.92);
  }

  .hero-tech:hover .hero-tech-icon {
    filter: none;
    opacity: 1;
  }
}

/* ─── section ────────────────────────────────────────────── */
.section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-more {
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.section-more:hover { color: var(--ink-2); }

/* ─── post list ──────────────────────────────────────────── */
.post-list { list-style: none; }

.post-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 0 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-item:first-child { padding-top: 0; }
.post-item:last-child  { border-bottom: none; padding-bottom: 0; }

.post-date {
  font-size: 11px;
  color: var(--ink-3);
  padding-top: 2px;
}

.cv-list .post-item {
  grid-template-columns: 88px 1fr;
}

.cv-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.4;
}

.post-item-title {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
}

.post-item-title:hover { color: var(--link); }

.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--mono);
}

/* ─── project list ───────────────────────────────────────── */
.project-list { list-style: none; }

.project-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.project-item:first-child { padding-top: 0; }
.project-item:last-child  { border-bottom: none; padding-bottom: 0; }

.project-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-item-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.project-item-name:hover { color: var(--link); }

.project-stack { font-size: 11px; color: var(--ink-3); }

.project-item-desc {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ─── prose (post body) ──────────────────────────────────── */
.post {
  max-width: var(--measure);
}

.post-header { margin-bottom: 2.5rem; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

time {
  font-size: 11px;
  color: var(--ink-3);
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.post-lede {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  font-style: italic;
}

.prose {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-2);
}

.prose p     { margin-bottom: 1.25em; }
.prose h2    { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin: 2.5em 0 0.75em; }
.prose h3    { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); margin: 2em 0 0.5em; }
.prose a {
  color: var(--ink-3);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.prose a:hover { color: var(--ink-2); }
.prose code  { font-family: var(--mono); font-size: 13px; background: var(--rule); padding: 2px 5px; border-radius: 3px; color: var(--ink); }
.prose pre   { background: var(--rule); padding: 1.25rem; border-radius: 6px; overflow-x: auto; margin: 1.5em 0; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 2px solid var(--rule-strong); padding-left: 1rem; margin: 1.5em 0; font-style: italic; color: var(--ink-3); }
.prose ul, .prose ol { margin: 1em 0 1em 1.5em; }
.prose li    { margin-bottom: 0.4em; }
.prose hr    { border: none; border-top: 1px solid var(--rule); margin: 2.5em 0; }

/* project page links */
.project-links { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

.project-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.project-link:hover { color: var(--ink-2); }

/* ─── index pages ────────────────────────────────────────── */
.page-header { margin-bottom: 2.5rem; }

.page-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}

.page-desc {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
}

/* post footer nav */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 12px;
}

.post-footer a { color: var(--ink-2); text-decoration: none; }
.post-footer a:hover { color: var(--link); }

/* ─── tag status variant ─────────────────────────────────── */
.tag--status { color: var(--ink); }

/* ─── audio placeholder ──────────────────────────────────── */
.audio-embed {
  border: 1px dashed var(--rule-strong);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5em 0;
}

.audio-placeholder {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* ─── accessibility ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  * { scroll-behavior: auto !important; }
}
