/* Trixipper. A con badge on a lanyard, in Dipper's red-to-blue with his paw prints. */

:root {
  --ink: #1F2766;        /* deep indigo: text on the badge, lanyard */
  --ink-soft: #4A4E7A;
  --fox: #F4973A;        /* the fox's orange */
  --fox-pale: #FFE3C2;
  --sky: #425FC7;        /* Dipper's blue */
  --brick: #A15C5C;      /* Dipper's red */
  --paper: #FFFFFF;
  --on-bg: #FFFFFF;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, p, ul, li { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

html { font-size: 16px; overflow-x: clip; }

body {
  min-height: 100vh;
  min-width: 320px;
  overflow-x: hidden;
  font-family: 'Figtree', system-ui, sans-serif;
  color: var(--ink);
  background-color: #5D4FAE;
  -webkit-text-size-adjust: 100%;
}

/* His paw pattern, quieter, over the same red-to-blue, fixed behind the page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url('/images/paws-soft.svg'),
    linear-gradient(170deg, #3E55C2 0%, #5D4FAE 48%, #A0596A 100%);
  background-size: 150px, auto;
  background-position: center top, 0 0;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--fox-pale);
  outline-offset: 3px;
}

.page {
  display: grid;
  grid-template-columns: 22.5rem minmax(0, 1fr);
  gap: 4.5rem;
  align-items: start;
  width: min(66rem, 100%);
  margin: 0 auto;
  padding: 5.5rem 2.5rem 3rem;
}

/* ---------- Badge ---------- */

.badge-col {
  position: relative;
  padding-top: 1.5rem;
}

/* Strap from the top of the page down to the badge clip */
.lanyard {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1.5rem - 0.6rem);
  width: 1.75rem;
  height: 60rem;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent 3px, rgba(255, 255, 255, 0.35) 3px 4px, transparent 4px calc(100% - 4px), rgba(255, 255, 255, 0.35) calc(100% - 4px) calc(100% - 3px), transparent calc(100% - 3px)),
    var(--ink);
}
.lanyard .clip {
  position: absolute;
  left: 50%;
  bottom: -0.25rem;
  width: 1.25rem;
  height: 1.6rem;
  transform: translateX(-50%);
  border-radius: 0.35rem 0.35rem 0.6rem 0.6rem;
  background: linear-gradient(90deg, #A9AEC9, #E8EAF4 45%, #9BA0BE);
  box-shadow: 0 2px 3px rgba(20, 16, 60, 0.4);
}

.swing {
  position: relative;
  transform-origin: 50% 0;
  animation: swing 1.8s ease-in-out both;
}
@keyframes swing {
  0%   { transform: rotate(-7deg); }
  35%  { transform: rotate(3.5deg); }
  62%  { transform: rotate(-1.5deg); }
  82%  { transform: rotate(0.6deg); }
  100% { transform: rotate(0deg); }
}

.badge {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.75rem 1.75rem;
  background: var(--paper);
  border-radius: 1.4rem;
  box-shadow:
    0 1.5rem 3rem -1rem rgba(31, 22, 80, 0.6),
    0 0.25rem 0.75rem rgba(31, 22, 80, 0.18);
  overflow: hidden;
}
.badge-band {
  align-self: stretch;
  position: relative;
  height: 6.5rem;
  margin: 0 -1.75rem;
  background: url('/images/paws-orange.svg') center / 96px, var(--fox);
}
.slot {
  position: absolute;
  left: 50%;
  top: 0.9rem;
  width: 3.25rem;
  height: 0.7rem;
  transform: translateX(-50%);
  border-radius: 1rem;
  background: #7A3E0C;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.35);
}
.avatar {
  position: relative;
  z-index: 1;
  width: 8.5rem;
  height: 8.5rem;
  margin-top: -4.25rem;
  border-radius: 50%;
  border: 0.4rem solid var(--paper);
  background: var(--paper);
}
.name {
  margin-top: 0.6rem;
  font-family: 'Shrikhand', 'Figtree', sans-serif;
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.bio {
  margin-top: 0.9rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 30ch;
}
.bio p + p { margin-top: 0.7rem; }

.ask {
  margin-top: 1.4rem;
  align-self: stretch;
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.ask:hover { background: var(--sky); }

/* Con ribbons hanging under the badge */
.ribbons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: -0.75rem;
}
.ribbon {
  display: block;
  width: 7.25rem;
  padding: 1.35rem 0.5rem 1.6rem;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: none;
}
.ribbon--artist { background: var(--fox); color: var(--ink); transform: rotate(-2.5deg); transform-origin: top center; }
.ribbon--suit { background: var(--sky); transform: rotate(2deg); transform-origin: top center; }

/* ---------- Right column ---------- */

.info-col {
  display: grid;
  gap: 3rem;
  padding-top: 1.5rem;
  color: var(--on-bg);
}
.info-col h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(20, 16, 60, 0.3);
}

.links { display: grid; gap: 0.6rem; }
.links a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0.5rem 1.25rem -0.6rem rgba(31, 22, 80, 0.55);
  transition: background-color 0.2s ease;
}
.links a:hover { background: var(--fox-pale); }
.links .link--site { background: var(--fox); }
.links .link--site .handle { color: var(--ink); }
.links .link--site:hover { background: var(--fox-pale); }
.links svg {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  fill: var(--ink);
}
.links .label { font-weight: 700; font-size: 1.05rem; }
.links .handle {
  margin-left: auto;
  padding-left: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  white-space: nowrap;
}

.gallery {
  display: flex;
  gap: 0.75rem;
}
.gallery li { flex: var(--r) 1 0; min-width: 0; }
.gallery a {
  display: block;
  background: #F1EEFB;
  border-radius: 0.9rem;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 0.75rem 1.5rem -0.75rem rgba(31, 22, 80, 0.7);
}
.gallery img {
  width: 100%;
  transition: transform 0.25s ease;
}
.gallery a:hover img { transform: scale(1.04); }

.version {
  padding: 0 1rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Art viewer ---------- */

.viewer {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 94vh;
  overflow: visible;
}
.viewer::backdrop { background: rgba(24, 18, 72, 0.85); }
.viewer img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 0.9rem;
}
.viewer-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.35);
}
.viewer-close svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    max-width: 30rem;
    padding: 3.5rem 1.25rem 2.5rem;
  }
  .info-col { padding-top: 0; gap: 2.5rem; }
  .gallery { flex-wrap: wrap; }
  .gallery li { flex: 1 1 40%; }
  .gallery li:last-child { flex-basis: 100%; }
}
@media (max-width: 400px) {
  .links .handle { display: none; }
  .badge { padding: 0 1.25rem 1.5rem; }
  .badge-band { margin: 0 -1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .swing { animation: none; }
  .gallery img, .links a, .ask { transition: none; }
}
