/* ==========================================================================
   Matthew Palermo — Portfolio Stylesheet
   Shared across index.html and all project pages.
   ========================================================================== */

:root {
  --bg: #0f1115;
  --bg-alt: #161922;
  --bg-card: #1b1f2a;
  --border: #2a2f3d;
  --text: #e9ebf1;
  --text-dim: #a3a9b8;
  --text-faint: #6b7180;
  --accent: #d9484f;      /* matches the red "Resume" box in the sketch */
  --accent-soft: rgba(217, 72, 79, 0.12);
  --good: #4caf7d;
  --warn: #d9a545;
  --max-width: 1100px;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

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

img { max-width: 100%; display: block; border-radius: 6px; }

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

/* ---------------- Header / Nav ---------------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.identity .name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.identity .title {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav.main-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text);
  border-color: var(--accent);
}

nav.main-nav a.resume-link {
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
}

nav.main-nav a.resume-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  max-width: 720px;
}

.hero p {
  color: var(--text-dim);
  max-width: 620px;
  font-size: 1.05rem;
  margin: 0;
}

/* ---------------- Section headings ---------------- */

section { padding: 64px 0; }
section + section { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-head h2 {
  font-size: 1.7rem;
  margin: 0;
}

.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.section-note {
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* ---------------- Project cards (homepage) ---------------- */

.project-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  transition: border-color .15s ease, transform .15s ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #21263380, #12141a80),
              repeating-linear-gradient(45deg, #22273400 0 10px, #262c3a 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.project-card .card-body {
  padding: 22px 26px 26px;
}

.project-card .role {
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.project-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.project-card .summary {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 14px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
}

.view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ---------------- About ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.about-photo {
  aspect-ratio: 3 / 4;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
}

.about-copy p { color: var(--text-dim); margin: 0 0 16px; }

.experience-list {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.experience-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}

.experience-item .role { color: var(--text); font-weight: 600; }
.experience-item .meta { color: var(--text-faint); text-align: right; }

/* ---------------- Contact ---------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

form.contact-form { display: flex; flex-direction: column; gap: 14px; }

form.contact-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: -8px;
}

form.contact-form input,
form.contact-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

form.contact-form textarea { resize: vertical; min-height: 120px; }

form.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  margin-top: 6px;
}

.contact-links { display: flex; flex-direction: column; gap: 10px; justify-content: center; }

.contact-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.contact-links a:hover { border-color: var(--accent); color: var(--text); }

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

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-faint);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- Project detail page ---------------- */

.project-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.breadcrumb a { color: var(--accent); font-weight: 600; }

.project-hero h1 {
  margin: 0 0 8px;
  font-size: 2.1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.project-hero .role-line { color: var(--text-dim); font-size: 1rem; margin: 0; }

/* Flags a project page as an in-progress status update rather than a finished result */
.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--warn);
  background: rgba(217,165,69,0.14);
  border: 1px solid rgba(217,165,69,0.35);
  padding: 4px 10px;
  border-radius: 100px;
  vertical-align: middle;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.hero-shot {
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}

.meta-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  height: fit-content;
}

.meta-panel dl { margin: 0; }

.meta-panel dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-top: 16px;
}

.meta-panel dt:first-child { margin-top: 0; }

.meta-panel dd {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 600;
}

/* Process blocks: What I Did / Intent / Iteration / Rejected / Result / Growth */

.process-block {
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
}

.process-block .block-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.label-did { background: var(--accent-soft); color: var(--accent); }
.label-intent { background: rgba(76,175,125,0.12); color: var(--good); }
.label-iteration { background: rgba(217,165,69,0.14); color: var(--warn); }
.label-rejected { background: rgba(217,72,79,0.1); color: var(--accent); }
.label-result { background: rgba(76,175,125,0.12); color: var(--good); }
.label-growth { background: var(--bg-alt); color: var(--text-dim); border: 1px solid var(--border); }

.process-block h3 { margin: 0 0 14px; font-size: 1.3rem; }
.process-block p { color: var(--text-dim); margin: 0 0 16px; max-width: 760px; }

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}

.pair-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin: 24px 0 0;
}

.pair-label:first-of-type {
  margin-top: 20px;
}

.image-pair figure { margin: 0; }

.image-pair .frame {
  aspect-ratio: 4/3; /* fallback for any pair without a tuned ratio — see inline style note below */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
  padding: 10px;
}

.image-pair figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.single-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
  margin-top: 20px;
}

/* Video/iframe embeds are consistently 16:9 — give those a fixed ratio so
   there's no layout shift before the video loads. Plain images (like an
   annotated diagram) get no forced ratio, so they show at their natural size. */
.single-frame:has(video),
.single-frame:has(iframe) {
  aspect-ratio: 16/9;
}

/* Reconstructed-process callout for older work missing real assets */

.reconstruction-note {
  border: 1px dashed var(--warn);
  background: rgba(217,165,69,0.06);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.reconstruction-note .tag-mark {
  color: var(--warn);
  font-weight: 800;
  flex-shrink: 0;
}

/* Placeholder text markers */
.placeholder { color: var(--text-faint); font-style: italic; }

/* Card thumbnails / profile photo: crop to fill the box */
.thumb img,
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Hero shot: fixed 16:9 box, matches the real screenshots exactly, so contain is safe here */
.hero-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
  border-radius: inherit;
}

/* Process/analysis screenshots: box ratio is set per-instance (inline style, tuned to
   that image/pair) so the box stays a consistent, predictable size, and contain
   ensures nothing gets cropped — any leftover gap just shows as a thin bg-alt bar */
.frame img,
.single-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
  border-radius: inherit;
}

/* Embedded video (YouTube/Vimeo iframe or a self-hosted <video>) inside a frame */
.single-frame iframe,
.single-frame video {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: inherit;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 760px) {
  .about-grid, .contact-grid, .detail-grid, .image-pair {
    grid-template-columns: 1fr;
  }
  nav.main-nav { gap: 16px; flex-wrap: wrap; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
