/* ============================================================
   JUSTIN PHILLIPSON — PORTFOLIO STYLESHEET
   ============================================================
   Table of contents:
   1. Variables & Reset
   2. Global / Base
   3. Header & Nav
   4. Hero
   5. Project List & Shared Band Styles
   6. ROW VARIANTS
   7. Image Placeholders (remove when real images are in)
   8. Footer
   9. Animations
   10. Responsive
   ============================================================ */

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

:root {
  --bg:        #f5f3f0;
  --ink:       #1a1c21;
  --ink-mid:   #6b6f7a;
  --ink-faint: #b0aca6;
  --accent:    #2a7a6e;
  --bord:      rgba(26, 28, 33, 0.1);
  --font:      'Instrument Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --margin: 120px;
  --max:    1200px;
  /* text column is narrower than max for readability */
  --col:       680px;
  --mobile-gap: 64px;
}

/* ============================================================
   2. GLOBAL / BASE
   ============================================================ */
html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ============================================================
   3. HEADER & NAV
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  /*background: var(--bg);*/
  background-color: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
  opacity: 0;
  animation: rise 0.5s ease forwards 0.05s;
}

header.scrolled {
  border-color: rgba(26, 28, 33, 0.1);
  background: var(--bg);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--margin);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

nav { display: flex; gap: 32px; }

nav a {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-mid);
  transition: color 0.15s;
}

nav a:hover { color: var(--ink); }

/* ============================================================
   4. HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  margin: auto;
  max-width: var(--max);
  /*justify-content: center;*/
  /*text-align: center;*/
  padding: 0 var(--margin);
  opacity: 0;
  animation: rise 0.8s ease forwards 0.2s;
  overflow: hidden;
  margin-top: -61px;        /* add this — adjust px to match your header's actual height */
  padding-top: 61px;        /* add this — keeps content from hiding under header */
}

#pixel-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hero-statement {
  position: relative;
  z-index: 1;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--ink-mid);
  font-family: var(--font);
  /*padding-bottom: 15vh;*/
  /*text-transform: uppercase;*/
}

/*.hero {
  position: relative;   /* add this line *//*
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--margin);
  opacity: 0;
  animation: rise 0.8s ease forwards 0.2s;
}

.hero-statement {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.9;
  color: var(--ink-mid);
  /* max-width: 380px; *//*
  font-family: var(--font-mono);
  text-transform: uppercase;
}*/

/*#pixel-block {
  position: absolute;
  bottom: 0;
  right: var(--margin);
  width: 240px;
  height: 192px;
  image-rendering: pixelated;
  opacity: 0.55;
}*/

/* ============================================================
   5. PROJECT LIST — shared band styles
   ============================================================ */
.projects {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px var(--margin) 140px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.card.visible { opacity: 1; transform: translateY(0); }
.card:hover .card-title { color: var(--accent); }

.card-image {
  position: relative;
  overflow: hidden;
  background: #e8e5e1;
  width: 100%;
  border: 1px solid var(--bord);
}
.card-image.dash-background {
  background-color: #4a526e;
  background: linear-gradient(225deg,rgba(78, 86, 128, 1) 0%, rgba(29, 29, 38, 1) 100%);
}

.card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.card-text { display: flex; flex-direction: column; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.card-index {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  display: none;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-title {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.15s;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  margin-top: 16px;
  transition: color 0.15s, gap 0.2s;
}

.read-more:hover { color: var(--ink); gap: 11px; }

/* ============================================================
   5A. PROJECT PAGE LAYOUT
   ============================================================ */

.project-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--margin) 140px;
  opacity: 0;
  animation: rise 0.6s ease forwards 0.15s;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-mid);
  padding-top: 52px;
  padding-bottom: 56px;
  transition: color 0.15s, gap 0.2s;
  display: block;
}

.back-link:hover { color: var(--ink); }
.back-link::before { content: '←  '; }

/* ── Project header ── */
.project-header {
  margin-bottom: 64px;
}

.project-tag {
  margin-bottom: 20px;
  display: block;
}

.project-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  max-width: 820px;
}

/* ── Opening layout: prose + optional metrics aside ──
   Uses CSS grid so metrics float beside the first paragraphs.
   If .metrics is absent the prose spans full column width.   */
.project-opening {
  display: grid;
  grid-template-columns: var(--col) 1fr;
  gap: 0 80px;
  align-items: start;
  margin-bottom: 56px;
}

/* ── Body prose ── */
.project-body {
  max-width: var(--col);
}

.project-body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 28px;
}

.project-body p:last-child { margin-bottom: 0; }

/* ── Metrics aside ──
   Place inside .project-opening alongside .project-body.
   Remove the entire .metrics element if not needed.        */
.metrics {
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 0;
}

.metric-value {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  line-height: 1.4;
}

/* ── Inline prose continuation (after opening grid) ── */
.project-prose {
  max-width: var(--col);
  margin-bottom: 56px;
}

.project-prose p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 28px;
}

.project-prose p:last-child { margin-bottom: 0; }

.footnote-link {
  text-decoration: none;
  color: var(--ink-mid);
  transition: color 0.15s;
}

.footnote-link:hover {
  color: var(--accent);
}

.footnote-link sup {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.05em;
  vertical-align: super;
  line-height: 0;
}

/* ============================================================
   IMAGE COMPONENTS
   Drop these anywhere in the flow between prose blocks.
   ============================================================ */

.project-page img {
  border: 1px solid var(--bord);
}
.project-page .no-border img {
  border: none;
}

/* Full-width image — spans the full content column */
.img-full {
  margin: 56px 0;
}

.img-full img {
  width: 100%;
  height: auto;
  display: block;
}

.img-contained {
  margin: 56px auto;
  max-width: 480px;
}

.img-contained img {
  width: 100%;
  height: auto;
  display: block;
}

.img-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
  margin-top: 12px;
  line-height: 1.5;
}

/* Half-width image — floats left or right beside text
   Wrap a .project-prose and an .img-half in .img-half-wrap */
.img-half-wrap {
  display: grid;
  gap: 48px;
  align-items: start;
  margin: 56px 0;
}

.img-half-wrap.img-half-left  { grid-template-columns: 1fr 1fr; }
.img-half-wrap.img-half-right { grid-template-columns: 1fr 1fr; }

.img-half-wrap.img-half-left  .img-half  { order: -1; }
.img-half-wrap.img-half-right .img-half  { order: 1; }

.img-half img { width: 100%; height: auto; }

/* Left: text stacked above image. Right: single tall image.
   Both columns share the same height naturally. */
.img-side-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin: 56px 0;
}

.img-side-stack-left {
  display: flex;
  flex-direction: column;
}

.img-side-stack-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.img-side-stack-right {
  /*position: sticky;*/
  top: 80px; /* accounts for sticky header */
}

/* Two images side by side */
.img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 56px 0;
}

.img-pair img { width: 100%; height: auto; }

/* ============================================================
   PULL QUOTE
   Use 0–1 times per project. Place between prose blocks.
   ============================================================ */

.pull-quote {
  margin: 72px 0;
  padding: 0;
  /* deliberately wider than prose column — creates visual break */
  max-width: 860px;
}

.pull-quote blockquote {
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 32px;
}

.pull-quote cite {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mid);
  font-style: normal;
  margin-top: 20px;
  padding-left: 34px;
}

/* ============================================================
   6. ROW VARIANTS
   ============================================================ */
/* ROW: SINGLE */
.row-single { display: grid; align-items: start; gap: 48px; }
.row-single.img-left  { grid-template-columns: 1fr 300px; }
.row-single.img-right { grid-template-columns: 300px 1fr; }
.row-single.img-left .card-image  { grid-column: 1; grid-row: 1; }
.row-single.img-left .card-text   { grid-column: 2; grid-row: 1; padding-top: 6px; }
.row-single.img-right .card-image { grid-column: 2; grid-row: 1; }
.row-single.img-right .card-text  { grid-column: 1; grid-row: 1; padding-top: 6px; }
.row-single .card-image { aspect-ratio: 4 / 3; }
.row-single .card-image-short { aspect-ratio: 2 / 1; }
.row-single .card-image-mediumshort { aspect-ratio: 5 / 3; }
.row-single .card-title { font-size: clamp(22px, 2.4vw, 34px); }

/* ROW: TWO-UP */
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.row-two .card-image { aspect-ratio: 3 / 2; }
.row-two .card-text  { padding-top: 18px; }
/*.row-two .card-title { font-size: clamp(16px, 1.5vw, 21px); }*/
.row-two .card-title { font-size: 22px; }

/* ROW: THREE-UP */
.row-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; align-items: start; }
.row-three .card-image { aspect-ratio: 4 / 3; }
.row-three .card-text  { padding-top: 14px; }
/*.row-three .card-title { font-size: clamp(13px, 1.2vw, 17px); }*/
.row-three .card-title { font-size: clamp(17px, -0.5vw + 22px, 22px); }

/* ROW: FOOTER PROJECT */
.row-footer-project .card-image { aspect-ratio: 21 / 5; }
.row-footer-project .card-text  { padding-top: 18px; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 32px; }
.row-footer-project .card-meta  { margin-bottom: 0; }
.row-footer-project .card-title { font-size: clamp(13px, 1.2vw, 16px); }
.row-footer-project .read-more  { margin-top: 0; flex-shrink: 0; }

/* ============================================================
   6.1 CONTACT NUDGE
   ============================================================ */


/* ============================================================
   6.2 ABOUT SECTION
   ============================================================ */

.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--margin) 100px;
  border-top: 1px solid rgba(26, 28, 33, 0.1);
}

.about-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 80px;
  padding-top: 52px;
  max-width: 860px;
}

.about-label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding-top: 4px;
}

.about-text p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 20px;
}

.about-text a {
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-mid);
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-mono);
}

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

@media (max-width: 560px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ============================================================
   7. IMAGE PLACEHOLDERS
   ============================================================ */
.ph { position: absolute; inset: 0; }
.ph-warm { background: #edeae5; }
.ph-cool { background: #e4e8e7; }
.ph-mid  { background: #e8e5e1; }
.ph-grid {
  background-color: #edeae5;
  background-image: linear-gradient(rgba(26,28,33,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(26,28,33,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.ph-strips { display: flex; height: 100%; }
.ph-strips .s1 { flex: 1; background: #dedbd6; }
.ph-strips .s2 { flex: 1; background: #d3d0ca; }
.ph-strips .s3 { flex: 1; background: #c9c5be; }
.ph-strips .s4 { flex: 1; background: #bfbab3; }
.ph-strips .s5 { flex: 1; background: #b4afa7; }

/* ============================================================
   8. FOOTER
   ============================================================ */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--margin) 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(26, 28, 33, 0.1);
}
.footer-name { font-size: 13px; font-weight: 500; color: var(--ink-mid); }
.footer-links { display: flex; gap: 28px; }
.footer-links a { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink-mid); transition: color 0.15s; }
.footer-links a:hover { color: var(--ink); }

/* ============================================================
   9. ANIMATIONS
   ============================================================ */
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  :root { --margin: 64px; }
  .row-single.img-left  { grid-template-columns: 1fr 240px; }
  .row-single.img-right { grid-template-columns: 240px 1fr; }
}

@media (max-width: 860px) {
  :root { --margin: 36px; }
  .row-single.img-left, .row-single.img-right { grid-template-columns: 1fr; gap: 20px; }
  .row-single .card-image, .row-single .card-text { grid-column: 1 !important; grid-row: unset !important; }
  .row-single .card-image { order: -1; }
  .row-two   { grid-template-columns: 1fr; gap: var(--mobile-gap); }
  .row-three { grid-template-columns: 1fr 1fr; gap: var(--mobile-gap); }
  .row-footer-project .card-image { aspect-ratio: 16 / 5; }
  .projects { gap: var(--mobile-gap); }
  .hero-statement { font-size: 24px;}

  /* Opening: metrics drop below prose on tablet */
  .project-opening {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .metrics {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px 40px;
    padding-top: 0;
    border-top: 1px solid rgba(26,28,33,0.1);
    padding-top: 28px;
  }

  /* Half-image wraps stack */
  .img-half-wrap.img-half-left,
  .img-half-wrap.img-half-right {
    grid-template-columns: 1fr;
  }

  .img-half-wrap .img-half { order: -1; }

  /* Side Stacked text and image */
  .img-side-stack {
    grid-template-columns: 1fr;
  }

  .img-side-stack-right {
    position: static;
  }
}

@media (max-width: 560px) {
  :root { --margin: 20px; }
  .header-inner { /*flex-direction: column; gap: 14px;*/ align-items: flex-start; }
  nav { flex-wrap: wrap; gap: 14px; }
  .hero { min-height: 75vh; }
  .row-three { grid-template-columns: 1fr; }
  .row-footer-project .card-text { flex-direction: column; gap: 10px; }
  .projects { gap: var(--mobile-gap); padding-bottom: 80px; }
  .hero-statement { font-size: 20px; }

  .project-title { font-size: 28px; }

  .img-pair { grid-template-columns: 1fr; }

  .pull-quote blockquote { font-size: 20px; padding-left: 20px; }
  .pull-quote cite { padding-left: 22px; }

  .project-body p,
  .project-prose p { font-size: 16px; }
}
