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

:root {
  --bg: #fff;
  --text: #000;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cursor-metal: url("images/cursor-small.png") 2 2, auto;
}

html {
  font-size: 16px;
  background: #fff;
  color-scheme: only light;
  cursor: var(--cursor-metal);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  cursor: var(--cursor-metal);
}

.social {
  position: fixed;
  top: 2.5rem;
  right: 2.5rem;
  z-index: 10;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social a {
  display: flex;
  color: #000;
  text-decoration: none;
  line-height: 0;
}

.social a:hover {
  opacity: 0.5;
}

main {
  max-width: calc(100vw - 5rem);
  margin: 0;
  padding: 3rem 2.5rem 1.5rem 2.5rem;
}

header {
  margin-bottom: 1.75rem;
}

.header-visual {
  width: 95%;
  max-width: 36rem;
}

h1 {
  margin: 0;
}

.name {
  display: block;
  width: 96%;
  height: auto;
}

.portrait-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 2rem;
  overflow: hidden;
}

.portrait {
  display: block;
  width: 100%;
  filter:
    contrast(1.3)
    saturate(2.4)
    sepia(0.45)
    hue-rotate(290deg)
    brightness(1.1);
}

.portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 120, 200, 0.22) 0%,
    rgba(120, 220, 255, 0.14) 45%,
    rgba(200, 130, 255, 0.2) 100%
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

section {
  margin-top: 1.75rem;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.intro p {
  margin: 0 0 0.6rem;
}

.greeting {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem !important;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: var(--cursor-metal);
}

a:hover {
  opacity: 0.6;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li,
.timeline li {
  margin-bottom: 0.55rem;
}

.links li:last-child,
.timeline li:last-child {
  margin-bottom: 0;
}

.pub {
  display: inline-block;
  min-width: 3.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: baseline;
}

.pub::after {
  content: " — ";
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.meta::before {
  content: "— ";
}

.timeline li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  column-gap: 0.75rem;
  align-items: baseline;
}

.timeline time {
  font-variant-numeric: tabular-nums;
}

.event {
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.guestbook-tagline {
  margin: 0 0 0.75rem;
}

.signature-pad-wrap {
  width: 100%;
  max-width: 32rem;
  margin-bottom: 0.75rem;
}

#signature-canvas {
  display: block;
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.guestbook-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.guestbook-actions button {
  padding: 0;
  border: none;
  background: none;
  color: #000;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: var(--cursor-metal);
}

.guestbook-actions button:hover {
  opacity: 0.6;
}

.guestbook-status {
  min-height: 1.5em;
  margin: 0;
}

.guestbook-status:empty {
  display: none;
}

.visitor-book {
  margin-top: 0.75rem;
  padding: 0.5rem 2.5rem 2.5rem;
}

.signature-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signature-gallery li {
  margin: 0;
}

.signature-gallery img {
  display: block;
  max-width: 11rem;
  max-height: 4.5rem;
  width: auto;
  height: auto;
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  main {
    padding: 2rem 1.5rem 3rem 1.5rem;
    max-width: calc(100vw - 3rem);
  }

  .social {
    top: 1.5rem;
    right: 1.5rem;
    gap: 0.85rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
  }

  .visitor-book {
    padding: 0.5rem 1.5rem 2rem;
  }
}
