/* static/css/home.css */

.home-title {
  margin: 0 0 6px 0;
  font-size: 38px;
  font-weight: 600;
}

.rule {
  margin: 12px 0 24px 0;
  border: none;
  border-top: 1px solid var(--line);
}

.h2 {
  margin: 0 0 12px 0;
  font-size: 31px;
  font-weight: 600;
}

.p {
  margin: 0 0 14px 0;
  line-height: 1.85;
  font-size: 16.5px;
  color: var(--muted);
}

.list {
  margin: 8px 0 0 18px;
  color: var(--muted);
  line-height: 1.85;
}

.section {
  margin-top: 22px;
}

.timeline {
  display: flex;
  margin-top: 28px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  right: 19px;
  top: 19px;
  height: 1px;
  background: var(--line);
  z-index: 0;
}

.timeline-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 8px;
  z-index: 1;
}

.timeline-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text);
}

.timeline-icon svg {
  width: 16px;
  height: 16px;
}

.timeline-year {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.2;
}

.timeline-text {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
  max-width: 150px;
  line-height: 1.4;
}

/* tech stack */
.stack {
  margin-top: 26px;
}

/* IMPORTANT: your template uses .tech-grid + .tech-item */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tech-item {
  border: 1px solid var(--line);
  background: var(--chip-bg);
  border-radius: 14px;
  padding: 12px 12px;

  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.tech-item img {
  width: 32px;        /* size control */
  height: 32px;       /* size control */
  object-fit: contain;
  display: block;
  flex: 0 0 26px;
}

.tech-item span {
  font-size: 17.5px;
  color: var(--chip-text);
  line-height: 1.2;
  white-space: nowrap;
}

/* tech stack interactions */
.tech-item {
  cursor: default;
  user-select: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  will-change: transform;
}

.tech-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 38px rgba(109, 71, 21, 0.12);
  background: rgba(109, 71, 21, 0.06);
}

/* click "no" shake */
.tech-item:active {
  animation: tech-nope 160ms ease-in-out;
}

@keyframes tech-nope {
  /*0%   { transform: translateX(0) scale(1.01); }*/
  /*15%  { transform: translateX(-5px) scale(1.01); }*/
  /*30%  { transform: translateX(5px) scale(1.01); }*/
  /*45%  { transform: translateX(-4px) scale(1.01); }*/
  /*60%  { transform: translateX(4px) scale(1.01); }*/
  /*75%  { transform: translateX(-3px) scale(1.01); }*/
  /*100% { transform: translateX(0) scale(1.01); }*/
  0%   { transform: translateX(0) scale(1.01); }
  25%  { transform: translateX(-3px) scale(1.01); }
  50%  { transform: translateX(3px) scale(1.01); }
  75%  { transform: translateX(-2px) scale(1.01); }
  100% { transform: translateX(0) scale(1.01); }
}

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .tech-item,
  .tech-item:hover {
    transition: none;
    transform: none;
  }
  .tech-item:active {
    animation: none;
  }
}

/* responsive */
@media (max-width: 900px) {
  .tech-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* card-ify each home section to match the mobile design */
  .home-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 18px 18px 20px;
    margin-bottom: 16px;
  }

  .home-card:last-child {
    margin-bottom: 0;
  }

  .home-card .section {
    margin-top: 0;
  }

  .home-title {
    font-size: 22px;
  }

  .rule {
    margin: 10px 0 16px 0;
  }

  .h2 {
    font-size: 19px;
  }

  /* vertical timeline: icon column on the left, year/text stacked to its right */
  .timeline {
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
  }

  .timeline::before {
    left: 19px;
    right: auto;
    top: 19px;
    bottom: 19px;
    width: 1px;
    height: auto;
  }

  .timeline-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    column-gap: 14px;
    row-gap: 2px;
    flex: none;
    align-items: start;
    text-align: left;
    padding: 0;
  }

  .timeline-icon {
    grid-row: 1 / 3;
    margin-bottom: 0;
  }

  .timeline-year {
    grid-column: 2;
  }

  .timeline-text {
    grid-column: 2;
    max-width: none;
  }
}

@media (max-width: 650px) {
  .tech-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* iPad landscape gap (see layout.css) */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 980px) and (max-width: 1400px) {
  .home-title {
    font-size: 27px;
  }

  .h2 {
    font-size: 21px;
  }

  .p {
    font-size: 14px;
  }

  .tech-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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