@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&display=swap');

:root {
  --body-text-color: #3A3B3C;

  --link-color: #007FFF;
  --link-hover-color-1: #72dcff;
  --link-hover-color-2: #0066cd;

  --selection-color: var(--selection-color-1);
  --selection-background: var(--selection-background-1);

  --selection-color-1: white;
  --selection-background-1: #ff3399;

  --selection-color-2: white;
  --selection-background-2: #c1b001;

  --selection-color-3: white;
  --selection-background-3: #a8140e;

  --selection-color-4: white;
  --selection-background-4: #4315aa;

  --selection-color-5: white;
  --selection-background-5: #359d09;

  --selection-color-6: white;
  --selection-background-6: #8f4762;
}

html {
  color-scheme: light dark;
  font-family: system-ui;
  font-size: var(--font-size, 0.85rem);
  line-height: var(--line-height, 1.5);
  color: var(--body-text-color);
}

body {
  padding-bottom: 20rem;
}

::selection {
  color: var(--selection-color);
  background: var(--selection-background);
}

h1, h2 {
  margin-top: 1em;
  margin-bottom: 1em;
}

h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 1em;
}

/* Tighten spacing around draft labels */
h3:has(+ .draft) {
  margin-bottom: 0;
}

h1:has(+ p) {
  margin-bottom: 0;
}

p:has(+ p > .draft) {
  margin-bottom: 0;
}

h2 {
  font-weight: 400;
}

:is(h1, h2) > a {
  text-decoration: none;
  color: var(--body-text-color);
  font-weight: 400;
}

:is(h3, h4, h5, h6) > a {
  text-decoration: none;
  color: var(--body-text-color);
  font-weight: 100;
}

h3, h4, h5, h6 {
  font-weight: 100;
}

:is(h3, h4, h5, h6) > a {
  text-decoration: none;
  color: var(--body-text-color);
  font-weight: 100;
}

p {
  margin-top: 0;
}

p:has(+ ul), p:has(+ ol) {
  margin-bottom: 0;
}

ul, ol {
  margin-top: 0;
  padding-left: 1.2rem;
}

/* inline code: Slack/Bitbucket-style, clearly distinct from body text */
:not(pre) > code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
  background: rgba(128, 128, 128, 0.16);
  color: #c7254e;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid rgba(128, 128, 128, 0.22);
}

a {
  color: var(--link-color);
  font-weight: 300;
  background: linear-gradient(to right, var(--link-hover-color-1) 0%, var(--link-hover-color-2) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  transition: color .1s ease-in-out;
  text-decoration: none;
}

a:hover {
  color: rgba(0, 0, 0, 0);
}

:is(h2, h3, h4, h5, h6) > a:hover::after {
  content: '🔗';
  padding-left: 0.5rem;
  font-size: small;
}

figure {
  margin: 0;
}

.drop-cap::first-letter {
  font-family: 'Cinzel Decorative', serif;
  float: left;
  font-size: 4.5em;
  line-height: 0.8;
  padding-right: 0.1em;
  color: #8B4513;
}

article {
  margin-bottom: 2rem;
}

/* post listing meta (date / last updated) */
h3:has(+ .post-date) {
  margin-bottom: 0.25rem;
}
.post-date {
  margin-top: 0;
  margin-bottom: 0.75em;
}
.post-date small {
  color: #6b7280;
}
time.ts {
  border-bottom: 1px dotted #94a3b8;
  cursor: help;
  position: relative;
}
/* instant custom tooltip (the native title= attribute is too slow to appear) */
time.ts[data-tooltip]:hover::after,
time.ts[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  white-space: pre-line;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  z-index: 50;
  background: #1f2937;
  color: #fff;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  width: max-content;
  max-width: 260px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
/* small screens: pin the timestamp tooltip to a fixed on-screen card */
@media (max-width: 640px) {
  time.ts[data-tooltip]:hover::after,
  time.ts[data-tooltip]:focus::after {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 1rem;
    width: auto;
    max-width: none;
  }
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

.content-grid {
  --padding-x: 2rem;
  --content-max-width: 70ch;
  --breakout-width: 15ch;

  display: grid;
  grid-template-columns:
    [full-width-start] minmax(var(--padding-x), 1fr)
      [breakout-lg-start] minmax(0, var(--breakout-width))
        [breakout-md-start] minmax(0, var(--breakout-width))
          [breakout-start] minmax(0, var(--breakout-width))
            [content-start] min(100% - (var(--padding-x) * 2), var(--content-max-width))
            [content-end] minmax(0, var(--breakout-width))
          [breakout-end] minmax(0, var(--breakout-width))
        [breakout-md-end] minmax(0, var(--breakout-width))
      [breakout-lg-end] minmax(var(--padding-x), 1fr)
    [full-width-end];
}

.content-grid > * {
  grid-column: content;
}

.content-grid > .full-width {
  grid-column: full-width;
}

.content-grid > .breakout-xs {
  grid-column: content / span 1;
  margin-left: -2.5ch;
  margin-right: -2.5ch;
}

.content-grid > .breakout-sm {
  grid-column: content / span 1;
  margin-left: -5ch;
  margin-right: -5ch;
}

.content-grid > .breakout {
  grid-column: breakout;
}

.content-grid > .breakout-md {
  grid-column: breakout-md;
}

.content-grid > .breakout-lg {
  grid-column: breakout-lg;
}


.draft {
  font-size: 0.70rem;
  color: white;
  background-color: #F40009;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 5px;
}

/* Using: https://www.gradient-animator.com/ */
.animated-gradient {
  background: linear-gradient(270deg, #230000, #211200, #181a00, #071a00, #001405, #001816, #000a23, #060025, #150023, #210023, #21000e);
  background-size: 2200% 2200%;

  -webkit-animation: gradient-animation 120s linear infinite;
  -moz-animation: gradient-animation 120s linear infinite;
  animation: gradient-animation 120s linear infinite;
}

@-webkit-keyframes gradient-animation {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

@-moz-keyframes gradient-animation {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

@keyframes gradient-animation {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

/* inline person profile: dotted name, click for a card (used by posts, wired up in _layouts/default.html) */
.person { position: relative; display: inline; }
.person-btn {
  font: inherit; cursor: pointer; background: none; border: none; padding: 0; color: inherit;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; text-decoration-color: #ff3399;
}
.person-btn:hover { color: #d81b76; }
.person-pop {
  display: none; position: absolute; z-index: 30; left: 0; top: 1.7em;
  width: min(340px, 80vw); padding: .75em .85em;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: .82rem; line-height: 1.45; text-align: left; white-space: normal; font-weight: 400;
}
.person.open .person-pop { display: block; }
.person-head { display: block; font-weight: 700; margin-bottom: .45em; }
.person-bio { display: block; color: #475569; }
.person-links { display: block; margin-top: .4em; }
.person-links a { display: block; margin-top: .35em; }
.person-pic {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 96px; margin-bottom: .55em;
  background: repeating-linear-gradient(45deg,#f1f5f9,#f1f5f9 10px,#e8edf3 10px,#e8edf3 20px);
  border: 1px dashed #cbd5e1; border-radius: 8px; color: #94a3b8; font-size: .78rem;
}
.person-pic img { display: block; width: 100%; height: auto; border-radius: 8px; }
.person-pic:has(img) { border: none; background: none; height: auto; padding: 0; }
@media (max-width: 640px) {
  .person-pop {
    position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; inset-inline: 1rem;
    width: auto; max-width: none; max-height: 70vh; overflow-y: auto; z-index: 100;
    box-shadow: 0 -6px 30px rgba(0,0,0,.28);
  }
}

.site-footer {
  margin-top: 3rem;
  padding-block: 1.5rem;
  border-top: 1px solid #ddd;
}
