/* ══════════════════════════════════════════
   MATTHEW HERRICK — SITE-WIDE STYLESHEET
   ══════════════════════════════════════════
   Sections:
     1.  Reset
     2.  Variables
     3.  Base
     4.  Nav — shared logo & about link
     5.  Home nav  (sticky,  <nav>)
     6.  Portfolio nav  (fixed, .site-nav)
     7.  Footer
     8.  Animations & scroll reveals
     ── Home page ──────────────────────────
     9.  Hero
     10. Filters
     11. Portfolio grid
     12. Cards
     ── Portfolio pages ────────────────────
     13. Page header, pills & meta
     14. Hero image (full-bleed)
     15. Content wrapper & sections
     16. Image layouts
     17. Stats block
     18. Project nav (bottom prev/next)
     ── Responsive ─────────────────────────
     19. Mobile  (≤ 680px)
     20. Tablet  (681 – 900px)
══════════════════════════════════════════ */


/* ─────────────────────────────────────────
   1. RESET
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ─────────────────────────────────────────
   2. VARIABLES
───────────────────────────────────────── */
:root {
  /* Colors */
  --color-bg:     #ffffff;
  --color-text:   #111111;
  --color-muted:  #999999;
  --color-border: #e4e4e4;
  --color-navy:   #181c2e;

  /* Typography */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Layout — home */
  --nav-height:  58px;   /* home: sticky nav */
  --page-pad:    2rem;   /* home: horizontal padding */
  --grid-gap:    0.65rem;

  /* Layout — portfolio pages */
  --nav-h:    64px;                    /* portfolio: fixed nav */
  --gutter:   clamp(20px, 5vw, 72px); /* portfolio: horizontal padding */
  --max:      1200px;                  /* portfolio: content max-width */
}


/* ─────────────────────────────────────────
   3. BASE
───────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

/* Portfolio pages have class="page-start" on <body>:
   switch to the display font used throughout those pages */
body.page-start {
  font-family: var(--font-display);
  font-weight: 400;
  padding-top: calc(var(--nav-h) + 36px); /* offset fixed nav + pn-bar */
}

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


/* ─────────────────────────────────────────
   4. NAV — shared logo & about link
   (applies on both home and portfolio pages)
───────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 28px;
  width: auto;
  display: block;
}

.nav-about {
  font-size: 0.83rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--color-text);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.nav-about:hover {
  opacity: 1;
}


/* ─────────────────────────────────────────
   5. HOME NAV  — sticky <nav> element
───────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}


/* ─────────────────────────────────────────
   6. PORTFOLIO NAV  — fixed .site-nav
───────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* Slim prev/next bar that sits below the fixed nav */
.pn-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  height: 36px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.pn-bar a {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pn-bar a:hover {
  color: var(--color-text);
}


/* ─────────────────────────────────────────
   7. FOOTER
───────────────────────────────────────── */
footer {
  padding: 22px var(--gutter);
  margin-top: 32px;
  border-top: none;
  font-size: 0.74rem;
  color: var(--color-muted);
}

/* Home page uses --page-pad for its gutter */
body:not(.page-start) footer {
  padding: 1.75rem var(--page-pad);
}


/* ─────────────────────────────────────────
   8. ANIMATIONS & SCROLL REVEALS
───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}


/* ══════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════ */

/* ─────────────────────────────────────────
   9. HERO
───────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-height) - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.25rem 9rem;
  max-width: 1440px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-headline strong {
  font-weight: 700;
}

.hero-sub {
  font-size: 0.95rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-muted);
  letter-spacing: 0.01em;
}


/* ─────────────────────────────────────────
   10. FILTERS
───────────────────────────────────────── */
.filters-wrap {
  padding: 0 var(--page-pad) 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.32rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

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

.filter-btn.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}


/* ─────────────────────────────────────────
   11. PORTFOLIO GRID
───────────────────────────────────────── */
.grid {
  padding: 1.25rem var(--page-pad) 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.asymmetric-row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1.78fr;
  gap: var(--grid-gap);
}

.asymmetric-row.reverse {
  grid-template-columns: 1.78fr 1fr;
}


/* ─────────────────────────────────────────
   12. CARDS
───────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  min-height: 300px;
  display: block;
  outline: 1px solid rgba(0,0,0,0.06);
}

.card.full {
  grid-column: span 2;
  min-height: 300px;
}

.card.square {
  aspect-ratio: 1 / 1;
  min-height: auto;
}

.card.widescreen {
  aspect-ratio: 16 / 9;
  min-height: auto;
}

/* Placeholder background (card color before image loads) */
.card-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Image layer */
.card-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  opacity: 0;
  transition: opacity 0.42s ease;
}

/* Text layer */
.card-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.38s ease;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.32);
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

.card.on-light .card-tag {
  border-color: rgba(0,0,0,0.22);
  color: rgba(0,0,0,0.65);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.55rem;
  font-size: clamp(1.15rem, 2vw, 1.75rem);
}

.card.on-light .card-title { color: #181818; }
.card.on-light .card-desc  { color: rgba(0,0,0,0.55); }

.card-title.caps {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.card.full .card-title:not(.caps) {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
}

.card-desc {
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255,255,255,0.6);
}

/* Hover: swap image in, fade text out (desktop only) */
@media (hover: hover) {
  .card:hover .card-image { opacity: 1; }
  .card:hover .card-text  { opacity: 0; }
}

.card.hidden { display: none; }


/* ══════════════════════════════════════════
   PORTFOLIO PAGES
══════════════════════════════════════════ */

/* ─────────────────────────────────────────
   13. PAGE HEADER, PILLS & META
───────────────────────────────────────── */
.page-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) var(--gutter) clamp(40px, 6vw, 72px);
  animation: fadeUp 0.6s ease both;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pill {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #ccc;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  max-width: 820px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 32px;
  border-top: 1px solid var(--color-border);
  padding-top: 18px;
}

.meta-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
}

.meta-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.meta-value {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text);
  white-space: nowrap;
}

.meta-value a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ─────────────────────────────────────────
   14. HERO IMAGE  — full-bleed
───────────────────────────────────────── */
.hero-image {
  width: 100%;
  animation: fadeUp 0.7s 0.2s ease both;
}

.hero-image img {
  width: 100%;
  height: clamp(280px, 52vw, 700px);
  object-fit: cover;
  display: block;
}


/* ─────────────────────────────────────────
   15. CONTENT WRAPPER & SECTIONS
───────────────────────────────────────── */
.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px 80px;
  padding: 64px 0;
  border-bottom: 1px solid var(--color-border);
}

.section-label {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding-top: 4px;
}

.section-text p {
  font-size: clamp(0.96rem, 1.3vw, 1.06rem);
  font-weight: 300;
  line-height: 1.82;
  color: #2a2a2a;
  margin-bottom: 1.25em;
}

.section-text p:last-child { margin-bottom: 0; }


/* ─────────────────────────────────────────
   16. IMAGE LAYOUTS
───────────────────────────────────────── */
.img-full img { width: 100%; display: block; }

.img-2up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.img-2up img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.img-4up {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.img-4up img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 3/4;
}

.gap { height: 4px; }


/* ─────────────────────────────────────────
   17. STATS BLOCK
───────────────────────────────────────── */
.stats-block {
  background: var(--color-navy);
  color: #fff;
  padding: 64px var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.stat-number {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-desc {
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.65;
  opacity: 0.6;
}

/* ─────────────────────────────────────────
   18. STATS BLOCK PROJECT NAV — bottom prev/next
───────────────────────────────────────── */

.project-nav-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;

  border: none;           /* remove top border */
  width: 100%;
}

.project-nav-bottom a {
  display: flex;
  flex-direction: column;

  gap: 12px;              /* spacing instead of visual separator */
  padding: 18px var(--gutter) 36px;

  text-decoration: none;
  color: var(--color-text);
  transition: background 0.2s;

  border: none;           /* prevent inherited borders */
}

.project-nav-bottom .next {
  text-align: right;
  border-left: none;      /* remove center divider */
}

.pn-dir {
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-muted);

  border: none;           /* removes line under Previous/Next */
  padding: 0;
}

footer {
  border-top: none;
}

.section:last-child {
  border-bottom: none;
}


   /* ═══════════════════════════════════════════════
       ABOUT PAGE — additional styles
       
    ═══════════════════════════════════════════════ */

    /* body class mirrors page-start but without pn-bar offset */
    body.about-start {
      font-family: var(--font-display);
      font-weight: 400;
      padding-top: var(--nav-h); /* fixed nav only — no pn-bar on this page */
    }

    /* ── Two-column portrait + bio ── */
    .about-wrap {
      max-width: var(--max);
      margin: 0 auto;
      padding: clamp(56px, 9vw, 112px) var(--gutter) clamp(48px, 7vw, 80px);
      display: grid;
      grid-template-columns: 360px 1fr;
      gap: clamp(32px, 5vw, 72px);
      align-items: start;
    }

    .about-portrait img {
      width: 100%;
      display: block;
    }

    /* Bio text — reuses .section-text type styles */
    .about-bio p {
      font-size: clamp(0.96rem, 1.3vw, 1.06rem);
      font-weight: 300;
      line-height: 1.82;
      color: #2a2a2a;
      margin-bottom: 1.5em;
    }

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

    /* ── Contact links ── */
    .about-contact {
      max-width: var(--max);
      margin: 0 auto;
      padding: 0 var(--gutter) clamp(40px, 6vw, 72px);
      /* indent to align with bio text column */
      padding-left: calc(var(--gutter) + 360px + clamp(32px, 5vw, 72px));
      display: flex;
      gap: 36px;
      align-items: center;
    }

    .about-contact-link {
      display: flex;
      align-items: center;
      gap: 7px;
      font-family: var(--font-display);
      font-size: 0.88rem;
      font-weight: 400;
      color: var(--color-text);
      text-decoration: none;
      opacity: 0.75;
      transition: opacity 0.2s ease;
    }

    .about-contact-link:hover { opacity: 1; }

    .about-contact-link svg {
      width: 15px;
      height: 15px;
      flex-shrink: 0;
    }

    /* ── Nav: second link for active "ABOUT" state ── */
    .nav-work {
      font-size: 0.83rem;
      font-weight: 400;
      text-decoration: none;
      color: var(--color-text);
      opacity: 0.55;
      transition: opacity 0.2s ease;
      margin-right: 8px; /* breathing room before ABOUT */
    }

    .nav-work:hover { opacity: 1; }

    .nav-about-current {
      font-size: 0.83rem;
      font-weight: 500;
      color: var(--color-text);
      opacity: 1;
    }


/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* ─────────────────────────────────────────
   19. MOBILE  (≤ 680px)
───────────────────────────────────────── */
@media (max-width: 680px) {
  :root {
    --page-pad: 1rem;
    --grid-gap: 0.5rem;
  }

  /* Home hero */
  .hero {
    min-height: 60vh;
    padding: 2rem 1.25rem;
  }

  /* Portfolio sections */
  .section {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stats-block {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Grid */
  .grid {
    grid-template-columns: 1fr;
    padding: 1rem var(--page-pad) 3.5rem;
  }

  .card,
  .card.full {
    grid-column: span 1;
    min-height: 240px;
    border-radius: 8px;
  }

  .asymmetric-row,
  .asymmetric-row.reverse {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .card.square,
  .card.widescreen {
    aspect-ratio: auto;
    min-height: 240px;
  }

  /* Always show image on mobile */
  .card-image {
    opacity: 1 !important;
  }

  /* Gradient overlay so text reads over image */
  .card-text {
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.78) 0%,
      rgba(0,0,0,0.18) 55%,
      transparent 100%
    );
    opacity: 1 !important;
    justify-content: flex-end;
  }

  .card-title,
  .card.on-light .card-title {
    color: #fff !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.015em;
  }

  .card-title.caps {
    font-size: 1rem;
    letter-spacing: 0.04em;
  }

        .about-wrap {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: clamp(32px, 8vw, 56px);
      }

      .about-contact {
        padding-left: var(--gutter);
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
      }
  
  
  /* Hide tags and descriptions — images tell the story */
  .card-tags { display: none; }
  .card-desc  { display: none; }
}


/* ─────────────────────────────────────────
   20. TABLET  (681 – 900px)
───────────────────────────────────────── */
@media (min-width: 681px) and (max-width: 900px) {
  :root { --page-pad: 1.5rem; }

  .card      { min-height: 250px; }
  .card.full { min-height: 260px; }
  
        .about-wrap {
        grid-template-columns: 280px 1fr;
      }

      .about-contact {
        padding-left: calc(var(--gutter) + 280px + clamp(32px, 5vw, 72px));
      }
}
