/* Hallmark · pre-emit critique: P5 H4 E5 S5 R5 V4 */
:root {
  color-scheme: light;
  --paper: #e6e7e2;
  --paper-deep: #d7d8d3;
  --ink: #202020;
  --faint: #70736e;
  --grid: rgba(46, 48, 45, 0.13);
  --grid-soft: rgba(46, 48, 45, 0.06);
  --panel: rgba(235, 236, 231, 0.74);
  --accent: #ef4f2f;
  --mono: "SFMono-Regular", "Roboto Mono", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}

body {
  background:
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.5), transparent 32%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 72px 72px, 72px 72px, 18px 18px, 18px 18px, auto;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
}

body::before {
  background-image:
    repeating-radial-gradient(circle at 18% 28%, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(96deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 5px);
  content: "";
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.28;
  pointer-events: none;
  position: fixed;
}

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

.projects-shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: clamp(32px, 6vw, 82px) clamp(18px, 5vw, 68px) 36px;
  position: relative;
}

.projects-head {
  align-items: end;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  margin-bottom: clamp(52px, 8vw, 104px);
}

.sys-label,
.head-meta,
.project-index,
.project-kicker,
.project-tags,
.project-action,
.projects-footer,
.bot-sigil {
  font-family: var(--mono);
}

.sys-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 10px;
}

h1 {
  font-family: var(--mono);
  font-size: clamp(54px, 7.5vw, 108px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.78;
  margin: 0;
  overflow-wrap: anywhere;
}

h1 span { color: var(--accent); }

.head-meta {
  border-top: 1px solid var(--ink);
  font-size: 13px;
  padding-top: 14px;
}

.head-meta p {
  margin: 0 0 24px;
  max-width: 48ch;
}

.back-link {
  display: inline-flex;
  font-size: 12px;
  min-height: 44px;
  align-items: center;
}

.back-link:hover,
.back-link:focus-visible { color: var(--accent); outline: none; }

.project-list { border-top: 1px solid var(--ink); }

.project-row {
  align-items: center;
  border-bottom: 1px solid var(--ink);
  display: grid;
  gap: clamp(18px, 3vw, 40px);
  grid-template-columns: 36px 132px minmax(0, 1fr) 154px;
  min-height: 220px;
  padding: 28px 0;
  position: relative;
}

.project-row::after {
  background: var(--accent);
  bottom: -1px;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
  width: 100%;
}

.project-row:has(.project-action:hover)::after,
.project-row:focus-within::after { transform: scaleX(1); }

.project-index {
  align-self: start;
  color: var(--accent);
  font-size: 13px;
  padding-top: 4px;
}

.project-image,
.bot-sigil {
  height: 132px;
  margin: 0;
  overflow: hidden;
  width: 132px;
}

.project-image { background: var(--ink); }

.project-image img {
  display: block;
  filter: grayscale(1) contrast(0.9);
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: filter 300ms ease, opacity 300ms ease, transform 450ms ease;
  width: 100%;
}

.project-row:hover .project-image img {
  filter: grayscale(0.15) contrast(1);
  opacity: 1;
  transform: scale(1.025);
}

.project-image--app img { object-position: 50% 16%; }

.bot-sigil {
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  font-size: 28px;
  justify-content: center;
  position: relative;
}

.bot-sigil::after {
  border: 1px solid var(--accent);
  content: "";
  height: 12px;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 12px;
}

.project-copy { min-width: 0; }

.project-kicker {
  color: var(--faint);
  display: flex;
  font-size: 10px;
  gap: 14px;
  margin-bottom: 8px;
}

.project-kicker span:last-child { color: var(--accent); }

h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 42px);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.project-copy p {
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 68ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  font-size: 9px;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-tags li {
  border: 1px solid var(--ink);
  padding: 3px 6px;
}

.project-action {
  align-items: center;
  border: 1px solid var(--ink);
  display: flex;
  font-size: 11px;
  justify-content: center;
  min-height: 44px;
  padding: 10px;
  white-space: nowrap;
}

.project-action:hover,
.project-action:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.projects-footer {
  color: var(--faint);
  display: flex;
  font-size: 10px;
  justify-content: space-between;
  padding-top: 24px;
}

@media (max-width: 820px) {
  .projects-head { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .project-row {
    align-items: start;
    grid-template-columns: 30px 108px minmax(0, 1fr);
  }
  .project-image,
  .bot-sigil { height: 108px; width: 108px; }
  .project-action { grid-column: 3; justify-self: start; }
}

@media (max-width: 520px) {
  .projects-shell { padding-inline: 14px; }
  .projects-head { margin-bottom: 48px; }
  .project-row {
    gap: 14px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 22px 0 26px;
  }
  .project-image,
  .bot-sigil {
    grid-column: 2;
    height: auto;
    aspect-ratio: 16 / 9;
    width: min(100%, 240px);
  }
  .project-copy,
  .project-action { grid-column: 2; }
  .project-action { justify-self: stretch; }
  .project-kicker { flex-wrap: wrap; }
  .projects-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
