/* /projects — MIT Media Lab look: black, white, hairline rules, Neue Haas Grotesk.
   Tiles are the News + Updates grid (2x2 large, 1x1 small) with Groups-style
   content. The accent shows up only on hover, focus and click. Loaded only on
   /projects pages, after styles.css. */

body.page-projects {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.34);
  --rule: #2b2b2b;
  --card: #0d0d0d;
  --accent: #7cc4ff;
  --accent-fg: #000;
  --mh-display: "neue-haas-grotesk-display", "Neue Haas Grotesk Display Pro",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mh-text: "neue-haas-grotesk-text", "Neue Haas Grotesk Text Pro",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  color-scheme: dark;
  font-family: var(--mh-text);
}
body.page-projects .theme-toggle { display: none; }
body.page-projects main { max-width: 100rem; }
body.page-projects .site-mark { font-family: var(--mh-display); font-style: normal; font-weight: 700; }
body.page-projects a { color: inherit; }

.pf { --pf-accent: var(--accent); padding-bottom: 4rem; }

/* ── Head + filters ── */
.pf-head h1 {
  font-family: var(--mh-display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin: 1.5rem 0 0.75rem;
}
.pf-head h1 sup,
.pf-tab sup {
  font-size: 0.32em;
  font-weight: 500;
  vertical-align: top;
  position: relative;
  top: 0.35em;
  margin-left: 0.15em;
  font-variant-numeric: tabular-nums;
}
.pf-lede { color: var(--muted); max-width: 60ch; margin: 0 0 2rem; }
.pf-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin-bottom: 0.9rem; }
.pf-tab {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mh-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem); letter-spacing: -0.01em;
  color: var(--faint);
}
.pf-tab:hover, .pf-tab[aria-pressed="true"] { color: var(--fg); }
.pf-tab[aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 0 1.5rem; border-top: 1px solid var(--rule); }
.pf-chip {
  background: none; border: 1px solid var(--rule); color: var(--muted);
  font: 0.8rem/1 var(--mh-text); padding: 0.4rem 0.6rem; cursor: pointer;
}
.pf-chip:hover { color: var(--fg); }
.pf-chip[aria-pressed="true"] { color: var(--fg); border-color: var(--fg); }
.pf-tab:focus-visible, .pf-chip:focus-visible { outline: 2px solid var(--pf-accent); outline-offset: 2px; }
.pf-empty { color: var(--muted); padding: 2rem 0; }

/* ── Sections: one per category, large tiles first ── */
.pf-section { margin-bottom: 3rem; }
.pf-section[hidden] { display: none; }
.pf-section-h {
  font-family: var(--mh-display); font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.pf-section-h sup { font-size: 0.45em; font-weight: 500; vertical-align: top; position: relative; top: 0.3em; margin-left: 0.15em; color: var(--muted); }

/* ── Grid: hairline rules come from the 1px gaps over the rule color ── */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 19rem;
  grid-auto-flow: dense;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 70rem) { .pf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 48rem) { .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) {
  .pf-grid { grid-template-columns: 1fr; }
  .pt.pt-large { grid-column: span 1; }
}

/* ── Tile ── */
.pt {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  padding: 1rem 1.15rem;
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.22s, background-color 0.22s;
}
.pt-large { grid-column: span 2; grid-row: span 2; }
.pt[hidden] { display: none; }
.pt:hover,
.pt:focus-visible {
  z-index: 5;
  outline: none;
  transform: scale(1.045);
  background: color-mix(in srgb, var(--pf-accent) 7%, #000);
  box-shadow: 0 0 0 1px var(--pf-accent), 0 0 2.2rem 0.25rem color-mix(in srgb, var(--pf-accent) 28%, transparent);
}
.pt.is-pressed { animation: pt-press 0.32s ease-out; }
@keyframes pt-press {
  0% { box-shadow: 0 0 0 1px var(--pf-accent), 0 0 4rem 1rem color-mix(in srgb, var(--pf-accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 1px var(--pf-accent), 0 0 2.2rem 0.25rem color-mix(in srgb, var(--pf-accent) 28%, transparent); }
}
.pt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.pt-mark {
  flex: none; display: grid; place-items: center;
  width: 1.65rem; height: 1.65rem; border: 1.5px solid currentColor;
  font: 700 0.7rem/1 var(--mh-display); letter-spacing: -0.02em;
}
.pt-tags { font-size: 0.75rem; line-height: 1.35; color: var(--faint); text-align: right; overflow-wrap: anywhere; }
.pt:hover .pt-tags, .pt:focus-visible .pt-tags { color: var(--muted); }
.pt-art { flex: 1; min-height: 0; position: relative; display: block; }
.pt-art canvas, .pt-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pt-art img { object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.22s; }
.pt:hover .pt-art img, .pt:focus-visible .pt-art img { filter: none; }
.pt-title {
  font-family: var(--mh-display); font-weight: 700;
  font-size: 1.2rem; line-height: 1.12; letter-spacing: -0.005em;
  text-wrap: balance;
}
.pt-large .pt-title { font-size: clamp(1.6rem, 2.4vw, 2.15rem); }
.pt:hover .pt-title, .pt:focus-visible .pt-title { color: var(--pf-accent); }
.pt-desc {
  font-size: 0.82rem; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-large .pt-desc { font-size: 0.95rem; -webkit-line-clamp: 4; max-width: 56ch; }
.pt-foot { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Project page ── */
.pf-crumb { color: var(--muted); font-size: 0.85rem; margin: 1.5rem 0 0; }
.pf-crumb a { text-decoration: none; }
.pf-crumb a:hover { color: var(--pf-accent); }
.pf-item-head {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem;
  padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--rule);
}
@media (max-width: 48rem) { .pf-item-head { grid-template-columns: 1fr; } }
.pf-item-tags { text-align: left; margin: 0 0 0.75rem; }
.pf-item-head h1 {
  font-family: var(--mh-display); font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.75rem); line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 1rem; text-wrap: balance;
}
.pf-item-why { font-size: 1rem; line-height: 1.55; max-width: 60ch; margin: 1rem 0 0; }
.pf-item-why-k { display: block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-accent); margin-bottom: .25rem; }
.pf-item-oneline { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.45; color: var(--muted); max-width: 52ch; margin: 0; }
.pf-item-art { position: relative; min-height: 16rem; border: 1px solid var(--rule); }
.pf-item-art .pt-art { position: absolute; inset: 1rem; }
.pf-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px; background: var(--rule); border-bottom: 1px solid var(--rule); margin: 0;
}
.pf-meta div { background: var(--bg); padding: 1rem 1.25rem; }
.pf-meta div:first-child { padding-left: 0; }
.pf-meta dt { font-size: 0.75rem; color: var(--faint); margin-bottom: 0.25rem; }
.pf-meta dd { margin: 0; font-size: 0.95rem; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding: 1.5rem 0; }
.pf-cta {
  display: inline-block; padding: 0.6rem 1rem; border: 1px solid var(--fg);
  text-decoration: none; font-weight: 500;
}
.pf-cta:hover, .pf-cta:focus-visible { background: var(--pf-accent); border-color: var(--pf-accent); color: #000; outline: none; }
.pf-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; font-size: 0.9rem; }
.pf-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.pf-links a:hover { color: var(--pf-accent); text-decoration-color: currentColor; }
.pf-related h2 { font-family: var(--mh-display); font-weight: 700; font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.pf-grid-related { grid-auto-rows: 17rem; }

@media (prefers-reduced-motion: reduce) {
  .pt, .pt-art img { transition: none; }
  .pt:hover, .pt:focus-visible { transform: none; }
  .pt.is-pressed { animation: none; }
}

/* ── Reading pages: /blog, /blog/<slug>, /portfolio/<group> ──
   Same black-and-white Media Lab look, set for reading: bigger body type,
   more contrast on secondary text, and a comfortable line length. */
.rd { --muted: rgba(255, 255, 255, 0.74); --faint: rgba(255, 255, 255, 0.5); }
.rd-lede { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.5; max-width: 46ch; }

.rd-list { list-style: none; margin: 0 0 3rem; padding: 0; border-top: 1px solid var(--rule); max-width: 52rem; }
.rd-list li { border-bottom: 1px solid var(--rule); }
.rd-item { display: grid; gap: 0.35rem; padding: 1.4rem 0; text-decoration: none; }
.rd-item:hover .rd-title, .rd-item:focus-visible .rd-title { color: var(--pf-accent); }
.rd-item:focus-visible { outline: 2px solid var(--pf-accent); outline-offset: 4px; }
.rd-date { font-size: 0.85rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.rd-title { font-family: var(--mh-display); font-weight: 700; font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -0.005em; }
.rd-summary { font-size: 1.05rem; line-height: 1.5; color: var(--muted); max-width: 60ch; }

.rd-next ul { list-style: none; margin: 0; padding: 0; max-width: 52rem; }
.rd-next li { display: grid; gap: 0.25rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.rd-next .rd-title { font-size: 1.15rem; color: var(--fg); }

.rd-post { max-width: 44rem; }
.rd-post-head { padding: 1.25rem 0 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.75rem; }
.rd-post-head h1 { font-family: var(--mh-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 0.75rem; text-wrap: balance; }
.rd-body { font-size: 1.15rem; line-height: 1.7; color: rgba(255, 255, 255, 0.9); }
.rd-body p, .rd-body ul, .rd-body ol { margin: 0 0 1.2em; }
.rd-body li { margin-bottom: 0.5em; }
.rd-body a { text-decoration: underline; text-underline-offset: 3px; }
.rd-body a:hover { color: var(--pf-accent); }
.rd-back { margin: 2.5rem 0 0; font-size: 1rem; color: var(--muted); }
.rd-back a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.rd-back a:hover { color: var(--pf-accent); }

.rd-group-head h1 { font-size: clamp(2.6rem, 7vw, 5.25rem); margin-top: 1rem; }
.rd-group .rd-lede { max-width: 52ch; margin-bottom: 2.5rem; }
.pt-slot { color: var(--faint); }
.pt-slot .pt-art { border: 1px dashed var(--rule); }
.pt-slot:hover, .pt-slot:focus-visible { transform: none; background: var(--bg); box-shadow: none; }
/* Group pages: end-of-page link to the full Projects page */
.pg-more { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 2rem; margin: 5rem 0 1.5rem; padding: 3.5rem 3rem; min-height: 14rem; align-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; color: var(--fg, #fff); text-decoration: none; transition: border-color .25s, box-shadow .25s, background .25s; }
.pg-more-q { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.05; max-width: 18ch; font-weight: 500; letter-spacing: -.01em; }
.pg-more-cta { font-size: clamp(1.1rem, 1.6vw, 1.4rem); color: var(--pf-accent, #7cc4ff); white-space: nowrap; }
.pg-more:hover { border-color: var(--pf-accent, #7cc4ff); background: color-mix(in srgb, var(--pf-accent, #7cc4ff) 8%, transparent); box-shadow: 0 0 28px color-mix(in srgb, var(--pf-accent, #7cc4ff) 28%, transparent); }

/* Project pages: stack, cost and running list of needs */
.pf-build { margin: 2.5rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.pf-build h2 { font-family: var(--mh-display); font-weight: 700; font-size: 1.5rem; margin: 0 0 1rem; }
.pf-build-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (max-width: 48rem) { .pf-build-cols { grid-template-columns: 1fr; } }
.pf-build-col { background: var(--bg); padding: 1.25rem 1.4rem 1.5rem; }
.pf-build-col h3 { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 0 0 0.9rem; }
.pf-build-col p { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.pf-build-stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pf-build-stack li { font-size: 0.85rem; padding: 0.25rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; }
.pf-build-needs { margin: 0; padding-left: 1.1rem; font-size: 0.95rem; line-height: 1.55; }
.pf-build-needs li::marker { color: var(--pf-accent); }
.pf-build-tbd { color: var(--faint); }

/* Long-form sections on a project page (content/projects.json "about"). */
.pf-about { margin: 1rem 0 0; }
.pf-about-sec { margin: 2.25rem 0 0; padding-top: 2rem; border-top: 1px solid var(--rule); }
.pf-about-sec h2 { font-family: var(--mh-display); font-weight: 700; font-size: 1.5rem; margin: 0 0 .9rem; }
.pf-about-sec p, .pf-about-sec li { font-size: 1.02rem; line-height: 1.6; max-width: 68ch; }
.pf-about-sec p { margin: 0 0 .9rem; }
.pf-about-sec ul { margin: 0; padding-left: 1.2rem; }
.pf-about-sec li { margin-bottom: .45rem; }

/* ── Home (/) ── the same black-and-white look, set as an introduction:
   big name, a short intro, a few project tiles, Jarvis Voice, background. */
.hm-hero { padding: 0.5rem 0 3rem; border-bottom: 1px solid var(--rule); }
.hm-hero h1 {
  font-family: var(--mh-display); font-weight: 700;
  font-size: clamp(3.25rem, 10vw, 7.5rem); line-height: 0.92; letter-spacing: -0.03em;
  margin: 1.5rem 0 1.75rem; text-wrap: balance;
}
.hm-intro p { font-size: clamp(1.15rem, 1.75vw, 1.45rem); line-height: 1.45; max-width: 46ch; margin: 0 0 1rem; color: var(--muted); }
.hm-intro p:first-child { color: var(--fg); }
.hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; margin: 2rem 0 0; }
.hm-actions a:not(.pf-cta) { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--faint); }
.hm-actions a:not(.pf-cta):hover { color: var(--pf-accent); text-decoration-color: currentColor; }
.hm-sec { padding-top: 3rem; }
.hm-sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; }
.hm-more { color: var(--muted); text-decoration: none; }
.hm-more:hover, .hm-more:focus-visible { color: var(--pf-accent); }
.hm .pg-more { margin: 3.5rem 0 0; }
.hm .pg-more-cta { white-space: normal; }
@media (max-width: 40rem) { .hm .pg-more { padding: 2rem 1.5rem; min-height: 0; } }
.hm-bg { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 64rem; }
.hm-bg li { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 0.2rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 40rem) { .hm-bg li { grid-template-columns: 1fr; } }
.hm-bg-k { font-family: var(--mh-display); font-weight: 700; font-size: 1.15rem; line-height: 1.4; }
.hm-bg-v { color: var(--muted); font-size: 1.05rem; line-height: 1.55; max-width: 62ch; }
.hm-bg-v a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); white-space: nowrap; }
.hm-bg-v a:hover { color: var(--pf-accent); text-decoration-color: currentColor; }
.hm-contact-links {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 0;
  font-family: var(--mh-display); font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem); letter-spacing: -0.01em;
}
.hm-contact-links a { text-decoration: none; }
.hm-contact-links a:hover, .hm-contact-links a:focus-visible { color: var(--pf-accent); }
