/* Homepage: the desktop. Windows sit at fixed spots on wide screens and stack on narrow ones. */

.desktop {
  position: relative;
  display: flex; flex-direction: column; gap: 2rem;
  padding: 1.5rem calc(var(--gutter) + 8px) 3.5rem var(--gutter);
}
.window[hidden] { display: none; }
.closebox[hidden] { display: none; }

.content { padding: 1.25rem 1.25rem 1.5rem; }

/* About */
#about .content { padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.75rem) 2rem; }
#about h1 {
  margin: 0 0 .75rem;
  font: 700 clamp(2.75rem, 5.4vw, 5.25rem)/.92 var(--pixel);
  letter-spacing: -.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
#about .lede { margin: 0 0 1.25rem; max-width: 34ch; font: 500 clamp(1.25rem, 1.9vw, 1.5rem)/1.25 var(--pixel); }
#about p { margin: 0 0 1rem; max-width: 60ch; font-size: 1.125rem; line-height: 1.55; }
#about .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem; }

/* Links: Finder list view */
.listview { width: 100%; border-collapse: collapse; font-size: 1rem; }
.listview th {
  padding: .45rem .75rem; text-align: left;
  font: 400 .9375rem/1 var(--pixel);
  border-bottom: 1px solid var(--ink);
}
.listview th + th, .listview td + td { border-left: 1px dotted var(--ink); }
.listview td { padding: .3rem .75rem; vertical-align: middle; line-height: 1.25; }
.listview tbody tr { position: relative; }
.listview tbody tr:first-child td { padding-top: .55rem; }
.listview .name a { display: flex; align-items: center; gap: .6rem; font-weight: 700; text-decoration: none; }
.listview .name a::after { content: ""; position: absolute; inset: 0; }
.listview .name a:hover, .listview .name a:focus-visible { background: none; color: inherit; outline: none; }
.listview tbody tr:hover, .listview tbody tr:focus-within { background: var(--ink); color: var(--paper); }
.listview tbody tr:hover td, .listview tbody tr:focus-within td { border-color: var(--paper); }
.listview tbody tr:hover .icon, .listview tbody tr:focus-within .icon { color: inherit; --paper: var(--ink); }
.listview .kind, .listview .comment { font-size: .9375rem; }
.listview .comment { white-space: nowrap; }
.listview th:last-child, .listview td:last-child { padding-right: 1rem; }

/* Testimony.log */
.log { width: 100%; border-collapse: collapse; }
.log th, .log td { padding: .45rem 0; vertical-align: baseline; text-align: left; border-bottom: 1px dotted var(--ink); }
.log tr:last-child th, .log tr:last-child td { border-bottom: 0; }
.log th {
  width: 7.5rem; padding-right: 1rem;
  font: 400 1rem/1.3 var(--pixel);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.log td { line-height: 1.4; }

/* The Great Hack */
.poster { margin: 0; padding: 1rem 1rem .9rem; }
.poster > a { display: block; width: fit-content; margin: 0 auto; border: var(--frame) solid var(--ink); line-height: 0; }
.poster > a:hover { background: none; }
.poster img { display: block; width: 270px; height: auto; image-rendering: pixelated; }
.poster figcaption { margin-top: .9rem; font-size: .9375rem; line-height: 1.45; max-width: 34ch; }

/* Selected writing: icon view */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem 1.25rem; margin: 0; padding: 1rem 1rem 1.25rem; list-style: none; }
.files a { display: grid; grid-template-columns: 32px 1fr; gap: .2rem .8rem; padding: .5rem; text-decoration: none; }
.files .t { font-weight: 700; line-height: 1.3; }
.files .m { grid-column: 2; font: 400 .9375rem/1.3 var(--pixel); }
.files .icon { grid-row: span 2; }
.files a:hover .icon, .files a:focus-visible .icon { color: inherit; --paper: var(--ink); }

/* Desktop icons */
.icons { display: none; }
.icons a {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  width: 6.5rem; padding: .35rem 0;
  text-decoration: none; text-align: center;
}
.icons a:hover { background: none; color: inherit; }
.icons .label { padding: .1rem .35rem; background: var(--paper); font: 400 .9375rem/1.15 var(--pixel); }
.icons a:hover .label, .icons a:focus-visible .label { background: var(--ink); color: var(--paper); }
.icons a:focus-visible { outline: none; background: none; }
.icons a:not(.is-open) .icon { color: var(--ink); }
.icons a.is-open .icon { --paper: transparent; }
.icons a.is-open .icon { background: var(--dither-25); }

.footer { padding: 0 var(--gutter) 2rem; font: 400 .9375rem/1.3 var(--pixel); }
.footer span { background: var(--paper); padding: .15rem .4rem; }

/* Narrow: one column in reading order, nothing to drag or close. */
.col { display: contents; }
#about { order: 1; } #links { order: 2; } #testimony { order: 3; } #hack { order: 4; } #writing { order: 5; }
.desktop .closebox { display: none; }

/* Wide: two loose columns of windows over the desktop, then Writing across the bottom.
   Windows stay in flow so they never cover each other at rest; dragging offsets them. */
@media (min-width: 1100px) {
  .desktop {
    display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 2.5rem 3rem; align-items: start;
    margin-right: 8.5rem; padding: 2rem 0 4rem 2rem;
  }
  .col { display: flex; flex-direction: column; gap: 2.25rem; }
  .desktop .window { position: relative; }
  .desktop .closebox { display: grid; }
  .desktop .closebox[hidden] { display: none; }
  .col-b { padding-top: 1.75rem; }
  #testimony { margin: 0 2.5rem 0 4.5rem; }
  #hack { align-self: center; width: calc(270px + 2rem + 4px); }
  #writing { grid-column: 1 / -1; margin-right: 1rem; }
  .icons {
    position: absolute; right: 1rem; top: calc(var(--menubar) + 1.25rem);
    display: flex; flex-direction: column; gap: .9rem;
  }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  .listview .kind, .listview th.kind { display: none; }
}
/* Desktop icons at 3x so they hold their own beside the windows. */
.icons .icon { width: 48px; height: 48px; }
@media (max-width: 34rem) {
  .listview .kind, .listview th.kind { display: none; }
  .listview .comment { white-space: normal; }
  .log th { width: 6.5rem; }
}
