/* ================================================
   MATT PENNETTI — PORTFOLIO  ·  SHARED SYSTEM
   ------------------------------------------------
   One stylesheet for the whole site.

   HOME PALETTE: black + white only. Variation comes
   from outlines, horizontal rules, and type hierarchy
   — not color.

   THEME LAYER (project pages may override in a small
   inline <style> block — colors + fonts only):
     --bg --white --black --rule --accent --serif --sans
   Structure and interactions stay identical across pages.
   ================================================ */

:root {
  --bg:      #FFFFFF;
  --white:   #FFFFFF;
  --black:   #1A1918;
  --rule:    #1A1918;
  --accent:  #1A1918;
  --serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:    'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --max:     1180px;
  --gutter:  clamp(20px, 5vw, 80px);
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--black);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ════════════════════════════════════════════════
   SITE HEADER  —  identical on every page
   ════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 22px; width: auto; display: block; }

.header-email {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--black);
  white-space: nowrap;
}
.header-email:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ════════════════════════════════════════════════
   HOME — INTRO  (one line, serif, black, no italics)
   ════════════════════════════════════════════════ */

.intro {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
}

.intro-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25;
  font-weight: 500;
  color: var(--black);
  max-width: 40ch;
}

/* ════════════════════════════════════════════════
   SECTION TITLE  (the title is the heading — no eyebrow)
   ════════════════════════════════════════════════ */

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--black);
  padding: clamp(48px, 6vw, 72px) 0 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ════════════════════════════════════════════════
   SHARED LOGO TILE  —  black mark on white, centered
   ════════════════════════════════════════════════ */

.logo-tile {
  width: 100%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--rule);
}
.logo-tile img {
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 56%;
  object-fit: contain;
  filter: brightness(0);
}
.logo-tile img.no-knockout { filter: none; max-width: 72%; max-height: 70%; }

/* ════════════════════════════════════════════════
   FEATURED CARDS  (large, two-up)
   ════════════════════════════════════════════════ */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 36px);
}

.feat-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--black);
  overflow: hidden;
  transition: transform .25s ease;
}
.feat-card:hover { transform: translateY(-4px); }
.feat-card:hover .feat-link { text-decoration: underline; text-underline-offset: 4px; }

.feat-card .logo-tile { aspect-ratio: 16 / 9; }

.feat-body {
  padding: clamp(24px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* role / client / engagement — the shared tagline */
.tagline {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 14px;
}
.tagline i { font-style: normal; padding: 0 6px; }

.feat-client {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 14px;
}

.feat-impact {
  font-size: 14px;
  color: var(--black);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 22px;
}

.feat-link {
  margin-top: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--black);
}

/* ════════════════════════════════════════════════
   OTHER PROJECTS  (compact, three-up)
   ════════════════════════════════════════════════ */

.other-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
}

.proj-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--black);
  overflow: hidden;
  transition: transform .25s ease;
}
.proj-card:hover { transform: translateY(-4px); }
.proj-card:hover .proj-name { text-decoration: underline; text-underline-offset: 4px; }

.proj-card .logo-tile { aspect-ratio: 3 / 2; }

/* illustration box uses a real image, not a logo */
.proj-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.proj-img img { width: 100%; height: 100%; object-fit: cover; }

.proj-body { padding: clamp(20px, 2.4vw, 26px); }
.proj-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}
.proj-body .tagline { margin-bottom: 10px; }

/* ════════════════════════════════════════════════
   SITE FOOTER  —  minimal, no nav
   ════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 36px 0;
  margin-top: clamp(56px, 8vw, 96px);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--black);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner a { color: var(--black); }
.footer-inner a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 24px; }

/* ════════════════════════════════════════════════
   RESUME MODAL  —  appears on load, dismissible
   ════════════════════════════════════════════════ */

.resume-modal {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 300;
  width: 296px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border: 1px solid var(--black);
  padding: 22px 22px 20px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.resume-modal.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.rm-close {
  position: absolute;
  top: 10px; right: 12px;
  background: none; border: none;
  font-size: 20px; line-height: 1;
  color: var(--black); cursor: pointer;
  padding: 2px 4px;
}

.rm-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 4px;
}
.rm-sub { font-size: 12px; color: var(--black); margin-bottom: 16px; }

.rm-actions { display: flex; flex-direction: column; gap: 8px; }

.rm-btn {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  transition: background .2s, color .2s;
}
.rm-btn:hover { background: var(--black); color: var(--white); }
.rm-btn--primary { background: var(--black); color: var(--white); }
.rm-btn--primary:hover { background: var(--white); color: var(--black); }

/* ════════════════════════════════════════════════
   SHARED PROJECT-PAGE COMPONENTS  (phase-two migration)
   ════════════════════════════════════════════════ */

.progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--accent);
  z-index: 400;
  transition: width .08s linear;
}

.ss { position: relative; margin: 40px 0; }
.ss__stage {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--white);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.ss__slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .4s ease;
}
.ss__slide.active { opacity: 1; }
.ss__slide img { width: 100%; height: 100%; object-fit: contain; }
.ss--cover .ss__slide img { object-fit: cover; }

.ss__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--black);
  color: var(--black);
  cursor: pointer; z-index: 10;
  transition: background .2s, color .2s;
}
.ss__btn:hover { background: var(--black); color: var(--white); }
.ss__prev { left: 12px; }
.ss__next { right: 12px; }

.ss__dots {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: center; margin-top: 16px;
}
.ss__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--black);
  padding: 0; cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.ss__dot.active { background: var(--black); }

.lb {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.94);
  display: none; align-items: center; justify-content: center;
}
.lb.open { display: flex; }
.lb img { max-width: 90vw; max-height: 86vh; object-fit: contain; }
.lb__close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none;
  color: #fff; font-size: 30px; cursor: pointer;
}
.lb__prev, .lb__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff; font-size: 22px; cursor: pointer;
  transition: border-color .2s;
}
.lb__prev:hover, .lb__next:hover { border-color: #fff; }
.lb__prev { left: 20px; }
.lb__next { right: 20px; }

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

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

@media (max-width: 560px) {
  .other-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .resume-modal { left: 16px; right: 16px; width: auto; }
}

/* ════════════════════════════════════════════════
   SINGLE-SOURCE CHROME  (injected by partials.js)
   Header, project prev/next, and footer are identical
   on every page. Edit them in ONE place: partials.js
   for markup, here for style. Pages never redefine them.
   ════════════════════════════════════════════════ */

/* Header stays sticky (in normal flow). partials.js injects it
   as the first element in <body>, before the rest of the page
   parses, so there is no load-time shift. */

.header-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
}
.header-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--black);
  white-space: nowrap;
}
.header-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Project-to-project navigation — sits just above the footer */
.project-nav {
  border-top: 1px solid var(--rule);
  margin-top: clamp(56px, 8vw, 96px);
}
.project-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px) 0;
}
.project-nav a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--black);
  max-width: 48%;
}
.project-nav .pn-next { margin-left: auto; text-align: right; align-items: flex-end; }
.pn-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.pn-name {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.1;
}
.project-nav a:hover .pn-name { text-decoration: underline; text-underline-offset: 4px; }

/* The injected footer never carries top margin of its own —
   the project-nav above it owns the spacing. */
.project-nav + .site-footer { margin-top: 0; }

@media (max-width: 560px) {
  .header-links { gap: 16px; }
  .header-email { display: none; } /* résumé + logo stay; full email lives in footer */
  .project-nav__inner { gap: 16px; }
  .pn-name { font-size: 18px; }
}

/* Injected chrome (footer + prev/next) follows each page's own text color,
   so it stays readable on both light and dark project themes. */
.project-nav a, .footer-inner, .footer-inner a { color: inherit; }
.project-nav, .site-footer { border-top-color: rgba(128,128,128,0.30); }
