:root {
  --text: #232323;
  --background: #fff;
  --accent: #777;
  --frame-bg: #0f0f10;
  --top-bg: #1a1a1b;
  --dot: #ffffff;
  --frame-radius: 12px;
  --top-height: 30px;
  --border-size: 1px;
  --border-colour: #bebebe;
  --max-width: 900px;
  --dot-size: 11px;
  --dot-gap: 8px;
}

body {
    color: var(--text);
    background: var(--background);
    font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, Segoe UI, Roboto,  "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 0.8em;
    line-height: 1.6;
    margin: 0;
}

.layout {
    display: flex;
    flex-direction: column;
    gap: 10rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.sidebar { top: 1.25rem; align-self: start; }
.sidebar h1 { margin: 0 0 0.5em 0; }
.sidebar nav { display: flex; flex-direction: column; gap: 0.25em; }
.sidebar a { color: inherit; text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }

h1, h2 { font-size: 1em; font-weight: normal; margin: 0 0 0.25em 0; }

a { color: inherit; text-decoration: underline; }
a:hover { text-decoration: underline; }

.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    padding: 0.25rem 0;
}
.archive-list li:first-child { padding-top: 0; }
.archive-list .meta { font-size: 0.8em; color: var(--accent); }

.meta-line { font-size: 0.85em; font-family: monospace; }

.grid h2 { font-size: 1em; margin: 0 0 0.5rem 0; font-weight: normal; }
.grid ul { margin: 0 0 1rem 1.25rem; padding: 0; }
.grid li { margin: 0 0 0.25rem 0; }

.archive-list li > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.archive-list li > div[style*="grid-template-columns"] {
    gap: 1rem;
}

.archive-list li:first-of-type > img:first-of-type {
    width: 100%;
    aspect-ratio: 2.85 / 1;
    object-fit: cover;
    display: block;
    background-color: #fff;
  }

.header {
    background: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgb(221, 221, 221);
}
.header .name { font-size: 1rem; padding-top: 2em; }
#spinny {
    max-width: 70vmin;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 5em auto;
    transform-origin: 50% 50%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    clip-path: circle(50%);
    overflow: hidden;
}

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between-start { display: flex; align-items: flex-start; justify-content: space-between; }

.flex-equal > * { flex: 1 1 0; min-width: 0; }
.gap-1 { gap: 1rem; }
.gap-1em { gap: 1em; }

.video-auto { width: 100%; height: auto; display: block; }

.screen-dots { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.screen-dots .dot {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.001);
    -webkit-backdrop-filter: invert(1);
    backdrop-filter: invert(1);
}
.screen-dots .dot { will-change: transform; }

@supports not (mix-blend-mode: difference) {
    .screen-dots .dot { background: var(--text); }
}
.screen-dots .dot-top { top: 15px; left: 50%; transform: translate(-50%, -50%); }
.screen-dots .dot-bottom { bottom: 15px; left: 50%; transform: translate(-50%, 50%); }
.screen-dots .dot-left { left: 15px; top: 50%; transform: translate(-50%, -50%); }
.screen-dots .dot-right { right: 15px; top: 50%; transform: translate(50%, -50%); }

img { max-width: 100%; height: auto; opacity: 0; transition: opacity 0.5s ease-in-out; }
img.loaded { opacity: 1; }
.grid img { width: 100%; height: auto; display: block; }
.fade-in { opacity: 0; transition: opacity 0.6s ease-in-out; }
.fade-in.loaded { opacity: 1; }

@media (max-width: 700px) {
    .layout { padding: 1rem 0.75rem; gap: 4rem; }
    .grid { gap: 0.75rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .flex-equal { flex-direction: column; }
    .flex-between-start { flex-direction: column; gap: 0.75rem; }
    .flex-center { flex-direction: column; }
    .video-auto { width: 100%; height: auto; }
    .archive-list img { width: 100% !important; height: auto; }
    #spinny { width: 100% !important; max-width: 100%; }
}

/* Desktop browser frame */
.browser-frame {
  display: inline-block;
  width: 100%;
  max-width: var(--max-width);
  background: var(--frame-bg);
  border-radius: var(--frame-radius);
  overflow: hidden;
  position: relative;
}
.border {
  border: 1px solid var(--border-colour);
}
/* Top bar */
.browser-frame::before {
  content: "";
  display: block;
  height: var(--top-height);
  background: var(--top-bg);
}

/* Dots */
.browser-frame .dots {
  position: absolute;
  top: calc(var(--top-height) / 2 - var(--dot-size) / 2);
  left: 12px;
  display: flex;
  gap: var(--dot-gap);
}

.browser-frame .dots div {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--dot);
}

.browser-frame img,
.browser-frame video {
  width: 100%;
  height: auto;
  display: block;
}

/* iPhone frame */
.iphone-frame {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 380px;
  border-radius: 48px;
  background: #0a0a0a;
  padding: 12px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
}

.iphone-frame::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 26px;
  border-radius: 13px;
  background: #1a1a1a;
  z-index: 5;
}

.iphone-frame video,
.iphone-frame img {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  object-fit: cover;
  display: block;
}

.iphone-frame.white {
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.iphone-frame.white::before {
  background: #cccccc;
}

@media (max-width: 640px) {
  .browser-frame {
    max-width: 100%;
  }
}
