/* ==========================================================================
   Components — buttons, icons, project cards, modal, canvas background.
   ========================================================================== */

/* --- Icons --------------------------------------------------------------- */

.icon {
  cursor: pointer;
  height: 2rem;
}

/* --- Buttons ------------------------------------------------------------- */

.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: auto;  /* pins the button row to the bottom of a card */
  padding-top: 1rem;
}

.btn {
  font-weight: 600;
  transition: var(--transition);
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
}

/* Note: `width` and `padding` are intentionally not set here — in the original
   stylesheet .btn was declared after .project-btn and won, so project buttons
   have always used .btn's 8rem width and 1rem padding. */
.project-btn {
  min-width: 100px;
  font-size: 0.9rem;
}

.btn-color-1,
.btn-color-2 {
  border: var(--color-ink-soft) 0.1rem solid;
}

.btn-color-1:hover,
.btn-color-2:hover {
  cursor: pointer;
}

.btn-color-1,
.btn-color-2:hover {
  background: var(--color-ink-soft);
  color: white;
}

.btn-color-1:hover {
  background: var(--color-ink);
}

.btn-color-2 {
  background: none;
}

.btn-color-2:hover {
  border: white 0.1rem solid;
}

/* --- Project card -------------------------------------------------------- */

.details-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  border-radius: var(--radius-card);
  text-align: center;
  background: var(--color-surface);
  border: 4px solid var(--color-ink);
  flex: 0 1 320px;
  height: auto;
  min-height: 520px;
  overflow: visible;
}

.details-container h2 {
  font-size: 1.2rem;
  margin: 1rem 0;
  /* min-height, not height: keeps short titles aligned across cards while
     letting long ones grow instead of overlapping the metrics below. */
  min-height: 3.2rem;
  line-height: 1.3;
  white-space: normal;
  word-wrap: break-word;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-img {
  border-radius: var(--radius-image);
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* --- Scrollbar ----------------------------------------------------------- */

.experience-details-container::-webkit-scrollbar {
  height: 8px;
}

.experience-details-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.experience-details-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* --- Modal --------------------------------------------------------------- */

.modal {
  display: none;
  position: fixed;
  z-index: 10;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal.open {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  background-color: var(--color-surface-strong);
  backdrop-filter: blur(1000px);
  margin: 15% auto;
  padding: 25px;
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  text-align: center;
  border: 3px solid var(--color-ink);
  word-wrap: break-word;
  overflow-wrap: break-word;
  height: auto;
  min-height: 150px;
}

.modal-content p {
  margin-top: 15px;
  line-height: 1.6;
  color: var(--color-ink);
  display: block;
  white-space: normal;
  text-align: justify;
  text-justify: inter-word;
}

.close {
  font-family: inherit;
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
}

.close:hover {
  color: var(--color-ink);
}

/* --- Animated background canvas ------------------------------------------ */

#network-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* --- Section headings ----------------------------------------------------- */

.subsection-title {
  font-size: 1.75rem;
  text-align: center;
  margin: 3rem 0 0.5rem;
}

.subsection-note {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* --- Chips (skills, project tags) ---------------------------------------- */

.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: var(--color-ink-soft);
  white-space: nowrap;
}

.chip-list--tags {
  justify-content: center;
  margin-bottom: 0.25rem;
}

/* --- Timeline (experience, education) ------------------------------------ */

.timeline-container {
  max-width: 820px;
  margin: 2rem auto 0;
  text-align: left;
}

.timeline {
  list-style: none;
  padding-left: 2rem;
  border-left: 2px solid rgba(var(--accent-rgb), 0.35);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2rem - 7px);
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3px solid rgb(var(--accent-rgb));
}

.timeline-item.is-current::before {
  background: rgb(var(--accent-rgb));
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-role {
  font-size: 1.15rem;
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0 0.6rem;
  font-size: 0.9rem;
}

.timeline-org {
  font-weight: 600;
  color: rgb(var(--accent-rgb));
}

.timeline-location {
  color: var(--color-text-muted);
}

.timeline-location::before {
  content: "· ";
}

.timeline-points {
  padding-left: 1.1rem;
}

.timeline-points li {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

/* --- Skills grid --------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto 4rem;
}

.skill-group {
  background: var(--color-surface);
  border: 2px solid var(--color-ink);
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: left;
}

.skill-group-title {
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

/* --- Filter bar ---------------------------------------------------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.filter-chip {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--color-ink);
  background: none;
  color: var(--color-ink);
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip:hover {
  background: rgba(var(--accent-rgb), 0.15);
}

.filter-chip.is-active {
  background: var(--color-ink-soft);
  border-color: var(--color-ink-soft);
  color: white;
}

/* --- Coursework list ----------------------------------------------------- */

#coursework {
  max-width: 900px;
  margin: 3rem auto 2rem;
}

.coursework-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coursework-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--color-surface);
  border: 2px solid var(--color-ink);
  border-radius: 1rem;
  text-align: left;
  white-space: normal;
}

.coursework-title {
  flex: 1 1 auto;
  font-weight: 600;
}

.coursework-category {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.coursework-link {
  font-size: 0.9rem;
  font-weight: 600;
}

/* --- Utility ------------------------------------------------------------- */

.is-hidden {
  display: none !important;
}

/* --- Project card: subtitle and image placeholder ------------------------- */

.project-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: normal;
  margin-bottom: 0.75rem;
}

.project-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  padding: 1rem;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: rgb(var(--accent-rgb));
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  white-space: normal;
}

/* --- Modal: long structured write-ups ------------------------------------ */

/* Without this, content taller than the viewport is unreachable. */
.modal {
  overflow-y: auto;
}

.modal-content--wide {
  max-width: 720px;
  /* Less top offset than the short modals: this content is tall already. */
  margin: 5% auto;
}

/* Justification opens up distracting word gaps over this much text. */
.modal-content--wide p {
  text-align: left;
}

.modal-heading {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  text-align: left;
  color: var(--color-ink);
}

.modal-list {
  margin-top: 0.75rem;
  padding-left: 1.2rem;
  text-align: left;
}

.modal-list li {
  color: var(--color-ink);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
  white-space: normal;
}
