/* ── Computer Modern (KaTeX_Main) — local ── */
@font-face {
  font-family: 'CMU';
  src: url('KaTeX_Main-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'CMU';
  src: url('KaTeX_Main-Italic.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: 'CMU';
  src: url('KaTeX_Main-Bold.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'CMU';
  src: url('KaTeX_Main-BoldItalic.woff2') format('woff2');
  font-weight: bold;
  font-style: italic;
}

:root {
  --bg:      #f5f0e8;
  --ink:     #1a1a1a;
  --muted:   #666;
  --light:   #999;
  --rule:    1px solid #d4cdc3;
  --font:    'CMU', Georgia, serif;
  --nav-h:   58px;
  --max-w:   660px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  animation: pageIn 0.55s ease 0.04s forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Top navigation ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3em;
  background: var(--bg);
  border-bottom: var(--rule);
  z-index: 100;
}

.nav-home {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-home:hover { color: var(--muted); }

.nav-links {
  display: flex;
  gap: 2em;
  list-style: none;
}

.nav-links a {
  font-size: 0.87em;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--muted); }

.nav-links a.current {
  color: var(--muted);
  font-style: italic;
  pointer-events: none;
}

/* ── Home page ── */
.home-wrap {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: max(3em, calc(50vw - var(--max-w) / 2));
  padding-right: 2em;
}

.home-content {
  max-width: 520px;
}

.home-name {
  font-size: 1.75em;
  font-weight: normal;
  margin-bottom: 0.85em;
  line-height: 1.25;
}

.home-bio {
  font-size: 1em;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 1.4em;
}

.home-meta {
  font-size: 0.87em;
  color: var(--muted);
  font-style: italic;
}

/* ── Inner pages ── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3.5em) 2em 7em;
}

.page-title {
  font-weight: normal;
  font-size: 1.55em;
  margin-bottom: 2.5em;
}

/* ── Section headings ── */
.section-heading {
  font-size: 0.76em;
  font-weight: bold;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.5em;
  margin-bottom: 0;
  padding-bottom: 0.5em;
  border-bottom: var(--rule);
}

/* ── Job entries ── */
.job {
  padding: 1.4em 0;
  border-bottom: var(--rule);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3em;
}

.job-org {
  font-weight: bold;
  font-size: 0.95em;
}

.job-location {
  font-size: 0.84em;
  color: var(--muted);
  font-style: italic;
}

.job-role-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 0.15em;
  margin-bottom: 0.4em;
  gap: 0.3em;
}

.job-role {
  font-style: italic;
  font-size: 0.92em;
}

.job-dates {
  font-size: 0.84em;
  color: var(--muted);
  font-style: italic;
}

.job-desc {
  font-size: 0.91em;
  line-height: 1.72;
}

.job-desc ul {
  padding-left: 1.2em;
  margin-top: 0.2em;
}

.job-desc li { margin-bottom: 0.2em; }

/* ── Projects flat list ── */
.project-item {
  padding: 1.5em 0;
  border-bottom: var(--rule);
}

.project-item:first-child {
  border-top: var(--rule);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2em;
  margin-bottom: 0.5em;
}

.project-title {
  font-size: 0.95em;
  line-height: 1.45;
  color: var(--ink);
}

.project-link {
  flex-shrink: 0;
  color: var(--light);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
  margin-top: 1px;
}

.project-link:hover {
  color: var(--ink);
  transform: translate(1px, -1px);
}

.project-desc {
  font-size: 0.88em;
  line-height: 1.78;
  color: var(--muted);
  font-style: italic;
}

/* ── Currently section ── */
.currently {
  margin-top: 2.4em;
  padding-top: 1.6em;
  border-top: var(--rule);
}

.currently-label {
  font-size: 0.75em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85em;
}

.currently-items {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45em 1.4em;
  font-size: 0.88em;
}

.currently-key {
  color: var(--muted);
  font-style: italic;
}

.currently-val {
  color: var(--ink);
}

.currently-val a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.currently-val a:hover {
  color: var(--muted);
  text-decoration-color: var(--muted);
}

/* ── Animated music bars ── */
.music-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 11px;
  margin-right: 0.4em;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.music-bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--ink);
  transform-origin: bottom;
  animation: musicBar 1s ease-in-out infinite alternate;
}

.music-bars span:nth-child(1) { height: 5px;  animation-duration: 0.85s; }
.music-bars span:nth-child(2) { height: 11px; animation-duration: 1.1s;  animation-delay: 0.12s; }
.music-bars span:nth-child(3) { height: 7px;  animation-duration: 0.75s; animation-delay: 0.28s; }
.music-bars span:nth-child(4) { height: 9px;  animation-duration: 1.0s;  animation-delay: 0.05s; }

@keyframes musicBar {
  from { transform: scaleY(0.2); }
  to   { transform: scaleY(1); }
}

/* ── Socials page ── */
.socials-wrap {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2em;
  padding-right: 2em;
}

.socials-grid {
  display: flex;
  gap: 3.5em;
  flex-wrap: wrap;
  justify-content: center;
}

.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65em;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s, transform 0.22s;
}

.social-item:hover {
  color: var(--muted);
  transform: translateY(-4px);
}

.social-item svg {
  display: block;
}

.social-label {
  font-size: 0.75em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.social-item:hover .social-label {
  color: var(--light);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .site-nav { padding: 0 1.5em; }
  .nav-links { gap: 1.3em; }

  .home-wrap {
    padding-left: 1.5em;
    padding-right: 1.5em;
    align-items: flex-start;
    padding-top: calc(var(--nav-h) + 3em);
  }

  .page-wrap { padding-left: 1.5em; padding-right: 1.5em; }

  .job-header,
  .job-role-row { flex-direction: column; gap: 0.1em; }
}
