/* ---------- Fonts (loaded via <link> in HTML for non-blocking parallel fetch) ---------- */

/* ---------- Theme: earthy parchment (multi-tone) ---------- */
:root {
  --bg: #f4ecdc;
  --bg-soft: #ebe0c9;
  --bg-card: rgba(255, 252, 244, 0.6);
  --border: rgba(74, 56, 38, 0.14);
  --text: #2d2418;
  --text-dim: #6b5a47;

  /* earth palette */
  --sienna:    #a0522d;
  --sage:      #6b8e4e;
  --ochre:     #c08a3a;
  --rust:      #b0492a;
  --moss:      #4a6b3c;
  --mustard:   #d4a534;
  --clay:      #c46f3f;
  --forest:    #3d5a3c;
  --rose:      #b8694e;
  --indigo:    #4a5a78;
  --saffron:   #d49a3a;
  --plum:      #6e3b4e;

  --accent: var(--sienna);
  --accent-2: var(--sage);
  --accent-3: var(--ochre);
  --glow: 0 8px 30px rgba(160, 82, 45, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 14px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typewriter accent font for big display elements */
.tw { font-family: 'Special Elite', 'JetBrains Mono', monospace; }

/* ---------- Top nav ---------- */
.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 36px;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  font-family: 'Special Elite', 'JetBrains Mono', monospace;
  font-size: 17px;
}
.topnav a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 2px;
  position: relative;
  transition: color 0.2s ease;
}
.topnav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.topnav a:hover { color: var(--rust); }
.topnav a:hover::after { transform: scaleX(1); }
.topnav a.active { color: var(--rust); }
.topnav a.active::after { transform: scaleX(1); }

/* ---------- Animated background ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
/* Static earthy gradient backdrop — far cheaper than 5 blurred animated orbs */
.bg-orbs {
  background:
    radial-gradient(60% 50% at 12% 8%,   rgba(176, 73, 42, 0.18) 0%, transparent 60%),
    radial-gradient(55% 45% at 92% 28%,  rgba(107, 142, 78, 0.16) 0%, transparent 65%),
    radial-gradient(50% 40% at 30% 58%,  rgba(192, 138, 58, 0.14) 0%, transparent 65%),
    radial-gradient(55% 45% at 88% 92%,  rgba(74, 90, 120, 0.14) 0%, transparent 65%),
    radial-gradient(45% 40% at 6% 90%,   rgba(110, 59, 78, 0.12) 0%, transparent 65%);
}
.orb { display: none; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.08); }
  66%      { transform: translate(-40px, 60px) scale(0.95); }
}

/* ---------- Layout ---------- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 28px 80px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 48px;
  align-items: center;
  padding: 30px 0 50px;
  animation: fadeUp 0.8s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.name {
  font-family: 'American Typewriter', 'Cutive', 'Special Elite', 'Courier New', serif;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg,
    var(--rust) 0%,
    var(--clay) 20%,
    var(--ochre) 40%,
    var(--mustard) 55%,
    var(--sage) 75%,
    var(--moss) 90%,
    var(--indigo) 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  margin-bottom: 8px;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.tagline {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-2);
  font-size: 13px;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.bio {
  color: var(--text-dim);
  margin-bottom: 22px;
}

.bio a, p a { color: var(--accent-2); text-decoration: none; border-bottom: 1px dashed transparent; transition: border-color 0.2s; }
.bio a:hover, p a:hover { border-bottom-color: var(--accent-2); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.links a {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-card);
  transition: all 0.25s ease;
  text-decoration: none;
}
.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.avatar-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--rust), var(--clay), var(--ochre), var(--mustard),
    var(--sage), var(--moss), var(--forest), var(--indigo),
    var(--plum), var(--rose), var(--rust));
  animation: spin 8s linear infinite;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  z-index: 1;
  transition: transform 0.4s ease;
}
.avatar:hover { transform: scale(1.04); }

/* ---------- Sections ---------- */
section { margin-top: 56px; }

.section-title {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.research-blurb {
  color: var(--text-dim);
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);

}

/* ---------- Publication cards ---------- */
.pub {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  padding: 22px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);

  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}
.pub.visible { opacity: 1; transform: translateY(0); }

/* Each card gets its own earth-tone accent via --c */
.pub                    { --c: var(--sienna); }
.pub:nth-of-type(1)     { --c: var(--rust); }
.pub:nth-of-type(2)     { --c: var(--sage); }
.pub:nth-of-type(3)     { --c: var(--ochre); }
.pub:nth-of-type(4)     { --c: var(--clay); }
.pub:nth-of-type(5)     { --c: var(--moss); }
.pub:nth-of-type(6)     { --c: var(--rose); }
.pub:nth-of-type(7)     { --c: var(--indigo); }
.pub:nth-of-type(8)     { --c: var(--mustard); }
.pub:nth-of-type(9)     { --c: var(--plum); }

.pub::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c);
  opacity: 0.7;
}
.pub { position: relative; }

.pub:hover {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--c) 22%, transparent);
}
.pub:hover .pub-title { color: var(--c); }
.pub .pub-venue { color: var(--c); }
.pub .pub-tag { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.pub .pub-actions a:hover { color: var(--c); border-bottom-color: var(--c); }

.pub.featured {
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--c) 9%, transparent),
    color-mix(in srgb, var(--ochre) 5%, transparent));
}
.pub-tag {
  display: inline-block;
  padding: 3px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  background: rgba(160, 82, 45, 0.14);
  color: var(--accent);
  margin-bottom: 8px;
}

.pub-thumb {
  width: 140px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.pub:hover .pub-thumb img { transform: scale(1.08); }

.pub-thumb.placeholder {
  background: linear-gradient(135deg, rgba(160, 82, 45, 0.16), rgba(107, 142, 78, 0.12));
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 8px;
}

.pub-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  transition: color 0.2s;
}
.pub-title a { color: inherit; text-decoration: none; }

.pub-authors { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-style: italic; font-size: 13px; margin-bottom: 8px; }
.pub-actions { display: flex; gap: 14px; margin-bottom: 8px; font-size: 12px; }
.pub-actions a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}
.pub-desc { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

/* ---------- Blog ---------- */
.blog-header {
  padding: 28px 0 42px;
  text-align: center;
  animation: fadeUp 0.8s ease-out;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 36px;
}
.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}
.blog-title {
  font-family: 'American Typewriter', 'Cutive', 'Special Elite', serif;
  font-size: 54px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  margin: 0 auto 18px;
  max-width: 600px;
}
.blog-title em {
  font-style: italic;
  color: var(--rust);
  font-weight: 400;
}
.rule {
  font-family: 'Special Elite', 'Courier New', monospace;
  color: var(--text-dim);
  letter-spacing: 0.6em;
  margin: 18px 0 24px;
  opacity: 0.7;
}
.blog-intro {
  font-family: 'Cutive', 'American Typewriter', serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto;
}
.hl {
  background: linear-gradient(180deg, transparent 60%, color-mix(in srgb, var(--ochre) 38%, transparent) 60%);
  color: var(--text);
  padding: 0 2px;
}
.tw-cursor::after {
  content: '▍';
  display: inline-block;
  margin-left: 3px;
  color: var(--rust);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.post-stamp {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--c);
  opacity: 0.55;
  border: 1px solid currentColor;
  padding: 2px 8px;
  border-radius: 2px;
  transform: rotate(2deg);
}
.footer-mark {
  font-family: 'Cutive', serif;
  color: var(--text-dim);
  letter-spacing: 0.4em;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 8px;
  opacity: 0.6;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.post-card {
  --c: var(--sienna);
  position: relative;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);

  transition: all 0.3s ease;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c);
  opacity: 0.75;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--c) 22%, transparent);
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-dim);
}
.post-date {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.post-title {
  font-family: 'Special Elite', 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 10px;
  line-height: 1.25;
}
.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.post-card:hover .post-title a { color: var(--c); }

.post-excerpt {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.65;
}

.read-more {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--c);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}
.read-more:hover { border-bottom-color: var(--c); }

/* ---------- Footer ---------- */
footer {
  margin-top: 80px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .avatar-wrap { width: 160px; height: 160px; margin: 0 auto; }
  .links { justify-content: center; }
  .pub { grid-template-columns: 1fr; }
  .pub-thumb { width: 100%; height: 140px; }
  .name { font-size: 34px; }
}
