.dally-page {
  background: #fdfdfd;
}

.dally-page .site-header {
  position: relative;
}

.dally {
  --placeholder: #d8d8d8;
  --accent: #ff8e78;
  padding: 48px clamp(20px, 4vw, 64px) 80px;
  color: #111;
  font: 1rem / 1.4 var(--sans);
}

.dally h1,
.dally h2 {
  color: inherit;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

.dally h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
}

.dally h2 {
  font-size: 2rem;
}

.dally p {
  margin: 0;
}

.dally-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.dally-split p {
  max-width: 30ch;
}

.dally-hero,
.dally-materials-section,
.dally-prints,
.dally-setup {
  position: relative;
}

.dally-star {
  --star-image: url("../assets/dally/gold-star-sticker.png");
  position: absolute;
  top: var(--star-y);
  left: var(--star-x);
  z-index: 1;
  width: min(var(--star-size), 9vw);
  aspect-ratio: 468 / 533;
  background: var(--star-image) center / contain no-repeat;
  transform: translate(-50%, -50%) rotate(var(--star-angle));
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .dally-star::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 37%, #fff2bd45 50%, transparent 63%) 82% 0 / 240% 100% no-repeat;
    mask: var(--star-image) center / contain no-repeat;
    animation: dally-star-sheen 1s linear infinite alternate;
  }

  @keyframes dally-star-sheen {
    to { background-position: 18% 0; }
  }
}

.dally-hero-demo {
  display: grid;
  place-items: center;
  aspect-ratio: 378 / 243;
  padding: 12px;
  background: var(--placeholder);
  text-align: center;
}

.dally-hero-copy p {
  margin-top: 10px;
}

.dally-hero-copy .pill-button {
  margin-top: 24px;
}

.dally-materials-section {
  scroll-margin-top: 24px;
}

.dally .pill-button {
  background: var(--accent);
  color: #fff;
}

.dally .dally-rounded-button {
  border-radius: 999px;
}

.dally-objects {
  display: grid;
  grid-template-columns: minmax(0, 64fr) minmax(0, 25fr) minmax(0, 11fr);
  gap: clamp(8px, 2vw, 32px);
  align-items: center;
  position: relative;
  margin: 60px 0 72px;
  padding-block: 16px;
  overflow: clip;
}

.dally-object-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 1.5vw, 20px);
  position: relative;
}

.dally-object-group img,
.dally-rothko-card {
  width: 100%;
  height: clamp(78px, 15vw, 195px);
  object-fit: contain;
}

.dally-object-group img {
  transform: translateX(var(--object-shift, 0px)) rotate(var(--object-angle, 0deg));
}

.dally-object-group img:nth-child(2) {
  --object-angle: -7deg;
}

.dally-object-group img:nth-child(3) {
  --object-angle: -8deg;
  width: 88%;
  justify-self: center;
}

.dally-object-headline {
  max-width: 92%;
  font-size: clamp(1.45rem, 3vw, 3rem);
  line-height: 1.15;
  transform: translateX(var(--headline-shift, 0px));
}

.dally-reveal {
  display: grid;
  grid-column: 2 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(8px, 1.5vw, 24px);
  align-items: center;
  font-size: clamp(0.875rem, 1.6vw, 1.5rem);
  line-height: 1.2;
  opacity: var(--reveal-opacity, 1);
}

.dally-scroll-scene .dally-reveal {
  position: absolute;
  grid-column: auto;
  top: 50%;
  right: 1%;
  width: 27%;
  transform: translateY(-50%);
}

.dally-rothko-card {
  transform: translateX(var(--card-shift, 0px)) rotate(9deg);
}

.dally .dally-materials {
  max-width: 24ch;
  font-size: clamp(1.6rem, 3vw, 3.5rem);
  line-height: 1.28;
}

.dally-materials p + .dally-materials-note {
  margin-top: 0.9em;
  font-size: 0.6em;
}

.dally-materials button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline dotted;
  text-decoration-color: #888;
  text-underline-offset: 0.18em;
}

.dally-materials button[aria-pressed="true"],
.dally-materials button:hover,
.dally-materials button:focus-visible {
  text-decoration-color: var(--accent);
}

.dally-materials img {
  display: inline-block;
  width: auto;
  height: 1.22em;
  vertical-align: middle;
}

.dally-materials .dally-nfc-tags {
  width: 2.2em;
  object-fit: cover;
}

.dally-material-previews {
  display: grid;
  text-align: center;
}

.dally-material-previews article {
  grid-area: 1 / 1;
}

.dally-material-previews article[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.dally-material-previews img {
  display: block;
  width: 100%;
  height: clamp(200px, 24vw, 330px);
  object-fit: contain;
}

.dally .dally-material-description {
  margin: 10px auto 16px;
  max-width: 36ch;
}

.dally-prints {
  margin-top: 32px;
  scroll-margin-top: 100px;
}

.dally-prints h2 {
  margin-bottom: 28px;
  text-align: center;
}

.dally-cad-video {
  display: block;
  width: 100%;
  height: auto;
}

.dally-prints-details p {
  max-width: none;
}

.dally-prints-details p + p {
  margin-top: 1em;
}

.dally-prints-details .pill-button {
  margin-top: 16px;
}

.dally-setup {
  --setup-rule: #d6d6de;
  margin-top: 70px;
}

.dally-setup h2 {
  margin-bottom: 24px;
  text-align: center;
}

.dally-projects-link {
  display: table;
  margin: clamp(40px, 6vw, 72px) auto 0;
  font-weight: 700;
}

.dally-setup-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.dally-setup-steps li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 0.85fr);
  gap: clamp(8px, 2vw, 24px);
  padding: 18px clamp(10px, 2vw, 28px);
  border-top: 1px solid var(--setup-rule);
}

.dally-setup-steps li:nth-child(even) {
  border-left: 1px solid var(--setup-rule);
}

.dally-setup-steps .dally-demo-cell {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.dally-demo-square {
  width: min(100%, 260px);
  aspect-ratio: 1;
  background: var(--placeholder);
}

.dally-setup-steps li:hover,
.dally-setup-steps li:focus-within {
  z-index: 1;
}

.dally-step-visual {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.dally-step-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dally-step-caption {
  grid-column: 1;
  grid-row: 1;
  padding-top: 8px;
  font-size: clamp(0.875rem, 1.4vw, 1.15rem);
}

.dally-step-title {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-bottom: 0.5em;
  font-size: clamp(1rem, 2vw, 1.65rem);
  line-height: 1.13;
}

.dally-step-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.55em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.dally-step-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 8px;
}

.dally-phone {
  display: block;
  position: relative;
  aspect-ratio: 354 / 705;
  max-width: 230px;
  margin: 0 auto 8px;
  filter: grayscale(1);
  opacity: 0.68;
}

.dally-step-toggle[aria-pressed="true"] .dally-phone {
  filter: none;
  opacity: 1;
}

@media (hover: hover) {
  .dally-step-toggle:hover .dally-phone,
  .dally-step-visual:hover .dally-phone {
    transform: scale(1.06);
    filter: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .dally-phone {
    transition: transform 0.25s ease, filter 180ms ease-out, opacity 180ms ease-out;
  }
}

.dally-phone img {
  position: absolute;
  /* The frame opening sits slightly right of center. Extend beneath its bezel. */
  top: 2.13%;
  left: 7.06%;
  width: 88.14%;
  height: 94.47%;
  border-radius: 12% / 5.5%;
  object-fit: fill;
}

.dally-phone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/dally/iphone-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .dally-step-enter {
    animation:
      dally-step-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--step-delay) backwards,
      dally-step-fade 0.6s ease var(--step-delay) backwards;
  }

  @keyframes dally-step-enter {
    from {
      transform: translate(var(--step-start-x), var(--step-start-y)) scale(0.35);
    }
  }

  @keyframes dally-step-fade {
    from {
      opacity: 0;
    }
  }
}

@media (max-width: 620px) {
  .dally {
    padding-top: 32px;
  }

  .dally-split {
    grid-template-columns: 1fr;
  }

  .dally-hero-copy {
    grid-row: 1;
  }

  .dally-hero > .dally-star:nth-child(1) {
    top: 0;
    left: 58%;
  }

  .dally-hero > .dally-star:nth-child(2) {
    top: 57%;
    left: 5%;
  }

  .dally-hero > .dally-star:nth-child(3) {
    display: none;
  }

  .dally-hero > .dally-star:nth-child(4) {
    top: 43%;
    left: 88%;
  }

  .dally-objects {
    margin-block: 44px 48px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dally-object-group {
    grid-column: 1 / -1;
  }

  .dally-object-headline {
    transform: none;
  }

  .dally-scroll-scene .dally-reveal {
    position: static;
    grid-column: 2;
    width: auto;
    transform: none;
  }

  .dally-setup {
    margin-top: 48px;
  }

  .dally-setup-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .dally-setup-steps li:nth-child(even) {
    border-left: 0;
  }
}
