/* Modern, clean design for computational biology blog */

:root {
  --primary: #4AE854;
  --primary-dark: #3DB743;
  --link: #57B8FF;
  --link-hover: #3DA0E8;
  --text: #F5E6D3;
  --text-light: #D4C5B2;
  --bg: #8A7D68;
  --bg-secondary: #3a3530;
  --border: #5A9E3F;
  --accent: #4AE854;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  font-size: 1.2rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.76rem; }
h3 { font-size: 1.32rem; }

a {
  color: var(--link);
  text-decoration: underline;
  transition: color 0.2s;
}

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

/* Layout */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.6rem;
}

/* Header */
body > header {
  padding: 1.6rem 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  position: relative;
}

body > header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1040px;
  height: 35px;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='35' viewBox='0 -8 200 35' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 12 Q 25 0 50 12 T 100 12 T 150 12 T 200 12' stroke='%235A9E3F' stroke-width='16' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 1.6rem center;
}

body > header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 4.99rem;
  font-weight: 700;
  color: #FF7A5A;
  text-decoration: none;
}

nav a {
  margin-left: 1.6rem;
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  font-size: 1.2rem;
}

nav a:hover {
  color: var(--link-hover);
}

/* Hero section */
.hero {
  padding: 2.4rem 0 1.6rem;
}

.hero-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.6rem;
}

.profile-photo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 10px solid var(--border);
  flex-shrink: 0;
}

.bio-text {
  flex: 1;
}

.bio-text p {
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Post sections */
.posts-section {
  padding: 1.6rem 0;
}

.section-title {
  margin-bottom: 1.6rem;
  color: var(--primary);
  font-size: 1.86rem;
}

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

.post-item {
  margin-bottom: 0.4rem;
}

.post-item a {
  color: var(--link);
  font-size: 1.2rem;
  text-decoration: underline;
  display: inline-block;
  transition: color 0.2s;
}

.post-item a:hover {
  color: var(--link-hover);
}

/* Single post page */
.post-header {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.4rem 1.6rem 0;
}

.post-header h1 {
  margin-bottom: 0.4rem;
  color: var(--primary);
  font-size: 2.86rem;
}

.post-date {
  text-align: left;
  color: var(--text-light);
  margin-bottom: 0.8rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 600px;
  margin-bottom: 3rem;
}

.tag {
  position: relative;
  display: inline-block;
  padding: 0.15rem 0.5rem 0.15rem 0.7rem;
  font-size: 0.7rem;
  color: var(--primary);
  border: 3px solid var(--primary);
  border-left: none;
  text-decoration: none;
  margin-left: 0.5rem;
}

.tag::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 0;
  width: 0;
  height: 0;
  border-top: 0.75rem solid transparent;
  border-bottom: 0.75rem solid transparent;
  border-right: 0.5rem solid var(--primary);
}

.tag::after {
  content: '';
  position: absolute;
  left: -0.38rem;
  top: 0.12rem;
  width: 0;
  height: 0;
  border-top: 0.55rem solid transparent;
  border-bottom: 0.55rem solid transparent;
  border-right: 0.38rem solid var(--bg);
}

.tag:hover {
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.tag:hover::before {
  border-right-color: var(--primary-dark);
}

.post-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.6rem 2.4rem;
  font-size: 1.2rem;
  line-height: 1.8;
}

.post-content h1 {
  margin-top: 4.5rem;
  margin-bottom: 0.8rem;
}

.post-content h2 {
  margin-top: 3.5rem;
  margin-bottom: 0.8rem;
}

.post-content h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  color: var(--primary);
}

.post-content p {
  margin-bottom: 2rem;
}

.post-content code {
  background: var(--bg-secondary);
  padding: 0.16rem 0.32rem;
  border-radius: 2px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Courier New', monospace;
}

.post-content pre {
  background: var(--bg-secondary);
  padding: 1.2rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content ul, .post-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.6rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

/* Contact Form */
form {
  max-width: 600px;
}

form p {
  margin-bottom: 1.5rem;
}

form label {
  display: block;
  color: var(--text);
  margin-bottom: 0.4rem;
}

form input[type="text"],
form input[type="email"],
form textarea {
  width: 100%;
  padding: 0.8rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  border-radius: 4px;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

form textarea {
  resize: vertical;
  min-height: 150px;
}

form button {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

form button:hover {
  background: var(--primary-dark);
}

.hidden {
  display: none;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  padding: 2.4rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }

  .container {
    padding: 0 0.8rem;
  }

  header .container {
    flex-direction: column;
    gap: 0.8rem;
  }

  nav {
    display: flex;
    gap: 0.8rem;
  }

  nav a {
    margin-left: 0;
  }

  .hero {
    padding: 1.6rem 0;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-photo {
    width: 80px;
    height: 80px;
  }

  .posts-section {
    padding: 1.2rem 0;
  }
}
