/* Shared stylesheet for project detail pages. Matches the homepage system. */

:root {
  --orange: #ce7241;
  --ink: #1b130d;
  --line: #1b130d;
  --rule: 2px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--orange);
  color: var(--ink);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell { max-width: 1240px; margin: 0 auto; padding: var(--gutter); }
a { color: inherit; }

/* ---------- Masthead ---------- */
/* Mobile: RETURN left, protein GIF right, contact links in a row below. */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "ret  mark"
    "links links";
  align-items: center;
  column-gap: clamp(14px, 4vw, 28px);
  row-gap: 16px;
  padding-bottom: 18px;
  border-bottom: var(--rule) solid var(--line);
}

.masthead .return { grid-area: ret; justify-self: start; white-space: nowrap; }
.masthead .brand-mark { grid-area: mark; }
.masthead .contact { grid-area: links; }

.wordmark {
  font-family: 'Rubik Mono One', sans-serif;
  font-weight: 400;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: -0.01em;
  text-decoration: none;
  line-height: 1;
}

/* Spinning protein GIF, cropped into its square and clickable -> gallery. */
.brand-mark {
  display: grid;
  place-items: center;
  justify-self: end;
  width: clamp(58px, 16vw, 84px);
  aspect-ratio: 1;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); }

/* Contact links, mirroring the homepage. */
.contact {
  display: flex;
  flex-flow: row wrap;
  gap: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding-top: 14px;
  border-top: 1px solid rgba(27, 19, 13, 0.32);
}
.contact a {
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: border-color 120ms ease;
}
.contact a:hover { border-color: var(--ink); }

/* ---------- Project header ---------- */
.project-head { margin: clamp(34px, 6vw, 56px) 0 clamp(26px, 4vw, 36px); }

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow .yr { font-weight: 600; }
.eyebrow .tag { border: 1px solid currentColor; padding: 3px 8px; opacity: 0.85; }

.project-title {
  margin: 0;
  font-family: 'Rubik Mono One', sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 5.2vw, 52px);
  line-height: 1.03;
  letter-spacing: -0.015em;
  max-width: 20ch;
}

/* ---------- Detail body ---------- */
.detail { display: grid; grid-template-columns: 1fr; gap: var(--gutter); align-items: start; }

.body p {
  margin: 0 0 18px;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.62;
  max-width: 64ch;
}

.confidential {
  font-size: 13px;
  opacity: 0.82;
  border-left: 2px solid var(--ink);
  padding-left: 12px;
  max-width: 60ch;
}

.actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: var(--rule) solid var(--ink);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 130ms ease, color 130ms ease;
}
.btn:hover { background: var(--ink); color: var(--orange); }

/* ---------- Figure ---------- */
.figure { margin: 0; }
.figure img { display: block; width: 100%; height: auto; border: var(--rule) solid var(--line); }
.figure figcaption {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

/* ---------- Footer ---------- */
.colophon {
  margin-top: clamp(40px, 7vw, 64px);
  padding-top: 18px;
  border-top: var(--rule) solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.maxim { font-style: italic; }
.attrib { margin-left: 10px; opacity: 0.78; }
.colophon .loc { opacity: 0.78; }

@media (min-width: 860px) {
  .shell {
    max-width: none;
    padding-left: clamp(16px, 2.4vw, 40px);
    padding-right: clamp(16px, 2.4vw, 40px);
  }

  /* RETURN flush left · links left of the GIF · GIF flush right. */
  .masthead {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "ret links mark";
    column-gap: clamp(24px, 4vw, 56px);
  }
  .contact {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 6px;
    padding-top: 0;
    border-top: 0;
  }
  .brand-mark { width: clamp(72px, 9vw, 104px); }

  .detail { grid-template-columns: 1.05fr 1fr; }
  .detail.no-fig { grid-template-columns: 1fr; }

  /* Wide, monitor-proportioned project images (no distortion) */
  .figure img { aspect-ratio: 16 / 9; object-fit: cover; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
