/* =========================================================
   utilities.css — reusable pieces: container, buttons,
   theme toggle, hero text block and project cards.
   ========================================================= */

.container {
  max-width: var(--width-medium);
  margin: 0 auto;
  padding: 1rem 2rem;
}

h1::selection,
h2::selection,
h3::selection,
p::selection {
  color: #111;
  background: var(--primary-color);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.9rem;
  border-radius: 30px;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: var(--weight-semibold);
  transition: 0.3s;
}

.btn-primary {
  background: var(--primary-color);
  color: #000000;
}

.btn-primary:hover {
  background: var(--secondary-color);
}

.btn-secondary {
  margin: 5px 0;
  background-color: var(--bg-secondary);
  color: var(--bg-primary);
}

.btn-secondary:hover {
  opacity: 0.82;
}

.btn-outline {
  margin: 5px 0;
  border: 2px solid var(--bg-secondary);
  color: var(--text-color);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  color: var(--bg-primary);
}

/* ---------------- Dark mode toggle ---------------- */
#switch {
  display: none;
}

.theme-switch {
  display: flex;
  align-items: center;
}

.toggle-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.toggle-icons > img {
  transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  width: 30px;
}

.moon {
  transform: rotate(10deg);
}

#switch:checked + .toggle-icons .moon {
  transform: rotate(250deg);
}

#switch:checked + .toggle-icons .sun {
  transform: rotate(100deg);
}

/* ---------------- Hero text block ---------------- */
.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 8rem;
  padding: 1rem;
}

.header-container > div {
  margin-top: 1rem;
}

.content-text {
  text-align: center;
  margin: 1.5rem 0 2.5rem;
}

.content-text h2 {
  font-size: 3rem;
  line-height: 1.2;
  transition: 0.2s ease-in-out;
}

.content-text p {
  padding: 0.5rem;
  margin: 0 auto;
  max-width: 700px;
  color: var(--text-muted);
}

/* ---------------- Project cards ---------------- */
.card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  border-radius: 6px;
  background-color: #16181d;
  background-size: cover;
  background-position: center center;
  color: #ffffff;
  transition: 0.35s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* A soft yellow wash so each tile has depth even without a photo */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255, 205, 66, 0.22), rgba(0, 0, 0, 0.85) 65%);
  transition: 0.35s ease-in-out;
}

.card:hover::after {
  background: linear-gradient(150deg, rgba(255, 205, 66, 0.12), rgba(0, 0, 0, 0.92) 55%);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

/* Big faded icon in the corner of each card */
.card-watermark {
  position: absolute;
  right: -0.5rem;
  top: -0.75rem;
  font-size: 6rem;
  color: rgba(255, 255, 255, 0.07);
  z-index: 1;
}

.card .project-info {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
}

.card .project-bio h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.card .project-bio p {
  font-size: 0.78rem;
  color: var(--primary-color);
  margin-top: 0.2rem;
}

.card .project-link a {
  color: #ffffff;
  font-size: 1.1rem;
  margin-left: 0.35rem;
  transition: 0.25s ease-in-out;
}

.card .project-link a:hover {
  color: var(--primary-color);
}

/* Description: hidden until hover on desktop, always shown on touch screens */
.card-detail {
  position: relative;
  z-index: 2;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #d9d9d9;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.4s ease-in-out;
}

.card:hover .card-detail,
.card:focus-within .card-detail {
  max-height: 220px;
  opacity: 1;
  margin-top: 0.85rem;
}

@media (hover: none) {
  .card-detail {
    max-height: 220px;
    opacity: 1;
    margin-top: 0.85rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    margin-top: 7rem;
    text-align: center;
  }

  .content-text h2 {
    font-size: 2.1rem;
  }

  #hero h1 {
    font-size: 1.8rem;
  }
}
