:root {
  --sidebar-width: 42%;
  --sidebar-max: 38rem;
  --paper: #ffffff;
  --paper-2: #f8f8f8;
  --ink: #3a3a3a;
  --heading: #333333;
  --muted: #999999;
  --line: #dddddd;
  --accent: #0054b2;
  --accent-hover: #004ca1;
  --pill-border: rgba(255, 255, 255, 0.95);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Nunito, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1em;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

a:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #111;
  padding: 0.5rem 0.75rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 2.625rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(40, 40, 40, 0.92);
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-width);
  max-width: var(--sidebar-max);
  background: #0b1020 url("assets/sidebar-bg.jpg") center / cover no-repeat;
  color: #fff;
  text-align: center;
}

.sidebar__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(12, 16, 32, 0.42) 15%, rgba(8, 10, 18, 0.28) 100%);
}

.sidebar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem 2.2rem;
}

.avatar {
  margin: 0 0 1rem;
}

.avatar img {
  width: 12.5rem;
  height: 12.5rem;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.3);
}

.sidebar__name {
  margin: 0 0 0.75rem;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.sidebar__name a {
  color: inherit;
  text-decoration: none;
}

.sidebar__tagline {
  margin: 0 0 1.1rem;
  max-width: 18rem;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: #cccccc;
  -webkit-font-smoothing: antialiased;
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.social a:hover {
  color: #fff;
  opacity: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 10.5rem;
  margin-top: 0.35rem;
}

.sidebar-nav a {
  display: block;
  width: 100%;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0.88;
  white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  opacity: 1;
  color: #fff;
  border-color: #fff;
}

.sidebar-nav-secondary {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 11rem;
  margin-top: 0.85rem;
}

.sidebar-nav-secondary a {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0.85;
}

.sidebar-nav-secondary a:hover,
.sidebar-nav-secondary a.is-active {
  opacity: 1;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
}

.content {
  margin-left: min(var(--sidebar-width), var(--sidebar-max));
  min-height: 100vh;
  background: var(--paper);
  font-family: Nunito, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.4em;
  color: var(--ink);
}

.content__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 3.15rem 4.5rem 2.8rem 3.5rem;
}

.page-section {
  padding: 0 0 2.4rem;
  margin: 0 0 2.4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.page-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.page-section h2 {
  margin: 0 0 0.85em;
  font-family: "Marcellus SC", serif;
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.2em;
  color: var(--heading);
  -webkit-font-smoothing: antialiased;
}

.page-section h3 {
  margin: 1.2em 0 0.45em;
  font-family: "Marcellus SC", serif;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--heading);
}

.prose p {
  margin: 0 0 1.3em;
  max-width: none;
  line-height: 1.7em;
}

.prose ul {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
}

.prose li {
  margin: 0 0 0.3rem;
}

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

.timeline {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.9rem;
  margin: 0 0 0.55em;
  line-height: 1.7em;
}

.timeline span {
  color: var(--muted);
}

.news {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news li {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 0.9rem;
  margin: 0 0 1em;
  align-items: baseline;
  line-height: 1.7em;
}

.news li:last-child {
  margin-bottom: 0;
}

.news span {
  color: var(--muted);
  font-size: 0.92em;
}

.news p {
  margin: 0;
  max-width: none;
}

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pubs li {
  padding: 0 0 1.35rem;
  margin: 0 0 1.35rem;
  border-bottom: 1px solid var(--line);
}

.pubs li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.pubs .authors,
.pubs .title,
.pubs .venue,
.pubs .links {
  margin: 0 0 0.2rem;
}

.pubs .title {
  font-family: Nunito, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.4;
  color: var(--heading);
}

.pubs .venue {
  color: #5a5a5a;
  font-size: 0.96rem;
}

.pubs .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.92rem;
}

.code-timeline {
  position: relative;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.code-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4.7rem;
  width: 2px;
  background: #f1f1f1;
}

.code-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 9.4rem minmax(0, 1fr);
  gap: 1.6rem 2rem;
  align-items: center;
  min-height: 9.4rem;
  margin: 0 0 2.4rem;
}

.code-timeline li:last-child {
  margin-bottom: 0;
}

.code-timeline__image {
  position: relative;
  z-index: 1;
  width: 9.4rem;
  height: 9.4rem;
}

.code-timeline__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  border: 7px solid #f1f1f1;
  border-radius: 50%;
}

.code-timeline__panel h3 {
  margin: 0 0 0.35em;
}

.code-timeline__panel h3 a {
  text-decoration: none;
}

.code-timeline__panel h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.code-timeline__panel p {
  margin: 0;
  line-height: 1.7em;
}

.contact-block p {
  margin: 0 0 0.85rem;
  max-width: 42rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.95rem;
  width: min(100%, 28rem);
  margin-top: 1.5rem;
}

.contact-form .field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
}

.contact-form label {
  display: block;
  font-size: 1.05em;
  font-weight: 600;
  color: var(--heading);
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 2px solid #555555;
  border-radius: 4px;
  background: #fff;
  color: var(--heading);
  font: inherit;
  font-size: 1em;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--heading);
}

.contact-form textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-form button {
  align-self: flex-start;
  padding: 0.55rem 1.2rem;
  border: 2px solid #b9301c;
  border-radius: 999px;
  background: transparent;
  color: #b9301c;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1em;
  cursor: pointer;
}

.contact-form button:hover {
  color: #b9301c;
  border-color: #b9301c;
}

.contact-form .honey {
  display: none;
}

.site-footer {
  padding: 2rem 0 0;
  margin-top: 1rem;
  border-top: 2px solid var(--line);
  color: #b3b3b3;
  font-size: 0.7rem;
}

.site-footer p {
  margin: 0;
}

@media (min-width: 90.5rem) {
  .content {
    margin-left: var(--sidebar-max);
  }
}

@media (max-width: 60rem) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    width: 100%;
    max-width: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .sidebar--open {
    max-height: 100vh;
    overflow-y: auto;
  }

  .sidebar__inner {
    min-height: auto;
    padding: 3.5rem 1.5rem 2rem;
  }

  .content {
    margin-left: 0;
    padding-top: 2.625rem;
  }

  .content__inner {
    padding-inline: 1.25rem;
  }
}

@media (max-width: 45rem) {
  .timeline li,
  .news li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .code-timeline::before {
    left: 3.55rem;
  }

  .code-timeline li {
    grid-template-columns: 7.1rem minmax(0, 1fr);
    gap: 1rem 1.2rem;
    min-height: 7.1rem;
    margin-bottom: 1.8rem;
  }

  .code-timeline__image {
    width: 7.1rem;
    height: 7.1rem;
  }

  .code-timeline__image img {
    border-width: 5px;
  }

  .avatar img {
    width: 9.5rem;
    height: 9.5rem;
  }
}
