/* Design chooser panel and motion (reveal on scroll, hero parallax). */

.chooser-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0.625rem 1.125rem;
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: right bottom;
}

.chooser-toggle::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--highlight);
}

.chooser-toggle:hover {
  background: var(--accent-hover);
}

.chooser {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: min(100%, 24rem);
  padding: 1.5rem;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow-y: auto;
  visibility: hidden;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease), visibility 0s 0.35s;
}

.chooser.is-open {
  visibility: visible;
  transform: none;
  transition: transform 0.35s var(--ease);
}

.chooser__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.chooser__title {
  font-family: var(--font-head);
  font-size: 1.625rem;
  font-weight: var(--head-weight);
  line-height: 1.2;
}

.chooser__intro {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.chooser__close {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.chooser fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.chooser legend {
  margin-bottom: 0.625rem;
  padding: 0;
  font-weight: 700;
}

.chooser__options {
  display: grid;
  gap: 0.5rem;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.75rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  background: var(--tint);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.option__name {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.option__hint {
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.35;
}

.swatch {
  display: flex;
  width: 3.25rem;
  height: 2.25rem;
  border-radius: 0.25rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}

.swatch i {
  flex: 1;
}

.swatch--1 i:nth-child(1) { background: #0b2545; }
.swatch--1 i:nth-child(2) { background: #0b7a86; }
.swatch--1 i:nth-child(3) { background: #62e0d4; }
.swatch--2 i:nth-child(1) { background: #0a3b2c; }
.swatch--2 i:nth-child(2) { background: #0b7a55; }
.swatch--2 i:nth-child(3) { background: #76e8b7; }
.swatch--3 i:nth-child(1) { background: #1c232b; }
.swatch--3 i:nth-child(2) { background: #0a66c2; }
.swatch--3 i:nth-child(3) { background: #7cc4ff; }

.specimen {
  width: 3.25rem;
  font-size: 1.875rem;
  line-height: 1;
  text-align: center;
}

.specimen--1 { font-family: "Zen Old Mincho", Georgia, serif; font-weight: 700; }
.specimen--2 { font-family: "Zen Antique", Georgia, serif; font-weight: 400; }
.specimen--3 { font-family: "LXGW WenKai TC", Georgia, serif; font-weight: 700; }

.chooser__share {
  display: grid;
  gap: 0.625rem;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.chooser__share p {
  color: var(--muted);
  font-size: var(--text-small);
}

.chooser__status {
  min-height: 1.5em;
  font-weight: 600;
}

/* Motion */

.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);

}

.js .reveal--2 {
  transition-delay: 90ms;
}

.js .reveal--3 {
  transition-delay: 180ms;
}

.js .reveal--4 {
  transition-delay: 270ms;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@supports (animation-timeline: scroll()) {
  .hero__media img {
    animation: hero-drift linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100vh;
  }
}

@keyframes hero-drift {
  to {
    transform: translateY(5%) scale(1.04);
  }
}

@media (max-width: 36rem) {
  .chooser-toggle {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    border-radius: 999px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
