/* Jonathan Pilch — homepage
   A single column of white rounded cards on light grey. */

:root {
  --page: #e6e6e6;
  --card: #ffffff;
  --well: #f1f1f1;
  --ink: #111111;
  --muted: #8a8a8a;
  --line: #e4e4e4;
  --pink: #ff5fd8;
  --radius: 26px;
  --gap: 8px;
  --col: 38.5rem;
  --pad: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 30;
  padding: .5em .9em; border-radius: 999px; background: var(--ink); color: #fff;
}
.skip-link:focus { top: 1rem; }

.page {
  width: 100%;
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 48px 16px 64px;
}
main { display: flex; flex-direction: column; gap: var(--gap); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  scroll-margin-top: 96px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 7px 7px 18px;
  margin-bottom: var(--gap);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.mark {
  font-weight: 700; font-size: 19px; letter-spacing: -.04em;
  white-space: nowrap;
  text-decoration: none;
}
.nav nav { display: flex; gap: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 9px 9px 16px;
  border-radius: 999px;
  background: var(--well);
  font-size: 19px; letter-spacing: -.02em;
  text-decoration: none;
  transition: background-color .25s ease;
}
.tab:hover { background: #e7e7e7; }
.tab[aria-current="true"] { background: var(--pink); }
.sign {
  position: relative; width: 22px; height: 22px; flex: none;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.sign::before, .sign::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 1.5px; margin: -.75px 0 0 -5px;
  background: currentColor;
  transition: transform .25s ease;
}
.sign::after { transform: rotate(90deg); }
.tab[aria-current="true"] .sign::after { transform: rotate(0deg); }

/* ---------- info ---------- */

.info { display: flex; flex-direction: column; gap: 92px; }
.info-top { display: flex; align-items: flex-start; gap: 20px; }
.portrait {
  width: 196px; height: auto; aspect-ratio: 1; flex: none;
  border-radius: 14px;
  object-fit: cover;
  background: #ddd;
}
.place { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.clock { margin-left: auto; font-variant-numeric: tabular-nums; }
.bio { font-size: 24px; line-height: 1.24; letter-spacing: -.025em; text-wrap: pretty; }
.bio-more { display: flex; flex-direction: column; gap: .8em; margin-top: -72px; color: var(--muted); font-size: 16px; }

/* ---------- logo marquee ---------- */

.logos { padding: 0; overflow: hidden; }
.marquee {
  display: flex; width: max-content;
  animation: scroll 28s linear infinite;
}
.logos:hover .marquee { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.track { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.track li {
  display: flex; align-items: center; gap: 8px;
  height: 78px; padding: 0 30px;
  white-space: nowrap;
}
.lg-nu { width: 30px; height: 30px; }
.w-nu { font-family: Georgia, "Cooper Black", serif; font-weight: 900; font-size: 25px; letter-spacing: -.03em; }
.lg-ndex { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.w-ndex { font-weight: 700; font-size: 24px; letter-spacing: -.04em; }
.lg-alum { width: 27px; height: 27px; }
.w-alum { font-family: Georgia, serif; font-weight: 700; font-size: 25px; letter-spacing: -.03em; }
.w-pam { font-weight: 800; font-size: 13px; line-height: .95; text-transform: uppercase; letter-spacing: -.02em; }
.lg-star { width: 22px; height: 22px; margin-left: -4px; align-self: flex-start; margin-top: 22px; }

/* ---------- work list ---------- */

.work { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.item { border-radius: 20px; background: var(--well); transition: background-color .2s; }
.item:hover { background: #ececec; }
.item[open] { background: var(--well); }
.item summary {
  display: grid; grid-template-columns: 154px 1fr 24px; gap: 20px;
  padding: 20px;
  cursor: pointer;
  list-style: none;
}
.item summary::-webkit-details-marker { display: none; }
.thumb {
  width: 154px; aspect-ratio: 1;
  border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  position: relative;
}
.item-text { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; }
.item-head { display: flex; flex-direction: column; gap: 2px; }
.item-title { font-size: 17px; font-weight: 500; }
.item-role { font-size: 13px; color: var(--muted); }
.item-desc { color: var(--muted); font-size: 16px; line-height: 1.38; text-wrap: pretty; }
.plus {
  position: relative; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid #b5b5b5; border-radius: 50%;
}
.plus::before, .plus::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 1.5px; margin: -.75px 0 0 -5px;
  background: #9a9a9a; transition: transform .25s ease;
}
.plus::after { transform: rotate(90deg); }
.item[open] .plus::after { transform: rotate(0deg); }

.item-body {
  display: flex; flex-direction: column; gap: .85em;
  padding: 0 20px 22px calc(20px + 154px + 20px);
  color: #444; font-size: 15.5px; line-height: 1.55;
}
.item-body a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
.ext { font-weight: 500; color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.facts li { padding: 5px 11px; border-radius: 999px; background: #fff; font-size: 13px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }

/* thumbnails, each in its product's own colors */
.th-nu { background: #000; }
.th-nu img { width: 56%; filter: invert(1); }

.th-ndex {
  background: linear-gradient(180deg, rgba(18,63,134,.55), rgba(10,36,82,.85)), url("assets/vt-drillfield.jpg") center / cover;
}
.th-ndex svg { width: 46%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 8px rgba(0,0,0,.25)); }

.th-alum {
  background:
    radial-gradient(70% 70% at 15% 15%, rgba(245,180,140,.85), transparent 70%),
    radial-gradient(70% 70% at 90% 20%, rgba(214,160,190,.8), transparent 70%),
    #f6f5f2;
}
.th-alum img { width: 46%; }

.th-pam { background: #FFBF00; place-items: end start; padding: 14px; }
.th-pam span { font-weight: 800; font-size: 25px; line-height: .88; text-transform: uppercase; letter-spacing: -.045em; color: #111; }
.th-pam img { position: absolute; top: 10px; right: 10px; width: 44%; mix-blend-mode: multiply; }

.th-math { background: linear-gradient(160deg, #8e7cff, #5a45e8); color: #fff; font: 600 44px/1 -apple-system, "SF Pro Display", system-ui, sans-serif; letter-spacing: -.03em; }

.th-music {
  background: radial-gradient(90% 80% at 50% 0%, #2a2d36, #0f1014);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.th-music i { width: 8px; border-radius: 4px; background: #ffb648; animation: eq 1.4s ease-in-out infinite; }
.th-music i:nth-child(1) { height: 26%; animation-delay: -.2s; }
.th-music i:nth-child(2) { height: 48%; background: #ff6b8b; animation-delay: -.9s; }
.th-music i:nth-child(3) { height: 70%; background: #6be0c8; animation-delay: -.5s; }
.th-music i:nth-child(4) { height: 40%; background: #8fa8ff; animation-delay: -1.1s; }
.th-music i:nth-child(5) { height: 62%; animation-delay: -.3s; }
.th-music i:nth-child(6) { height: 34%; background: #ff6b8b; animation-delay: -.7s; }
.th-music i:nth-child(7) { height: 20%; background: #6be0c8; animation-delay: -1.3s; }
/* personal projects: the two thumbnails split side by side */
.th-projects { display: flex; }
.th-projects .half { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; }
.th-projects .th-math { font-size: 30px; }
.th-projects .th-music { gap: 4px; }
.th-projects .th-music i { width: 6px; }
.project { display: flex; flex-direction: column; gap: .7em; }
.project + .project { padding-top: 1.1em; border-top: 1px solid #e2e2e2; }
.project h3 { margin: 0; font-size: 16px; font-weight: 500; color: var(--ink); letter-spacing: -.015em; }
.project-meta { margin-top: -.6em; font-size: 13px; color: var(--muted); }
@keyframes eq { 50% { transform: scaleY(.55); } }

/* ---------- writing ---------- */

.card-label { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.essay-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; margin: 0 -4px -4px;
  border-radius: 18px; background: var(--well);
  text-decoration: none;
  transition: background-color .2s;
}
.essay-link:hover { background: #ececec; }
.essay-link-title { font-size: 24px; letter-spacing: -.025em; line-height: 1.15; }
.essay-link-sub { color: var(--muted); font-size: 16px; line-height: 1.38; }
.essay-link-meta { margin-top: 18px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* ---------- contact ---------- */

.contact { display: flex; flex-direction: column; gap: 78px; padding-top: 22px; }
.contact-lede { font-size: 16px; }
.contact-links { color: var(--muted); font-size: 16px; line-height: 1.5; }
.contact-links a { text-decoration: none; }
.contact-links a:hover { color: var(--ink); }

/* ---------- essay page ---------- */

.essay-head { display: flex; flex-direction: column; padding-bottom: 26px; }
.essay-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 84px; }
.back { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.essay-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.essay-head h1 { margin: 0 0 .3em; font-weight: 500; font-size: clamp(36px, 6vw, 48px); line-height: 1.02; letter-spacing: -.04em; }
.essay-sub { font-size: 20px; line-height: 1.3; letter-spacing: -.02em; color: var(--muted); max-width: 30em; }

.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li + li { border-top: 1px solid var(--line); }
.toc a { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; font-size: 16px; text-decoration: none; }
.toc a:hover { color: #555; }
.toc-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.essay-body { padding: 28px 28px 32px; }
.prose { font-size: 17px; line-height: 1.68; letter-spacing: -.008em; color: #222; }
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  margin: 1.9em 0 .6em; padding-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2;
  scroll-margin-top: 96px;
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.essay-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.essay-foot a { text-decoration: none; }
.essay-foot a:hover { color: var(--ink); }

/* ---------- small screens ---------- */

@media (max-width: 600px) {
  :root { --radius: 22px; --pad: 16px; }
  .page { padding: 12px 10px 40px; }
  .nav { top: 8px; padding-left: 14px; }
  .nav nav { gap: 4px; }
  .tab { font-size: 14.5px; gap: 5px; padding: 6px 6px 6px 11px; }
  .sign { width: 18px; height: 18px; }
  .sign::before, .sign::after { width: 8px; margin-left: -4px; }
  .portrait { width: 124px; }
  .info { gap: 56px; }
  .info-top { flex-wrap: wrap; gap: 10px 14px; }
  .bio { font-size: 20px; }
  .essay-top { margin-bottom: 48px; }
  .essay-sub { font-size: 18px; }
  .essay-body { padding: 20px 18px 24px; }
  .prose { font-size: 16.5px; }
  .essay-link-title { font-size: 21px; }
  .bio-more { margin-top: -40px; }
  .item summary { grid-template-columns: 76px 1fr 22px; gap: 14px; padding: 14px; }
  .thumb { width: 76px; border-radius: 10px; }
  .item-text { gap: 8px; }
  .item-desc { font-size: 14.5px; }
  .item-body { padding: 0 14px 18px; }
  .th-pam { padding: 8px; }
  .th-pam span { font-size: 12.5px; }
  .th-pam img { top: 8px; right: 8px; }
  .th-math, .th-projects .th-math { font-size: 18px; }
  .th-music { gap: 3px; }
  .th-music i, .th-projects .th-music i { width: 3px; }
  .th-projects .th-music { gap: 2px; }
  .mark { font-size: 16px; }
  .track li { height: 64px; padding: 0 22px; }
}

@media (max-width: 420px) {
  /* room for the full name: drop the +/- circles on the smallest phones */
  .tab .sign { display: none; }
  .tab { padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee, .th-music i { animation: none; }
}
