/* jhermann.digital */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Light.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Bold.woff2") format("woff2");
}

:root {
  --base: #daa2ff;
  --text: #000000;
  --muted: #3a2452;
  --accent: #1900d8;
  --button: #000000;
  --button-text: #daa2ff;
  --rule: rgba(25, 0, 216, 0.35);
  --panel: rgba(255, 255, 255, 0.22);
  --terrain-ink: #1900d8;
  --terrain-peak: #ffa96b;

  --column: 42rem;
  --wide: 62rem;
  --gutter: clamp(1.1rem, 4vw, 2rem);
  --step: 1.6rem;

  color-scheme: light;
}

/* opt-in, switched from the footer */
:root[data-theme="dark"] {
  --base: #170b2e;
  --text: #f3e8ff;
  --muted: #c9b3e6;
  --accent: #daa2ff;
  --button: #daa2ff;
  --button-text: #170b2e;
  --rule: rgba(218, 162, 255, 0.4);
  --panel: rgba(218, 162, 255, 0.08);
  --terrain-ink: #b47bff;
  --terrain-peak: #ff9a5c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

#terrain {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--button);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus { top: 0.5rem; color: var(--button-text); }

/* ---------- header and footer ---------- */

.site-header {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.6rem) var(--gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
}
.site-title {
  font-size: 1.2rem;
  font-style: italic;
  text-decoration: none;
  white-space: nowrap;
}
.site-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.5rem;
}
.site-header li, .site-footer li { margin: 0; }
.site-header nav a {
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}
.site-header nav a:hover,
.site-header nav a[aria-current] { border-bottom-color: currentColor; }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 6rem) var(--gutter) clamp(3rem, 8vw, 5rem);
}

.site-footer {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer p { margin: 0 0 0.9rem; }
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem 1.4rem;
}
.site-footer button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.22em;
}
.site-footer button:hover { color: var(--accent); }

/* ---------- text ---------- */

h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 2.4rem; }
h2 { font-size: 1rem; font-weight: 700; margin-top: 3.2rem; margin-bottom: 1.1rem; }
h3 { font-size: 0.9375rem; font-weight: 700; }
p, ul, ol, figure, pre, blockquote, details { margin: 0 0 var(--step); }
main > :last-child, article > :last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.35rem; }
img { max-width: 100%; height: auto; display: block; }
figure { margin-left: 0; margin-right: 0; }
figcaption { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }

blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
}
blockquote > :last-child { margin-bottom: 0; }
cite { font-style: normal; font-size: 0.85rem; color: var(--muted); }

.button {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  background: var(--button);
  color: var(--button-text);
  border-radius: 4px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { background: var(--accent); color: var(--base); transform: translateY(-1px); }
[data-theme="dark"] .button:hover { background: #ffffff; color: #170b2e; }

/* ---------- home ---------- */

.hero { text-align: left; }
.hero h1 { text-align: center; font-size: 1rem; margin-bottom: 1.6rem; }
.portrait {
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 2rem;
  border-radius: 50%;
  filter: url("#duotone");
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  margin-top: 3.4rem;
}
.card p { margin: 1.3rem 0 0; }
/* outlined like the contour lines, filled on hover */
.cards .button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 1.1rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cards .button::after {
  content: "\2192";
  color: var(--accent);
  transition: transform 0.2s ease, color 0.2s ease;
}
.cards .button:hover,
.cards .button:focus-visible { background: var(--accent); color: var(--base); transform: none; }
.cards .button:hover::after,
.cards .button:focus-visible::after { color: var(--base); transform: translateX(0.25rem); }
@media (prefers-reduced-motion: reduce) {
  .cards .button::after { transition: none; }
}
@media (max-width: 38rem) {
  .cards { grid-template-columns: 1fr; gap: 2.2rem; }
}

.linklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.linklist li { margin: 0; }
.linklist .button { display: block; text-align: center; padding: 0.8rem 1.15rem; }

/* ---------- entries (vita, work, projects) ---------- */

.entry {
  margin: 0 0 1.5rem;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--rule);
}
.entry > * { margin-bottom: 0.7rem; }
.entry > :last-child { margin-bottom: 0; }
.entry-date {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.entry-title { font-weight: 700; }
.entry-note { font-size: 0.875rem; color: var(--muted); }

/* ---------- galleries ---------- */

.gallery {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--step);
}
.gallery li {
  margin: 0;
  flex: var(--r, 1.5) 1 calc(var(--r, 1.5) * 9.5rem);
  min-width: 0;
}
.gallery a { display: block; height: 100%; overflow: hidden; border-radius: 3px; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery a:hover img { transform: scale(1.04); }
@media (min-width: 70rem) {
  .gallery {
    width: var(--wide);
    max-width: calc(100vw - 2 * var(--gutter));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery img, .button { transition: none; }
}

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(10, 4, 24, 0.88); }
.lightbox img {
  max-width: min(94vw, 110rem);
  max-height: 88vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 3px;
}
.lightbox-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.lightbox-bar button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 4px;
  background: #daa2ff;
  color: #000;
  cursor: pointer;
}
.lightbox-bar button:hover { background: #fff; }

/* ---------- code ---------- */

pre {
  padding: 1rem 1.1rem;
  background: var(--panel);
  border-radius: 4px;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.55;
  tab-size: 2;
}
code { font-family: inherit; }
details.code { background: var(--panel); border-radius: 4px; }
details.code summary {
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  font-size: 0.875rem;
}
details.code pre {
  margin: 0;
  max-height: 32rem;
  background: none;
  border-top: 1px solid var(--rule);
  border-radius: 0;
}

/* ---------- embeds ---------- */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.2rem;
  margin-bottom: var(--step);
}
.cols > div > :last-child { margin-bottom: 0; }

.embed { position: relative; background: var(--panel); border-radius: 4px; overflow: hidden; }
.embed--video { aspect-ratio: 16 / 9; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.embed--audio iframe { height: 352px; }
.embed__load {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.embed--audio .embed__load { padding: 1.4rem 1.1rem 1.4rem 4.4rem; min-height: 5rem; }
.embed__load img { width: 100%; height: 100%; object-fit: cover; }
.embed__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  border-radius: 50%;
  background: #000;
}
.embed--audio .embed__play { left: 1.1rem; top: 50%; margin: -1.3rem 0 0; width: 2.6rem; height: 2.6rem; }
.embed__play::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent #daa2ff;
}
.embed__load:hover .embed__play { background: #1900d8; }
.embed--video .embed__note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.8rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
}
.embed-note { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }

