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

:root {
  --paper: #fbfaf4;
  --dot: #e3ddc9;
  --card: #fffef9;
  --card-border: #e0dac4;
  --ink: #2b211a;
  --body: #3d3527;
  --muted: #8a7a5e;
  --terra: #a9603a;
  --terra-dark: #993c1d;
  --teal: #0f6e56;
  --teal-bright: #1d9e75;
  --highlight: #f7e9a0;
  --pill-bg: #faece7;
  --pill-ink: #712b13;
  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

html {
  background: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

body {
  font-family: var(--sans);
  color: var(--body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

main { flex: 1; }

h1, h2, h3 { font-family: var(--mono); color: var(--ink); line-height: 1.3; margin: 1.75rem 0 0.75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
h1::before { content: '# '; color: var(--terra); }
h2::before { content: '## '; color: var(--terra); }
h3::before { content: '### '; color: var(--terra); }

p, ul, ol { margin-bottom: 1rem; }
ul, ol { padding-left: 1.4rem; }

a { color: var(--terra); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terra-dark); }

a.wikilink, span.wikilink {
  font-family: inherit;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal);
}
a.wikilink:hover { color: var(--teal-bright); border-bottom-style: solid; }
span.wikilink.broken { color: var(--muted); border-bottom-color: var(--muted); }

mark { background: var(--highlight); padding: 0 3px; color: var(--ink); }

.sidenote-num {
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--terra);
  vertical-align: super;
  line-height: 0;
}
.sidenote {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--muted);
}
.sidenote-tag {
  color: var(--terra);
  font-weight: 500;
  margin-right: 0.15em;
}

@media (min-width: 1100px) {
  .note .sidenote {
    float: right;
    clear: right;
    width: 11rem;
    margin-right: -13rem;
    margin-top: 0.2em;
    line-height: 1.5;
  }
}

.note-figure { margin: 1.5rem 0; }
.note-figure img {
  display: block;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--card-border);
}
.note-figure figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 3px;
  padding: 1px 5px;
}
pre { background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
pre code { border: none; background: none; padding: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--card-border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--mono);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}
.prompt { color: var(--ink); font-weight: 700; text-decoration: none; }
.prompt .dollar { color: var(--muted); }
.folders { display: flex; gap: 1rem; font-size: 0.9rem; }
.folders a { color: var(--muted); text-decoration: none; }
.folders a:hover { color: var(--teal); }
.folders a.here { color: var(--terra); }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px dashed var(--card-border);
  padding-top: 1rem;
  margin-top: 3rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--terra); }
#sound-toggle {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 1px dashed var(--muted);
  cursor: pointer;
  padding: 0;
}
#sound-toggle:hover { color: var(--terra); border-bottom-color: var(--terra); }

.typed-line { font-family: var(--mono); font-size: 1.3rem; color: var(--ink); margin: 0.5rem 0 0.25rem; min-height: 1.8em; }
.typed-line .tilde { color: var(--teal-bright); }
[data-typed].typing::after, #typed.typing::after { content: '▊'; color: var(--terra); animation: blink 1.1s steps(1) infinite; }
body.typed-done #typed::after { content: '▊'; color: var(--terra); animation: blink 1.1s steps(1) infinite; }
h1[data-typed] { min-height: 1.3em; }
@keyframes blink { 50% { opacity: 0; } }
.ls-output { font-family: var(--mono); font-size: 0.95rem; margin-bottom: 1.5rem; }
.ls-output a { color: var(--teal); text-decoration: none; margin-right: 1.25rem; }
.ls-output a:hover { color: var(--teal-bright); text-decoration: underline; }
.js .ls-output { opacity: 0; transition: opacity 0.5s ease; }
.js body.typed-done .ls-output, html.js body.typed-done .ls-output { opacity: 1; }

.intro { font-size: 1.05rem; }
.intro em { font-style: italic; color: var(--terra); }

.note-meta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-bottom: -0.5rem; }
.note h1 { margin-top: 0.5rem; }

.backlinks {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px dashed var(--card-border);
  padding-top: 0.75rem;
  margin-top: 2.5rem;
}
.backlinks a.wikilink { margin-right: 0.6rem; }
.backlinks a.wikilink::before { content: '[['; }
.backlinks a.wikilink::after { content: ']]'; }

.post-list { list-style: none; padding: 0; }
.post-list li { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 0.4rem; }
.post-list .date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.post-list a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--card-border); }
.post-list a:hover { color: var(--terra); border-bottom-color: var(--terra); }

.meta-card { padding: 0.75rem 1rem; }
.meta-table { font-size: 0.88rem; border-collapse: collapse; }
.meta-table td { padding: 2px 0; vertical-align: top; }
.meta-table td:first-child { font-family: var(--mono); color: var(--terra); padding-right: 1.25rem; white-space: nowrap; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.pill {
  background: var(--pill-bg);
  color: var(--pill-ink);
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.resume-header { border-bottom: 3px solid var(--terra); padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
.resume-header .role { font-family: var(--mono); color: var(--terra); font-size: 0.95rem; }
.resume-contact { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.resume-contact a { color: var(--muted); }
.resume-grid { display: grid; grid-template-columns: 1.85fr 1fr; gap: 2rem; }
.resume-grid h2 { font-size: 0.95rem; margin-top: 1.25rem; }
.resume-grid h2:first-child { margin-top: 0; }
.job { margin-bottom: 1rem; }
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.job-head .company { font-weight: 600; color: var(--ink); }
.job-head .dates { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.job-title { font-size: 0.85rem; color: var(--terra); font-weight: 500; }
.job ul { margin: 0.25rem 0 0; font-size: 0.9rem; }
.job li { margin-bottom: 2px; }
.rail-text { font-size: 0.9rem; }
.edu .degree { font-weight: 600; color: var(--ink); }
.edu .school { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 640px) {
  .resume-grid { grid-template-columns: 1fr; }
  .typed-line { font-size: 1.1rem; }
}

@media print {
  html { background: #fff; }
  body { max-width: none; padding: 0.25in 0.4in; font-size: 10pt; }
  .site-header, .site-footer, .print-hint { display: none; }
  .note h1, h1::before { margin-top: 0; }
  .resume-grid { grid-template-columns: 1.85fr 1fr; gap: 1.5rem; }
  .card { box-shadow: none; }
  a { text-decoration: none; color: inherit; }
}
