/* work.css -- the "Our work" page: a 28-photo flip-card grid plus the
   shared job-details modal. Reuses base.css's .section/h2 rhythm and the
   site's shared button/token system; nothing here touches those files. */

.work-hero {
  background: var(--bg-soft);
  /* header is position:fixed (height 64px <=900px, 76px above it); this
     section is the page's first content, so it needs its own clearance --
     header height + 32px -- or the heading renders underneath the header. */
  padding-top: 96px;
}

@media (min-width: 901px) {
  .work-hero { padding-top: 108px; padding-bottom: 28px; }
}

.work-hero__inner {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 64px);
}

.work-hero h1 {
  overflow: visible;
}

.work-subline {
  margin: 0;
  margin-top: 12px;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
  max-width: 46ch;
}

.work-grid-section {
  background: var(--charcoal);
  padding-block: 0 clamp(80px, 10vw, 140px);
  padding-top: 48px;
  position: relative;
}

@media (min-width: 901px) {
  .work-grid-section {
    padding-top: 72px;
  }
}

.work-grid-section__inner {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 64px);
  position: relative;
  z-index: 1;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1200px) {
  .work-grid { grid-template-columns: repeat(4, 1fr); }
}

.work-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  perspective: 1200px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform 150ms ease;
}

@media (hover: hover) {
  .work-card:hover { transform: translateY(-3px); }
}

.work-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work-card.is-flipped .work-card__inner { transform: rotateY(180deg); }

.work-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  border-radius: var(--radius);
  overflow: hidden;
}

.work-card__face--front { transform: translateZ(1px); }
.work-card__face--back { transform: rotateY(180deg) translateZ(1px); }

.work-card__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: var(--charcoal);
  color: #fff;
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: var(--radius);
}

.work-card__flip-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-card:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .work-card__inner { transition: none; }
  .work-card__face { transition: opacity 150ms ease; }
  .work-card__face--front { opacity: 1; }
  .work-card__face--back { opacity: 0; transform: none; }
  .work-card.is-flipped .work-card__inner { transform: none; }
  .work-card.is-flipped .work-card__face--front { opacity: 0; }
  .work-card.is-flipped .work-card__face--back { opacity: 1; }
}

.work-details-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
}

.work-details-btn:hover { text-decoration: underline; }

.work-cta {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

/* .work-grid-section sits on --charcoal; the primary button's default fill
   is also --charcoal (see buttons.css), so its label needs a light colour
   to stay legible against the section behind it. */
.work-cta .btn--primary {
  color: var(--bg-soft);
}

/* ---------- job details modal ---------- */

.work-modal {
  max-width: 720px;
  width: calc(100% - 48px);
  border: none;
  border-radius: var(--radius);
  padding: 32px;
  color: var(--ink);
}

.work-modal::backdrop { background: rgba(0, 0, 0, 0.6); }

.work-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.work-modal__title {
  margin: 0 0 12px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
}

.work-modal__field {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink-muted);
}

.work-modal__pair {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.work-modal__pair img {
  width: 50%;
  border-radius: var(--radius);
  object-fit: cover;
}

@media (max-width: 600px) {
  .work-modal__pair { flex-direction: column; }
  .work-modal__pair img { width: 100%; }
}

.work-modal__extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.work-modal__extra img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}
