:root {
  color-scheme: light;
  --paper: #efe5cf;
  --paper-deep: #dfcfad;
  --ink: #30291e;
  --faded: #74664e;
  --faint: rgba(63, 52, 35, 0.26);
  --line: rgba(66, 52, 31, 0.34);
  --line-strong: rgba(56, 42, 24, 0.72);
  --focus: #6b3f1e;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 10px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(63, 52, 35, 0.12);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 10;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.notebook {
  width: min(1180px, calc(100% - 30px));
  margin: 0 auto;
  padding: 36px 0 52px;
}

.title-block {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  margin: 0 auto 12px;
  text-align: center;
}

.folio {
  margin: 0 0 8px;
  color: var(--faint);
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 20px;
  line-height: 1;
  transform: rotate(-2deg);
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  color: #2c251b;
  font-size: clamp(34px, 4.8vw, 58px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0;
}

.title-block p:last-child {
  margin-bottom: 0;
  color: var(--faded);
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.45;
}

.plate-section {
  padding-top: 8px;
}

.specimen {
  position: relative;
  width: min(1110px, 100%);
  margin: 0 auto;
}

.specimen-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(58, 42, 23, 0.28);
  box-shadow:
    0 18px 60px rgba(74, 51, 22, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.26) inset;
}

.annotation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.leader {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.3;
  stroke-dasharray: 2.8 7;
  stroke-linecap: round;
}

.annotation {
  position: absolute;
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: 245px;
  color: var(--faded);
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  line-height: 1.16;
  transform: rotate(var(--tilt, -2deg));
}

.annotation-ai {
  --tilt: -5deg;
  left: 7.6%;
  top: 17.4%;
}

.annotation-desk {
  --tilt: 3deg;
  right: 8.2%;
  top: 15.5%;
  text-align: right;
}

.annotation-sights {
  --tilt: -3deg;
  right: 10.5%;
  bottom: 17.3%;
  text-align: right;
}

.annotation-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: -0.12em -0.28em 0.08em;
  padding: 0.12em 0.28em 0.1em;
  color: var(--ink);
  font-size: clamp(23px, 2.4vw, 32px);
  text-decoration: none;
  text-shadow: 0 0 0 transparent;
  transition:
    color 180ms ease,
    transform 180ms ease,
    text-shadow 180ms ease;
}

.annotation-name span {
  position: relative;
  z-index: 1;
}

.annotation-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: var(--circle-width, 138%);
  height: var(--circle-height, 178%);
  overflow: visible;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    rotate(var(--circle-tilt, -2deg))
    scaleX(var(--circle-stretch, 1));
}

.annotation-circle path {
  fill: none;
  opacity: 0;
  stroke: var(--circle-ink, rgba(51, 40, 24, 0.55));
  stroke-dasharray: var(--circle-dash, 500);
  stroke-dashoffset: var(--circle-dash, 500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--circle-stroke, 1.35);
  transition:
    opacity 140ms ease,
    stroke-dashoffset 640ms cubic-bezier(0.32, 0.02, 0.18, 1);
  vector-effect: non-scaling-stroke;
}

.annotation-circle path + path {
  stroke-width: var(--circle-overdraw-stroke, 0.9);
  transition-delay: 120ms;
}

.annotation-name:is(:hover, :focus, :focus-visible) .annotation-circle path,
.annotation:has(.annotation-name:hover) .annotation-circle path,
.annotation:focus-within .annotation-circle path {
  opacity: 1;
  stroke-dashoffset: 0;
}

.annotation-name:is(:hover, :focus, :focus-visible) .annotation-circle path + path,
.annotation:has(.annotation-name:hover) .annotation-circle path + path,
.annotation:focus-within .annotation-circle path + path {
  opacity: var(--circle-overdraw, 0.45);
}

.annotation-ai .annotation-name {
  --circle-height: 174%;
  --circle-ink: rgba(49, 41, 30, 0.42);
  --circle-dash: 510;
  --circle-overdraw: 0.32;
  --circle-stroke: 1.05;
  --circle-tilt: -5deg;
  --circle-width: 136%;
}

.annotation-desk .annotation-name {
  --circle-height: 170%;
  --circle-dash: 520;
  --circle-ink: rgba(42, 33, 22, 0.58);
  --circle-overdraw: 0.5;
  --circle-stroke: 1.45;
  --circle-tilt: 4deg;
  --circle-width: 134%;
}

.annotation-sights .annotation-name {
  --circle-height: 172%;
  --circle-dash: 525;
  --circle-ink: rgba(53, 42, 28, 0.5);
  --circle-overdraw: 0.38;
  --circle-stretch: 1.04;
  --circle-stroke: 1.25;
  --circle-tilt: -2deg;
  --circle-width: 132%;
}

.annotation-desk .annotation-name,
.annotation-sights .annotation-name {
  justify-self: end;
}

.annotation-note {
  color: rgba(61, 49, 35, 0.72);
  font-size: clamp(13px, 1.25vw, 16px);
}

.annotation:hover .annotation-name,
.annotation:focus-within .annotation-name {
  color: #171108;
  text-shadow: 0 0 0.25px currentColor;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .annotation-circle path {
    transition: opacity 120ms ease;
  }
}

@media (min-width: 761px) {
  .notebook {
    min-height: 100svh;
    padding: clamp(14px, 2.3vh, 30px) 0 clamp(14px, 2.6vh, 34px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .title-block {
    margin-bottom: clamp(5px, 1vh, 10px);
  }

  h1 {
    font-size: clamp(34px, min(4.8vw, 6vh), 58px);
  }

  .title-block p:last-child {
    font-size: clamp(16px, min(2.1vw, 2.4vh), 20px);
  }

  .plate-section {
    min-height: 0;
    padding-top: 0;
    display: flex;
    align-items: center;
  }

  .specimen {
    width: min(1110px, 112vh, 100%);
  }
}

@media (max-width: 760px) {
  .notebook {
    width: min(100% - 20px, 1180px);
    padding-top: 26px;
  }

  .title-block {
    margin-bottom: 16px;
  }

  .folio {
    font-size: 18px;
  }

  .plate-section {
    padding-top: 0;
  }

  .specimen {
    display: grid;
    gap: 22px;
  }

  .specimen-image {
    border-radius: 1px;
  }

  .annotation-lines {
    display: none;
  }

  .annotation {
    position: static;
    width: auto;
    max-width: none;
    padding: 0 8px;
    text-align: left;
    transform: rotate(-1deg);
  }

  .annotation-ai,
  .annotation-desk,
  .annotation-sights {
    justify-self: stretch;
  }

  .annotation-desk .annotation-name,
  .annotation-sights .annotation-name {
    justify-self: start;
  }

  .annotation-name {
    font-size: clamp(25px, 8vw, 34px);
  }

  .annotation-note {
    font-size: 15px;
  }
}

@media (max-width: 460px) {
  .notebook {
    width: min(100% - 16px, 1180px);
  }

  .title-block {
    text-align: left;
    padding-inline: 6px;
  }

  .folio {
    transform: rotate(-1.3deg);
  }
}
