/* ==========================================================================
   Variables setup
   ========================================================================== */
:root {
  --font-family-sans: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;
  --font-family-serif: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
  --font-family-monospace: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;

  /* Calculated via https://utopia.fyi/ */
  --font-size--1: clamp(0.9rem, 0.7957rem + 0.5217vw, 1.2rem);
  --font-size-0: clamp(1.125rem, 0.9946rem + 0.6522vw, 1.5rem);
  --font-size-1: clamp(1.4063rem, 1.2432rem + 0.8152vw, 1.875rem);
  --font-size-2: clamp(1.7581rem, 1.5544rem + 1.0185vw, 2.3438rem);
  --font-size-3: clamp(2.1975rem, 1.9427rem + 1.2739vw, 2.93rem);
  --font-size-4: clamp(2.7469rem, 2.4286rem + 1.5913vw, 3.6619rem);

  --color-white: 0, 0%, 100%;
  --color-black: 0, 0%, 0%;
  --color-grey: 217, 5%, 46%;
  --color-dark-grey: 210, 5%, 7%;
  --color-light-grey: 17, 12%, 72%;
  --color-lightest-grey: 0, 0%, 90%;
  --color-pale-violet-red: 338, 61%, 57%;
  --color-violet: 277, 69%, 51%;
  --color-dim-grey: 308, 35%, 47%;
  --color-golden-rod: 44, 87%, 80%;

  --color-text: var(--color-dark-grey);
  --color-background: var(--color-white);
  --color-primary: var(--color-pale-violet-red);
  --color-secondary: var(--color-golden-rod);

  /* Calculated via https://utopia.fyi/ */
  --ratio: 1.5;
  --s-5: calc(var(--s-4) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-1: calc(var(--s0) / var(--ratio));
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  --s5: calc(var(--s4) * var(--ratio));

  --content-width-wide: 67rem;
  --content-width-text: 37rem;

  --border-radius: var(--s-2);
  --drop-shadow: drop-shadow(4px 4px 0 hsl(var(--color-lightest-grey)));
}

/* ==========================================================================
   Base - Setting up some base styles
   ========================================================================== */
*,
*:before,
*:after {
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-0);
  line-height: 1.6666;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  background: hsl(var(--color-background)) url("/assets/images/plant.min.jpg") fixed no-repeat center center;
  background-size: cover;
}

body {
  font-family: var(--font-family-sans);
  color: hsl(var(--color-text));
  margin: var(--s2) clamp(0.625rem, -0.5489rem + 5.8696vw, 4rem);
  -webkit-font-feature-settings: 'kern' 1;
  -moz-font-feature-settings: 'kern' 1;
  -o-font-feature-settings: 'kern' 1;
}

::-moz-selection {
  color: var(--color-white);
  background: hsla(var(--color-primary),0.8);
}

::selection {
  color: var(--color-white);
  background: hsla(var(--color-primary),0.8);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  -webkit-font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1;
  -moz-font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1;
  -o-font-feature-settings: 'dlig' 1, 'liga' 1, 'lnum' 1, 'kern' 1;
  margin: 1em 0 0.4em 0;
  color: var(--color-text);
  font-family: var(--font-family-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-inline-size: 60ch;
}

@media print {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    break-after: avoid-page;
  }
}
h1 {
  font-size: var(--font-size-4);
  margin: 0;
}
h2 {
  font-size: var(--font-size-3);
}
h3 {
  font-size: var(--font-size-2);
}
h4, h5, h6 {
  font-size: var(--font-size-1);
}

a {
  position: relative;
  display: inline;
  outline: medium none;
  color: hsl(var(--color-text));
  vertical-align: bottom;
  text-decoration: solid underline hsl(var(--color-secondary)) 0.17em;
  transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

a:hover,
a:focus {
  animation: linkanimation 0.5s infinite linear;
  animation-direction: alternate;
  text-decoration-color: currentColor;
}

@media print {
  a[href^="http"]:not([href*="robert.katzki.de"]):after {
    content: " ➮[" attr(href) "] ";
    font-size: var(--font-size--1);
    color: var(--color-light-grey);
  }
}

p, ul, ol, dl {
  -webkit-font-feature-settings: 'liga' 1, 'onum' 1, 'kern' 1;
  -moz-font-feature-settings: 'liga' 1, 'onum' 1, 'kern' 1;
  -o-font-feature-settings: 'liga' 1, 'onum' 1, 'kern' 1;
  text-wrap: pretty;
  max-inline-size: 60ch;
}

hr {
  display: block;
  inline-size: 100%;
  block-size: 0.7rem;
  margin-block: var(--s3);
  border: 0;
  padding: 0;
  position: relative;
  background: url("/assets/images/wavy-line.svg") center center no-repeat;
}

time {
  white-space: nowrap;
}

blockquote {
  margin: 0;
  position: relative;
  z-index: 1;
  max-inline-size: 60ch;
}

blockquote::before {
  content: '“';
  position: absolute;
  top: -0.3em;
  left: -0.5em;
  color: hsl(var(--color-secondary));
  font-size: var(--font-size-4);
  font-family: var(--font-family-serif);
  z-index: -1;
  transform: skew(-1.7deg);
}

blockquote p {
  margin-block: var(--s-1);
}

blockquote small {
  display: inline-block;
  margin: 0.8em 0 0.8em 1.5em;
  font-size: var(--font-size--1);
  color: hsl(var(--color-light-grey));
}

blockquote small:before {
  content: "\2014 \00A0";
}

blockquote cite {
  font-weight: 700;
}

blockquote cite a {
  font-weight: normal;
}

mark {
  background-color: hsl(var(--color-secondary));
}

code,
tt {
  padding: var(--s-4);
  font-family: var(--font-family-monospace);
  font-size: var(--font-size--1);
  white-space: pre-wrap;
  background: hsla(var(--color-light-grey), 0.4);
  border-radius: var(--border-radius);
}

pre {
  font-size: .75rem;
  margin: 0 0 var(--s2) 0;
  padding: var(--s0) var(--s1);
  font-family: var(--font-family-monospace);
  white-space: pre;
  overflow: auto;
  background: #2f1e2e;
  color: hsl(var(--color-white));
  border-radius: var(--border-radius);
  border: 1px solid hsl(var(--color-text));
  filter: var(--drop-shadow);
}

pre code, tt {
  font-size: inherit;
  white-space: -moz-pre-wrap;
  white-space: pre-wrap;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

table {
  margin: var(--s2) 0;
  width: 100%;
  max-width: 100%;
  background-color: transparent;
}

table th, table td {
  padding: var(--s-1);
  line-height: var(--s1);
  text-align: left;
  vertical-align: top;
  border-top: hsl(var(--color-light-grey)) 1px solid;
}

table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td {
  border-top: 0;
}

table tbody + tbody {
  border-top: hsl(var(--color-light-grey)) 2px solid;
}

table table table {
  background-color: hsl(var(--color-white));
}

table tbody > tr:nth-child(odd) > td,
table tbody > tr:nth-child(odd) > th {
  background-color: hsl(var(--color-lightest-grey));
}

table.plain tbody > tr:nth-child(odd) > td,
table.plain tbody > tr:nth-child(odd) > th {
  background: transparent;
}

img, iframe {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  border: 1px solid hsl(var(--color-text));
  filter: var(--drop-shadow);
}

figure {
  font-size: 1rem;
  color: hsl(var(--color-light-grey));
  margin: 0;
  inline-size: 100%;
  max-inline-size: calc(100vh / var(--height) * var(--width) * 0.94);
}

figure img {
  min-inline-size: var(--s4);
  min-block-size: var(--s4);
  background: url("../images/loading.svg") center center;
  background-size: 140px;
  display: block;
}

@media print {
  figure {
    page-break-inside: avoid;
  }
}

figcaption {
  font-size: var(--font-size--1);
  font-style: italic;
  margin: 0 auto;
  color: hsl(var(--color-dark-grey));
  text-align: left;
  padding: 0.5em 1.5em;
}

.more-links {
  font-size: var(--font-size-2);
  font-family: var(--font-family-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-align: center;
  margin: var(--s4) 0 0 0;
  grid-column: popout;
}

.more-links a {
  display: inline-block;
  margin: var(--s0);
}

@media print {
  .more-links {
    display: none;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes linkanimation {
  0%, 30% {
    color: hsl(var(--color-primary));
  }
  35%, 65% {
    color: hsl(var(--color-violet));
  }
  70%, 100% {
    color: hsl(var(--color-dim-grey));
  }
}
