/*
 * Nihatcan's Homepage: shared styles.
 *
 * A late-90s homepage that wandered into the Middle Ages: blackletter and
 * parchment, gilt frames, banners, shields and a dragon, with visitors from
 * other eras (heavy metal and a few famous paintings). Underneath,
 * the layout shrinks to fit phones and the motion stops when the visitor asks
 * for reduced motion.
 */

/* ------------------------------------------------------------------ fonts (SIL Open Font License, see fonts/) */

@font-face {
  font-family: "UnifrakturMaguntia";
  src: url("../fonts/UnifrakturMaguntia-Book.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("../fonts/IMFellEnglish-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  src: url("../fonts/IMFellEnglish-Italic.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English SC";
  src: url("../fonts/IMFellEnglishSC-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Metal Mania";
  src: url("../fonts/MetalMania-Regular.woff2") format("woff2");
  font-display: swap;
}

/* ------------------------------------------------------------------ base */

:root {
  --blackletter: "UnifrakturMaguntia", "Old English Text MT", "Luminari", serif;
  --book: "IM Fell English", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "IM Fell English SC", "Palatino Linotype", Palatino, Georgia, serif;
  --metal: "Metal Mania", Impact, "Arial Black", sans-serif;
  --ink: #2b1a0e;
  --vermilion: #b3201b;
  --lapis: #1c3f94;
  --gold: #e8b923;
  --gold-deep: #9a6b12;
  --verdigris: #2e7d5b;
  --parchment: #f3e3bb;
  --oak: #5a3412;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 10px 16px 40px;
  font: 19px/1.45 var(--book);
  overflow-x: hidden;
  cursor: url("../img/cursor-sword.png") 1 1, auto;
}

img {
  max-width: 100%;
  height: auto;
}

a:not([class]) {
  color: var(--link);
}

a:not([class]):visited {
  color: var(--visited);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffd75e;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #000;
}

.pixel,
.pixel-art {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Swapped for a still picture when the visitor prefers reduced motion. */
.still-only {
  display: none;
}

/* ------------------------------------------------------------------ navigation: a row of hanging banners */

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 6px;
  margin: 0 auto 16px;
}

.nav a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 92px;
  padding: 7px 10px 17px;
  font: 16px/1.1 var(--caps);
  color: #fff7dc;
  text-decoration: none;
  text-shadow: 1px 1px 0 #000;
}

/* The cloth, cut into a swallowtail and hung from a wooden rod. */
.nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 22%), transparent 25% 75%, rgb(0 0 0 / 28%)),
    var(--banner, var(--lapis));
  border-top: 5px solid var(--oak);
  box-shadow: inset 0 0 0 2px var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 11px), 0 100%);
}

.nav a:nth-child(even) {
  --banner: var(--vermilion);
}

.nav a:hover {
  --banner: var(--verdigris);
}

.nav a[aria-current="page"] {
  --banner: var(--gold);
  color: var(--ink);
  text-shadow: none;
}

.nav img {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ parts bin, 1998 by way of 1398 */

marquee,
.marquee-still {
  display: block;
  margin: 8px 0 18px;
  padding: 3px 0;
  font: 18px/1.4 var(--caps);
  color: var(--gold);
  background: #3a0d0d;
  border-block: 3px double var(--gold);
}

.marquee-still {
  padding-inline: 10px;
}

.blackletter-title {
  margin: 0;
  font: clamp(52px, 13vw, 104px)/1.05 var(--blackletter);
  color: var(--gold);
  background: linear-gradient(#fff3b0, #f2c94c 42%, #b8860b 58%, #ffe58a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px #3a2200;
  filter: drop-shadow(3px 3px 0 #000);
}

.blink {
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.new {
  display: inline-block;
  padding: 0 4px;
  font: bold italic 12px/16px Arial, Helvetica, sans-serif;
  color: #ff0;
  vertical-align: 3px;
  background: #e00;
  border: 1px solid #000;
  animation: blink 0.9s step-end infinite;
}

.sparkle {
  flex: none;
  width: 46px;
  height: 46px;
  animation: twinkle 1.8s ease-in-out infinite;
}

.sparkle path {
  fill: #f2e38c;
  stroke: #7a5800;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.sparkle.late {
  animation-delay: -0.9s;
}

@keyframes twinkle {
  50% {
    transform: scale(0.55) rotate(45deg);
  }
}

/* A wooden sign with a nail in each corner. */
.plank-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px;
  font: 28px/1.1 var(--blackletter);
  color: #ffe9a8;
  text-decoration: none;
  text-shadow: 2px 2px 0 #000;
  background:
    radial-gradient(circle at 9px 9px, #1a1a1a 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, #1a1a1a 2.5px, transparent 3.5px),
    radial-gradient(circle at 9px calc(100% - 9px), #1a1a1a 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #1a1a1a 2.5px, transparent 3.5px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgb(0 0 0 / 12%) 7px 8px),
    linear-gradient(#8a5a2b, #6b4220 45%, #4e2f16);
  border: 3px solid #2b1608;
  border-radius: 6px;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 20%), 3px 4px 0 #000;
}

.plank-btn:hover {
  color: #fff;
  filter: brightness(1.15);
}

.plank-btn:active {
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 20%);
  transform: translate(3px, 4px);
}

.plank-btn img {
  width: 32px;
  height: 32px;
}

.plank-btn.small {
  gap: 8px;
  padding: 6px 16px;
  font: 17px/1.2 var(--caps);
}

.plank-btn.small img {
  width: 16px;
  height: 16px;
}

/* A parchment button with a red rule, for the minstrel. */
.minstrel-btn {
  margin: 2px 4px;
  padding: 6px 16px;
  font: 17px/1.3 var(--caps);
  color: var(--ink);
  background: #efdcb0 url("../img/bg-parchment.png");
  border: 2px solid var(--oak);
  box-shadow: inset 0 0 0 2px #efdcb0, inset 0 0 0 3px var(--vermilion), 2px 2px 0 #000;
  cursor: pointer;
}

.minstrel-btn:active {
  box-shadow: inset 0 0 0 2px #efdcb0, inset 0 0 0 3px var(--vermilion);
  transform: translate(2px, 2px);
}

/* The music's stop/play button, added by js/retro.js. It stays in the corner
   of the screen on every page, large enough to hit easily. */
.music-toggle {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 101;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 16px;
  font: 18px/1.2 var(--caps);
  color: #fff;
  background: #1a0f07;
  border: 3px solid #ffd75e;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.music-toggle:hover {
  background: #3a210d;
}

.music-toggle:active {
  box-shadow: none;
  transform: translate(3px, 3px);
}

@media print {
  .music-toggle {
    display: none;
  }
}

/* The hit counter, carved in stone in Roman numerals. */
.visits {
  font: 20px var(--caps);
  text-align: center;
}

.counter {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  vertical-align: middle;
  background: #2a2d3a;
  border: 3px solid;
  border-color: #6b7088 #1a1c25 #1a1c25 #6b7088;
}

.counter span {
  display: inline-block;
  min-width: 22px;
  padding: 0 3px;
  font: 24px/30px var(--book);
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 6px rgb(255 200 60 / 50%);
  background: linear-gradient(#4a4f63, #34384a);
  box-shadow: inset 1px 1px 0 #20232e;
}

/* Sparks and dust off the cursor's sword, added and moved by js/retro.js. */
.spark,
.dust {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
}

/* A white-hot streak cooling to orange along its tail. Its head sits on the
   point it flies from, and it turns about that point. */
.spark {
  width: 8px;
  height: 2px;
  margin: -1px 0 0 -8px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgb(255 90 0 / 0%), #ff8a1c 45%, #ffd84a 80%, #fffbe8);
  /* A dark edge as well as the glow, so the sparks still show on parchment. */
  box-shadow: 0 0 1px rgb(90 25 0 / 65%), 0 0 4px rgb(255 140 20 / 50%);
  transform-origin: 100% 50%;
}

/* A soft puff of grit: pale at the heart to show on dark stone, a darker rim
   to show on parchment. */
.dust {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(215 205 188 / 80%),
    rgb(160 146 128 / 50%) 35%,
    rgb(110 96 80 / 25%) 55%,
    transparent 70%
  );
}

/* A gilt picture frame, for portraits and the gallery. */
.gilt {
  padding: 16px;
  background:
    linear-gradient(135deg, #fff1a8, #c8962a 22%, #7a5512 40%, #f0cf6a 58%, #8a6216 78%, #e0b450);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px #3a2600,
    inset 0 0 0 5px #f6d77a,
    inset 0 0 0 7px #8a6216,
    inset 0 0 0 11px #c8962a,
    inset 0 0 0 13px #3a2600,
    0 8px 18px rgb(0 0 0 / 60%);
}

.gilt > svg,
.gilt > img {
  display: block;
  width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------ footer */

.footer {
  font: 16px/1.5 var(--book);
  text-align: center;
}

.knot-rule {
  height: 14px;
  margin: 32px 0 18px;
  border: 0;
  background:
    radial-gradient(circle, var(--gold) 0 3px, var(--vermilion) 3.5px 4.5px, transparent 5px) 0 50% / 18px 14px repeat-x,
    linear-gradient(transparent 6px, var(--gold-deep) 6px 8px, transparent 8px);
  animation: rule-slide 3s linear infinite;
}

@keyframes rule-slide {
  to {
    background-position: 18px 50%, 0 0;
  }
}

.webring {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  font: 17px var(--caps);
  color: var(--parchment);
  background: #1d1410;
  border: 4px ridge var(--gold-deep);
}

.webring a:not([class]),
.webring a:not([class]):visited {
  color: #ffd75e;
}

.webring b {
  font: 21px var(--blackletter);
  color: #fff;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}

/* The 88 x 31 buttons stay pure 1998. */
.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  overflow: hidden;
  font: bold 9px/1.15 Verdana, Geneva, Arial, sans-serif;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgb(255 255 255 / 55%), inset -1px -1px 0 rgb(0 0 0 / 45%);
}

.badge b {
  font-size: 10px;
}

.badge-candle {
  font-size: 8px;
  color: #ffd75e;
  background: radial-gradient(circle at 50% 120%, #7a4a10, #140c04 70%);
}

.badge-y1k {
  color: var(--ink);
  background: linear-gradient(#f6eaca, #d6b97f);
}

.badge-y1k b {
  font: 15px/1 var(--blackletter);
  color: var(--vermilion);
}

.badge-metal {
  color: #c9ccd6;
  background: #000;
}

.badge-metal b {
  font: 13px/1 var(--metal);
  color: #ff3b1f;
  letter-spacing: 0.5px;
  text-transform: none;
}

.badge-knight {
  color: #f6e7bf;
  background: linear-gradient(135deg, #1c3f94 50%, #b3201b 50%);
}

.badge-knight b {
  font: 13px/1 var(--blackletter);
  color: var(--gold);
  text-transform: none;
}

.badge-love {
  color: #ffde59;
  background: linear-gradient(#d0283e, #6e0d1c);
}

.badge-gh {
  color: #fff;
  background: #24292f;
}

.badge-in {
  color: #fff;
  background: #0a66c2;
}

a.badge:hover {
  filter: brightness(1.25);
}

.small {
  font-size: 15px;
}

/* ------------------------------------------------------------------ home: a castle under a starry night */

/* A tiled castle wall, with a string of bunting across the top. */
.page-home {
  --link: #ffd75e;
  --visited: #f0b8ff;
  padding-top: 52px;
  color: var(--parchment);
  background: #4e4a44 url("../img/bg-stone.png");
}

.page-home::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 44px;
  background: url("../img/bunting.png") repeat-x;
  pointer-events: none;
}

/* Shrinks to the width of the menu's banners, so the proclamation above them matches it. */
.herald {
  width: fit-content;
  margin-inline: auto;
}

/* A town crier's notice, standing in for the banner ad. It takes the herald's
   width without pushing it wider: the menu alone sets that. */
.proclamation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 0;
  min-width: 100%;
  min-height: 60px;
  margin: 0 auto 16px;
  padding: 8px 16px;
  font: 17px/1.2 var(--caps);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  background: #efdcb0 url("../img/bg-parchment.png");
  border: 2px solid var(--oak);
  box-shadow: inset 0 0 0 3px #efdcb0, inset 0 0 0 5px var(--vermilion), 3px 3px 0 #000;
}

.proclamation .flash {
  flex: none;
  padding: 2px 8px;
  font: 21px/1.1 var(--blackletter);
  color: #fff;
  background: var(--vermilion);
  border: 2px solid #000;
  transform: rotate(-8deg);
}

.proclamation .click {
  flex: none;
  color: var(--lapis);
  text-decoration: underline;
}

.title-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto 4px;
  padding: 10px 16px 16px;
  text-align: center;
  background: rgb(8 14 40 / 72%);
  border: 3px double var(--gold);
  box-shadow: 0 0 0 2px #000;
}

.tagline {
  margin: 0;
  font: italic 21px var(--book);
  color: var(--parchment);
}

/* Flaming torches on the wall, either side of the title. */
.title-torch {
  position: absolute;
  top: 50%;
  width: 48px;
  transform: translateY(-50%);
}

.title-torch img {
  display: block;
  width: 48px;
  height: 96px;
}

.title-torch.left {
  right: calc(100% + 30px);
}

.title-torch.right {
  left: calc(100% + 30px);
}

.subtitle {
  margin: 6px 0 0;
  font: 19px/1.35 var(--caps);
  color: #fff;
}

/* The castle scene, seen through a window in the wall, framed like a
   table with a fat border. */
.realm {
  margin: 0 0 22px;
  border: 12px ridge #7d776c;
  box-shadow: 0 0 0 2px #000;
}

.realm svg {
  display: block;
  width: 100%;
  height: auto;
}

/* One whole scene pixel per step, so the dragon stays on the pixel grid. */
.realm .dragon {
  animation: dragon-walk 32s steps(340) -11s infinite;
}

@keyframes dragon-walk {
  from {
    transform: translateX(-100px);
  }

  to {
    transform: translateX(240px);
  }
}

.me {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 22px;
  margin: 0 0 28px;
}

.portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.gilt.oval {
  padding: 14px;
  border-radius: 50%;
}

/* The portrait photo is 342x426, shown at half size so it stays sharp on high-DPI screens. */
.gilt.oval img {
  width: 171px;
  height: 213px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #3a2600;
}

.brass {
  margin-top: 10px;
  padding: 4px 12px;
  font: italic 14px/1.25 var(--book);
  color: #2b1a00;
  text-align: center;
  background: linear-gradient(#f7e08a, #c99a2e 50%, #f0d070);
  border: 1px solid #5a3d0a;
  border-radius: 2px;
  box-shadow: 1px 2px 0 #000;
}

.brass b {
  font: 15px var(--caps);
}

.this-is-me {
  margin: 0;
  font: 34px var(--blackletter);
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
}

/* Four heraldic shields for the main menu. */
.shields {
  display: grid;
  grid-template-columns: repeat(4, 140px);
  justify-content: center;
  gap: 18px 22px;
  margin: 0 0 30px;
}

.shield-btn {
  position: relative;
  display: block;
  width: 140px;
  height: 160px;
  text-decoration: none;
  filter: drop-shadow(3px 4px 0 #000);
  transition: transform 0.15s;
}

.shield-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}

.shield-btn span {
  position: absolute;
  top: 40%;
  right: -8px;
  left: -8px;
  padding: 3px 0;
  font: 18px/1.15 var(--caps);
  color: var(--ink);
  text-align: center;
  background: #efdcb0 url("../img/bg-parchment.png");
  border: 2px solid var(--oak);
  box-shadow: 2px 2px 0 #000;
}

.shield-btn:hover {
  transform: translateY(-4px) rotate(-2deg);
}

.shield-btn:hover span {
  color: var(--vermilion);
}

.vault {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 26px;
  margin: 0 0 34px;
}

.latest {
  display: flex;
  align-items: center;
  gap: 10px;
}

.latest-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 112px;
  padding: 8px 6px 6px;
  font: 15px/1.2 var(--caps);
  color: var(--lapis);
  text-align: center;
  text-decoration: underline;
  background: #efdcb0 url("../img/bg-parchment.png");
  border: 3px solid var(--oak);
  box-shadow: inset 0 0 0 2px var(--gold), 3px 3px 0 #000;
}

.latest-box img {
  width: 48px;
  height: 48px;
}

/* A rolled scroll with a wax seal, for the Oracle's sayings. */
.scroll {
  --link: var(--lapis);
  --visited: #6b2a7a;
  position: relative;
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 24px 28px 30px;
  color: var(--ink);
  background: #efdcb0 url("../img/bg-parchment.png");
  box-shadow: inset 0 0 30px rgb(120 80 20 / 45%);
}

.scroll::before,
.scroll::after {
  content: "";
  position: absolute;
  right: -12px;
  left: -12px;
  height: 22px;
  background: linear-gradient(#f6e7bf, #c9a35c 45%, #8a6a32 62%, #d8b878);
  border-radius: 11px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 55%);
}

.scroll::before {
  top: -14px;
}

.scroll::after {
  bottom: -14px;
}

.scroll-title {
  margin: 0 0 8px;
  font: 36px/1.1 var(--blackletter);
  color: var(--vermilion);
  text-align: center;
}

.oracle-intro {
  margin: 0 0 6px;
  font-style: italic;
  text-align: center;
}

.oracle-saying {
  margin: 0;
  padding: 10px 8px;
  border-block: 1px solid rgb(90 52 18 / 30%);
}

.oracle-saying p {
  margin: 0;
  font: 24px/1.35 var(--caps);
  color: var(--lapis);
  text-align: center;
}

.oracle-again {
  margin: 14px 0 0;
  text-align: center;
}

.wax-seal {
  position: absolute;
  right: 22px;
  bottom: -26px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  font: 30px/1 var(--blackletter);
  color: #f7c7b5;
  background: radial-gradient(circle at 35% 30%, #e0453f, #a3171a 55%, #6a0b0d);
  border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
  box-shadow: 0 2px 4px rgb(0 0 0 / 60%), inset 0 0 0 5px rgb(0 0 0 / 15%);
  transform: rotate(-12deg);
}

/* A knight's banner with his vows, hung from a pole. The swallowtail is cut
   with clip-path; the gold edging is the outer cloth showing round the inner one. */
.vows {
  max-width: 560px;
  margin: 0 auto 56px;
  filter: drop-shadow(4px 6px 0 rgb(0 0 0 / 55%));
}

.vows::before {
  content: "";
  position: relative;
  z-index: 1;
  display: block;
  height: 14px;
  margin: 0 -22px -4px;
  background:
    radial-gradient(circle at 7px 50%, #fff1a8 0 2px, var(--gold) 3px 5.5px, #3a2600 6px 7px, transparent 7.5px),
    radial-gradient(circle at calc(100% - 7px) 50%, #fff1a8 0 2px, var(--gold) 3px 5.5px, #3a2600 6px 7px, transparent 7.5px),
    linear-gradient(#a06a35, var(--oak) 55%, #2e1a0a) center / calc(100% - 20px) 8px no-repeat;
}

.vows-cloth {
  padding: 6px 6px 0;
  background: linear-gradient(90deg, #b8860b, var(--gold) 30%, #fff1a8 50%, var(--gold) 70%, #b8860b);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 56px), 0 100%);
}

.vows-inner {
  padding: 8px 34px 84px;
  color: var(--parchment);
  background:
    repeating-linear-gradient(45deg, transparent 0 22px, rgb(232 185 35 / 18%) 22px 23px),
    repeating-linear-gradient(-45deg, transparent 0 22px, rgb(232 185 35 / 18%) 22px 23px),
    linear-gradient(90deg, #12296a, var(--lapis) 22%, #2a52b0 50%, var(--lapis) 78%, #12296a);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 64px), 0 100%);
}

.vows-charge {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  color: var(--vermilion);
  text-align: center;
  text-shadow: 0 0 0 #000, 1px 1px 0 #000, -1px -1px 0 var(--gold), 1px -1px 0 var(--gold), -1px 1px 0 var(--gold);
}

.vows h2 {
  margin: 0;
  font: 42px/1.1 var(--blackletter);
  color: var(--gold);
  text-align: center;
  text-shadow: 2px 2px 0 #000;
}

.vows-intro {
  margin: 2px 0 10px;
  font-style: italic;
  text-align: center;
  color: #f6e7bf;
}

.vows ol {
  margin: 0;
  padding-left: 2.4em;
  list-style: upper-roman;
}

.vows li {
  padding: 2px 0;
}

.vows li::marker {
  font-family: var(--caps);
  color: var(--gold);
}

/* ------------------------------------------------------------------ about: an illuminated manuscript on an oak desk */

.page-about {
  --link: var(--lapis);
  --visited: #6b2a7a;
  color: var(--ink);
  background-color: #3b2413;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 9px, rgb(0 0 0 / 10%) 9px 11px),
    linear-gradient(90deg, #35200f, #4a2d17 45%, #3b2413);
}

.page-about .wrap {
  max-width: 940px;
}

.codex {
  position: relative;
  padding: 50px clamp(22px, 7vw, 80px) 44px;
  background: #efdcb0 url("../img/bg-parchment.png");
  border-radius: 3px;
  box-shadow: inset 0 0 70px rgb(120 80 20 / 50%), 0 12px 30px rgb(0 0 0 / 65%);
}

/* Ruled border in red and blue, with gold roundels at the corners. */
.codex::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid var(--vermilion);
  outline: 1px solid var(--lapis);
  outline-offset: 4px;
  pointer-events: none;
}

.codex::after {
  --roundel: radial-gradient(circle, var(--gold) 0 5px, var(--vermilion) 5.5px 7px, transparent 7.5px);
  content: "";
  position: absolute;
  inset: 7px;
  background:
    var(--roundel) 0 0 / 18px 18px no-repeat,
    var(--roundel) 100% 0 / 18px 18px no-repeat,
    var(--roundel) 0 100% / 18px 18px no-repeat,
    var(--roundel) 100% 100% / 18px 18px no-repeat;
  pointer-events: none;
}

.codex-title {
  margin: 0;
  font: clamp(34px, 7vw, 60px)/1.1 var(--blackletter);
  color: var(--vermilion);
  text-align: center;
}

.codex-title .lapis {
  color: var(--lapis);
}

.fleuron {
  margin: 6px 0 16px;
  font-size: 24px;
  line-height: 1;
  color: var(--vermilion);
  text-align: center;
}

.codex p {
  margin: 0 0 16px;
}

/* An illuminated initial: gold leaf on lapis. */
.incipit::first-letter {
  float: left;
  margin: 6px 12px 0 0;
  padding: 10px 10px 4px;
  font: 76px/0.8 var(--blackletter);
  color: var(--gold);
  text-shadow: 1px 1px 0 #000;
  background:
    radial-gradient(circle, rgb(255 255 255 / 20%) 1px, transparent 1.5px) 0 0 / 8px 8px,
    var(--lapis);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 2px var(--vermilion), 3px 3px 0 rgb(0 0 0 / 35%);
}

.deeds a {
  display: block;
  width: fit-content;
  font-size: 21px;
  text-decoration: none;
}

.deeds a:hover {
  text-decoration: underline;
}

.deeds a::before {
  content: "¶ ";
  color: var(--vermilion);
}

.deeds a:nth-child(even)::before {
  color: var(--lapis);
}

.c-red {
  color: #b3201b;
}

.c-orange {
  color: #b5541a;
}

.c-yellow {
  color: #9a6b00;
}

.c-green {
  color: #2e7d5b;
}

.c-blue {
  color: #1c3f94;
}

.c-indigo {
  color: #3a2a7a;
}

.c-violet {
  color: #7a2a7f;
}

.c-brown {
  color: #6b3a1a;
}

/* Little drawings in the margin, as the monks did. */
.marginalia {
  float: right;
  width: 170px;
  margin: 4px -40px 10px 22px;
  font: italic 15px/1.3 var(--book);
  color: #6b3a1a;
  text-align: center;
}

.marginalia.left {
  float: left;
  margin: 4px 22px 10px -40px;
}

.marginalia img {
  width: 144px;
}

.ascii {
  clear: both;
  margin: 22px 0 0;
  font: bold 15px/1.15 "Courier New", Courier, monospace;
  white-space: pre;
  overflow-x: auto;
}

.posie {
  font-style: italic;
  color: #7a2a7f;
}

.arms {
  max-width: 440px;
  margin: 8px auto 0;
  text-align: center;
}

.arms-art {
  display: block;
  width: min(260px, 100%);
  height: auto;
  margin: 0 auto;
}

.arms-motto {
  font: 10.5px var(--caps);
  letter-spacing: 0.2px;
  fill: #7a1512;
}

.arms figcaption {
  margin-top: 8px;
  font: italic 16px/1.4 var(--book);
  color: #6b3a1a;
}

.arms figcaption b {
  font: 17px var(--caps);
  color: var(--ink);
}

.codex h2 {
  clear: both;
  margin: 30px 0 4px;
  font: clamp(30px, 5vw, 40px)/1.1 var(--blackletter);
  color: var(--vermilion);
  text-align: center;
}

.relics {
  margin: 10px 0 18px;
  padding-left: 0;
  list-style: none;
}

.relics li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0;
}

/* Rubrics: the labels in red, as a scribe would write them. */
.relics b {
  font: 19px var(--caps);
  color: var(--vermilion);
}

.relics img {
  flex: none;
  width: 16px;
  height: 16px;
  translate: 0 2px;
}

.tapestry {
  margin: 28px 0 8px;
}

.tapestry-scroll {
  overflow-x: auto;
  background: #ece2c8;
  border: 3px solid var(--oak);
  box-shadow: inset 0 0 14px rgb(90 60 20 / 40%);
}

.tapestry svg {
  display: block;
  width: auto;
  max-width: none;
  height: 250px;
}

.tapestry figcaption {
  margin-top: 6px;
  font: italic 16px var(--book);
  color: #6b3a1a;
  text-align: center;
}

/* Running stitches for the outlines. */
.tapestry [stroke="#283048"] {
  stroke-dasharray: 5 1.6;
}

.tap-text {
  font: 18px var(--caps);
  letter-spacing: 3px;
  fill: #283048;
}

.shout {
  margin: 34px 0 8px;
  font: clamp(30px, 6vw, 50px)/1.15 var(--blackletter);
  text-align: center;
}

.huge {
  margin: 14px 0 0;
  font: clamp(26px, 4.6vw, 40px)/1.15 var(--book);
}

.page-about .footer {
  --link: #ffd75e;
  --visited: #f0b8ff;
  color: var(--parchment);
}

/* ------------------------------------------------------------------ skills: the armory, heavy metal edition */

.page-skills {
  --link: #ffcf3a;
  --visited: #ff9a6b;
  color: #ececec;
  background: #120404 radial-gradient(ellipse at 50% 0, #5a0000, #120404 70%) no-repeat;
  background-size: 100% 900px;
}

.page-skills .wrap {
  max-width: 1100px;
}

.metal-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 230px;
  padding: 16px 30px 44px;
  overflow: hidden;
  background: #a00 url("../img/bg-flames.png");
  border: 3px solid #000;
  box-shadow: 0 0 0 2px #6a0000, 0 0 30px rgb(255 60 0 / 35%);
}

.metal-heading {
  position: relative;
  z-index: 1;
  text-align: center;
}

.metal-pre {
  margin: 0;
  font: italic 20px var(--book);
  color: #ffcf3a;
  text-shadow: 2px 2px 0 #000;
}

.metal-logo {
  margin: 0;
  font: clamp(44px, 8vw, 84px)/1 var(--metal);
  letter-spacing: 2px;
  background: linear-gradient(#fff 0%, #d9dde6 36%, #5b6070 50%, #f2f4f8 62%, #8a90a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px #000;
  filter: drop-shadow(0 0 8px #ff2a00) drop-shadow(3px 3px 0 #000);
  /* Its own layer, so Safari draws the filter once instead of again for every
     strip of page it paints while scrolling and every frame of the fire below. */
  will-change: transform;
}

.metal-tour {
  margin: 8px 0 0;
  font: 19px var(--caps);
  color: #fff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px #000, 2px 2px 0 #000;
}

.crest {
  position: relative;
  z-index: 1;
  flex: none;
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 0 10px #000);
  will-change: transform; /* see .metal-logo */
}

.crest-text {
  font: 34px var(--metal);
  fill: #ffcf3a;
  stroke: #000;
  stroke-width: 1.5px;
  paint-order: stroke;
}

.fire-strip {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 80px;
  background: url("../img/fire.gif") repeat-x left bottom / 256px 80px;
  image-rendering: pixelated;
}

/* Three riveted iron plates, read as one long setlist. */
.armory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  counter-reset: track;
}

.plate,
.campaign {
  --rivet: radial-gradient(circle, #c9ccd6 0 2px, #2a2c31 2.5px 3.5px, transparent 4px);
  padding: 16px 20px 22px;
  /* The brushed lines are one 3px tile repeated, not a repeating gradient:
     Safari is slow to draw such a fine repeating gradient, and it draws it
     again for every strip of page it paints, which left blank patches while
     scrolling. */
  background:
    var(--rivet) 6px 6px / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) 6px / 12px 12px no-repeat,
    var(--rivet) 6px calc(100% - 6px) / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) calc(100% - 6px) / 12px 12px no-repeat,
    linear-gradient(90deg, rgb(255 255 255 / 3%) 1px, transparent 1px) 0 0 / 3px 100%,
    linear-gradient(160deg, #4a4d55, #26282d 50%, #3b3e45);
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%), inset 0 0 0 4px #1b1c20, inset 0 0 0 5px #6a6e78, 0 4px 0 #000;
}

.plate h2 {
  margin: 18px 0 6px;
  font: 27px/1.1 var(--metal);
  color: #ff3b1f;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgb(255 59 31 / 55%), 2px 2px 0 #000;
}

.plate h2:first-child {
  margin-top: 4px;
}

.plate ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plate li {
  padding-left: 2.1em;
  font-size: 17px;
  line-height: 1.4;
  text-indent: -2.1em;
  counter-increment: track;
}

.plate li::before {
  content: counter(track, decimal-leading-zero) ". ";
  font-family: var(--caps);
  color: #9aa0ad;
}

.dedication-line {
  margin: 10px 0 0;
  line-height: 1.6;
}

.dedication {
  padding: 1px 0;
  font-size: 17px;
  color: #fff;
  background: #6a0000;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* A fact about the devil's interval, and the button that plays it. */
.tritone {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 26px 0 0;
  padding: 16px 20px;
  background: #000;
  border: 3px solid #3a3d45;
  box-shadow: inset 0 0 0 1px #6a6e78;
}

.tritone .horns {
  flex: none;
  font: 46px/1 var(--metal);
  color: #ff3b1f;
  text-shadow: 0 0 10px rgb(255 59 31 / 60%);
}

.tritone h2 {
  margin: 0;
  font: 28px/1.1 var(--metal);
  color: #ff3b1f;
  letter-spacing: 1px;
}

.tritone p {
  margin: 6px 0 0;
  font-size: 17px;
}

.page-skills .minstrel-btn {
  font: 20px/1.2 var(--metal);
  color: #fff;
  letter-spacing: 1px;
  background: linear-gradient(#3b3e45, #111);
  border-color: #000;
  box-shadow: inset 0 0 0 2px #6a6e78, 0 0 10px rgb(255 59 31 / 50%);
}

/* Work history: one riveted plate per job, with its projects as quests. */
.campaigns {
  margin: 30px 0 0;
}

.campaigns > h2 {
  margin: 0;
  font: clamp(34px, 6vw, 46px)/1.1 var(--metal);
  color: #ff3b1f;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgb(255 59 31 / 60%), 3px 3px 0 #000;
}

.campaigns-sub {
  margin: 0 0 6px;
  font: italic 19px var(--book);
  color: #ffcf3a;
  text-align: center;
}

.campaign {
  margin-top: 14px;
  padding: 18px 26px 22px;
}

.campaign-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 18px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #6a6e78;
}

.campaign h3 {
  margin: 0;
  font: 26px/1.15 var(--metal);
  color: #ff3b1f;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 #000;
}

.campaign h3 .note {
  font: italic 16px var(--book);
  color: #c9ccd6;
  letter-spacing: 0;
  text-shadow: none;
}

.campaign-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 0;
}

.campaign .company {
  font: 19px var(--caps);
  color: var(--gold);
}

.campaign .dates {
  font: 17px var(--caps);
  color: #c9ccd6;
  white-space: nowrap;
}

.campaign > ul {
  margin: 0;
  padding-left: 1.3em;
  font-size: 17px;
  line-height: 1.45;
}

.campaign > ul li::marker {
  color: #ff3b1f;
}

.quests-label {
  margin: 14px 0 0;
  font: 15px var(--caps);
  color: #9aa0ad;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.quest {
  margin-top: 12px;
  scroll-margin-top: 20px;
  padding-left: 14px;
  border-left: 3px solid #8a0000;
}

.quest h4 {
  margin: 0;
  font: bold 19px/1.3 var(--book);
  color: #fff;
}

.quest h4 span {
  font-weight: normal;
  font-style: italic;
  color: #c9ccd6;
}

.quest p {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.45;
}

/* The figures worth noticing, picked out like the dedication above. */
.quest b {
  padding: 0 3px;
  font-weight: normal;
  color: #fff;
  background: #6a0000;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.quest .tech {
  font: 15px var(--caps);
  color: #ffcf3a;
}

.campaign .also {
  margin: 12px 0 0;
  font-size: 16px;
  font-style: italic;
  color: #c9ccd6;
}

.campaigns-more {
  margin: 16px 0 0;
  text-align: center;
}

/* ------------------------------------------------------------------ projects: the royal gallery */

.page-projects {
  --link: #ffd75e;
  --visited: #f0b8ff;
  color: var(--parchment);
  background-color: #4a0f17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23661c27' stroke-width='2'%3E%3Ccircle cx='24' cy='15' r='9'/%3E%3Ccircle cx='24' cy='33' r='9'/%3E%3Ccircle cx='15' cy='24' r='9'/%3E%3Ccircle cx='33' cy='24' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

.page-projects .wrap {
  max-width: 940px;
}

.gallery-header {
  margin: 6px 0 4px;
  text-align: center;
}

.intro {
  max-width: 640px;
  margin: 10px auto 0;
  font-size: 19px;
}

.exhibit {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: center;
  gap: 24px 34px;
  margin: 0 0 54px;
  scroll-margin-top: 20px;
}

.exhibit:nth-of-type(even) {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.exhibit:nth-of-type(even) .painting {
  order: 2;
}

.painting {
  position: relative;
  isolation: isolate;
  margin: 0;
}

/* A gallery spotlight on the wall behind the painting. */
.painting::before {
  content: "";
  position: absolute;
  inset: -50px -40px -10px;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0, rgb(255 228 160 / 30%), transparent 70%);
}

.painting figcaption {
  margin-top: 10px;
  font: italic 15px/1.3 var(--book);
  color: #ead3a4;
  text-align: center;
}

.painting.tall {
  width: min(250px, 100%);
  justify-self: center;
}

.placard {
  --link: var(--lapis);
  --visited: #6b2a7a;
  padding: 18px 24px 20px;
  color: var(--ink);
  background: #f7f0de;
  border: 1px solid #b9a77f;
  box-shadow: 0 5px 12px rgb(0 0 0 / 55%);
}

.placard h2 {
  margin: 0;
  font: 32px/1.1 var(--blackletter);
  color: var(--vermilion);
}

.placard .new {
  font-size: 12px;
  vertical-align: 6px;
}

.placard .work {
  margin: 2px 0 10px;
  font-style: italic;
  color: #6b3a1a;
}

.placard p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.45;
}

.placard p:last-child {
  margin-bottom: 0;
}

.placard .medium {
  font-size: 15px;
  color: #4a3a2a;
}

.placard .medium b {
  font: 16px var(--caps);
  font-weight: normal;
  color: var(--ink);
}

.placard ul {
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
}

.placard li + li {
  margin-top: 6px;
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 900px) {
  .title-torch {
    display: none;
  }
}

@media (max-width: 760px) {
  .armory {
    grid-template-columns: minmax(0, 1fr);
  }

  .metal-banner {
    min-height: 0;
    padding: 18px 12px 56px;
  }

  .crest {
    width: 72px;
    height: 72px;
  }

  .exhibit,
  .exhibit:nth-of-type(even) {
    grid-template-columns: minmax(0, 1fr);
  }

  .exhibit:nth-of-type(even) .painting {
    order: 0;
  }

  .painting {
    width: min(360px, 100%);
    justify-self: center;
  }

  .painting::before {
    inset: -40px 0 -10px;
  }

  .marginalia,
  .marginalia.left {
    float: none;
    margin: 8px auto 16px;
  }
}

@media (max-width: 680px) {
  .shields {
    grid-template-columns: repeat(2, 140px);
  }
}

@media (max-width: 520px) {
  body {
    font-size: 18px;
  }

  .proclamation .flash,
  .this-is-me .blink {
    display: none;
  }

  .plank-btn {
    padding: 8px 14px;
    font-size: 23px;
  }

  .plank-btn img {
    width: 24px;
    height: 24px;
  }

  .shields {
    gap: 14px 12px;
  }

  .scroll {
    padding-inline: 18px;
  }

  .campaign {
    padding-inline: 16px;
  }

  .vows::before {
    margin-inline: -12px;
  }

  .vows-inner {
    padding-inline: 16px;
  }

  .vows ol {
    padding-left: 2em;
  }

  .tapestry svg {
    height: 200px;
  }

  .tritone {
    flex-direction: column;
    text-align: center;
  }
}

/* ------------------------------------------------------------------ calm mode */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .fire-strip {
    display: none;
  }

  .anim-only {
    display: none;
  }

  .still-only {
    display: inline;
  }
}
