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

:root {
  --bg:        #080808;
  --text:      #c0c0c0;
  --text-dim:  #4a4a4a;
  --text-hi:   #efefef;
  --green:     #4ade80;
  --blue:      #7dd3fc;
  --border:    #1a1a1a;
  --font:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
}

/* ─── light theme ─────────────────────────── */

html.light {
  --bg:        #f9f9f7;
  --text:      #3a3a3a;
  --text-dim:  #999999;
  --text-hi:   #111111;
  --green:     #0a6640;
  --blue:      #1a56db;
  --border:    #e5e5e5;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── layout ──────────────────────────────── */

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 28px 100px;
}

/* ─── header ──────────────────────────────── */

header {
  margin-bottom: 80px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.site-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.3px;
}

.site-role {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-dim);
  margin-top: 5px;
}

.social-links {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.social-links a {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0 12px;
  border-right: 1px solid var(--border);
  transition: color 0.12s;
}

.social-links a:first-child {
  padding-left: 0;
}

.social-links a:last-child {
  border-right: none;
  padding-right: 0;
}

.social-links a:hover {
  color: var(--green);
}

/* ─── theme toggle ────────────────────────── */

.theme-toggle {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  cursor: pointer;
  padding: 0 0 0 12px;
  transition: color 0.12s;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--green);
}

/* show sun in dark mode, moon in light mode */
.theme-toggle { display: flex; align-items: center; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
:root.light .theme-toggle .icon-sun  { display: none; }
:root.light .theme-toggle .icon-moon { display: block; }

/* ─── sections ────────────────────────────── */

section {
  margin-bottom: 68px;
}

.section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3.5px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── entries ─────────────────────────────── */

.entry {
  margin-bottom: 44px;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.entry-org {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-hi);
}

.entry-org a {
  color: var(--text-hi);
  text-decoration: none;
}

.entry-org a:hover {
  color: var(--green);
}

.entry-date {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.entry-role {
  font-size: 12px;
  color: var(--green);
  margin-bottom: 14px;
  font-weight: 400;
}

.entry-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.85;
}

.entry-body p {
  margin-bottom: 10px;
}

.entry-body p:last-child {
  margin-bottom: 0;
}

.entry-body a {
  color: var(--blue);
}

.entry-body a:hover {
  text-decoration: underline;
}

.entry-body em {
  font-style: italic;
  color: var(--text-hi);
}

/* ─── projects ────────────────────────────── */

.project-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.source-link {
  font-size: 11px;
  color: var(--text-dim) !important;
  font-weight: 400;
}

.source-link:hover {
  color: var(--green) !important;
  text-decoration: none !important;
}

/* ─── prose ───────────────────────────────── */

.prose {
  font-size: 13px;
  line-height: 1.85;
}

.prose p {
  margin-bottom: 14px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--blue);
}

.prose a:hover {
  text-decoration: underline;
}

/* ─── footer ──────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--green);
}

footer .sep {
  opacity: 0.3;
}

/* ─── responsive ──────────────────────────── */

@media (max-width: 580px) {
  .container {
    padding: 48px 20px 72px;
  }

  .header-inner {
    flex-direction: column;
    gap: 20px;
  }

  .site-name {
    font-size: 19px;
  }

  .social-links a {
    padding: 0 8px;
  }

  .entry-header {
    flex-direction: column;
    gap: 2px;
  }
}
