/* White page, Geist, plain links. */
:root {
  --page: #fff;
  --ink: #111;
  --link: #0000ee;
  --visited: #551a8b;
  --soft: #6a6a6a;
  --rule: #111;
  --mute: #a8a8a8;
  --line: #dcdcdc;
  --sq: #efefef;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
:root.dark {
  --page: #0d0d0d;
  --ink: #e8e8e8;
  --link: #8fb0ff;
  --visited: #c3a6ff;
  --soft: #8c8c8c;
  --rule: #e8e8e8;
  --mute: #6a6a6a;
  --line: #333;
  --sq: #1f1f1f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  padding: 8px 28px 96px;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:visited { color: var(--visited); }
a:focus-visible { outline: 2px dotted currentColor; outline-offset: 3px; }
p { margin: 0 0 1em; }

/* ---------- header, every page ---------- */
.masthead { margin: 0 0 4px; }
.masthead a { display: flex; align-items: center; justify-content: center; }
#archipelago { display: block; margin: 0 auto; max-width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- a note ---------- */
.note { max-width: 1000px; margin: 0 auto; }
.note > :not(.tl) { max-width: 36em; }
.note h1 { font-size: 22px; font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 6px; }
.note h2 { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); margin: 32px 0 6px; }
.meta { color: var(--soft); }
.note img { display: block; max-width: 100%; height: auto; }
.note ul { list-style: none; margin: 0; padding: 0; }
.note li { padding: 2px 0; }
.missing { color: var(--soft); }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; margin: 0 0 1em; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- links bar, stuck to the bottom of every page ---------- */
.home-links {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 14px;
  padding: 10px 28px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--page);
}

@media (max-width: 760px) {
  body { padding: 6px 16px 120px; }
  .masthead { margin-bottom: 4px; }
  .home-links { padding-left: 16px; padding-right: 16px; gap: 6px 20px; }
}

/* ---------- home: timeline of square thumbnails, filtered by type ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 16px; }
.filters button { font: inherit; font-size: 12px; color: var(--mute); background: none; border: 0; padding: 0; cursor: pointer; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.tl-scroll { overflow-x: auto; }
.tl-cols { display: flex; min-width: 560px; max-width: none; }
.tl-col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.stack { list-style: none; margin: 0; padding: 10px 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.stack a { display: block; color: var(--ink); text-decoration: none; max-width: 35px; }
.sq { display: block; aspect-ratio: 1; background: var(--sq); overflow: hidden; }
.sq img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stack .t { display: block; white-space: nowrap; font-size: 11px; line-height: 1.3; color: var(--soft); margin-top: 4px; }
.stack a:hover .t { color: var(--ink); }
.yr { border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); padding-top: 4px; position: relative; }
.yr .end { position: absolute; right: 0; }
.note-cv, .note-friends { font-size: 12px; }
.note-cv h1, .note-friends h1 { font-size: 18px; }
.note-cv h2 { font-size: 10px; margin-top: 26px; }


.home-links a, .home-links a:visited { color: var(--ink); text-decoration: none; }
.home-links a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tl { max-width: 1000px; margin: 0 auto; }

/* ---------- dark mode button ---------- */
.masthead { position: relative; }
.mode { position: absolute; top: 10px; right: 0; width: 11px; height: 11px; padding: 0; border: 1px solid #000; background: #000; cursor: pointer; z-index: 1; }
.dark .mode { background: #fff; border-color: #fff; }
html, body, .home-links { transition: background-color .25s ease, color .25s ease; }

/* ---------- perimeter version (/perimeter/): timeline wrapped around the page edge ---------- */
.perimeter { height: 100vh; overflow: hidden; padding: 0; }
.perimeter .p-line { position: fixed; z-index: 2; top: 20px; left: 20px; right: 20px; bottom: 41px; border: 1px solid var(--line); pointer-events: none; }
.perimeter .mode { position: fixed; top: 4px; right: 20px; }
.perimeter .filters { justify-content: center; margin: 0 0 10px; }
.perimeter .p-cap { font-size: 12px; color: var(--soft); margin: 0; }
.perimeter .p-item { position: fixed; z-index: 3; width: 35px; height: 35px; transition: opacity .3s ease; }
.perimeter .p-item.off { opacity: .1; pointer-events: none; }
.perimeter .p-item:hover .sq { outline: 1px solid var(--ink); }
.perimeter .p-end { position: fixed; font-size: 11px; color: var(--mute); }
.perimeter .p-older { top: 3px; left: 20px; line-height: 1.3; }
.perimeter .p-newer { top: 26px; left: 4px; writing-mode: vertical-rl; transform: rotate(180deg); }
.perimeter .p-scroll { position: fixed; inset: 0; padding: 60px 60px 81px; box-sizing: border-box; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: none; }
.perimeter .p-scroll::-webkit-scrollbar { display: none; }
.perimeter .p-inner { width: 100%; display: flex; flex-direction: column; align-items: center; padding: 8px 0 24px; }
.perimeter .masthead { width: 100%; margin: 0; }
.perimeter .p-center { display: flex; flex-direction: column; align-items: center; }
.perimeter .p-content { width: 100%; max-width: 36em; margin-top: 18px; }
.perimeter .p-content h1 { font-size: 18px; font-weight: 500; margin: 0 0 4px; }
.perimeter .p-content .meta { color: var(--soft); }
.perimeter .p-content a, .perimeter .p-content a:visited { color: var(--ink); }
.perimeter .p-item.on .sq { outline: 1px solid var(--ink); }
.ph-img { aspect-ratio: 4 / 3; background: var(--sq); margin: 0 0 1em; }
.perimeter .home-links a.on { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.perimeter .p-content ul { list-style: none; margin: 0; padding: 0; }
.perimeter .p-content li { padding: 2px 0; }
.perimeter .p-content { transition: opacity .7s ease; }
.perimeter:not(.ready) .masthead, .perimeter:not(.ready) .p-scroll { visibility: hidden; }


/* ---------- bottom bar: pages left, visit counter middle, email + socials right ---------- */
.home-links { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav-l, .nav-r { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.nav-r { justify-content: flex-end; }
.counter { font-size: 12px; color: var(--mute); padding: 0 24px; white-space: nowrap; }
.perimeter .home-links { padding-left: 20px; padding-right: 20px; background: transparent; }
@media (max-width: 760px) { .nav-l, .nav-r { gap: 6px 14px; } .counter { padding: 0 10px; } }
.perimeter .p-content img { display: block; max-width: 100%; height: auto; margin: 0 0 12px; }

.note > .w98,.perimeter .p-content .w98{max-width:none}
.w98{width:100%;box-sizing:border-box;background:#c0c0c0;padding:3px;border:1px solid;border-color:#dfdfdf #000 #000 #dfdfdf;box-shadow:inset 1px 1px #fff,inset -1px -1px #808080;font:bold 11px Tahoma,Geist,sans-serif;color:#fff}
.w98-bar{display:flex;justify-content:space-between;align-items:center;height:18px;padding:0 2px 0 4px;background:linear-gradient(90deg,#000080,#1084d0)}
.w98-bar i{display:flex;gap:2px;font-style:normal}
.w98-bar b{width:16px;height:14px;display:grid;place-items:center;background:#c0c0c0;color:#000;font-size:9px;line-height:1;box-shadow:inset -1px -1px #000,inset 1px 1px #fff,inset -2px -2px #808080,inset 2px 2px #dfdfdf}
.w98-screen{margin-top:2px;aspect-ratio:16/10;box-sizing:border-box;overflow:hidden;position:relative;background:#fff;box-shadow:inset 1px 1px #808080,inset -1px -1px #fff,inset 2px 2px #000,inset -2px -2px #dfdfdf;padding:2px}
.w98-screen video{position:absolute;inset:2px;width:calc(100% - 4px);height:calc(100% - 4px);background:#000;object-fit:contain}
.w98-screen iframe{position:absolute;inset:2px;width:calc(100% - 4px);height:calc(100% - 4px);border:0}

.perimeter .p-piece { transition: opacity .7s ease; }
.perimeter .p-piece + .p-piece { margin-top: 160px; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .perimeter .p-line { top: 14px; left: 14px; right: 14px; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
  .perimeter .p-item { width: 24px; height: 24px; }
  /* the column runs up under the squares but stops at the frame line above the links */
  .perimeter .p-scroll { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); padding: 46px 46px 32px; }
  .perimeter .mode { top: 1px; right: 14px; }
  .perimeter .p-end { font-size: 10px; }
  .perimeter .p-older { top: 0; left: 14px; }
  .perimeter .p-newer { top: 18px; left: 1px; }
  .perimeter .home-links { grid-template-columns: 1fr; justify-items: center; gap: 3px; font-size: 12px; padding: 6px 14px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .perimeter .nav-l, .perimeter .nav-r { justify-content: center; gap: 2px 14px; }
  .perimeter .counter { display: none; }
  .perimeter .filters { gap: 4px 12px; }
}
