/* reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* palette */
:root {
  --bg: #fafafa;
  --text: #111;
  --text-soft: #555;
  --text-muted: #888;
  --border: #e0e0e0;
}

/* base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* header */
header {
  padding: 4rem 0 2rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.tagline {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* main */
main {
  flex: 1;
  padding: 2rem 0;
}

/* projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project h2 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.project h2 a {
  color: var(--text);
}

.project p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}

.project-links {
  display: flex;
  gap: 1.2rem;
  font-size: 0.84rem;
}

.project-links a {
  color: var(--text-muted);
}

/* challenge intro */
.challenge-intro {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
}

/* challenge */
.challenge {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.challenge-card {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.challenge-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.challenge-card-header {
  margin-bottom: 0.5rem;
}

.number-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-family: 'Lora', Georgia, serif;
}

.challenge-card-header h2 {
  font-size: 1.15rem;
  font-weight: 500;
}

.challenge-card-header h2 a {
  color: var(--text);
}

.problem {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.build-hook {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.challenge-card-meta {
  display: flex;
  gap: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.coming-soon {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.section-heading {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
}

/* links */
a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.6;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* footer */
footer {
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}

footer a {
  color: var(--text-muted);
}

/* project detail */
.detail h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.detail .subtitle {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* prose */
.prose p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.detail .subtitle a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* timeline */
.timeline-wrapper {
  position: relative;
  display: flex;
  gap: 3rem;
}

.timeline-nav {
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 28px;
  padding-top: 0.35rem;
}

.timeline-nav span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: all 0.25s ease;
  border: 1.5px solid transparent;
}

.timeline-nav span.active {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg);
}

.timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.milestone {
  position: relative;
  padding: 0 0 3rem 2rem;
  border-left: 1.5px solid var(--border);
}

.milestone:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.milestone::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--text-muted);
}

.milestone-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.milestone h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.milestone p {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.milestone a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* how it's built */
.how-built {
  margin-top: 0.8rem;
  padding: 1rem 1.2rem;
  background: #f0f0f0;
  border-left: 2px solid var(--text-muted);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.how-built strong {
  font-weight: 500;
  color: var(--text);
}

/* responsive */
@media (max-width: 768px) {
  header {
    padding: 3rem 0 1.5rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 1.5rem;
  }

  .projects {
    gap: 1.2rem;
  }

  .timeline-wrapper {
    gap: 0;
  }

  .timeline-nav {
    display: none;
  }

  .milestone {
    padding-bottom: 2.5rem;
  }

  .challenge {
    gap: 2rem;
  }

  .challenge-card {
    padding-bottom: 2rem;
  }

  .challenge-card-meta {
    flex-wrap: wrap;
  }
}
