@import url('https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* === Base === */
body {
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: linear-gradient(153deg, rgb(255, 255, 255) 0%, rgb(255, 236, 216) 51%, rgb(251, 229, 206) 100%);
  background-attachment: fixed;
  color: #000000;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; font: inherit; }
a { color: #000000; text-underline-offset: 3px; }
a:hover { color: #0066ff; }
.card__description a::after,
.card__expanded-text a::after {
  content: " \2197";
  font-size: 0.85em;
}

/* === Layout === */
.header {
  text-align: center;
  padding: clamp(60px, 8vw, 120px) 20px 40px;
}

.header__badge {
  display: inline-block;
  font-family: "Arvo", Georgia, serif;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.header__title {
  font-family: "Arvo", Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: clamp(10px, 2vw, 24px);
}

.header__subtitle {
  font-family: "Arvo", Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  color: #000000;
  margin-bottom: clamp(16px, 3vw, 40px);
}

/* === Projects === */
.projects {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

/* === Card divider === */
.card-divider {
  border: none;
  height: auto;
  background: none;
  margin: 0 auto;
  font-size: 0.9rem;
  letter-spacing: 0.8em;
  color: rgba(0, 0, 0, 0.15);
  text-align: center;
}
.card-divider::before {
  content: "●  ●  ●";
}

/* === Card === */
.card {
  display: grid;
  gap: 0 40px;
  align-items: start;
  min-width: 0;
}

/* Desktop stagger */
@media (min-width: 768px) {
  .card {
    grid-template-columns: 1fr 1fr;
  }

  .card__text { display: contents; }

  .card--image-right .card__title { grid-column: 1; grid-row: 1; padding-top: 20px; }
  .card--image-right .card__subtitle { grid-column: 1; grid-row: 2; }
  .card--image-right .card__tags { grid-column: 1; grid-row: 3; }
  .card--image-right .card__description { grid-column: 1; grid-row: 4; }
  .card--image-right .card__media { grid-column: 2; grid-row: 1 / span 20; align-self: start; }
  .card--image-right .card__toggle { grid-column: 1; grid-row: 5; justify-self: center; }
  .card--image-right .card__expanded { grid-column: 1; grid-row: 6; }

  .card--image-left .card__media { grid-column: 1; grid-row: 1 / span 20; align-self: start; }
  .card--image-left .card__title { grid-column: 2; grid-row: 1; padding-top: 20px; }
  .card--image-left .card__subtitle { grid-column: 2; grid-row: 2; }
  .card--image-left .card__tags { grid-column: 2; grid-row: 3; }
  .card--image-left .card__description { grid-column: 2; grid-row: 4; }
  .card--image-left .card__toggle { grid-column: 2; grid-row: 5; justify-self: center; }
  .card--image-left .card__expanded { grid-column: 2; grid-row: 6; }
}

.card__title {
  font-family: "Arvo", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card__subtitle {
  font-size: 1rem;
  color: #000000;
  margin-bottom: 8px;
  font-weight: 600;
}

.card__tags {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .card__tags {
    display: flex;
  }
}

.card__tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 3px;
  background: none;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.5);
}

.card__description {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #000000;
}

.card__description p {
  margin-bottom: 0.6em;
}

/* Mobile-only duplicate description (hidden on desktop by default) */
.card__description-mobile {
  display: none;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #000000;
}

.card__description-mobile p {
  margin-bottom: 0.6em;
}

.card__media {
}

.card__lead-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 40px;
  background: #ddd;
  box-shadow:
    0 1px 3px rgba(180, 140, 100, 0.06),
    0 8px 40px -8px rgba(96, 53, 11, 0.25);
}

/* Image placeholder */
.card__placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.8rem;
  font-style: italic;
}

/* === Toggle button === */
.card__toggle {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  border-radius: 20px;
  padding: 7px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #000000;
  transition: background 0.15s;
  justify-self: center;
  margin-top: 12px;
}

.card__toggle:hover {
  background: rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  .card__toggle--mobile-only {
    display: none;
  }
}

/* === Expanded section === */
.card__expanded {
  margin-top: 12px;
  min-width: 0;
}

.card__expanded[hidden] {
  display: none;
}

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

.card__expanded-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #000000;
}

.card__expanded-text p {
  margin-bottom: 0.6em;
}

/* === Additional images === */
.card__additional-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card__additional-image-wrap {
  position: relative;
}

.card__additional-image {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  background: #ddd;
}

@media (min-width: 768px) {
  .card__additional-image-wrap::after {
    content: "+";
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    background: #000000;
    border-radius: 50%;
    pointer-events: none;
    line-height: 1;
  }
}

/* Mobile: horizontal scroll strip */
@media (max-width: 767px) {
  .card {
    grid-template-columns: 1fr;
  }

  .card__text { order: 1; }
  .card__media { order: 2; margin-top: 12px; }
  .card__toggle { order: 3; }
  .card__expanded { order: 4; }

  /* Hide teaser description on mobile (always — it appears in expanded section instead) */
  .card .card__description {
    display: none;
  }

  /* Show mobile duplicate description inside expanded */
  .card__description-mobile {
    display: block;
  }

  .card__expanded-media {
    margin-left: -20px;
    margin-right: -20px;
    overflow: hidden;
  }

  .card__additional-image-wrap:first-child {
    padding-left: 20px;
  }

  .card__additional-image-wrap:last-child {
    padding-right: 20px;
  }

  .card__additional-images {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 20px;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 8px;
  }

  .card__additional-image-wrap {
    flex: 0 0 85vw;
    scroll-snap-align: start;
  }

  .card__additional-image {
    width: 100%;
    max-height: 95vh;
    object-fit: contain;
    cursor: default;
  }

  .card__additional-images--single {
    overflow: visible;
    display: block;
    padding: 0;
  }

  .card__additional-images--single .card__additional-image {
    width: 100%;
    max-height: none;
  }
}

/* === YouTube embed === */
.youtube-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 12px 0;
  border-radius: 8px;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* === TODO Documentation / Coming Soon === */
.todo-docs {
  max-width: 960px;
  margin: 60px auto 80px;
  padding: 0 20px;
}

.todo-docs__title {
  font-family: "Arvo", Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

.todo-docs__list {
  list-style: none;
  padding-left: 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #000000;
  text-align: center;
}

.todo-docs__list li {
  margin-bottom: 6px;
}

.todo-docs__item-name {
  font-family: "Arvo", Georgia, serif;
  font-weight: 700;
}

.todo-docs__subnotes {
  list-style: none;
  padding-left: 0;
  font-size: 0.92rem;
  color: #000000;
  line-height: 1.5;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 40px 20px 60px;
  font-size: 0.92rem;
  color: #000000;
}

.footer__label {
  font-family: "Arvo", Georgia, serif;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.footer a {
  color: #000000;
  text-underline-offset: 3px;
}

.footer a:hover {
  color: #0066ff;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s;
}

.lightbox.lightbox--visible {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
