body {
    margin: 0;
    padding: 20px;
    background: #F2F0EF;
    color: #000;
    font-family: Consolas, "Consolas", monospace;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 800px;
    width: 100%;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 30px;
    line-height: 1.35;
    background: #F2F0EF;
}

/* Intro */
.intro {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
}

.intro-item.image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid #000;
    border-radius: 8px;
    display: block;
}

.intro-item.text {
    flex: 1;
}

/* Headings */
h1, h2 {
    margin: 0 0 10px 0;
    font-weight: normal;
}

p {
    margin: 10px 0;
}

a {
    color: #000;
    text-decoration: underline;
}

a:hover {
    opacity: 0.7;
}

/* Navigation */
.nav {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #F2F0EF;

    margin-left: -30px;
    margin-right: -30px;
    padding: 0px 30px;
}

.nav.stuck {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    background: repeating-linear-gradient(
        45deg,
        #000 0px,
        #000 1px,
        transparent 1px,
        transparent 8px
    );
    opacity: 0.15;
}

.nav a {
    display: inline-block;
    padding: 5px 14px;
    text-decoration: none;
    color: #fff;
    background: #000;
}

.nav a.active {
    background: #F2F0EF;
    color: #000;
}

.nav a:hover {
    background: #fff;
    color: #000;
    text-decoration: underline;
}

/* Sections */
.section {
    margin-top: 50px;
    scroll-margin-top: 50px;
}

.section h2 {
    font-weight: bold;
}

.section h2::after {
    content: "";
    display: block;
    border-bottom: 2px solid #000;
    margin-top: 10px;

    margin-left: 0px;
    margin-right: 0px;
}

/* Timed Events */
.timed.event {
    display: grid;
    grid-template-columns: 20% 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
    font-size: 14px;
}

.timed.event .time {
    font-size: 16px;
    color: #666;
    font-weight: 600;
    font-style: italic;
    text-align: right;
}

.timed.event p {
    color: #333;
    margin: 6px 0;
}

.timed.event strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

.timed.event:not(:last-child) {
    border-bottom: 2px solid #ccc;
    padding-bottom: 15px;
}

/* About */
.about-img {
    float: right;
    max-width: 250px;
    margin: 0 0 10px 20px;
    border: 1px solid #000;
    border-radius: 6px;
}

#about p {
    margin-top: 15px;
    text-align: justify;
}

/* Publications */
.publication {
    padding: 20px 0;
    border-bottom: 2px solid #ddd;
}

.pub-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.pub-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    font-weight: bold;
}

.pub-desc {
    font-size: 14px;
    color: #333;
    line-height: 1.35;
    margin-bottom: 6px;
}

.pub-link {
    font-size: 12px;
    text-decoration: underline;
    color: #000;
}

.publication:last-child {
    border-bottom: none;
}

/* Projects */
.project {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 2px solid #ccc;
    align-items: flex-start;
}

.project:last-child {
    border-bottom: none;
}

.proj-img {
    width: 25%;
    border: 1px solid #000;
    border-radius: 6px;
    flex-shrink: 0;
}

.proj-content {
    display: flex;
    flex-direction: column;
}

.proj-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.proj-desc {
    font-size: 14px;
    color: #333;
    line-height: 1.35;
}

.proj-link {
    margin-top: 6px;
    font-size: 12px;
    text-decoration: underline;
    color: #000;
}

/* Contact */
.contact-item {
    display: grid;
    grid-template-columns: 20% 1fr;
    gap: 15px;
    padding-top: 10px;
    align-items: center;
}

.contact-item .label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-align: right;
}

.contact-item .value {
    font-size: 14px;
    color: #000;
}

.contact-item a:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {

  /* Container */
  .container {
    max-width: 100%;
    padding: 20px;
    padding-top: 15vw;
    border-radius: 0;
    border: none;
  }

  /* Intro section → stack */
  .intro {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .intro-item.text {
    text-align: center;
  }

  .intro-item.image img {
    width: 60vw;
    height: 60vw;
    object-fit: cover;
    border-radius: 50%;  /* makes it a circle */
    display: block;
    margin: 0 auto;      /* center it */
    border: 2px solid #000;
  }

  /* Navigation */
  .nav {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  /* Sections spacing */
  .section {
    margin-top: 25px;
  }

  /* Education → stack */
  .timed.event {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .timed.event .time {
    text-align: left;
    font-size: 14px;
  }

  /* About image → remove float */
  .about-img {
    float: none;              /* IMPORTANT: reset float */
    display: block;
    max-width: 90%;          /* let it scale with screen */
    height: auto;
    margin: 10px auto;        /* center it */
  }

  #about p {
    margin-top: 15px;
    text-align: justify;
  }

  /* Publications */
  .publication {
    padding: 15px 0;
  }

  .pub-title {
    font-size: 15px;
  }

  .pub-meta,
  .pub-link {
    font-size: 12px;
  }

  .pub-desc {
    font-size: 13px;
  }

  /* Projects → stack layout */
  .project {
    flex-direction: column;
    gap: 12px;
    padding: 15px 0;
  }

  .proj-img {
    width: 70%;
    height: auto;
    align-self: center;
  }

  .proj-title {
    font-size: 15px;
  }

  .proj-desc {
    font-size: 13px;
  }

  .proj-link {
    font-size: 12px;
  }

  /* Contact → stack */
  .contact-item {
    grid-template-columns: 1fr;
    gap: 0px;
  }

  .contact-item .label {
    text-align: left;
    font-size: 12px;
  }

  .contact-item .value {
    font-size: 14px;
  }
}