body {
  background-color: var(--background-color);
}

/* ============================================================
   HERO SECTION — Time2Help
   ============================================================ */

.hero-section-container {
  width: 100%;
  height: 100svh;
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 2rem;
  padding: 6rem 1.5rem 4rem;
  box-sizing: border-box;

  overflow: visible;
}

/* ---------- Ambient blobs ---------- */
.hero-section-container::before,
.hero-section-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.40;
  pointer-events: none;
  z-index: 0;
}

.hero-section-container::before {
  width: min(600px, 80vw);
  height: min(600px, 80vw);
  background: radial-gradient(circle, #e6564a, #c73e33);
  top: -100px;
  left: -120px;
  animation: blob-drift-a 12s ease-in-out infinite alternate;
}

.hero-section-container::after {
  width: min(400px, 60vw);
  height: min(400px, 60vw);
  background: radial-gradient(circle, #34c759, #1f9e46);
  bottom: -60px;
  right: -80px;
  animation: blob-drift-b 15s ease-in-out infinite alternate;
}

@keyframes blob-drift-a {
  0%   { transform: translate(0,   0)   scale(1);    }
  33%  { transform: translate(60px, 40px) scale(1.08); }
  66%  { transform: translate(20px, 80px) scale(0.95); }
  100% { transform: translate(80px, 20px) scale(1.05); }
}

@keyframes blob-drift-b {
  0%   { transform: translate(0,    0)    scale(1);    }
  33%  { transform: translate(-50px,-30px) scale(1.10); }
  66%  { transform: translate(-20px,-70px) scale(0.92); }
  100% { transform: translate(-70px,-10px) scale(1.06); }
}

/* ---------- Device image ---------- */
.hero-image {
  position: relative;
  z-index: 1;

  width: min(18rem, 62vw);
  height: auto;
  min-height: 0;
  object-fit: contain;

  filter:
    drop-shadow(0 8px 24px rgba(0,0,0,0.22))
    drop-shadow(0 24px 60px rgba(0,0,0,0.18));

  opacity: 0;
  transform: translateY(28px) scale(0.93);
  animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
  will-change: transform, opacity;
}

/* ---------- Text group ---------- */
.hero-items-container {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  padding: 0;
  gap: 0.75rem;
}

.hero-section-icon {
  width: clamp(5rem, 15vw, 8rem);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 22%;

  opacity: 0;
  transform: translateY(26px) scale(0.94);
  filter: blur(8px);
  animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
  will-change: transform, opacity, filter;

  view-transition-name: project-icon;
}

.hero-section-title {
  margin: 0;
  color: #223044;
  font-size: clamp(2.2rem, 8vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;

  opacity: 0;
  transform: translateY(26px) scale(0.94);
  filter: blur(8px);
  animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.38s forwards;
  will-change: transform, opacity, filter;

  view-transition-name: project-title;
}

.hero-section-title .accent {
  color: #34c759;
}

.hero-section-subtitle {
  margin: 0;
  color: #4d5b6b;
  font-size: clamp(1rem, 4vw, 1.5rem);

  opacity: 0;
  transform: translateY(26px) scale(0.94);
  filter: blur(8px);
  animation: fadeSlideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
  will-change: transform, opacity, filter;
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (prefers-color-scheme: dark) {
  .hero-section-title {
    color: #f2f4f7;
  }

  .hero-section-subtitle {
    color: #a9b3c0;
  }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */

@media (max-width: 480px) {
  .hero-section-container {
    gap: 1.5rem;
    padding-top: 5rem;
  }

  .hero-image {
    max-height: 35vh;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero-image {
    width: min(12rem, 30vw);
  }

  .hero-section-container {
    flex-direction: row;
    justify-content: center;
    gap: 3rem;
    padding: 3rem 4rem;
  }

  .hero-items-container {
    align-items: flex-start;
    text-align: left;
  }
}

@media (min-width: 1000px) {
  .hero-section-container {
    justify-content: flex-start;
    padding-top: 8rem;
  }
}

@media (min-width: 1200px) {
  .hero-image {
    width: 19rem;
  }
}

.back-button-container {
  position: absolute;
  top: 0;
  left: 0;
}

/* ---------------- MAIN CONTENT ---------------- */

.main-content-container, .full-width-container {
  width: 90%;
  margin: 0 auto;

  display: flex;
  align-items: stretch;
  justify-content: center;

  gap: 2rem;
}

.left-detail-container,
.middle-content-container,
.right-detail-container {
  display: flex;
  flex: 1;
  flex-direction: column;

  padding: 1.8rem;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);

  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;

  height: fit-content;
}

.left-detail-container {
  flex-direction: row-reverse;
  justify-content: space-between;
}

@media (min-width: 1000px) {
  .left-detail-container {
    flex-direction: column;
    justify-content: flex-start;
  }

  .polimi-logo {
    align-self: center;
  }

  .left-detail-container,
  .middle-content-container,
  .right-detail-container {
    height: auto;
  }
}

.left-detail-container-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 1rem;
}

@media (min-width: 1000px) {
  .left-detail-container-inner {
    margin: 2rem 0 0 0;
  }
}

.left-detail-container:hover,
.middle-content-container:hover,
.right-detail-container:hover {
  transform: translateY(-4px);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 34px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.10);
}

.middle-content-container {
  flex: 2.5;
}

.left-detail-container,
.right-detail-container {
  max-width: 300px;
}

/* Color personality — red heart + green star, matching the Time2Help logo */
.left-detail-container {
  background: linear-gradient(
    180deg,
    rgba(230, 78, 68, 0.10),
    rgba(230, 78, 68, 0.04)
  );
  border: 1px solid rgba(230, 78, 68, 0.18);

  align-items: flex-start;
}

.right-detail-container {
  background: linear-gradient(
    180deg,
    rgba(52, 199, 89, 0.10),
    rgba(52, 199, 89, 0.04)
  );
  border: 1px solid rgba(52, 199, 89, 0.18);

  align-items: flex-start;
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 1000px) {
  .main-content-container {
    flex-direction: column;
  }

  .left-detail-container,
  .middle-content-container,
  .right-detail-container {
    width: 100%;
    max-width: 100%;
  }
}

.section-title-bar {
  padding: 0;
}

.middle-section-title {
  font-size: 2rem;
}

.content {
  text-align: justify;
  hyphens: auto;
  text-justify: inter-word;
}

.course-container, .skills-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.subsection-header-label {
  font-weight: bold;
  color: var(--text-color-secondary);
  opacity: 0.65;
  margin: 0;
}

.project-popup-skill-pills-container {
  margin: 0.5rem 0 0 0;
}

.degree-badge-container {
  margin: 0.25rem 0 0 0;
}

@media (min-width: 1000px) {
  .project-exam-course {
    font-size: 0.9rem;
  }

  .project-popup-skill-pills-container {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

.polimi-logo {
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;

  height: 5rem;
}

@media (prefers-color-scheme: dark) {
  .polimi-logo {
    filter: invert(1);
  }
}

.right-detail-container-inner {
  display: flex;
  flex-direction: column;
}

#github-group-partners {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.partner-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  text-decoration: none;
}

.partner-link:hover {
  text-decoration: underline;
}

.partner-avatar {
  width: 1.3rem;
  border-radius: 999px;
}

.partner-username {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-color-secondary);
  opacity: 0.75;
}

.partner-username:hover {
  color: var(--text-color-accent);
}

.project-type-image {
  width: 3.5rem;

  align-self: center;
}

@media (max-width: 1000px) {
  .right-detail-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
}

.github-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background-color: rgba(30, 30, 30, 0.08);
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  color: #24292f;

  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.github-link-button:hover {
  transform: scale(1.1);
  background-color: rgba(30, 30, 30, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.github-icon {
  width: 1.4rem;
  height: 1.4rem;
  color: #24292f;
}

.github-link-text {
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  .github-link-button {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .github-link-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
  }
  .github-icon {
    color: #fff;
  }
}

.github-icon-link-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1000px) {
  .github-icon-link-container {
    align-self: center;
  }
}

.full-width-container {
  flex-direction: column;

  margin: 2rem 0;

  text-align: start;
}

/* ---------------- DESIGN PROCESS TIMELINE ---------------- */

.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.process-step {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  padding: 1.5rem;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(52, 199, 89, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 20px rgba(0, 0, 0, 0.08);

  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.process-step:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 14px 28px rgba(0, 0, 0, 0.12);
}

.process-step-icon {
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  object-fit: contain;
}

.process-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.process-step-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color-primary);
}

.process-step-text {
  margin: 0;
  color: var(--text-color-secondary);
  opacity: 0.85;
  line-height: 1.5;
}

.process-step-link {
  align-self: flex-start;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f9e46;
  text-decoration: none;
}

.process-step-link:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .process-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ---------------- RESOURCE LINK CARDS ---------------- */

.resource-links-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;

  width: 11rem;
  padding: 1.5rem 1rem;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(52, 199, 89, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 20px rgba(0, 0, 0, 0.08);

  text-decoration: none;
  text-align: center;

  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 16px 32px rgba(0, 0, 0, 0.14);
}

.resource-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.resource-card-label {
  margin: 0;
  font-weight: 700;
  color: var(--text-color-primary);
}

.resource-card-sublabel {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  opacity: 0.7;
}

/* ---------------- SCREENSHOT APPEARANCE TOGGLE ---------------- */

.screenshot-toggle {
  display: inline-flex;
  align-self: center;
  gap: 0.25rem;

  margin: 1.25rem 0 0.5rem;
  padding: 0.3rem;
  border-radius: 9999px;

  background: rgba(120, 120, 120, 0.10);
  border: 1px solid rgba(120, 120, 120, 0.18);
}

.screenshot-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  padding: 0.45rem 1rem;
  border: none;
  border-radius: 9999px;

  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color-secondary);
  opacity: 0.7;

  background: transparent;
  cursor: pointer;

  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.screenshot-toggle-btn:hover {
  opacity: 1;
}

.screenshot-toggle-btn.active {
  background: #1f9e46;
  color: #fff;
  opacity: 1;
}

.screenshot-toggle-icon {
  font-family: 'Material Symbols Outlined';
  font-size: 1.1rem;
  line-height: 1;
}
