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

:root {
  --bg: #ffffff;
  --sheet: #ffffff;
  --border: #d8d7d3;
  --text: #141414;
  --muted: #5a5a5a;
  --faint: #999;
  --font: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --max: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --sheet: #121212;
    --border: #2c2c2c;
    --text: #ededed;
    --muted: #a3a3a3;
    --faint: #767676;
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.15s ease, color 0.15s ease;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Nav */
.topnav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.topnav a { text-decoration: none; color: var(--muted); }
.topnav a.active { color: var(--text); font-weight: 600; }
.topnav a:hover { color: var(--text); }

/* Intro */
.intro { position: relative; }

.intro h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.subname {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.summary {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 0.9rem;
}

.quicklinks {
  font-size: 0.82rem;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.quicklinks a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); }
.quicklinks a:hover { text-decoration-color: var(--text); }

.portrait {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  height: 128px;
  aspect-ratio: 433 / 576;
  border-radius: 0;
  object-fit: contain;
  background: var(--sheet);
  border: 1px solid var(--text);
}

/* Sections */
section h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--faint);
  margin-bottom: 1rem;
}

.copy p { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.9rem; }
.copy p:last-child { margin-bottom: 0; }
.copy a { color: var(--text); }

/* Entries */
.entries { display: flex; flex-direction: column; gap: 1.4rem; }

.group-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 0.6rem;
}

.entries.compact { gap: 0.85rem; margin-bottom: 1.5rem; }
.entries.compact:last-of-type { margin-bottom: 0; }
.entries.compact .entry h3 { font-size: 0.85rem; margin-bottom: 0.25rem; }
.entries.compact .entry ul { gap: 0.15rem; }
.entries.compact .entry ul li { font-size: 0.8rem; line-height: 1.55; }

.entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
}

.entry .time {
  font-size: 0.76rem;
  color: var(--faint);
  padding-top: 0.15rem;
}

.entry h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.entry h3 a { color: var(--text); }

.entry .muted {
  font-size: 0.76rem;
  color: var(--faint);
  margin-bottom: 0.4rem;
}

.entry p:not(.time):not(.muted) {
  font-size: 0.85rem;
  color: var(--muted);
}

.entry ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.entry ul li {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
}

.entry ul li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--faint);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.skill-row:last-child { border-bottom: none; padding-bottom: 0; }

.skill-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding-top: 0.1rem;
}

.skill-vals {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

/* GitHub heatmap */
.heatmap-wrap {
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--sheet);
  border: 1px solid var(--border);
  border-radius: 0;
}

.heatmap {
  display: block;
  width: 100%;
  height: auto;
}

/* Links / writing */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.links a { color: var(--text); width: fit-content; }
.links .muted { color: var(--faint); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--faint);
}

.footer .quote {
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 560px) {
  .page { padding: 2rem 1.1rem 3.5rem; }
  .sheet { gap: 2rem; }

  .topnav { gap: 1.1rem; font-size: 0.78rem; padding-bottom: 1.1rem; }

  .intro h1 { font-size: 1.4rem; }
  .subname { font-size: 0.86rem; }
  .summary { font-size: 0.84rem; max-width: 100%; }
  .quicklinks { font-size: 0.78rem; gap: 0.5rem 0.8rem; }

  .portrait { position: static; height: 96px; margin-top: 1rem; }

  .entry { grid-template-columns: 1fr; gap: 0.35rem; }
  .entry .time { padding-top: 0; }

  .skill-row { grid-template-columns: 1fr; gap: 0.3rem; }

  .heatmap-wrap { padding: 0.6rem; }

  .footer { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .footer .quote { order: -1; }
}

@media (max-width: 360px) {
  body { font-size: 13px; }
  .intro h1 { font-size: 1.25rem; }
}
