/* Shared by every page of blog.clomm.dev: the portfolio's dark album page, its tape and
   stickers, and the header that moves between sections. Page-specific styles live in each page. */
:root {
  --page: #0b0b0c;
  --ink: #ececef;
  --soft: #c4c4cb;
  --muted: #a1a1aa;
  --faint: #8b8b94;
  --paper: #f3f3f1;
  --paper-ink: #1b1b1f;
  --tape: rgb(250 204 21 / .62);
  --yellow: #facc15;
  --well: #131316;
  --display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --hand: "Shantell Sans", "Geist", system-ui, sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--page);
  /* The portfolio's dark mode: a black photo-album page with a faint dot grid. */
  background-image: radial-gradient(circle at 1px 1px, rgb(255 255 255 / .055) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--yellow); color: #141210; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 3px; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.hand { font-family: var(--hand); font-variation-settings: "INFM" 100; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

.grain {
  position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Washi tape, the same strip the portfolio uses. */
.tape {
  position: absolute; z-index: 2; pointer-events: none;
  background-color: var(--tape);
  background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / .2) 0 5px, transparent 5px 11px);
  clip-path: polygon(3% 0, 97% 0, 100% 25%, 96% 50%, 100% 75%, 98% 100%, 2% 100%, 0 75%, 4% 50%, 0 25%);
}

/* Header: the brand, the three sections, and the way back to the portfolio. The section
   you're in is underlined with a scribble of highlighter. */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 34px; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 17px/1 var(--display); letter-spacing: -.01em; }
.brand img { width: 30px; height: auto; }
.nav { justify-self: end; display: flex; gap: 30px; }
.nav a { position: relative; padding: 6px 0; font: 560 16px/1 var(--sans); color: var(--muted); text-decoration: none; transition: color .15s ease; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current]::after {
  content: ""; position: absolute; left: -6px; right: -6px; bottom: -7px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9c18-5 33 3 52-1s35-6 62 1' fill='none' stroke='%23facc15' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.out { font-size: 15px; color: var(--faint); text-decoration: none; padding-left: 26px; border-left: 1px solid rgb(255 255 255 / .12); transition: color .15s ease; }
.out:hover { color: var(--ink); }

/* Art beside an entry. HTB avatars are transparent PNGs, so they get a die-cut white edge
   like a real sticker; --s sets the size wherever the art appears. */
.art { --s: 98px; position: relative; width: calc(var(--s) + 6px); height: calc(var(--s) + 6px); display: grid; place-items: center; }
.art > * { grid-area: 1 / 1; }
.sticker, .badge {
  transform: rotate(var(--tilt));
  filter: drop-shadow(2px 0 0 var(--paper)) drop-shadow(-2px 0 0 var(--paper)) drop-shadow(0 2px 0 var(--paper)) drop-shadow(0 -2px 0 var(--paper)) drop-shadow(0 9px 10px rgb(0 0 0 / .5));
  transition: transform .2s var(--ease-out);
}
.sticker { width: var(--s); height: var(--s); object-fit: contain; }
/* Writeups whose Notion icon is still an emoji: the emoji in the avatar's shape. */
.badge {
  width: calc(var(--s) * .92); height: calc(var(--s) * .92); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #2a2a31, #141417 70%);
  box-shadow: inset 0 0 0 calc(var(--s) * .06) var(--c), inset 0 0 0 calc(var(--s) * .08) rgb(0 0 0 / .35);
  font: calc(var(--s) * .43) / 1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.badge.initial { font: 700 calc(var(--s) * .37) / 1 var(--display); color: var(--c); }
/* Platforms with no avatar get a rubber stamp with the platform's name. */
.stamp {
  width: calc(var(--s) * .92); height: calc(var(--s) * .92); border-radius: 50%;
  display: grid; place-items: center; padding: 10px; text-align: center;
  color: #d9d9de; border: 3px solid currentColor;
  box-shadow: inset 0 0 0 5px var(--page), inset 0 0 0 6.5px currentColor;
  transform: rotate(calc(var(--tilt) - 8deg)); opacity: .9;
  transition: transform .2s var(--ease-out);
}
.stamp span { font: 650 13.5px/1.05 var(--hand); font-variation-settings: "INFM" 100; letter-spacing: .01em; }
.stamp .short { display: none; }
/* Sealed: the art is there but greyed out under a strip of tape. */
.sealed .sticker { filter: grayscale(1) brightness(.55) drop-shadow(2px 0 0 #8a8a8f) drop-shadow(-2px 0 0 #8a8a8f) drop-shadow(0 2px 0 #8a8a8f) drop-shadow(0 -2px 0 #8a8a8f); }
.sealed .badge, .sealed .stamp { filter: grayscale(1) brightness(.6); }
.seal { position: relative; z-index: 2; align-self: center; width: calc(var(--s) * 1.18); height: 24px; transform: rotate(-16deg); display: grid; place-items: center; }
.seal b { font: 600 14px/1 var(--hand); font-variation-settings: "INFM" 100; color: #2a2208; letter-spacing: .02em; white-space: nowrap; }

/* Small art, for lists like the front page's latest posts. */
.art.mini { --s: 50px; }
.art.mini .stamp { padding: 0; border-width: 2px; box-shadow: inset 0 0 0 3px var(--page), inset 0 0 0 4px currentColor; }
.art.mini .stamp .long { display: none; }
.art.mini .stamp .short { display: block; font-size: 12px; }
.art.mini .seal { height: 14px; }
.art.mini .seal b { font-size: 9px; }

/* A ruled index card standing in for research and notes, which have no art of their own. */
.card-art {
  width: calc(var(--s) * .86); height: calc(var(--s) * .7); transform: rotate(var(--tilt));
  background: var(--paper) repeating-linear-gradient(180deg, transparent 0 8px, rgb(96 125 180 / .35) 8px 9px);
  background-position: 0 12px; border-top: 4px solid #e4a5a5; border-radius: 2px;
  box-shadow: 0 6px 10px -4px rgb(0 0 0 / .6);
}

.end { display: flex; align-items: center; gap: 18px; padding: 72px 0 140px; color: var(--soft); }
.end img { width: 96px; height: auto; transform: rotate(-6deg); }
.end p { margin: 0; font-size: 20px; }
.end a { text-decoration-color: var(--yellow); text-underline-offset: 4px; }

/* Until the blog is live: a quiet note that the read counts are placeholders. */
.proto {
  position: fixed; left: 16px; bottom: 16px; z-index: 80; max-width: calc(100vw - 32px);
  margin: 0; padding: 9px 14px; border-radius: 10px;
  background: rgb(20 20 22 / .9); border: 1px solid rgb(255 255 255 / .12);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 13.5px; color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  a:hover .sticker, a:hover .badge, .entry:not(.sealed):hover .sticker, .entry:not(.sealed):hover .badge { transform: rotate(0deg) scale(1.04); }
  .entry:not(.sealed):hover .stamp { transform: rotate(-4deg) scale(1.04); }
}

/* The one header animation: the scribble under the current section is drawn on page load. */
@media (prefers-reduced-motion: no-preference) {
  .nav a[aria-current]::after { clip-path: inset(0 100% 0 0); animation: scribble .55s var(--ease-out) .15s forwards; }
}
@keyframes scribble { to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .sticker, .badge, .stamp, .nav a, .out { transition: none; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .top { grid-template-columns: 1fr auto; grid-template-areas: "brand out" "nav nav"; height: auto; padding: 16px 0 6px; row-gap: 14px; }
  .brand { grid-area: brand; }
  .out { grid-area: out; padding-left: 0; border-left: 0; }
  .nav { grid-area: nav; justify-self: stretch; gap: 0; border-top: 1px solid rgb(255 255 255 / .08); padding-top: 12px; }
  .nav a { flex: 1; text-align: center; font-size: 15.5px; }
  .nav a[aria-current]::after { left: 22%; right: 22%; }
  .art { --s: 78px; }
  .stamp span { font-size: 10px; }
  .seal { height: 21px; }
  .seal b { font-size: 12.5px; }
  .proto { position: static; margin: -96px 18px 32px; max-width: none; }
}
