:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --rule: #e2e2e2;
  --red: #b3121f;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Lora", Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  position: relative;
}

a { color: var(--red); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
a:hover { border-bottom-color: var(--red); }

h1, h2, h3, .logo { font-family: "Playfair Display", Georgia, serif; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--rule);
}
.logo { color: var(--text); font-weight: 700; font-size: 1.1rem; }
.logo:hover { border-bottom-color: transparent; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); border-bottom-color: var(--text); }

main { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { text-align: center; padding: 96px 0 72px; border-bottom: 1px solid var(--rule); }
.portrait {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d6d6d6;
  padding: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  animation: bob 3.5s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.kicker { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; }
h1 { font-size: clamp(2.6rem, 8vw, 4.4rem); line-height: 1.1; margin-bottom: 20px; }
.lead { color: var(--muted); max-width: 560px; margin: 0 auto 22px; font-size: 1.1rem; }
.award { display: inline-block; font-style: italic; color: var(--red); border-top: 1px solid var(--red); border-bottom: 1px solid var(--red); padding: 4px 14px; margin-bottom: 22px; }
.links { display: flex; justify-content: center; gap: 12px; color: var(--muted); }

/* Sections */
section { padding: 56px 0 8px; scroll-margin-top: 70px; }
h2 {
  font-size: 1.9rem;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.entry { margin-bottom: 36px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h3 { font-size: 1.3rem; }
.date { color: var(--muted); font-style: italic; font-size: 0.95rem; white-space: nowrap; }
.org { color: var(--muted); font-style: italic; margin-bottom: 4px; }
.entry ul { margin: 10px 0 0 22px; }
.entry li { margin-bottom: 4px; }
.meta { margin-top: 10px; color: var(--muted); font-size: 0.95rem; }
.demo {
  font-style: normal;
  font-weight: 500;
  border: 1px solid var(--red);
  border-radius: 2px;
  padding: 1px 8px;
  white-space: nowrap;
}
.demo:hover { background: var(--red); color: #fff; border-bottom-color: var(--red); }
.wip {
  font-style: italic;
  color: var(--muted);
  border: 1px dashed #b5b5b5;
  border-radius: 2px;
  padding: 1px 8px;
  white-space: nowrap;
}
.tag-award {
  font-family: "Lora", serif;
  font-size: 0.75rem;
  font-weight: 400;
  font-style: italic;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 2px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
#skills p { margin-bottom: 8px; }

/* Project thumbnails */
.project { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.project:last-child { border-bottom: none; }
.thumb { display: block; border: 1px solid #d6d6d6; padding: 6px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); transition: transform 0.25s, box-shadow 0.25s; }
.thumb:hover { border-bottom-color: #d6d6d6; transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1); }
.thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

footer { text-align: center; padding: 72px 24px 48px; color: var(--muted); border-top: 1px solid var(--rule); max-width: 820px; margin: 48px auto 0; position: relative; z-index: 1; }
.small { font-size: 0.85rem; margin-top: 6px; }

/* Soft light following the mouse */
#glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.22) 0%, rgba(179, 18, 31, 0.06) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s;
}
#glow.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portrait { animation: none; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .nav { padding: 14px 16px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }
  main { padding: 0 16px; }
  .hero { padding: 64px 0 48px; }
  .date { white-space: normal; }
  .project { grid-template-columns: 1fr; gap: 16px; }
}
