:root {
  --bg: #0a0a0a;
  --fg: #ededed;
  --muted: #c8c8c8;
  --faint: #9a9a9a;
  --accent: #bcd0f0;
  --border: #262626;
  --border-strong: #383838;
  --font: "IBM Plex Mono", "Courier New", monospace;
  --max: 680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scrollbar-gutter: stable; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
header {
  max-width: var(--max);
  width: 100%;
  margin: 1.5rem auto 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.site-title:hover { text-decoration: none; color: var(--fg); }

.mono-logo {
  width: 16px; height: 16px;
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
}
.mono-logo span { background: currentColor; }
.mono-logo span:nth-child(1),
.mono-logo span:nth-child(4) { opacity: 0.85; }
.mono-logo span:nth-child(2),
.mono-logo span:nth-child(3) { opacity: 0.25; }

nav { display: flex; gap: 1.5rem; margin-left: auto; }
nav a {
  color: var(--muted);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
nav a:hover, nav a.active { color: var(--fg); text-decoration: none; }
nav .move { color: var(--faint); font-size: 0.72rem; }
nav a:hover .move, nav a.active .move { color: var(--muted); }

/* main */
main {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* home */
.home { padding: 0.5rem 0 3rem; }
.home .kicker {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.home h1 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 1.6rem;
  line-height: 1.7;
}
.home h1 strong { font-weight: 500; }
.home p { margin-bottom: 1rem; }
.text-muted { color: var(--muted); font-size: 0.9rem; }
.home .links {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

/* article (general) */
article h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--fg);
}
article .lead { color: var(--muted); margin-bottom: 1.5rem; }
article p { margin-bottom: 1rem; font-size: 0.92rem; }
article ul, article ol { margin: 0.5rem 0 1rem 1.5rem; }
article li { margin-bottom: 0.25rem; font-size: 0.92rem; }
article h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.5rem 0 0.6rem;
}
article table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
article td { padding: 0.35rem 0; font-size: 0.85rem; vertical-align: top; }
article td:first-child { color: var(--muted); white-space: nowrap; padding-right: 2rem; font-variant-numeric: tabular-nums; }
article thead { display: none; }

/* social links */
.social-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  vertical-align: baseline;
}
.social-link svg { position: relative; top: 3px; }

/* about */
.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}
.portrait {
  flex-shrink: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(20%);
}
.about-intro h1 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.about-intro p { color: var(--muted); font-size: 0.85rem; }
.about-intro p + p { margin-top: 0.5rem; }
.about h2 { display: flex; align-items: baseline; gap: 0.6rem; }
.about h2 .num { color: var(--faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* project images */
.project-img {
  display: block;
  max-width: 300px;
  height: auto;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.project-img-pair {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
}
.project-img-pair__img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* projects list */
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.02em; }
.page-head .meta { color: var(--faint); font-size: 0.72rem; font-variant-numeric: tabular-nums; }

.project-divider {
  border: none;
  border-top: 1px solid var(--border-strong);
  margin: 2rem 0 0;
}
.project-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin: 1.25rem 0 0.25rem;
}
.post-list { list-style: none; }
.post-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  align-items: start;
}
.post-list li:last-child { border-bottom: none; }
.post-list .year { color: var(--faint); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.post-list .title-col { min-width: 0; }
.post-list .title-col a.title {
  color: var(--fg);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.post-list .title-col a.title:hover { color: var(--accent); text-decoration: none; }
.post-list .title-col a.title::after {
  content: "→";
  color: var(--faint);
  transition: transform 0.15s ease, color 0.15s ease;
  display: inline-block;
}
.post-list .title-col a.title:hover::after { color: var(--accent); transform: translateX(2px); }
.post-list .desc { color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.post-list .stack { color: var(--faint); font-size: 0.72rem; margin-top: 0.25rem; letter-spacing: 0.02em; }
.post-list .right-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}
.post-list .role { color: var(--muted); font-size: 0.72rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.status.shipped { color: #7fb28a; }
.status.wip { color: #d4b679; }
.status.archived { color: var(--faint); }

/* case study */
article.case .back {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}
article.case .back:hover { color: var(--fg); text-decoration: none; }
article.case .case-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
article.case .case-head h1 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
article.case .case-head .lead { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.8rem; }
article.case .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
article.case .meta-row b { color: var(--muted); font-weight: 400; margin-right: 0.25rem; }
article.case h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.5rem 0 0.6rem;
}

/* footer */
footer {
  max-width: var(--max);
  width: 100%;
  margin: 3rem auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
footer .sig { display: flex; flex-direction: column; gap: 0.2rem; }
footer .sig .eco { color: var(--faint); letter-spacing: 0.04em; }
.footer-easter-egg { color: var(--fg); font-size: 0.72rem; }
.footer-easter-egg:hover { color: var(--fg); text-decoration: none; }
.footer-legal { display: flex; gap: 1rem; }
.footer-legal a { color: var(--faint); font-size: 0.72rem; }
.footer-legal a:hover { color: var(--fg); text-decoration: none; }
.header-icons { display: flex; gap: 1rem; align-items: center; margin-left: 0.5rem; }
.header-icons a { color: var(--muted); display: flex; }
.header-icons a:hover { color: var(--fg); }

/* responsive */
@media (max-width: 560px) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list .right-col { align-items: flex-start; text-align: left; margin-top: 0.3rem; }
  .about-header { flex-direction: column-reverse; align-items: flex-start; }
}
