/* ==========================================================================
   Joshua Balgos — shared stylesheet
   ========================================================================== */

:root {
  --paper: #F7F5F0;
  --ink: #161512;
  --muted: #8c887e;
  --accent: #C1442D;
  --line: #d9d5cb;
  --card: #e9e5da;

  --serif: 'Fraunces', serif;
  --sans: 'IBM Plex Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------------------
   Layout shell
   -------------------------------------------------------------------- */

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 64px;
  position: relative;
}

@media (max-width: 900px) {
  .wrap {
    padding: 0 24px;
  }
}

/* --------------------------------------------------------------------
   Top nav
   -------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 0;
}

.site-header .wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.2px;
}

.site-nav {
  display: flex;
  gap: 40px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--ink);
}


/* --------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 56px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .footer-email {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

.site-footer .footer-email:hover {
  text-decoration-color: var(--ink);
}

/* --------------------------------------------------------------------
   Home
   -------------------------------------------------------------------- */

.home-main {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 900px;
  padding: 40px 0;
}

.home-main h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 92px;
  line-height: 1.02;
  letter-spacing: -1.5px;
}

.cycling-phrase {
  margin: 0 0 40px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.3;
  min-height: 44px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.cycling-phrase.is-fading {
  opacity: 0;
}

.bio {
  margin: 0 0 44px;
  font-size: 18px;
  line-height: 1.6;
  max-width: 620px;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  width: fit-content;
}

.cta-link svg {
  transition: transform 0.2s ease;
}

.cta-link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .home-main h1 {
    font-size: 56px;
  }
  .cycling-phrase {
    font-size: 24px;
  }
}

/* --------------------------------------------------------------------
   Work page: tag filter
   -------------------------------------------------------------------- */

.filter-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 56px 0 40px;
}

.filter-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 24px;
  row-gap: 17px;
  padding-bottom: 64px;
  align-content: start;   /* add this: rows keep their natural size at any grid height */
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

.work-card {
  display: block;
  will-change: transform, opacity;
}

.work-card .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--card);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}

.work-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card .title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  margin-bottom: 4px;
}

.work-card .tags {
  font-size: 13px;
  color: var(--muted);
}

.work-card.is-hidden {
  display: none;
}

/* --------------------------------------------------------------------
   About page (bio + contact combined)
   -------------------------------------------------------------------- */

.about-main {
  padding: 40px 0 80px;
  max-width: 720px;
}

.about-bio h1 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -1px;
}

.about-bio p {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.65;
  max-width: 620px;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-contact {
  margin-top: 72px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}

.about-contact h2 {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

@media (max-width: 900px) {
  .about-bio h1 {
    font-size: 44px;
  }
  .about-contact h2 {
    font-size: 32px;
  }
}

.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  margin-bottom: 48px;
  width: fit-content;
}

.social-links {
  display: flex;
  gap: 32px;
  font-size: 15px;
  font-weight: 500;
}

@media (max-width: 900px) {
  .contact-email {
    font-size: 22px;
  }
}

.about-clients {
  margin: 64px 0;
}

.about-clients-label {
  margin: 0 0 20px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--muted);
}

.about-clients-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 28px;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .about-clients-list {
    font-size: 22px;
    gap: 6px 24px;
  }
}

/* --------------------------------------------------------------------
   Case study page
   -------------------------------------------------------------------- */

.case-header {
  padding: 72px 0 40px;
}

.case-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.case-tags span {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.case-header h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 72px;
  line-height: 1.05;
  letter-spacing: -1px;
  max-width: 900px;
}

.case-dek {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 680px;
}

.case-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--card);
  border-radius: 4px;
  margin: 0 0 64px;
  overflow: hidden;
}

.case-hero img,
.case-hero video,
.case-hero iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-hero iframe {
  border: 0;
  display: block;
}

.case-body {
  display: flex;
  gap: 80px;
  padding-bottom: 64px;
}

.case-overview {
  flex: 2;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.75;
}

.case-overview p {
  margin: 0 0 24px;
}

.case-overview p:last-child {
  margin-bottom: 0;
}

.case-meta {
  flex: 1;
  border-left: 1px solid var(--line);
  padding-left: 40px;
  max-width: 280px;
}

.case-meta dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.case-meta dd {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 500;
}

.case-meta dd:last-child {
  margin-bottom: 0;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: 64px;
}

.case-gallery img,
.case-gallery video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--card);
}


.case-gallery .wide {
  grid-column: span 2;
}

.case-gallery .wide img {
  aspect-ratio: auto;
}

.case-gallery-1 {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--card);
  border-radius: 4px;
  margin: 0 0 32px;
  overflow: hidden;
}

.case-gallery-1 img,
.case-gallery-1 video,
.case-gallery-1 iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}

.case-disney-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 64px;
}

.case-disney-gallery img,
.case-disney-gallery video {
  width: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 4px;
  background: var(--card);
}

.case-disney-gallery .wide {
  grid-column: span 3;
}

.case-disney-gallery .wide img {
  aspect-ratio: auto;
}


.case-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
}

.case-footer-prev { justify-self: start; font-size: 15px; font-weight: 500; }
.case-footer-next { justify-self: end; font-size: 15px; font-weight: 500; }

.case-footer-email {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 600px) {
  .case-footer {
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
  }
  .case-footer-email {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }
}

@media (max-width: 900px) {
  .case-header h1 {
    font-size: 44px;
  }
  .case-body {
    flex-direction: column;
    gap: 40px;
  }
  .case-meta {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 24px;
    max-width: none;
  }
  .case-gallery {
    grid-template-columns: 1fr;
  }
  .case-gallery .wide {
    grid-column: auto;
  }
}

.case-summary {
  max-width: 680px;
  margin: 0 0 24px 0;
  font-size: 17px;
  line-height: 1.75;
}

.case-did {
  max-width: 650px;
  margin: 0;
  padding-left: 1.2em;
  font-size: 17px;
  line-height: 1.55;
}

.case-did li { margin-bottom: 10px; }
.case-did li:last-child { margin-bottom: 0; }

.case-video { aspect-ratio: 16 / 9; width: 100%; }
.case-video iframe { width: 100%; height: 100%; border: 0; }

/* --------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
