body {
  animation: fadeInOpacity 0.8s ease-out forwards;
}

.landing-page {
  animation: none;
}

.article-container h1,
.article-container h2,
.article-container h3 {
  font-family: var(--font-heading);
  line-height: 1.3;
  margin: 2rem 0 1rem;
}

.article-container p {
  margin: 1.2rem 0;
  font-size: var(--font-size-body);
  font-family: var(--font-body);
}

.article-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 8px;
}
.volunteering p {
  margin-bottom: 1em;
}

.volunteering {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 2rem;
  row-gap: 0.5rem;
}

@media (max-width: 768px) {
  .volunteering {
    grid-template-columns: 1fr;
  }
}

.skills-section {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.skills-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-tag {
  background-color: #f2f4f7;
  color: #222;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.skill-tag:hover {
  background-color: #e4e7ec;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
  .skills-section {
    margin: 2rem 1rem;
  }
  .skill-tag {
    font-size: 0.9rem;
  }
}

/* Blog Posts List */
.posts-section {
  max-width: var(--max-content-width);
  margin: 1rem auto;
}
.posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Individual Post Item */
.posts-list li {
  margin-bottom: 1.8rem;
}

.posts-list a {
  text-decoration: none;
}

.post-title {
  font-size: var(--font-size-post-title);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.25;
}

.post-link:hover .post-title {
  text-decoration: underline;
}

/* Timeline (text only with large faint year) */
.timeline {
  max-width: 700px;
  margin: 4rem auto;
  padding: 0 2rem;
  position: relative;
  font-family: var(--font-body);
}

.timeline-entry {
  position: relative;
  margin: 5rem 0;
}

.timeline-entry::before {
  content: attr(data-year);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--font-size-timeline-year);
  color: rgba(0, 0, 0, 0.04);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
  z-index: 0;
}

.timeline-content {
  position: relative;
  z-index: 1;
}

.timeline-content h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-timeline-heading);
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.timeline-content p {
  font-size: var(--font-size-timeline-text);
  line-height: 1.6;
  margin: 0;
  color: var(--color-text);
}

/* Mobile timeline scaling */
@media (max-width: 700px) {
  .timeline-entry {
    margin: 3rem 0;
  }

  .timeline-entry::before {
    font-size: var(--font-size-timeline-year-mobile);
    color: rgba(0, 0, 0, 0.05);
  }

  .timeline-content h3 {
    font-size: var(--font-size-timeline-heading-mobile);
  }

  .timeline-content p {
    font-size: var(--font-size-timeline-text-mobile);
  }
}

.typed-name {
  position: relative;
  display: inline-block;
  max-width: 100%;
  white-space: pre-line;
  word-break: normal;
  min-height: calc(var(--font-size-hero) * 2.1); /* reserve space for two-line name */
}

.typed-base {
  display: block;
  white-space: inherit;
  transition: opacity 0.15s ease;
}

.typed-live {
  position: absolute;
  inset: 0;
  white-space: inherit;
  pointer-events: none;
}

.typed-name.is-typing .typed-base,
.typed-name.is-done .typed-base {
  opacity: 0;
}

.typed-caret {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: currentColor;
  margin-left: 0.08em;
  animation: caretBlink 0.9s steps(1) infinite;
  vertical-align: baseline;
}

@media (max-width: 900px) {
  .typed-name {
    min-height: calc(var(--font-size-hero-tablet) * 2.1);
  }
}

@media (max-width: 600px) {
  .typed-name {
    min-height: calc(var(--font-size-hero-mobile) * 2.1);
  }

  .typed-caret {
    margin-left: 10px;
  }
}

@media (min-width: 1600px) {
  .article-container {
    max-width: 800px;
    padding: 1rem 2rem;
    padding-bottom: 1rem;
  }
}

/* Inline icon fix to keep icon and title aligned */
.post-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0;
}

.post-copy {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

.post-icon,
.pinned-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: block;
  opacity: 0.95;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.post-meta {
  display: block;
  margin: 0;
  font-size: var(--font-size-meta);
  line-height: 1.35;
  color: var(--color-meta);
}

.pinned-icon {
  transform: rotate(-90deg);
  transform-origin: center;
  transition: none !important; /* Prevent animation or rotation on hover */
}

.post-link:hover .pinned-icon {
  transform: rotate(-90deg); /* Force it to stay fixed */
}

@media (max-width: 860px), (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .posts-list li {
    margin-bottom: 2rem;
  }
}

/* Falling leaves animation (using /icons/leaf.svg) */

.leaf-fall {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 200; /* above sidebar/content so you can see it */
  /* soft fade at top and bottom */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 88%,
    transparent 100%
  );
}

/* Base leaf */
.leaf-fall .leaf {
  position: absolute;
  top: -12vh;
  width: 26px;
  height: 26px;
  /* CSS file lives in /assets, so use absolute path to the shared icon */
  background: url("/icons/leaf.svg") no-repeat center / contain;
  transform-origin: center;
  will-change: transform, opacity;
  animation: leafMotion var(--dur, 16s) linear var(--delay, 0s) infinite;
  filter: var(--leaf-filter);
}

/* Single animation that handles fall, drift, rotation, and fade */
@keyframes leafMotion {
  0% {
    transform: translate3d(var(--lane, 0px), -12vh, 0) rotate(var(--rot, 0deg));
    opacity: 0;
  }
  5% {
    opacity: 0.25;
  }
  25% {
    transform: translate3d(calc(var(--lane, 0px) - 25px), 25vh, 0)
      rotate(calc(var(--rot, 0deg) + 120deg));
  }
  50% {
    transform: translate3d(calc(var(--lane, 0px) + 25px), 55vh, 0)
      rotate(calc(var(--rot, 0deg) + 240deg));
  }
  75% {
    transform: translate3d(calc(var(--lane, 0px) - 15px), 85vh, 0)
      rotate(calc(var(--rot, 0deg) + 320deg));
  }
  100% {
    transform: translate3d(var(--lane, 0px), 112vh, 0)
      rotate(calc(var(--rot, 0deg) + 400deg));
    opacity: 0;
  }
}

/* Random lanes/speeds/sizes/starting angles */
.leaf-fall .leaf:nth-child(1) {
  left: 6%;
  --lane: -10px;
  --rot: 20deg;
  --dur: 13s;
  --delay: 0s;
}
.leaf-fall .leaf:nth-child(2) {
  left: 12%;
  --lane: 5px;
  --rot: -35deg;
  --dur: 17s;
  --delay: 0.8s;
  width: 22px;
  height: 22px;
}
.leaf-fall .leaf:nth-child(3) {
  left: 18%;
  --lane: -18px;
  --rot: 75deg;
  --dur: 15s;
  --delay: 1.2s;
  width: 28px;
  height: 28px;
}
.leaf-fall .leaf:nth-child(4) {
  left: 24%;
  --lane: 14px;
  --rot: -60deg;
  --dur: 19s;
  --delay: 0.4s;
}
.leaf-fall .leaf:nth-child(5) {
  left: 32%;
  --lane: -12px;
  --rot: 105deg;
  --dur: 16s;
  --delay: 2.1s;
  width: 24px;
  height: 24px;
}
.leaf-fall .leaf:nth-child(6) {
  left: 40%;
  --lane: 20px;
  --rot: -15deg;
  --dur: 20s;
  --delay: 1.6s;
}
.leaf-fall .leaf:nth-child(7) {
  left: 52%;
  --lane: -16px;
  --rot: 45deg;
  --dur: 14.5s;
  --delay: 0.3s;
}
.leaf-fall .leaf:nth-child(8) {
  left: 60%;
  --lane: 10px;
  --rot: -95deg;
  --dur: 18s;
  --delay: 2.6s;
  width: 30px;
  height: 30px;
}
.leaf-fall .leaf:nth-child(9) {
  left: 68%;
  --lane: -22px;
  --rot: 135deg;
  --dur: 16.5s;
  --delay: 1.1s;
}
.leaf-fall .leaf:nth-child(10) {
  left: 76%;
  --lane: 12px;
  --rot: -120deg;
  --dur: 21s;
  --delay: 0.7s;
  width: 23px;
  height: 23px;
}
.leaf-fall .leaf:nth-child(11) {
  left: 84%;
  --lane: -14px;
  --rot: 15deg;
  --dur: 17.5s;
  --delay: 1.9s;
}
.leaf-fall .leaf:nth-child(12) {
  left: 92%;
  --lane: 18px;
  --rot: -45deg;
  --dur: 22s;
  --delay: 2.9s;
  width: 27px;
  height: 27px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .leaf-fall .leaf {
    animation: none;
    opacity: 0.15;
  }
}

.services-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.services-grid {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 26px;
  justify-items: center;
  text-align: center;
}

/* Card */
.service-card {
  padding: 12px 10px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.service-card-icon {
  align-self: flex-start;
}

/* Icon */
.services-grid .service-icon {
  width: clamp(24px, 6vw, 28px);
  height: clamp(24px, 6vw, 28px);
  align-self: flex-start;
  display: block;
  margin: 0;
  padding-top: 3px;
  vertical-align: top;
  flex-shrink: 0;
  filter: var(--service-icon-filter);
}

/* Text content */
.service-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Title */
.service-card h3 {
  font-size: 1.15rem;
  margin: 0;
  color: var(--text-color);
}

/* Description */
.service-card p {
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
  color: var(--text-color);
}

@keyframes caretBlink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Mobile */
@media (max-width: 700px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
  }

  .service-card {
    max-width: none;
    padding: 10px 8px;
    gap: 10px;
  }

  .services-grid .service-icon {
    align-self: flex-start;
    margin: 0;
  }

  .service-card h3 {
    font-size: 1.05rem;
  }

  .service-card p {
    font-size: 0.9rem;
  }
}
