code {
  padding: .2em .4em;
  margin: 0;
  font-size: 85%;
  white-space: break-spaces;
  background-color: var(--color-neutral-muted, rgba(175, 184, 193, 0.2));
  border-radius: 6px;
}

/* === monospace (grid layout) === */

.grid {
  --grid-line-height: 1.2rem;
  --grid-border-width: 2px;
  --grid-padding-small: calc(var(--grid-line-height) / 2);
  --grid-content-line-height: 1.3rem;

  --grid-cells: 0;
  display: flex;
  gap: 1ch;

  #portrait {
    position: relative;
    top: var(--grid-padding-small);
    width: calc(100% - 4px);
    border: var(--grid-border-width) solid;
    margin-bottom: 1ch;
  }

  table.monospace {
    position: relative;
    top: var(--grid-padding-small);
    margin-bottom: 1ch;
    width: 100%;
    border-collapse: collapse;

    th, td {
      border: var(--grid-border-width) solid;
    }

    td:has(a img) {
      padding: 0;
    }

    th {
      padding: var(--grid-padding-small) calc(1ch - var(--grid-border-width) / 2) calc(var(--grid-padding-small) - var(--grid-border-width));
      line-height: var(--grid-line-height);
      vertical-align: top;
      text-align: left;
      font-weight: bold;
    }

    td {
      padding: 0 0.5rem;
      line-height: 1rem;
    }

    ul {
      list-style-type: disc;
      padding-left: 20px;
    }

    li {
      margin: 0;
    }


    .monospace-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      img {
        margin: initial !important;
      }
    }
  }

  .label {
    font-weight: 300;
    font-size: 10px;
    position: relative;
    left: -6px;
    top: -2px;
  }

  .content, p {
    position: relative;
    top: -3px;
    line-height: var(--grid-content-line-height);
  }

}

.uses-wrap {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.uses-box {
  border: 2px solid currentColor;
  padding: 4px 8px 8px;
}

.uses-box.wide {
  grid-column: span 2;
}

.uses-box.full {
  grid-column: 1 / -1;
}

.uses-box h2 {
  text-align: center;
  font-size: 1em;
  font-weight: 700;
  margin: 0 -8px 4px;
  padding: 0 8px 4px;
  border-bottom: 2px solid currentColor;
}

.uses-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 12px;
}

.uses-box.wide ul {
  columns: 3;
}

.uses-box li {
  line-height: 1.5;
  break-inside: avoid;
}

.uses-box li ul {
  columns: 1;
  padding-left: 1.5em;
  list-style: disc;
}

.uses-box li ul li {
  line-height: 1.2;
}

.uses-box img {
  width: 100%;
}

.uses-box .banner {
  aspect-ratio: 1 / 1;
  cursor: pointer;
  position: relative;
}

.uses-box .banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/public/images/240px-Zonenplatte_Cosinus.png');
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.uses-box .banner:hover::before {
  opacity: 1;
}

body.zone-bg {
  background-image: url('/public/images/Zonenplatte_Cosinus.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

@media screen and (max-width: 600px) {
  .uses-wrap {
    grid-template-columns: repeat(2, 1fr);
  }
  .uses-box ul {
    columns: 1;
  }
  .uses-box.wide ul {
    columns: 2;
  }
}

@media screen and (max-width: 450px) {
  .uses-wrap {
    grid-template-columns: 1fr;
  }
  .uses-box.wide,
  .uses-box.full {
    grid-column: auto;
  }
  .uses-box.wide ul {
    columns: 1;
  }
}

/* === main === */

@font-face {
  font-family: "Other Hand";
  src: url('/assets/font/OtherHand-Medium.woff2');
}

:root {
  color-scheme: light dark;
  --main-dark-color: rgb(215, 215, 216);
  --main-light-color: black;
  --main-color: var(--main-light-color);
  --main-bg-color: white;
}

* {
  cursor: url('/assets/Cursor79.webp'), auto;
}

a, button, [role="button"], [type="button"], [type="submit"], input[type="button"], input[type="submit"], input[type="reset"], label {
  cursor: url('/assets/Pointer98.webp'), pointer;
}

html {
  height: 100%;
  border-top-style: double;
}

body {
  color: var(--main-color);
  font-family: system-ui;
  font-size: clamp(0.8rem, 2vw, 1rem);
  line-height: 1.4;
  margin: 0;
  min-height: 100%;
  overflow-wrap: break-word;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  text-wrap: pretty;
}

nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0 1rem;
  flex-wrap: wrap;
}

strong, h2, h1, h3, h4, h5, h6 {
  font-weight: 500;
}

h2, h3, h4, h5, h6 {
  margin-top: 3rem;
}

hr {
  margin: 2rem 0;
  text-align: center;
  border: 0;

  &:before {
    content: '/////';
  }

  &:after {
    content: attr(data-content) '/////';
  }
}

p {
  margin: 1rem 0;
}

li {
  margin: 0.4rem 0;
}

ul {
  list-style-type: '- ';
}

a:visited {
  color: inherit;
}

.w {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

table {
  width: 100%;
}

table, th, td {
  border: thin solid;
  border-collapse: collapse;
  padding: 0.4rem;
}

blockquote {
  font-style: italic;
  border: thin solid var(--main-color);
  padding: 1rem;

  p {
    margin: 0;
  }
}

img, video {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

@media (prefers-color-scheme: dark) {
  :root {
    --main-bg-color: hsl(120, 2%, 9%);
    --main-color: var(--main-dark-color);
  }
  body {
    background: var(--main-bg-color);
  }

  a {
    color: hsl(206.7, 100%, 70%);
  }

  .img-frame {
    figcaption {
      color: hsl(120, 2%, 9%);
    }
  }

  #portrait video {
    opacity: 0.5;
  }
}

.final {
  &:before {
    content: 'LI';
  }

  &:after {
    content: attr(data-content) 'KE?';
  }
}

.typo {
  text-decoration: underline wavy red;
}

.post-header {
  margin-top: 1rem;

  h1, .post-meta {
    margin: 0;
  }

  h1 {
    border-bottom: solid 2px;
    padding-right: 1rem;
  }
}

sup {
  font-size: 10px;
}

.index-list-item {
  list-style-type: none;
  border-left: 2px solid;
  margin-bottom: 2rem;
  padding-left: 8px;
}

.index-list-title {
  margin: -5px 0;
}

.highlight {
  padding: 0;
}

.footnotes {
  font-size: small;

  p {
    margin: 0;
  }
}

ul ul {
  list-style-type: initial;
  padding-inline-start: 1rem;
}

sup a {
  text-decoration: none;
}

.post-tags {
  display: inline-flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;

  li {
    padding-right: 0.5rem;
    margin: 0;
    font-size: 0.7rem;
    color: #555;
    cursor: context-menu;
  }
  li:hover {
    color: unset;
  }
}

.projects-section {
  margin-bottom: 3rem;

  h2 {
    margin: 0;

    a {
      color: inherit;
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }

    a[href^="#"]:before {
      content: "#";
      display: inline-block;
      font-size: .7em;
      line-height: 1;
      margin-left: -.8em;
      text-decoration: none;
      visibility: hidden;
      width: .8em;
    }

    a[href^="#"]:hover:before {
      visibility: visible;
    }
  }

  p {
    margin: 0;
  }

  svg {
    padding-right: 2px;
  }

  .status-tag {
    display: flex;
    align-items: center;
  }
}

.img-frame {
  --box-shadow: rgba(0, 0, 0, 0.3);
  background-image: repeating-linear-gradient(
    45deg,
    #555 0,
    #555 1px,
    transparent 0px,
    transparent 0.5rem
  );
  padding: 5%;
  box-sizing: border-box;
  margin-top: 1rem;
  cursor: zoom-in;

  @media (prefers-color-scheme: dark) {
    --box-shadow: rgba(255, 255, 255, 0.3);
  }

  &:not(.full) #figure-container {
    position: relative;

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      translate: 1ch 1ch;
      background: var(--box-shadow);
      transition: translate .3s ease;
      z-index: -1;
    }
  }

  &:not(.full):hover #figure-container::after {
    translate: 0.5ch 0.5ch;
  }
}

.img-frame.full {
  position: fixed;
  top: 0;
  left: 0;
  cursor: zoom-out;
  margin: 0;
  align-content: center;
  max-width: initial !important;
  height: 100vh;
  width: 100vw;
  z-index: 1;
  background-color: rgba(0, 0, 0, 0.45);
  figcaption {
    font-size: large;
  }
}

.img-frame img {
  filter: saturate(0) contrast(10);
  transition: filter .3s;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: dodgerblue;
  box-sizing: border-box;
}

.img-frame:hover img {
    filter: saturate(2);
}

.img-frame figcaption {
  background: white;
  border-style: solid;
  border-color: hsl(120, 2%, 9%);
  text-align: left;
  width: 100%;
  padding: 5px;
  font-size: small;
  border-bottom: 0;
  box-sizing: border-box;
}

.img-frame.right {
  max-width: 60%;
  float: right;
}

.img-frame.left {
  max-width: 60%;
  float: left;
  margin: 0 2ch 0 0;
}

.img-icon {
  float: right;
}

.img-frame-center {
  margin: 0;
  padding: 2rem 4rem;
}

.ascii-table {
  border-left: none !important;
  font-size: 70%;
  padding: 0 !important;
  white-space: pre !important;
  color: unset;
  background: unset;
}

aside {
  float: left;
  max-width: 60%;
  margin-right: 2rem;

  figure {
    margin: 0;
  }
}

figure {
  img {
    border-style: solid;
    border-color: hsl(120, 2%, 9%);
  }

  figcaption {
    text-align: center;
    font-size: smaller;
  }
}

.blinking {
  animation: 2s blink ease infinite;
}

@keyframes blink {
  from, to {
    opacity: 0;
  }

  85% {
    opacity: 1;
  }
}

@media screen and (max-width: 600px) {
  .post-header {
    flex-direction: column-reverse;

    h1 {
      margin-bottom: 0.5em;
    }
  }

  #index-list {
    padding-left: 0;
  }

  blockquote {
    margin: 1rem 0;
  }

  aside {
    float: none;
    max-width: 100%;
    margin: 0;

    figure {
      text-align: center;
    }
  }

  .img-frame {
    max-width: 100% !important;
    float: initial !important;
    margin: 0 !important;
  }
}

section#quotes {
  margin-left: 1rem;

  > blockquote {
    border: initial;
    border-left: solid;
    margin: 0 1rem;
    padding: 0 1rem;
  }

  > p {
    margin: 0.5rem 0 2rem 0;
  }
}

#portrait video {
  width: 100%;
  display: block;
  aspect-ratio: 1/1;
}

#live-tag {
  cursor: help;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 0 0 4px 0;
  color: initial;
  padding: 0 3px;
  span {
    filter: invert(1);
  }
}

body:has(figure.full) {
  overflow: hidden;
}

#figure-container {
  margin: 0 auto;
}
@media (orientation: landscape) {
  #figure-container {
    max-width:75vh;
    img {
      max-height: 80cqh;
    }
  }
}
@media (orientation: portrait) { #figure-container { max-width:75vw; } }

page-likes a {
  color: LinkText;
  text-decoration: underline;
}

#logo-video {
    position: relative;
    cursor: pointer;
    image-rendering: pixelated;
}

.masked-logo-video {
    width: 100%;
    aspect-ratio: 640/56;
    object-fit: cover;
    mask: url('/public/images/logos/babfamnewsletter.webp') no-repeat center/contain;
    -webkit-mask: url('/public/images/logos/babfamnewsletter.webp') no-repeat center/contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#logo-video:hover .masked-logo-video {
    opacity: 1;
}

/* Fallback - show just the mask image when not hovering */
#logo-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/public/images/logos/babfamnewsletter.webp') no-repeat center/contain;
    background-size: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#logo-video:hover::before {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  #logo-video:hover::before {
      opacity: 1;
  }
  #logo-video:hover .masked-logo-video {
    opacity: 0;
  }
  .img-frame img {
    filter: saturate(2);
  }
  marquee {
    visibility: hidden;
  }
  marquee::before {
    content: "I might have just saved your life.";
    visibility: visible;
    position: absolute;
  }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) and (forced-colors: none) {
  :root {
    --main-color: white !important;
    --main-bg-color: black !important;
  }
  .post-tags li {
    color: white !important;
  }
}

.button-88x31 {
  width: 88px;
  height: 31px;
}
